From 4a74e5ea403dde4b1ad24b6f3fce8447d355d4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Jul 2023 15:06:42 +0800 Subject: [PATCH 001/298] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SzyhApiConstant.java | 167 ++++++++++++ .../response/CheckPasswordResponse.java | 21 ++ .../response/CompanyRegisterInfoResponse.java | 66 +++++ .../taxagent/response/SzyhResponseHead.java | 26 ++ .../entity/taxpayment/bo/TaxPaymentBO.java | 28 ++ .../dto/TaxAgreementBankFormDTO.java | 29 ++ .../dto/TaxAgreementFeedbackResultDTO.java | 33 +++ .../taxpayment/dto/TaxAgreementFormDTO.java | 28 ++ .../taxpayment/dto/TaxAmountFormDTO.java | 58 ++++ .../taxpayment/dto/TaxFeedbackResultDTO.java | 34 +++ .../taxpayment/dto/TaxPayTypeFormDTO.java | 38 +++ .../dto/TaxWithheldVoucherResultDTO.java | 39 +++ .../dto/TaxWithholdingVoucherFeedbackDTO.java | 89 +++++++ .../param/TaxPaymentQueryParam.java | 47 ++++ .../taxpayment/po/TaxPaymentRequestPO.java | 105 ++++++++ .../AgreementQueryFeedbackResponse.java | 86 ++++++ .../taxpayment/response/BaseResponse.java | 18 ++ .../SyncWithholdingFeedbackResponse.java | 19 ++ .../response/WithheldVoucherResponse.java | 61 +++++ .../response/WithholdingFeedbackResponse.java | 85 ++++++ .../WithholdingVoucherFeedbackResponse.java | 129 +++++++++ src/com/engine/salary/util/HttpUtil.java | 249 ++++++++++++++++++ 22 files changed, 1455 insertions(+) create mode 100644 src/com/engine/salary/constant/SzyhApiConstant.java create mode 100644 src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java create mode 100644 src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java create mode 100644 src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java create mode 100644 src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java create mode 100644 src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/BaseResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java create mode 100644 src/com/engine/salary/util/HttpUtil.java diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java new file mode 100644 index 000000000..1559b25de --- /dev/null +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -0,0 +1,167 @@ +package com.engine.salary.constant; + +/** + * 神州云合api常量 + * + * @author chengliming + * @date 2022-10-18 11:05 AM + **/ +public class SzyhApiConstant { + + /** + * 接口HOST + */ + public static final String HOST_URL = "https://ddapi.bigfintax.com/"; + + /** + * 测试接口host + */ + public static final String TEST_HOST_URL = "https://ddapi-t.bigfintax.com/"; + + /** + * 企业注册接口 + */ + public static final String GET_REGISTER_INFO_URL = "gateway/iit/declare/getCompanyRegisterInfo"; + + /** + * 校验密码接口 + */ + public static final String CHECK_PASSWORD_URL = "gateway/iit/check/checkPassword"; + + /** + * 人员专项附加扣除信息查询 + */ + public static final String QUERY_SPECIAL_AMOUNT = "gateway/iit/special/querySpecialAmount"; + + /** + * 人员专项附加扣除信息查询反馈 + */ + public static final String GET_QUERY_SPECIAL_AMOUNT_FEEDBACK = "gateway/iit/special/getQuerySpecialAmountFeedback"; + + /** + * 报送人员接口 + */ + public static final String DECLARE_EMPLOYEE_INFO = "gateway/iit/declare/declareEmployeeInfo"; + + /** + * 报送人员获取反馈接口 + */ + public static final String DECLARE_EMPLOYEE_INFO_FEEDBACK = "gateway/iit/declare/getEmployeeInfoFeedback"; + + /** + * 个税申报 + */ + public static final String DECLARE_TAX = "gateway/iit/report/send"; + + /** + * 获取个税申报反馈 + */ + public static final String DECLARE_TAX_FEEDBACK = "gateway/iit/report/getFeedback"; + + /** + * 作废申报 + */ + public static final String CANCEL_DECLARE = "gateway/iit/report/cancel"; + + /** + * 获取作废申报反馈 + */ + public static final String CANCEL_DECLARE_FEEDBACK = "gateway/iit/report/getCancelFeedback"; + + /** + * 更正申报 + */ + public static final String UPDATE_DECLARE = "/gateway/iit/report/correct"; + + /** + * 税局端申报状态查询 + */ + public static final String QUERY_DECLARE_STATUS = "/gateway/iit/report/queryDeclarationRecord"; + + /** + * 企业申报数据明细查询 + */ + public static final String QUERY_COMPANY_INCOMES = "/gateway/iit/report/getCompanyIncomes"; + + /** + * 获取流量统计情况 + */ + public static final String QUERY_ACCOUNT_BALANCE = "gateway/iit/statistic/queryAccountBalance"; + + /** + * 查询税号流量明细 + */ + public static final String QUERY_DETAILS_BY_TAX_NUMBER = "gateway/iit/statistic/queryDetailsByTaxNumber"; + + /** + * 获取企业三方信息 + */ + public static final String QUERY_AGREEMENT = "gateway/iit/payment/queryAgreement"; + + /** + * 获取企业三方信息查询反馈 + */ + public static final String GET_AGREEMENT_QUERY_FEEDBACK = "gateway/iit/payment/getAgreementQueryFeedback"; + + /** + * 三方协议缴款 + */ + public static final String DECLARE_WITH_HOLDING = "gateway/iit/payment/declareWithholding"; + + /** + * 三方协议缴款反馈 + */ + public static final String DECLARE_WITH_HOLDING_FEEDBACK = "gateway/iit/payment/getWithholdingFeedback"; + + /** + * 缴款凭证 + */ + public static final String WITHHOLDING_VOUCHER = "gateway/iit/payment/withholdingVoucher"; + + /** + * 缴款凭证反馈 + */ + public static final String WITHHOLDING_VOUCHER_FEEDBACK = "gateway/iit/payment/getWithholdingVoucherFeedback"; + + /** + * 缴款凭证作废 + */ + public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/payment/cancelWithholdingVoucher"; + /** + * 完税证明 + */ + public static final String GET_WITHHELD_VOUCHER = "gateway/iit/payment/getWithheldVoucher"; + /** + * 刷新缴款状态 + */ + public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; + + + /** + * 请求成功状态码 + */ + public static final String SUCCESS_CODE = "00000000"; + + /** + * 处理中状态码 + */ + public static final String HANDLING_CODE = "000004"; + + /** + * 企业服务不可用 + */ + public static final String APP_DISABLED_CODE = "990006"; + + /** + * 企业服务已停用 + */ + public static final String APP_PAUSED_CODE = "990007"; + /** + * 错误码 + */ + public static final String ERROR_CODE = "ITGCUS0002"; + /** + * 无缴款凭证 + */ + public static final String NONE_VOUCHER_CODE = "200028"; +} diff --git a/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java new file mode 100644 index 000000000..2078bfa08 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +/** + * 神州云合接口返回状态实体 + * + * @author chengliming + * @date 2022-10-18 10:39 AM + **/ +@Data +public class CheckPasswordResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; + /** + * 返回数据 + */ + private boolean body; +} diff --git a/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java new file mode 100644 index 000000000..b3a2557e3 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java @@ -0,0 +1,66 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +import java.util.List; + +/** + * 神州云合接口返回状态实体 + * + * @author chengliming + * @date 2022-10-18 10:39 AM + **/ +@Data +public class CompanyRegisterInfoResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; + /** + * 返回数据 + */ + private List body; + + /** + * 神州云合接口返回状态实体类 + **/ + @Data + public static class CompanyRegisterInfo { + /** + * 登记序号 + */ + private String djxhid; + /** + * 企业名称 + */ + private String qymc; + /** + * 法人姓名 + */ + private String frxm; + /** + * 联系电话 + */ + private String lxdh; + /** + * 生产经营地址 + */ + private String scjydz; + /** + * 行业名称 + */ + private String hymc; + /** + * 主管税务机关名称 + */ + private String zgswjgmc; + /** + * 主管税务分局所科名称 + */ + private String zgswjgskmc; + /** + * 是否分部门备案 + */ + private String fbmba; + } +} diff --git a/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java new file mode 100644 index 000000000..11b1185a0 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +/** + * 神州云合接口返回状态实体 + * + * @author chengliming + * @date 2022-10-18 10:39 AM + **/ +@Data +public class SzyhResponseHead { + private String code; + private String desc; + private String msg; + private String time; + private String status; + + public SzyhResponseHead() { + } + + public SzyhResponseHead(String code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java b/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java new file mode 100644 index 000000000..c1ac514d8 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.taxpayment.bo; + +import com.engine.salary.entity.taxpayment.dto.TaxWithholdingVoucherFeedbackDTO; +import com.engine.salary.entity.taxpayment.response.WithholdingVoucherFeedbackResponse; + +/** + * @author chengliming + * @date 2022-12-07 2:16 PM + **/ +public class TaxPaymentBO { + public static TaxWithholdingVoucherFeedbackDTO buildTaxWithholdingVoucherFeedbackDTO(WithholdingVoucherFeedbackResponse.Feedback synthesize) { + return TaxWithholdingVoucherFeedbackDTO.builder() + .taxDeclareCode(synthesize.getSblxdm()) + .taxDeclareName(synthesize.getSblxmc()) + .voucherNo(synthesize.getJkpzxh()) + .firstPrintDate(synthesize.getDysj()) + .taxCode(synthesize.getNsrsbh()) + .taxAgentName(synthesize.getNsrxm()) + .taxAuthoritiesNo(synthesize.getSwjgdm()) + .taxAuthoritiesName(synthesize.getSwjgmc()) + .deadline(synthesize.getXjrq()) + .lowerFormatAmount(synthesize.getXxjehj()) + .upperFormatAmount(synthesize.getDxjehj()) + .remark(synthesize.getBz()) + .printNum(synthesize.getDycs()) + .build(); + } +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java new file mode 100644 index 000000000..d2cece365 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxAgreementBankFormDTO { + + + @ApiModelProperty("开户行") + private String bank; + + @ApiModelProperty("开户账号") + private String bankNo; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java new file mode 100644 index 000000000..f7ac03735 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + + +/** + * 获取三方查询反馈结果 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("获取三方查询反馈结果") +public class TaxAgreementFeedbackResultDTO extends TaxFeedbackResultDTO { + @ApiModelProperty("实缴金额") + private String payAmount; + + @ApiModelProperty("滞纳金等金额") + private String otherAmount; + + @ApiModelProperty("申报人数") + private String personNum; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java new file mode 100644 index 000000000..233313c66 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.taxpayment.dto; + +import com.weaver.common.component.form.WeaForm; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxAgreementFormDTO extends TaxFeedbackResultDTO { + + private WeaForm form; + + private Map count; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java new file mode 100644 index 000000000..fc1f777d4 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -0,0 +1,58 @@ +package com.engine.salary.entity.taxpayment.dto; + +import com.weaver.common.component.form.item.WeaFormItemType; +import com.weaver.hrm.salary.annotation.SalaryForm; +import com.weaver.hrm.salary.annotation.SalaryFormItem; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxAmountFormDTO { + + @SalaryForm( + label = "个税扣缴义务人", + labelId = 86184, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) + } + ) + @ApiModelProperty("个税扣缴义务人") + private String taxAgent; + + @SalaryForm( + label = "应缴金额", + labelId = 175126, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) + } + ) + @ApiModelProperty("应缴金额") + private String amount; + + @SalaryForm( + label = "申报人数", + labelId = 175128, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) + } + ) + @ApiModelProperty("申报人数") + private String personNum; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java new file mode 100644 index 000000000..845e888a9 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + + +/** + * 获取三方查询反馈结果 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("获取反馈结果") +public class TaxFeedbackResultDTO { + @ApiModelProperty("请求id") + private String requestId; + + @ApiModelProperty("提示语") + private String msg; + + @ApiModelProperty("处理结果") + private String result; + + @ApiModelProperty("是否结束轮询") + private Boolean finish; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java new file mode 100644 index 000000000..942ef4423 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java @@ -0,0 +1,38 @@ +package com.engine.salary.entity.taxpayment.dto; + +import com.weaver.common.component.form.item.WeaFormItemType; +import com.weaver.hrm.salary.annotation.SalaryForm; +import com.weaver.hrm.salary.annotation.SalaryFormItem; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxPayTypeFormDTO { + + @SalaryForm( + label = "缴款方式", + labelId = 175127, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = TaxPaymentTypeEnum.class) + } + ) + @ApiModelProperty("缴款方式") + private String type; + +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java new file mode 100644 index 000000000..fb6cdf770 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java @@ -0,0 +1,39 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; + + +/** + * 获取完税证明 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("获取完税证明") +public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO { + @ApiModelProperty("完税证明") + private List vouchers; + + @Data + @AllArgsConstructor + public static class Voucher { + @ApiModelProperty("名称") + private String name; + + @ApiModelProperty("内容") + private String content; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java new file mode 100644 index 000000000..e0b38be9f --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java @@ -0,0 +1,89 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费凭证") +public class TaxWithholdingVoucherFeedbackDTO extends TaxFeedbackResultDTO{ + /** + * 申报类型代码 + */ + private String taxDeclareCode; + /** + * 申报类型名称 + */ + private String taxDeclareName; + /** + * 缴款凭证序号 + */ + private String voucherNo; + /** + * 首次打印时间 + */ + private String firstPrintDate; + /** + * 纳税人识别号 + */ + private String taxCode; + /** + * 纳税人名称 + */ + private String taxAgentName; + /** + * 税务机关代码 + */ + private String taxAuthoritiesNo; + /** + * 税务机关名称 + */ + private String taxAuthoritiesName; + /** + * 税款限缴日期 + */ + private String deadline; + /** + * 金额合计(小写) + */ + private String lowerFormatAmount; + /** + * 金额合计(大写) + */ + private String upperFormatAmount; + /** + * 备注 + */ + private String remark; + /** + * 打印次数 + */ + private String printNum; + /** + * 缴款凭证明细列表 + */ + private List details; + + @Data + public static class Detail { + /** + * 扣款反馈代码 + */ + private String paymentCode; + /** + * 扣款名称 + */ + private String paymentItem; + /** + * 实缴税额 + */ + private String payAmount; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java new file mode 100644 index 000000000..2b57b8a1b --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -0,0 +1,47 @@ +package com.engine.salary.entity.taxpayment.param; + +import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; + +/** + * 查询企业三方信息 + * + * @author chengliming + * @date: 2022-12-06 17:25:28 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询企业三方信息") +public class TaxPaymentQueryParam { + + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @ApiModelProperty("税款所属期") + private YearMonth taxYearMonth; + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; + + /** + * @see TaxPaymentServiceTypeEnum + */ + @ApiModelProperty("业务类型") + private Integer type; + + @ApiModelProperty("三方协议号") + private String protocolNumber; + + @ApiModelProperty("应缴税额") + private String taxAmount; + + @ApiModelProperty("是否为反馈校验 0否 1是") + private Integer checkFeedback; +} diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java new file mode 100644 index 000000000..246630568 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -0,0 +1,105 @@ +package com.engine.salary.entity.taxpayment.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.weaver.common.elog.annotation.ElogTransform; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 个税辅助缴款-三方缴款请求 + * + * @author chengliming + * @date 2022-12-07 13:41:30 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@TableName("hrsa_tax_payment_request") +@ElogTransform(name = "个税辅助缴款-请求信息") +public class TaxPaymentRequestPO implements Serializable { + + private static final long serialVersionUID = -203732044881927518L; + /** + * 主键id + */ + @ElogTransform(name = "主键id") + private Long id; + + /** + * 个税扣缴义务人的主键id + */ + @ElogTransform(name = "个税扣缴义务人的主键id") + private Long taxAgentId; + + /** + * 个税申报记录ID + */ + @ElogTransform(name = "个税申报记录id") + private Long taxDeclareRecordId; + + /** + * 税款所属期 + */ + @ElogTransform(name = "税款所属期") + private LocalDate taxYearMonth; + + /** + * 异步请求ID + */ + @ElogTransform(name = "异步请求ID") + private String requestId; + + + /** + * 请求类型 + * + * @see com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum + */ + @ElogTransform(name = "异步请求ID") + private Integer requestType; + + /** + * 是否已获取反馈 + * + * @see com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum + */ + @ElogTransform(name = "是否已获取反馈") + private Integer feedback; + + /** + * 租户key + */ + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; + + /** + * 创建人id + */ + @ElogTransform(name = "创建人id", ignore = true) + private Long creator; + + /** + * 是否删除 + */ + @ElogTransform(name = "是否删除", ignore = true) + private Integer deleteType; + + /** + * 创建时间 + */ + @ElogTransform(name = "创建时间", ignore = true) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @ElogTransform(name = "更新时间", ignore = true) + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java new file mode 100644 index 000000000..b1766074b --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java @@ -0,0 +1,86 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 获取企业欠费信息查询反馈结果 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class AgreementQueryFeedbackResponse extends BaseResponse { + /** + * 返回数据 + */ + private Body body; + + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 三方查询状态 0: 请求成功;1: 校验失败;2:请求失败 + */ + private String sfzt; + /** + * 失败原因 + */ + private String sbyy; + /** + * 三方列表 + */ + private List sflb; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 三方协议号 + **/ + private String sfxyh; + /** + * 银行行别代码 + **/ + private String yhhbdm; + /** + * 银行行别名称 + **/ + private String yhhbmc; + /** + * 银行营业网点代码 + **/ + private String yywddm; + /** + * 银行营业网点名称 + **/ + private String yywdmc; + /** + * 清算行行号 + **/ + private String qshhh; + /** + * 开户行行号 + **/ + private String khhhh; + /** + * 缴款帐号 + **/ + private String jkzh; + /** + * 缴款账户名称 + **/ + private String jkmc; + /** + * 税款所属税务机构代码 + **/ + private String zgswjgdm; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java b/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java new file mode 100644 index 000000000..382c546c2 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxpayment.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +/** + * 接口响应值 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class BaseResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java new file mode 100644 index 000000000..de5d979ee --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java @@ -0,0 +1,19 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 完税证明 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class SyncWithholdingFeedbackResponse extends BaseResponse { + /** + * 返回数据 + */ + private WithholdingFeedbackResponse.Feedback body; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java new file mode 100644 index 000000000..98401e525 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java @@ -0,0 +1,61 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 完税证明 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithheldVoucherResponse extends BaseResponse { + /** + * 返回数据 + */ + private Body body; + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 综合所得 + **/ + private Feedback zhsd; + /** + * 分类所得 + **/ + private Feedback flsd; + /** + * 非居民所得 + **/ + private Feedback fjmsd; + /** + * 限售股所得 + **/ + private Feedback xsgsd; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 缴款反馈状态 0成功 1失败 + */ + private String jkzt; + /** + * 扣款失败原因 + */ + private String jksbyy; + /** + * 完税证明列表 + */ + private List wszmlb; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java new file mode 100644 index 000000000..de1f72221 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java @@ -0,0 +1,85 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 三方协议缴款反馈 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithholdingFeedbackResponse extends BaseResponse { + + /** + * 返回数据 + */ + private Body body; + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 综合所得 + **/ + private Feedback zhsdjk; + /** + * 分类所得 + **/ + private Feedback flsdjk; + /** + * 非居民所得 + **/ + private Feedback fjmsdjk; + /** + * 限售股所得 + **/ + private Feedback xsgsdjk; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 申报状态 + **/ + private String sbzt; + + /** + * 扣款状态 0:扣款成功:1:信息校验失败;2:无欠费记录;3:扣款失败 + **/ + private String jkzt; + + /** + * 扣款失败原因 + **/ + private String jksbyy; + + /** + * 扣款详情列表 + **/ + private List kkfhlb; + } + + @Data + public static class Detail { + /** + * 扣款反馈代码 + */ + private String kkfhDm; + /** + * 扣款名称 + */ + private String kkfhmc; + /** + * 实缴税额 + */ + private String sjse; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java new file mode 100644 index 000000000..e49c10f80 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java @@ -0,0 +1,129 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 缴款凭证反馈 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithholdingVoucherFeedbackResponse extends BaseResponse { + /** + * 返回数据 + */ + private Body body; + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 综合所得 + **/ + private Feedback zhsd; + /** + * 分类所得 + **/ + private Feedback flsd; + /** + * 非居民所得 + **/ + private Feedback fjmsd; + /** + * 限售股所得 + **/ + private Feedback xsgsd; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 申报类型代码 + */ + private String sblxdm; + /** + * 申报类型名称 + */ + private String sblxmc; + /** + * 缴款凭证序号 + */ + private String jkpzxh; + /** + * 首次打印时间 + */ + private String dysj; + /** + * 纳税人识别号 + */ + private String nsrsbh; + /** + * 纳税人名称 + */ + private String nsrxm; + /** + * 税务机关代码 + */ + private String swjgdm; + /** + * 税务机关名称 + */ + private String swjgmc; + /** + * 税款限缴日期 + */ + private String xjrq; + /** + * 金额合计(小写) + */ + private String xxjehj; + /** + * 金额合计(大写) + */ + private String dxjehj; + /** + * 备注 + */ + private String bz; + /** + * 打印次数 + */ + private String dycs; + /** + * 缴款凭证明细列表 + */ + private List jkpzmxlb; + /** + * 反馈状态 0:成功 1:失败 + */ + private String fkzt; + /** + * 反馈描述 + */ + private String fkms; + } + + @Data + public static class Detail { + /** + * 扣款反馈代码 + */ + private String zsxmmc; + /** + * 扣款名称 + */ + private String zspmmc; + /** + * 实缴税额 + */ + private String yjse; + } +} diff --git a/src/com/engine/salary/util/HttpUtil.java b/src/com/engine/salary/util/HttpUtil.java new file mode 100644 index 000000000..6f99cf590 --- /dev/null +++ b/src/com/engine/salary/util/HttpUtil.java @@ -0,0 +1,249 @@ +package com.engine.salary.util; + + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.AuthSchemes; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.util.EntityUtils; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.Arrays; +import java.util.Collections; +import java.util.Map; + +/** + * Http调用处理类 + * + * @author Terry + */ +@Slf4j +public class HttpUtil { + + public static final String TEXT_TYPE = "text/plain"; + public static final String JSON_TYPE = "application/json"; + public static final String XML_TYPE = "text/xml"; + public static final String HTML_TYPE = "text/html"; + + public static final String EXCEL_TYPE = "application/vnd.ms-excel"; + public static final String STREAM_TYPE = "application/octet-stream"; + public static final int SLEEP_TIME = 1000; + public static final int IAS_SUCCESS = 400; + + public static HttpClient httpsTrustClient() { + try { + // 在调用SSL之前需要重写验证方法,取消检测SSL + X509TrustManager trustManager = new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] xcs, String str) { + } + + @Override + public void checkServerTrusted(X509Certificate[] xcs, String str) { + } + }; + SSLContext ctx = SSLContext.getInstance(SSLConnectionSocketFactory.TLS); + ctx.init(null, new TrustManager[]{trustManager}, null); + SSLConnectionSocketFactory socketFactory = + new SSLConnectionSocketFactory(ctx, NoopHostnameVerifier.INSTANCE); + // 创建Registry + RequestConfig requestConfig = + RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD_STRICT).setExpectContinueEnabled(Boolean.TRUE) + .setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST)) + .setProxyPreferredAuthSchemes(Collections.singletonList(AuthSchemes.BASIC)).build(); + Registry socketFactoryRegistry = RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.INSTANCE).register("https", socketFactory).build(); + // 创建ConnectionManager,添加Connection配置信息 + PoolingHttpClientConnectionManager connectionManager = + new PoolingHttpClientConnectionManager(socketFactoryRegistry); + + return HttpClients.custom().setConnectionManager(connectionManager) + .setDefaultRequestConfig(requestConfig).build(); + } catch (KeyManagementException | NoSuchAlgorithmException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 获取 HttpClient + * + * @param path + * @return + */ + public static HttpClient wrapClient(String path) { + HttpClient httpClient = HttpClientBuilder.create().build(); + if (path != null && path.startsWith("https://")) { + return httpsTrustClient(); + } + return httpClient; + } + + /** + * 设置http超时时间 + * + * @param requestConfig + * @return + */ + private static RequestConfig setTimeOutConfig(RequestConfig requestConfig) { + if (requestConfig == null) { + requestConfig = RequestConfig.DEFAULT; + } + return RequestConfig.copy(requestConfig).setConnectionRequestTimeout(900000).setConnectTimeout(900000) + .setSocketTimeout(900000).build(); + } + + /** + * get 请求 + * + * @param url + * @param header + * @param params + * @return + */ + public static String getRequest(String url, Map header, Map params) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + + StringBuilder urlStr = new StringBuilder(); + urlStr.append(url).append("?"); + + int i = params.size(); + for (Map.Entry map : params.entrySet()) { + urlStr.append(map.getKey()).append("=").append(map.getValue()); + if ((--i) == 0) { + continue; + } + urlStr.append("&"); + } + try { + httpClient = (CloseableHttpClient) wrapClient(url); + HttpGet httpGet = new HttpGet(urlStr.toString()); + if (null != header && !header.isEmpty()) { + for (String key : header.keySet()) { + httpGet.setHeader(key, header.get(key)); + } + } + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(20000) + .setConnectionRequestTimeout(20000).setSocketTimeout(40000).build(); + httpGet.setConfig(requestConfig); + response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + result = EntityUtils.toString(entity); + httpGet.abort(); + EntityUtils.consume(entity); + } catch (IOException e) { + log.error("发起GET请求失败", e); + result = getTimeoutErrorResponse(result, e); + } finally { + if (null != response) { + try { + httpClient.close(); + response.close(); + } catch (IOException e) { + log.error("发起GET请求失败", e); + } + } + + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + log.error("发起GET请求失败", e); + } + } + } + return result; + } + + /** + * HTTP Post 获取内容 + * + * @param url 请求的url地址 ?之前的地址 + * @param params 请求的参数 + * @param header 编码格式 + * @return 页面内容 + */ + public static String doPost(String url, Map header, String params, String contentType) { + String result = null; + try { + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("Connection", "close"); + httpPost.setConfig(setTimeOutConfig(httpPost.getConfig())); + httpPost.setHeader("Content-Type", contentType); + if (null != header && !header.isEmpty()) { + for (String key : header.keySet()) { + httpPost.setHeader(key, header.get(key)); + } + } + if (null != params) { + httpPost.setEntity(new StringEntity(params, Consts.UTF_8)); + } + HttpClient httpClient = wrapClient(url); + HttpResponse response = httpClient.execute(httpPost); + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + httpPost.abort(); + throw new RuntimeException("HttpClient,error status code :" + statusCode); + } + HttpEntity entity = response.getEntity(); + if (entity != null) { + result = EntityUtils.toString(entity, Consts.UTF_8); + } + EntityUtils.consume(entity); + httpPost.abort(); + return result; + } catch (Exception e) { + log.error("发起POST请求失败", e); + result = getTimeoutErrorResponse(result, e); + } + return result; + } + + private static String getTimeoutErrorResponse(String result, Exception e) { + if (e instanceof ConnectTimeoutException) { + BaseResponse baseResponse = new BaseResponse(); + SzyhResponseHead head = new SzyhResponseHead(); + head.setCode("-1"); + head.setMsg(SalaryI18nUtil.getI18nLabel(184072, "抱歉,系统因网络原因无法访问税局个税系统,此功能暂时无法使用,请确保网络情况正常且允许访问外网")); + head.setDesc("失败"); + head.setStatus("N"); + baseResponse.setHead(head); + result = JsonUtil.toJsonString(baseResponse); + } + return result; + } +} From ca2911e2c54852ddaa0ad154018c21b5c96a566c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 20 Jul 2023 09:58:27 +0800 Subject: [PATCH 002/298] v1 --- resource/sql/个税对接表.sql | 2 + resource/sqlupgrade/DM/sql202307180103.sql | 34 + resource/sqlupgrade/DM/sql202307180203.sql | 38 ++ resource/sqlupgrade/DM/sql202307180403.sql | 31 + resource/sqlupgrade/GS/sql202307180103.sql | 34 + resource/sqlupgrade/GS/sql202307180203.sql | 38 ++ resource/sqlupgrade/GS/sql202307180403.sql | 31 + resource/sqlupgrade/JC/sql202307180103.sql | 34 + resource/sqlupgrade/JC/sql202307180203.sql | 38 ++ resource/sqlupgrade/JC/sql202307180403.sql | 31 + resource/sqlupgrade/Mysql/sql202307170503.sql | 8 + resource/sqlupgrade/Mysql/sql202307180103.sql | 33 + resource/sqlupgrade/Mysql/sql202307180203.sql | 37 + resource/sqlupgrade/Mysql/sql202307180403.sql | 30 + .../sqlupgrade/Oracle/sql202307180103.sql | 33 + .../sqlupgrade/Oracle/sql202307180203.sql | 37 + .../sqlupgrade/Oracle/sql202307180403.sql | 30 + resource/sqlupgrade/PG/sql202307180103.sql | 33 + resource/sqlupgrade/PG/sql202307180203.sql | 37 + resource/sqlupgrade/PG/sql202307180403.sql | 30 + .../sqlupgrade/SQLServer/sql202307180103.sql | 33 + .../sqlupgrade/SQLServer/sql202307180203.sql | 37 + .../sqlupgrade/SQLServer/sql202307180403.sql | 30 + resource/sqlupgrade/ST/sql202307180103.sql | 34 + resource/sqlupgrade/ST/sql202307180203.sql | 38 ++ resource/sqlupgrade/ST/sql202307180403.sql | 31 + .../web/TaxAgentTaxReturnController.java | 7 + src/com/engine/salary/common/OptionDTO.java | 26 + .../common/taxdeclare/AsyncRequestIdDTO.java | 18 + .../QuerySpecialAmountFeedbackResponse.java | 140 ++++ .../response/QuerySpecialAmountResponse.java | 34 + .../taxagent/bo/TaxAgentTaxReturnBO.java | 100 +++ .../dto/TaxAgentTaxReturnCheckDTO.java | 48 ++ .../dto/TaxAgentTaxReturnCheckFormDTO.java | 74 ++ .../dto/TaxAgentTaxReturnListDTO.java | 56 ++ .../dto/TaxAgentTaxReturnMainFormDTO.java | 73 ++ .../dto/TaxAgentTaxReturnResultDTO.java | 48 ++ .../param/TaxAgentTaxReturnSaveParam.java | 93 +++ .../taxagent/po/TaxAgentTaxReturnPO.java | 151 +++++ .../entity/taxapiflow/bo/TaxApiFlowBO.java | 146 ++++ .../dto/CreateMessageRuleParamDTO.java | 35 + .../TaxDeclarationApiFlowRecordListDTO.java | 62 ++ ...larationApiFlowStatisticDetailListDTO.java | 41 ++ ...TaxDeclarationApiFlowStatisticListDTO.java | 40 ++ .../dto/TaxDeclarationApiFlowTotalDTO.java | 38 ++ ...axDeclarationApiFlowWarnConfigFormDTO.java | 49 ++ ...DeclarationApiFlowWarnReceiverFormDTO.java | 45 ++ ...DeclarationApiFlowWarnReceiverListDTO.java | 42 ++ .../TaxDeclarationBillingConfigFormDTO.java | 37 + .../param/CreateMessageRuleParam.java | 23 + .../TaxDeclarationApiFlowMonthQueryParam.java | 50 ++ ...TaxDeclarationApiFlowRecordQueryParam.java | 40 ++ ...DeclarationApiFlowWarnConfigSaveParam.java | 40 ++ ...clarationApiFlowWarnReceiverSaveParam.java | 36 + .../TaxDeclarationBillingConfigSaveParam.java | 35 + .../po/TaxDeclarationApiFlowRecordPO.java | 100 +++ .../po/TaxDeclarationApiFlowWarnConfigPO.java | 73 ++ .../TaxDeclarationApiFlowWarnReceiverPO.java | 76 +++ .../response/QueryAccountBalanceResponse.java | 52 ++ .../QueryDetailsByTaxNumberResponse.java | 52 ++ .../bo/TaxDeclarationCommon.java | 167 +++++ .../bo/TaxDeclarationGenerateResult.java | 29 + .../bo/TaxDeclarationRequest.java | 165 +++++ .../bo/TaxDeclarationResult.java | 34 + .../bo/TaxDeclarationStrategy.java | 21 + .../bo/TaxDeclarationValueList.java | 115 ++++ .../taxdeclaration/bo/TaxDeclareContext.java | 60 ++ .../bo/TaxDeclareEmployeeBO.java | 88 +++ .../taxdeclaration/bo/TaxDeclareRequest.java | 41 ++ .../dto/AbnormalEmployeeListDTO.java | 78 +++ .../dto/FailEmployeeListDTO.java | 71 ++ .../dto/TaxDeclarationRateDTO.java | 33 + .../dto/TaxDeclarationTabDTO.java | 30 + .../dto/TaxDeclarationValueListDTO.java | 30 + .../dto/TaxDeclareRecordFormDTO.java | 64 ++ .../dto/TaxDeclareRecordListDTO.java | 121 ++++ .../param/AbnormalEmployeeListQueryParam.java | 33 + .../TaxDeclarationValueListQueryParam.java | 31 + .../param/TaxDeclareRecordParam.java | 18 + .../po/TaxDeclarationApiConfigPO.java | 90 +++ .../po/TaxDeclarationApiProfilePO.java | 65 ++ .../po/TaxDeclarationValuePO.java | 80 +++ .../po/TaxDeclareEmployeePO.java | 21 + .../taxdeclaration/po/TaxDeclareFailPO.java | 57 ++ .../taxdeclaration/po/TaxDeclareRecordPO.java | 111 +++ .../taxdeclaration/po/TaxReportColumnPO.java | 45 ++ .../CancelDeclareFeedbackResponse.java | 24 + .../response/CancelDeclareResponse.java | 23 + .../response/DeclareTaxFeedbackResponse.java | 24 + .../response/DeclareTaxResponse.java | 23 + .../response/UpdateDeclareResponse.java | 21 + .../taxpayment/dto/TaxAgreementFormDTO.java | 3 +- .../taxpayment/dto/TaxAmountFormDTO.java | 116 ++-- .../taxpayment/dto/TaxPayTypeFormDTO.java | 12 - .../dto/TaxWithholdingVoucherFeedbackDTO.java | 2 +- .../param/TaxPaymentQueryParam.java | 3 +- .../taxpayment/po/TaxPaymentRequestPO.java | 34 +- .../engine/salary/enums/SalaryOnOffEnum.java | 11 + .../TaxAgentTaxReturnCheckTypeEnum.java | 51 ++ .../TaxAgentTaxReturnPasswordTypeEnum.java | 59 ++ .../taxagent/TaxAgentTaxReturnStatusEnum.java | 57 ++ .../CancelDeclareStatusEnum.java | 44 ++ .../DeclareFeedBackStatusEnum.java | 46 ++ .../EnumDeclareApiBusinessType.java | 45 ++ .../taxdeclaration/TaxAgentRangeEnum.java | 44 ++ .../TaxDeclareApiProfileEnum.java | 42 ++ .../taxdeclaration/TaxDeclareStatusEnum.java | 49 ++ .../taxdeclaration/TaxDeclareTypeEnum.java | 43 ++ .../TaxPaymentServiceTypeEnum.java | 59 ++ .../taxdeclaration/TaxPaymentStatusEnum.java | 53 ++ .../taxdeclaration/TaxPaymentTypeEnum.java | 57 ++ .../formlua/entity/parameter/ExcelFuncs.java | 633 +++++++++--------- .../entity/parameter/FuncDescUtil.java | 2 +- .../taxagent/TaxAgentTaxReturnMapper.java | 72 ++ .../taxagent/TaxAgentTaxReturnMapper.xml | 422 ++++++++++++ .../TaxDeclarationApiFlowRecordMapper.java | 21 + .../TaxDeclarationApiFlowRecordMapper.xml | 92 +++ .../TaxDeclarationApiFlowRecordMapper.java | 23 + .../TaxDeclarationApiFlowRecordMapper.xml | 92 +++ ...TaxDeclarationApiFlowWarnConfigMapper.java | 13 + .../TaxDeclarationApiProfileMapper.java | 67 ++ .../TaxDeclarationApiProfileMapper.xml | 200 ++++++ .../TaxDeclareApiConfigMapper.java | 75 +++ .../TaxDeclareApiConfigMapper.xml | 230 +++++++ .../TaxAgentTaxReturnCheckService.java | 48 ++ .../service/TaxAgentTaxReturnService.java | 56 ++ .../TaxDeclarationApiBillingService.java | 50 ++ .../TaxDeclarationApiConfigService.java | 44 ++ .../TaxDeclarationApiFlowWarnService.java | 99 +++ .../factory/SalaryCalcRunServiceFactory.java | 50 ++ .../TaxAgentTaxReturnCheckServiceFactory.java | 47 ++ .../factory/TaxPaymentServiceFactory.java | 33 + ...AbstractTaxAgentTaxReturnCheckService.java | 203 ++++++ .../impl/TaxAgentTaxReturnServiceImpl.java | 53 ++ .../TaxDeclarationApiBillingServiceImpl.java | 225 +++++++ .../TaxDeclarationApiConfigServiceImpl.java | 127 ++++ .../TaxDeclarationApiFlowWarnServiceImpl.java | 257 +++++++ .../TaxReturnCheckDepartmentServiceImpl.java | 43 ++ .../impl/TaxReturnCheckMainServiceImpl.java | 87 +++ ...TaxReturnCheckRegistrationServiceImpl.java | 44 ++ .../engine/salary/util/SingnatureData.java | 90 +++ src/com/engine/salary/util/Sm4Utils.java | 190 ++++++ .../web/TaxAgentTaxReturnController.java | 93 +++ .../wrapper/TaxAgentTaxReturnWrapper.java | 152 +++++ .../TaxDeclarationApiFlowBillingWrapper.java | 77 +++ 145 files changed, 9048 insertions(+), 407 deletions(-) create mode 100644 resource/sql/个税对接表.sql create mode 100644 resource/sqlupgrade/DM/sql202307180103.sql create mode 100644 resource/sqlupgrade/DM/sql202307180203.sql create mode 100644 resource/sqlupgrade/DM/sql202307180403.sql create mode 100644 resource/sqlupgrade/GS/sql202307180103.sql create mode 100644 resource/sqlupgrade/GS/sql202307180203.sql create mode 100644 resource/sqlupgrade/GS/sql202307180403.sql create mode 100644 resource/sqlupgrade/JC/sql202307180103.sql create mode 100644 resource/sqlupgrade/JC/sql202307180203.sql create mode 100644 resource/sqlupgrade/JC/sql202307180403.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307170503.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307180103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307180203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307180403.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307180103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307180203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307180403.sql create mode 100644 resource/sqlupgrade/PG/sql202307180103.sql create mode 100644 resource/sqlupgrade/PG/sql202307180203.sql create mode 100644 resource/sqlupgrade/PG/sql202307180403.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307180103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307180203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307180403.sql create mode 100644 resource/sqlupgrade/ST/sql202307180103.sql create mode 100644 resource/sqlupgrade/ST/sql202307180203.sql create mode 100644 resource/sqlupgrade/ST/sql202307180403.sql create mode 100644 src/com/api/salary/web/TaxAgentTaxReturnController.java create mode 100644 src/com/engine/salary/common/OptionDTO.java create mode 100644 src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java create mode 100644 src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java create mode 100644 src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java create mode 100644 src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java create mode 100644 src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java create mode 100644 src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java create mode 100644 src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml create mode 100644 src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java create mode 100644 src/com/engine/salary/service/TaxAgentTaxReturnService.java create mode 100644 src/com/engine/salary/service/TaxDeclarationApiBillingService.java create mode 100644 src/com/engine/salary/service/TaxDeclarationApiConfigService.java create mode 100644 src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java create mode 100644 src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java create mode 100644 src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java create mode 100644 src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java create mode 100644 src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java create mode 100644 src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java create mode 100644 src/com/engine/salary/util/SingnatureData.java create mode 100644 src/com/engine/salary/util/Sm4Utils.java create mode 100644 src/com/engine/salary/web/TaxAgentTaxReturnController.java create mode 100644 src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java create mode 100644 src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java diff --git a/resource/sql/个税对接表.sql b/resource/sql/个税对接表.sql new file mode 100644 index 000000000..18eaca552 --- /dev/null +++ b/resource/sql/个税对接表.sql @@ -0,0 +1,2 @@ +hrsa_tax_declare_api_profile + diff --git a/resource/sqlupgrade/DM/sql202307180103.sql b/resource/sqlupgrade/DM/sql202307180103.sql new file mode 100644 index 000000000..86cf943b7 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/DM/sql202307180203.sql b/resource/sqlupgrade/DM/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/DM/sql202307180403.sql b/resource/sqlupgrade/DM/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/GS/sql202307180103.sql b/resource/sqlupgrade/GS/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/GS/sql202307180203.sql b/resource/sqlupgrade/GS/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/GS/sql202307180403.sql b/resource/sqlupgrade/GS/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/JC/sql202307180103.sql b/resource/sqlupgrade/JC/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/JC/sql202307180203.sql b/resource/sqlupgrade/JC/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/JC/sql202307180403.sql b/resource/sqlupgrade/JC/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202307170503.sql b/resource/sqlupgrade/Mysql/sql202307170503.sql new file mode 100644 index 000000000..34a291882 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307170503.sql @@ -0,0 +1,8 @@ +alter table hrsa_tax_agent add tax_cycle_type int +; + +alter table hrsa_tax_agent modify column tax_cycle_type int default 3 +; + +update hrsa_tax_agent set tax_cycle_type = 3 where tax_cycle_type is null +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180103.sql b/resource/sqlupgrade/Mysql/sql202307180103.sql new file mode 100644 index 000000000..7464e0877 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + api_profile int comment 'ӿڻ' +) +; + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +; + +create table hrsa_tax_payment_request +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint not null comment '˰۽ID' , + tax_declare_record_id bigint comment '˰걨¼' , + tax_year_month date not null comment '˰' , + request_id varchar(50) not null comment 'id' , + request_type int not null comment '' +) +; + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180203.sql b/resource/sqlupgrade/Mysql/sql202307180203.sql new file mode 100644 index 000000000..ee05310cf --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + host varchar(255) comment 'ӿhost' , + app_key varchar(255) comment 'appKey' , + app_secret varchar(255) comment 'appSecret' +) +; + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +; + +alter table hrsa_tax_declare_api_config modify host varchar(255) not null +; + +alter table hrsa_tax_declare_api_config modify app_key varchar(255) not null +; + +alter table hrsa_tax_declare_api_config modify app_secret varchar(255) not null +; + +alter table hrsa_tax_declare_api_config add enable_use int +; + +alter table hrsa_tax_declare_api_config add totality bigint +; + +alter table hrsa_tax_declare_api_config add remain bigint +; + +alter table hrsa_tax_declare_api_config add last_update_time datetime +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180403.sql b/resource/sqlupgrade/Mysql/sql202307180403.sql new file mode 100644 index 000000000..a063f8f8d --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint not null comment '˰۽ID' , + tax_code varchar(50) not null comment '˰' , + tax_registration_number varchar(50) not null comment 'Ǽ' , + department_code varchar(50) comment 'ű' , + department_name varchar(50) comment '' , + nation varchar(50) comment '' , + province varchar(50) comment 'ʡ' , + city varchar(50) comment 'м' , + area_code varchar(50) not null comment '' , + password_type int(2) not null comment 'У' , + real_account varchar(50) comment 'ʵ˺' , + pwd varchar(50) not null comment '' , + check_status int(2) not null comment '˰֤״̬' , + fail_reason varchar(255) comment 'һ֤ʧԭ' +) +; + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +; + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180103.sql b/resource/sqlupgrade/Oracle/sql202307180103.sql new file mode 100644 index 000000000..c0a1672eb --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +) +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +) +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180203.sql b/resource/sqlupgrade/Oracle/sql202307180203.sql new file mode 100644 index 000000000..6ab4e5d58 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +) +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +/ + +alter table hrsa_tax_declare_api_config modify host not null +/ + +alter table hrsa_tax_declare_api_config modify app_key not null +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null +/ + +alter table hrsa_tax_declare_api_config add enable_use int +/ + +alter table hrsa_tax_declare_api_config add totality number +/ + +alter table hrsa_tax_declare_api_config add remain number +/ + +alter table hrsa_tax_declare_api_config add last_update_time date +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180403.sql b/resource/sqlupgrade/Oracle/sql202307180403.sql new file mode 100644 index 000000000..b713207b6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +) +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180103.sql b/resource/sqlupgrade/PG/sql202307180103.sql new file mode 100644 index 000000000..bae5ae375 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_declare_record_id bigint, + tax_year_month date not null, + request_id varchar(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180203.sql b/resource/sqlupgrade/PG/sql202307180203.sql new file mode 100644 index 000000000..367cd19a4 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + host varchar(255), + app_key varchar(255), + app_secret varchar(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config alter column host set not null ; +/ + +alter table hrsa_tax_declare_api_config alter column app_key set not null ; +/ + +alter table hrsa_tax_declare_api_config alter column app_secret set not null ; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality bigint; +/ + +alter table hrsa_tax_declare_api_config add remain bigint; +/ + +alter table hrsa_tax_declare_api_config add last_update_time timestamp; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180403.sql b/resource/sqlupgrade/PG/sql202307180403.sql new file mode 100644 index 000000000..bc4ebcfa6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_code varchar(50) not null, + tax_registration_number varchar(50) not null, + department_code varchar(50), + department_name varchar(50), + nation varchar(50), + province varchar(50), + city varchar(50), + area_code varchar(50) not null, + password_type int not null, + real_account varchar(50), + pwd varchar(50) not null, + check_status int not null, + fail_reason varchar(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180103.sql b/resource/sqlupgrade/SQLServer/sql202307180103.sql new file mode 100644 index 000000000..d69852a1e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + api_profile int +) +GO + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +GO + +create table hrsa_tax_payment_request +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_declare_record_id bigint, + tax_year_month datetime not null, + request_id nvarchar(50) not null, + request_type int not null +) +GO + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180203.sql b/resource/sqlupgrade/SQLServer/sql202307180203.sql new file mode 100644 index 000000000..06b82d4db --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + host nvarchar(255), + app_key nvarchar(255), + app_secret nvarchar(255) +) +GO + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +GO + +alter table hrsa_tax_declare_api_config alter column host nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config alter column app_key nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config alter column app_secret nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config add enable_use int +GO + +alter table hrsa_tax_declare_api_config add totality bigint +GO + +alter table hrsa_tax_declare_api_config add remain bigint +GO + +alter table hrsa_tax_declare_api_config add last_update_time datetime +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180403.sql b/resource/sqlupgrade/SQLServer/sql202307180403.sql new file mode 100644 index 000000000..8d807cf33 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_code nvarchar(50) not null, + tax_registration_number nvarchar(50) not null, + department_code nvarchar(50), + department_name nvarchar(50), + nation nvarchar(50), + province nvarchar(50), + city nvarchar(50), + area_code nvarchar(50) not null, + password_type int not null, + real_account nvarchar(50) , + pwd nvarchar(50) not null, + check_status int not null, + fail_reason nvarchar(255) +) +GO + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +GO + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202307180103.sql b/resource/sqlupgrade/ST/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/ST/sql202307180203.sql b/resource/sqlupgrade/ST/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/ST/sql202307180403.sql b/resource/sqlupgrade/ST/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/src/com/api/salary/web/TaxAgentTaxReturnController.java b/src/com/api/salary/web/TaxAgentTaxReturnController.java new file mode 100644 index 000000000..85af9c074 --- /dev/null +++ b/src/com/api/salary/web/TaxAgentTaxReturnController.java @@ -0,0 +1,7 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/taxAgent/taxReturn") +public class TaxAgentTaxReturnController extends com.engine.salary.web.TaxAgentTaxReturnController{ +} diff --git a/src/com/engine/salary/common/OptionDTO.java b/src/com/engine/salary/common/OptionDTO.java new file mode 100644 index 000000000..6ec60f48c --- /dev/null +++ b/src/com/engine/salary/common/OptionDTO.java @@ -0,0 +1,26 @@ +package com.engine.salary.common; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 人员选项 + * + * @author chengliming + * @date: 2022-09-06 16:57:23 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel("人员选项") +public class OptionDTO { + + @ApiModelProperty("人员ID") + private String id; + + @ApiModelProperty("人员姓名") + private String content; +} diff --git a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java new file mode 100644 index 000000000..6f20b5f65 --- /dev/null +++ b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java @@ -0,0 +1,18 @@ +package com.engine.salary.common.taxdeclare; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 异步接口中的requestId + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/10/25 4:50 PM + * @version:v1.0 + */ +@Data +public class AsyncRequestIdDTO { + + @ApiModelProperty("异步接口中的requestId") + private String requestId; +} diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java new file mode 100644 index 000000000..f94fe1cf0 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java @@ -0,0 +1,140 @@ +package com.engine.salary.entity.datacollection.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 人员专项附加扣除信息查询结果 + * + * @author chengliming + * @date 2022-10-27 10:00 AM + **/ +@Data +public class QuerySpecialAmountFeedbackResponse extends BaseResponse { + + /** + * 返回数据 + */ + private Body body; + + + /** + * 人员专项附加扣除信息查询反馈结果body + */ + @Data + public static class Body { + /** + * 结果列表 + */ + private List ryxxlb; + } + + /** + * 人员专项附加扣除信息查询反馈结果 + **/ + @Data + public static class Feedback { + /** + * 员工姓名 + */ + private String xm; + + /** + * 证件类型 + */ + private String zzlx; + + /** + * 证件号码 + */ + private String zzhm; + + /** + * 代报状态 + */ + private String sbzt; + + /** + * 失败原因 + */ + private String sbyy; + + /** + * 累计子女教育支出 + */ + private BigDecimal ljznjyzc; + + /** + * 累计租房租金支出 + */ + private BigDecimal ljzfzjzc; + + /** + * 累计住房贷款利息支出 + */ + private BigDecimal ljzfdklxzc; + + /** + * 累计赡养老人支出 + */ + private BigDecimal ljsylrzc; + + /** + * 累计继续教育支出 + */ + private BigDecimal ljjxjyzc; + + /** + * 累计非学历继续教育支出 + */ + private BigDecimal ljfxljxjyzc; + + /** + * 累计学历继续教育支出 + */ + private BigDecimal ljxljxjyzc; + + /** + * 累计3岁以下婴幼儿照护支出 + */ + private BigDecimal ljyyezhzc; + + /** + * 子女教育支出 + */ + private BigDecimal znjyzc; + + /** + * 赡养老人支出 + */ + private BigDecimal sylrzc; + + /** + * 住房贷款利息支出 + */ + private BigDecimal zfdklxzc; + + /** + * 住房租金支出 + */ + private BigDecimal zfzjzc; + + /** + * 继续教育支出 + */ + private BigDecimal jxjyzc; + + /** + * 非学历继续教育支出 + */ + private BigDecimal fxljxjyzc; + + /** + * 3岁以下婴幼儿照护支出 + */ + private BigDecimal yyezhzc; + } +} diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java new file mode 100644 index 000000000..9dfbc2cec --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.datacollection.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +/** + * 人员专项附加扣除信息查询结果 + * + * @author chengliming + * @date 2022-10-27 10:00 AM + **/ +@Data +public class QuerySpecialAmountResponse extends BaseResponse { + + /** + * 返回数据 + */ + private QuerySpecialAmountBody body; + + /** + * 人员专项附加扣除信息查询结果body + **/ + @Data + public static class QuerySpecialAmountBody { + /** + * 请求查询ID + */ + private String requestId; + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + } +} diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java new file mode 100644 index 000000000..c19abcd52 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -0,0 +1,100 @@ +package com.engine.salary.entity.taxagent.bo; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +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.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.Sm4Utils; +import dm.jdbc.util.IdGenerator; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * 报税信息BO + * + * @author chengliming + * @date: 2022-09-02 11:06:41 + */ +public class TaxAgentTaxReturnBO { + + public static TaxAgentTaxReturnMainFormDTO convertPo2FormDto(TaxAgentTaxReturnPO taxReturnPO) { + return new TaxAgentTaxReturnMainFormDTO() + .setId(taxReturnPO.getId()) + .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.parseByValue(taxReturnPO.getPasswordType())) + .setCity(taxReturnPO.getCity()) + .setProvince(taxReturnPO.getProvince()) + .setNation(taxReturnPO.getNation()) + .setAreaCode(taxReturnPO.getAreaCode()) + .setTaxCode(taxReturnPO.getTaxCode()) + .setAccount(taxReturnPO.getRealAccount()) + .setNetPassword(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null) + .setRealNamePassword(TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null) + .setTaxRegistrationNumber(taxReturnPO.getTaxRegistrationNumber()) + .setDepartmentCode(taxReturnPO.getDepartmentCode()) + .setCheckStatus(TaxAgentTaxReturnStatusEnum.parseByValue(taxReturnPO.getCheckStatus())) + .setFailReason(taxReturnPO.getFailReason()); + } + + public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + return TaxAgentTaxReturnPO.builder() + .taxAgentId(saveParam.getTaxAgentId()) + .taxCode(saveParam.getTaxCode()) + .nation(saveParam.getNation()) + .city(saveParam.getCity()) + .province(saveParam.getProvince()) + .areaCode(saveParam.getAreaCode()) + .realAccount(saveParam.getAccount()) + .passwordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + .pwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + .failReason("") + .id(IdGenerator.generate()) + .checkStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(LocalDateTime.now()) + .updateTime(LocalDateTime.now()) + .build(); + } + + public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + po.setTaxCode(saveParam.getTaxCode()) + .setNation(saveParam.getNation()) + .setCity(saveParam.getCity()) + .setProvince(saveParam.getProvince()) + .setAreaCode(saveParam.getAreaCode()) + .setRealAccount(saveParam.getAccount()) + .setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + .setTaxAgentId(saveParam.getTaxAgentId()) + .setUpdateTime(LocalDateTime.now()); + } + + public static Map convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) { + Map requestMap = new HashMap<>(); + requestMap.put("bizNo", UUID.randomUUID().toString().replace("-", "")); + requestMap.put("qymc", taxAgent.getName()); + requestMap.put("mmlx", taxAgentTaxReturn.getPasswordType()); + requestMap.put("smzh", taxAgentTaxReturn.getRealAccount()); + requestMap.put("smmm", taxAgentTaxReturn.getPwd()); + requestMap.put("jmsmmm", "1"); + requestMap.put("sbmm", taxAgentTaxReturn.getPwd()); + requestMap.put("jmsbmm", "1"); + requestMap.put("djxhid", taxAgentTaxReturn.getTaxRegistrationNumber()); + requestMap.put("nsrsbh", taxAgentTaxReturn.getTaxCode()); + requestMap.put("areaid", taxAgentTaxReturn.getAreaCode()); + requestMap.put("bmbh", ""); + requestMap.put("bmmc", ""); + return requestMap; + } + + @Override + public String toString() { + return super.toString(); + } +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java new file mode 100644 index 000000000..fbb47d85e --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.SalaryI18nUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + + +/** + * 税友验证成功信息 + * + * @author chengliming + * @date: 2022-08-31 15:25:44 + */ +@Data +@Accessors(chain = true) +@ApiModel("税友验证成功信息") +public class TaxAgentTaxReturnCheckDTO { + /** + * 验证状态 + * @see TaxAgentTaxReturnStatusEnum + */ + @ApiModelProperty("验证状态") + private Integer status; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("部门编号") + private String departmentCode; + + @ApiModelProperty("验证提示信息") + private String message; + + @ApiModelProperty("详细数据") + private List records; + + public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) { + this.message = message; + if (TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(status) || TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue().equals(status)) { + this.message = SalaryI18nUtil.getI18nLabel( 153350, "验证成功,报税主体信息已与税局系统进行认证确认"); + } + } +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java new file mode 100644 index 000000000..67b5a8f5e --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java @@ -0,0 +1,74 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * 税友验证信息表单 + * + * @author chengliming + * @date: 2022-08-31 15:25:44 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ApiModel("税友验证信息") +public class TaxAgentTaxReturnCheckFormDTO { + + @ApiModelProperty("税号") + private String taxCode; + + @ApiModelProperty("验证信息id") + @JsonSerialize(using = ToStringSerializer.class) + private Long index; + + @ApiModelProperty("个税扣缴义务人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @ApiModelProperty("个税扣缴义务人") + private String taxAgentName; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("纳税人状态") + private String taxpayerStatus; + + @ApiModelProperty("法人姓名") + private String legalPersonName; + + @ApiModelProperty("联系电话") + private String mobile; + + @ApiModelProperty("生产经营地址") + private String businessAddress; + + @ApiModelProperty("行业名称") + private String industryName; + + @ApiModelProperty("主管税务机关") + private String taxAuthorities; + + @ApiModelProperty("主管税务科所") + private String taxBranch; + + + @ApiModelProperty("是否分部门备案") + private SalaryOnOffEnum divideFiling; + + @ApiModelProperty("部门名称") + private String departmentName; + + @ApiModelProperty("部门编码") + private String departmentCode; +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java new file mode 100644 index 000000000..3d38a1772 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java @@ -0,0 +1,56 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 税友报税信息列表 + * + * @author chengliming + * @date: 2022-09-02 15:31:10 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//税友报税信息列表 +public class TaxAgentTaxReturnListDTO { + + //序号 + @JsonSerialize(using = ToStringSerializer.class) + private Long index; + + //税号 + private String taxCode; + + //个税扣缴义务人 + private String taxAgentName; + + //登记序号 + private String taxRegistrationNumber; + + //纳税人状态 + private String taxpayerStatus; + + //主管税务机关 + private String taxAuthorities; + + //主管税务科所 + private String taxBranch; + + //生产经营地址 + private String businessAddress; + + //行业名称 + private String industryName; + + //法人姓名 + private String legalPersonName; + + //联系电话 + private String mobile; +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java new file mode 100644 index 000000000..291f90835 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java @@ -0,0 +1,73 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 报税信息表单 + * + * @author chengliming + * @date: 2022-09-02 09:39:05 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("报税信息表单") +public class TaxAgentTaxReturnMainFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("名称") + private String name; + + @ApiModelProperty("税号") + private String taxCode; + + @ApiModelProperty("报税所属区域") + private String city; + + @ApiModelProperty("省份") + private String province; + + @ApiModelProperty("国家") + private String nation; + + @ApiModelProperty("行政区划代码") + private String areaCode; + + @ApiModelProperty("密码校验类型") + private TaxAgentTaxReturnPasswordTypeEnum passwordType; + + @ApiModelProperty("个税网报密码") + private String netPassword; + + @ApiModelProperty("实名账号") + private String account; + + @ApiModelProperty("实名账号密码") + private String realNamePassword; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("部门编码") + private String departmentCode; + + @ApiModelProperty("报税信息验证状态") + private TaxAgentTaxReturnStatusEnum checkStatus; + + @ApiModelProperty("失败原因") + private String failReason; + +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java new file mode 100644 index 000000000..24b12c7d6 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.page.PageInfo; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.Accessors; + + +/** + * 税友验证成功信息 + * + * @author chengliming + * @date: 2022-08-31 15:25:44 + */ +@Data +@Accessors(chain = true) +@Builder +//税友验证成功信息") +public class TaxAgentTaxReturnResultDTO { + + //展示类型:1、展示表单 2、展示列表 3、关闭所有tab") + private Integer compType; + + //验证状态") + private TaxAgentTaxReturnStatusEnum checkStatus; + + //失败原因") + private String failReason; + + //验证提示信息") + private String message; + + //个税扣缴义务人ID") + private String taxAgentId; + + //登记序号") + private String taxRegistrationNumber; + + //部门编号") + private String departmentCode; + + //表单") + private TaxAgentTaxReturnListDTO form; + + //列表") + private PageInfo table; +} diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java new file mode 100644 index 000000000..23dfe7a42 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java @@ -0,0 +1,93 @@ +package com.engine.salary.entity.taxagent.param; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author chengliming + * @desc: 个税扣缴义务人-报税信息-保存参数 + * @date: 2022-08-31 10:23:29 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("个税扣缴义务人-报税信息-保存参数") +public class TaxAgentTaxReturnSaveParam { + + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @ApiModelProperty("税号") + private String taxCode; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("省级") + private String province; + + @ApiModelProperty("市级") + private String city; + + @ApiModelProperty("国家") + private String nation; + + @ApiModelProperty("密码校验类型") + private String passwordType; + + @ApiModelProperty("密码") + private String password; + + @ApiModelProperty("实名账号") + private String account; + + @ApiModelProperty("部门编码,分部门备案时填入") + private String departmentCode; + + @ApiModelProperty("部门名称,分部门备案时填入") + private String departmentName; + + @ApiModelProperty("请求类型 1.保存并验证 2.仅保存") + private Integer requestType = 1; + + @ApiModelProperty("验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码") + @JsonIgnore + private Integer type; + + @ApiModelProperty("地区编码") + private String areaCode; + + public void checkParam() { + String notEmpty = SalaryI18nUtil.getI18nLabel(100577, "不能为空"); + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "个税扣缴义务人id不能为空")); + SalaryAssert.notBlank(this.taxCode, SalaryI18nUtil.getI18nLabel(144388, "税号") + notEmpty); + SalaryAssert.notBlank(this.nation, SalaryI18nUtil.getI18nLabel(144408, "国家") + notEmpty); + SalaryAssert.notBlank(this.province, SalaryI18nUtil.getI18nLabel(144407, "省份") + notEmpty); + SalaryAssert.notBlank(this.city, SalaryI18nUtil.getI18nLabel(144388, "城市") + notEmpty); + SalaryAssert.notNull(this.passwordType, SalaryI18nUtil.getI18nLabel(144390, "密码校验类型") + notEmpty); + if (TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.toString().equals(this.passwordType)) { + SalaryAssert.notBlank(this.password, SalaryI18nUtil.getI18nLabel(144391, "个税网报密码") + notEmpty); + } + if (TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.toString().equals(this.passwordType)) { + SalaryAssert.notBlank(this.password, SalaryI18nUtil.getI18nLabel(144392, "实名账号密码") + notEmpty); + } + } + + public void checkParam4Registration() { + String notEmpty = SalaryI18nUtil.getI18nLabel(100577, "不能为空"); + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "个税扣缴义务人id不能为空")); + SalaryAssert.notBlank(this.taxCode, SalaryI18nUtil.getI18nLabel(144388, "税号") + notEmpty); + SalaryAssert.notBlank(this.taxRegistrationNumber, SalaryI18nUtil.getI18nLabel(144400, "登记序号") + notEmpty); + } + + public void checkParam4Department() { + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "个税扣缴义务人id不能为空")); + } +} diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java new file mode 100644 index 000000000..98bafb451 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -0,0 +1,151 @@ +package com.engine.salary.entity.taxagent.po; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 个税扣缴义务人-报税信息 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_agent_tax_return +public class TaxAgentTaxReturnPO implements Serializable { + + private static final long serialVersionUID = -5077833887846911337L; + + /** + * 主键id + */ + private Long id; + + /** + * 个税扣缴义务人ID + */ + private Long taxAgentId; + + /** + * 税号 + */ + private String taxCode; + + /** + * 登记序号 + */ + private String taxRegistrationNumber; + + /** + * 部门编号 + */ + private String departmentCode; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 国家 + */ + private String nation; + + /** + * 省份 + */ + private String province; + + /** + * 省级行政编码 + */ + private String provinceCode; + + /** + * 市级 + */ + private String city; + + /** + * 市级 + */ + private String cityCode; + + /** + * 行政区划代码 + */ + private String areaCode; + + /** + * 密码校验类型 + * + * @see TaxAgentTaxReturnPasswordTypeEnum + */ + private Integer passwordType; + + /** + * 实名账号 + */ + private String realAccount; + + /** + * 密码 + */ + private String pwd; + + /** + * 税友验证状态 + * + * @see TaxAgentTaxReturnStatusEnum + */ + private Integer checkStatus; + + /** + * 最近一次验证失败原因 + */ + private String failReason; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + + //查询条件 + private Collection taxAgentIds; + private Collection taxCodes; +} diff --git a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java new file mode 100644 index 000000000..879f68bb5 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java @@ -0,0 +1,146 @@ +//package com.engine.salary.entity.taxapiflow.bo; +// +//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +//import com.engine.salary.enums.sicategory.DeleteTypeEnum; +//import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +//import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; +//import com.weaver.hrm.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +//import com.weaver.hrm.salary.util.SalaryDateUtil; +//import com.weaver.hrm.salary.util.SalaryEnumUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.mc.api.entity.*; +//import com.weaver.mc.util.StringUtils; +//import com.weaver.teams.domain.EntityType; +// +//import java.time.LocalDate; +//import java.time.LocalDateTime; +//import java.util.*; +//import java.util.concurrent.atomic.AtomicInteger; +// +///** +// * @author chengliming +// * @date 2022-11-16 1:41 PM +// **/ +//public class TaxApiFlowBO { +// +// /** +// * 流量使用情况 +// * +// * @param wrapper 包装类 +// * @param taxAgentId +// * @param employeeId +// * @return +// */ +// public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper, +// Long taxAgentId, +// Long employeeId) { +// return TaxDeclarationApiFlowRecordPO.builder() +// .id(IdGenerator.generate()) +// .deduct(null) +// .businessType(wrapper.getBusinessType().getValue()) +// .taxMonth(wrapper.getTaxYearMonth()) +// .useTime(LocalDate.now()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .employeeId(employeeId) +// .taxAgentId(taxAgentId) +// .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .tenantKey(wrapper.getTenantKey()) +// .creator(wrapper.getCurrentEmployeeId()) +// .build(); +// } +// +// public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) { +// String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId()); +// String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId()); +// String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getUsername(); +// String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getCardNum(); +// String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator()); +// String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId()); +// +// boolean isInternal = StringUtils.isNotEmpty(internalUsername); +// return TaxDeclarationApiFlowRecordListDTO.builder() +// .id(e.getId()) +// .indexNum(indexNum.getAndIncrement()) +// .createTime(SalaryDateUtil.DATE_TIME_FORMATTER.format(e.getCreateTime())) +// .taxAgentName(taxAgentName) +// .employeeName(isInternal ? internalUsername : externalUsername) +// .employeeType(isInternal ? "inside" : "external") +// .idCardNo(isInternal ? idNo : externalIdNo) +// .employeeId(e.getEmployeeId()) +// .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel()) +// .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel()) +// .creator(creator) +// .creatorId(e.getCreator()) +// .build(); +// } +// +// public static SendMessageEntity buildSendMessageEntity(TaxDeclarationApiFlowWarnConfigPO warnConfig, List receivers, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { +// String title = SalaryI18nUtil.getI18nLabel(160389, "智能算薪流量不足提醒"); +// String desc = String.format(SalaryI18nUtil.getI18nLabel(184069, "智能算薪流量已不足%s,请及时采购续费,避免次月无法使用。"), warnConfig.getThreshold()); +// Entity entity = new Entity() +// .setId(IdGenerator.generate() + "") +// .setModule(EntityType.hrmsalary.name()) +// .setName(title) +// .setCreatorId(updateWrapper.getCurrentEmployeeId()) +// .setCreateTime(new Date()); +// +// SendMessageEntity smg = new SendMessageEntity(); +// // 模块 +// smg.setModule(MessageModule.HRSA); +// // 事件 +// smg.setEvent(MessageEvent.PAYROLL); +// // 业务id +// smg.setBusinessId(warnConfig.getBusinessId().toString()); +// // 发送者 +// smg.setSender(UserEntity.SYSTEM_USER); +// // 接收者 +// smg.setReceivers(receivers); +// // 发送内容(短信&IM的自定义变量) +// Map params = new HashMap<>(); +// params.put("flowThreshold", warnConfig.getThreshold().toString()); +// smg.setDynamicParams(params); +// smg.setTitle(title); +// smg.setEntity(entity); +// smg.setText(desc); +// smg.setContent(desc); +// // 邮箱 +// EmailEntity emailEntity = new EmailEntity(); +// emailEntity.setEmailSubject(title); +// emailEntity.setEmailContent(desc); +// emailEntity.setMailUserAccountId(0); +// smg.setEmailInfo(emailEntity); +// return smg; +// } +// +// public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam, +// Long currentEmployeeId, +// String currentTenantKey) { +// saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" ")); +// saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" ")); +// return TaxDeclarationApiConfigPO.builder() +// .id(IdGenerator.generate()) +// .appKey(saveParam.getAppKey()) +// .appSecret(saveParam.getAppSecret()) +// .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .tenantKey(currentTenantKey) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .build(); +// } +// +// @Override +// public String toString() { +// return "TaxApiFlowBO{}"; +// } +//} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java new file mode 100644 index 000000000..3de26dafa --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量提醒-创建规则参数 + * + * @author chengliming + * @date 2022-11-22 11:25:48 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量提醒-创建规则参数") +public class CreateMessageRuleParamDTO { + @ApiModelProperty("模块") + @JsonSerialize(using = ToStringSerializer.class) + private Integer moduleId; + + @ApiModelProperty("事件") + @JsonSerialize(using = ToStringSerializer.class) + private Integer eventId; + + @ApiModelProperty("业务") + @JsonSerialize(using = ToStringSerializer.class) + private Long businessId; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java new file mode 100644 index 000000000..47281e693 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java @@ -0,0 +1,62 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量使用记录 + * + * @author chengliming + * @date 2022-11-21 16:51:10 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量使用记录") +public class TaxDeclarationApiFlowRecordListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("序号") + private Integer indexNum; + + @ApiModelProperty("使用时间") + private String createTime; + + @ApiModelProperty("个税扣缴义务人") + private String taxAgentName; + + @ApiModelProperty("人员") + private String employeeName; + + @ApiModelProperty("人员类型") + private String employeeType; + + @ApiModelProperty("人员id") + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + @ApiModelProperty("创建人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long creatorId; + + @ApiModelProperty("身份证号码") + private String idCardNo; + + @ApiModelProperty("接口业务") + private String businessTypeName; + + @ApiModelProperty("操作人") + private String creator; + + @ApiModelProperty("结果") + private String result; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java new file mode 100644 index 000000000..8f0897b70 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java @@ -0,0 +1,41 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量统计-月度详情 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量统计-月度详情") +public class TaxDeclarationApiFlowStatisticDetailListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @JsonIgnore + private Long taxAgentId; + + @JsonIgnore + private String taxAgentName; + + @ApiModelProperty("税款所属期") + private String taxMonth; + + @ApiModelProperty("月使用流量数") + private Integer used; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java new file mode 100644 index 000000000..f027f899d --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量统计 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量统计") +public class TaxDeclarationApiFlowStatisticListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("序号") + private Integer indexNum; + + @ApiModelProperty("个税扣缴义务人") + private String taxAgentName; + + @ApiModelProperty("个税扣缴义务人ID") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @ApiModelProperty("已使用") + private Integer used; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java new file mode 100644 index 000000000..139950acc --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java @@ -0,0 +1,38 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量统计 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量统计") +public class TaxDeclarationApiFlowTotalDTO { + @ApiModelProperty("总流量") + @JsonSerialize(using = ToStringSerializer.class) + private Long total; + + @ApiModelProperty("剩余流量") + @JsonSerialize(using = ToStringSerializer.class) + private Long remain; + + @ApiModelProperty("已使用流量") + @JsonSerialize(using = ToStringSerializer.class) + private Long used; + + @ApiModelProperty("最后更新时间") + private String lastUpdateTime; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java new file mode 100644 index 000000000..7910b6dbd --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量不足提醒-表单 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量不足提醒-表单") +public class TaxDeclarationApiFlowWarnConfigFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("提醒开关") + private Boolean enable; + + @ApiModelProperty("提醒规则") + private Integer threshold; + + @ApiModelProperty("提醒推送方式") + private String config; + + @ApiModelProperty("业务ID") + @JsonSerialize(using = ToStringSerializer.class) + private Long businessId; + + @ApiModelProperty("模块") + @JsonSerialize(using = ToStringSerializer.class) + private String moduleId; + + @ApiModelProperty("事件") + @JsonSerialize(using = ToStringSerializer.class) + private String eventId; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java new file mode 100644 index 000000000..2f3c38d1b --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.engine.salary.common.OptionDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 智能算税-流量不足提醒对象-表单 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量不足提醒对象-表单") +public class TaxDeclarationApiFlowWarnReceiverFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("提醒对象") + private List employee; + + @ApiModelProperty("手机号") + private String mobile; + + @ApiModelProperty("邮箱列表") + private String email; + + @ApiModelProperty("邮箱列表下拉框") + @JsonIgnore + private List emailOptions; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java new file mode 100644 index 000000000..d5afc26f5 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.minidev.json.annotate.JsonIgnore; + +/** + * 智能算税-流量提醒对象 + * + * @author chengliming + * @date 2022-11-22 11:25:48 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量提醒对象") + +public class TaxDeclarationApiFlowWarnReceiverListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("提醒对象") + private String employeeName; + + @JsonIgnore + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + @ApiModelProperty("手机号") + private String mobile; + + @ApiModelProperty("邮箱") + private String email; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java new file mode 100644 index 000000000..1604b8e96 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-启用设置-表单 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-启用设置-表单") +public class TaxDeclarationBillingConfigFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("appKey") + private String appKey; + + @ApiModelProperty("appSecret") + private String appSecret; + + @ApiModelProperty("智能算薪开关") + private Boolean enable; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java new file mode 100644 index 000000000..15deaba5f --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 创建推送规则 + * + * @author chengliming + * @date 2022-11-24 10:50 AM + **/ +@Data +public class CreateMessageRuleParam { + @ApiModelProperty("业务ID") + @NotNull(message = "业务ID不能为空") + private String businessId; + + @ApiModelProperty("详细规则") + @NotNull(message = "详细规则不能为空") + private String config; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java new file mode 100644 index 000000000..50e83b5f3 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java @@ -0,0 +1,50 @@ +package com.engine.salary.entity.taxapiflow.param; + +import com.engine.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; +import java.time.YearMonth; + +/** + * 流量月度详情查询参数 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量月度详情查询参数") +public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam { + + @ApiModelProperty("个税扣缴义务人id") + @NotNull(message = "个税扣缴义务人不能为空") + private Long taxAgentId; + + @ApiModelProperty("税款所属期开始时间") + private YearMonth startTaxMonth; + + @ApiModelProperty("税款所属期结束时间") + private YearMonth endTaxMonth; + + public Integer getStartTaxMonth() { + if (startTaxMonth == null) { + return 0; + } + return Integer.parseInt(startTaxMonth.toString().replace("-", "")); + } + + public Integer getEndTaxMonth() { + if (endTaxMonth == null) { + return Integer.MAX_VALUE; + } + return Integer.parseInt(endTaxMonth.toString().replace("-", "")); + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java new file mode 100644 index 000000000..8a5f7be71 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.param; + +import com.engine.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +/** + * 流量月度详情查询参数 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量月度详情查询参数") +public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam { + + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @ApiModelProperty("开始时间") + private LocalDate startDate; + + @ApiModelProperty("结束时间") + private LocalDate endDate; + + @ApiModelProperty("业务接口类型") + private Integer businessType; + + @ApiModelProperty("结果") + private Integer result; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java new file mode 100644 index 000000000..482c76195 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +/** + * 流量不足提醒规则创建 + * + * @author chengliming + * @date 2022-11-24 11:17:31 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量不足提醒规则创建") +public class TaxDeclarationApiFlowWarnConfigSaveParam { + @ApiModelProperty("提醒对象Id") + private Long id; + + @ApiModelProperty("提醒阈值") + @NotNull(message = "提醒规则不能为空") + private Long threshold; + + @ApiModelProperty("提醒开关是否打开") + private Boolean enable; + + @ApiModelProperty("业务ID") + @NotNull(message = "推送方式不能为空") + private Long businessId; + + @ApiModelProperty("规则") + private String config; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java new file mode 100644 index 000000000..345cc3ac7 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 流量不足提醒对象 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量不足提醒对象") +public class TaxDeclarationApiFlowWarnReceiverSaveParam { + @ApiModelProperty("提醒对象Id") + private Long id; + + @ApiModelProperty("提醒配置Id") + private Long warnConfigId; + + @ApiModelProperty("人员Id") + private Long employeeId; + + @ApiModelProperty("邮箱") + private String email; + + @ApiModelProperty("手机号") + private String mobile; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java new file mode 100644 index 000000000..afb9c15e1 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算薪配置参数 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算薪配置参数") +public class TaxDeclarationBillingConfigSaveParam { + + @ApiModelProperty("appKey") + private String appKey; + + @ApiModelProperty("appSecret") + private String appSecret; + + @ApiModelProperty("enable") + private String enable; + + @ApiModelProperty("配置ID") + private Long configId; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java new file mode 100644 index 000000000..ef1c9ba5b --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java @@ -0,0 +1,100 @@ +package com.engine.salary.entity.taxapiflow.po; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 个税申报-接口流量使用记录 + * + * @author chengliming + * @date 2022-11-11 17:36:16 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_record") +//"个税申报-接口流量使用记录") +public class TaxDeclarationApiFlowRecordPO implements Serializable { + + private static final long serialVersionUID = 5899885019997144301L; + /** + * 主键 + */ + private Long id; + + /** + * 个税扣缴义务人的主键id + */ + private Long taxAgentId; + + /** + * 税款所属期 + */ + private Date taxMonth; + + /** + * 使用时间 + */ + private Date useTime; + + /** + * 是否扣流量 + * + * @see SalaryOnOffEnum + */ + private Integer deduct; + + /** + * 人员ID + */ + private Long employeeId; + + /** + * 接口业务类型 + * + * @see EnumDeclareApiBusinessType + */ + private Integer businessType; + + /** + * 结果 + * + * @see TaxAgentTaxReturnStatusEnum + */ + private Integer resultStatus; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建人 + */ + private Long creator; + + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + /** + * 租户ID + */ + private String tenantKey; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java new file mode 100644 index 000000000..ca12c4476 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java @@ -0,0 +1,73 @@ +package com.engine.salary.entity.taxapiflow.po; + +import com.engine.salary.enums.SalaryOnOffEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 个税申报对接 - 流量不足提醒 + * + * @author chengliming + * @date 2022-11-14 11:26:02 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_warn_config") +//个税申报对接流量不足提醒") +public class TaxDeclarationApiFlowWarnConfigPO implements Serializable { + + private static final long serialVersionUID = -5502227652635855096L; + + /** + * 主键 + */ + private Long id; + + /** + * 是否提醒 + * @see SalaryOnOffEnum + */ + private Integer enableWarn; + + /** + * 提醒阈值 + */ + private Long threshold; + + /** + * 业务ID + */ + private Long businessId; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建人 + */ + private Long creator; + + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + /** + * 租户ID + */ + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java new file mode 100644 index 000000000..e546a8edb --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java @@ -0,0 +1,76 @@ +package com.engine.salary.entity.taxapiflow.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 流量不足提醒对象 + * + * @author chengliming + * @date 2022-11-14 11:26:02 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_receiver") +//流量不足提醒对象") +public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable { + + private static final long serialVersionUID = -5502227652635855096L; + + /** + * 主键 + */ + private Long id; + + /** + * 提醒配置的id + */ + private Long warnConfigId; + + /** + * 接受人id + */ + private Long employeeId; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号 + */ + private String mobile; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long creator; + + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + /** + * 租户ID + */ + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java new file mode 100644 index 000000000..67779fd42 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.taxapiflow.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +import java.util.List; + +/** + * 查询流量统计 + * + * @author chengliming + * @date 2022-11-16 3:17 PM + **/ +@Data +public class QueryAccountBalanceResponse { + + private SzyhResponseHead head; + + private Body body; + + @Data + public static class Body { + /** + * 已购买总流量 + **/ + private String total; + /** + * 已使用流量 + **/ + private String used; + /** + * 剩余流量 + **/ + private String surplus; + /** + * 使用明细 + */ + private List taxList; + } + + @Data + public static class Detail { + /** + * 税号 + */ + private String taxNumber; + /** + * 已使用流量 + */ + private String used; + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java new file mode 100644 index 000000000..413f7e546 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.taxapiflow.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +import java.util.List; + +/** + * 查询流量统计 + * + * @author chengliming + * @date 2022-11-16 3:17 PM + **/ +@Data +public class QueryDetailsByTaxNumberResponse { + + private SzyhResponseHead head; + + private Body body; + + @Data + public static class Body { + /** + * 税号 + **/ + private String taxNumber; + /** + * 已使用流量 + **/ + private String used; + /** + * 使用明细 + */ + private List detail; + } + + @Data + public static class Detail { + /** + * 月份 + */ + private String month; + /** + * 已使用流量 + */ + private String used; + + public Integer getMonthValue() { + return Integer.parseInt(month); + } + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java new file mode 100644 index 000000000..cbd849012 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -0,0 +1,167 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +//import com.engine.salary.util.SalaryEntityUtil; +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.common.elog.util.Util; +//import com.weaver.hrm.salary.annotation.SalaryFormulaVar; +//import com.weaver.hrm.salary.entity.datacollection.po.AddUpSituationPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultValuePO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; +//import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +// +//import java.lang.reflect.Field; +//import java.math.BigDecimal; +//import java.time.LocalDateTime; +//import java.time.YearMonth; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +// +///** +// * @description: 通用:一般劳务报酬所得、全年一次性奖金 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/12/2 3:16 PM +// * @version:v1.0 +// */ +//public class TaxDeclarationCommon implements TaxDeclarationStrategy { +// +// @Override +// public TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey) { +// LocalDateTime now = LocalDateTime.now(); +// // 薪资核算结果按照薪资核算人员id聚合分类 +// Map salaryAcctResultValueMap = SalaryEntityUtil.convert2Map( +// taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); +// // 薪资核算人员按照人员id聚合分类 +// Map> employeeIdKeyMap = SalaryEntityUtil.group2Map( +// taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); +// +// List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); +// for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { +// // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 +// SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); +// for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { +// SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); +// SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); +// if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { +// lastSalaryAcctEmployee = salaryAcctEmployee; +// } +// } +// Map valueMap = Maps.newHashMap(); +// for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) { +// SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() +// .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); +// SalaryAcctResultValuePO salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); +// String defaultValue = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0" : ""; +// String value = defaultValue; +// if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { +// value = salaryAcctResultValue.getResultValue().getOrDefault(Util.null2String(salarySobTaxReportRule.getSalaryItemId()), defaultValue); +// } +// valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); +// } +// TaxDeclarationValuePO taxDeclarationValue = new TaxDeclarationValuePO() +// .setId(IdGenerator.generate()) +// .setTaxDeclareRecordId(taxDeclareContext.getTaxDeclaration().getTaxDeclareRecordId()) +// .setTaxDeclarationId(taxDeclareContext.getTaxDeclaration().getId()) +// .setEmployeeType(employeeIdEntry.getValue().get(0).getEmployeeType()) +// .setEmployeeId(employeeIdEntry.getKey()) +// .setResultValue(valueMap) +// .setTenantKey(tenantKey) +// .setCreator(employeeId) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// taxDeclarationValues.add(taxDeclarationValue); +// } +// // 生成累计数据 +// List addUpSituations = generateAddUpSituation(taxDeclareContext, salaryAcctResultValueMap, employeeIdKeyMap); +// return new TaxDeclarationGenerateResult() +// .setTaxDeclarationValues(taxDeclarationValues) +// .setAddUpSituations(addUpSituations); +// } +// +// /** +// * 生成往期累计数据 +// * +// * @param taxDeclareContext +// * @param salaryAcctResultValueMap +// * @param employeeIdKeyMap +// * @return +// */ +// private List generateAddUpSituation(TaxDeclareContext taxDeclareContext, +// Map salaryAcctResultValueMap, +// Map> employeeIdKeyMap) { +// List addUpSituations = Lists.newArrayList(); +// // 只有「工资工资薪金」、「保险营销员佣金收入」、「证券经纪人佣金收入」、「其他连续劳务报酬所得」需要累计计税 +// TaxDeclarationPO taxDeclaration = taxDeclareContext.getTaxDeclaration(); +// if (!Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) +// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN.getValue()) +// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER.getValue()) +// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR.getValue())) { +// return addUpSituations; +// } +// for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { +// // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 +// SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); +// for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { +// SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); +// SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); +// if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { +// lastSalaryAcctEmployee = salaryAcctEmployee; +// } +// } +// SalaryAcctResultValuePO salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); +// Map valueMap = Maps.newHashMap(); +// for (Field declaredField : AddUpSituationPO.class.getDeclaredFields()) { +// if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { +// continue; +// } +// SalarySobAddUpRulePO salarySobAddUpRule = taxDeclareContext.getSalarySobAddUpRuleMap() +// .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + declaredField.getName()); +// String value = BigDecimal.ZERO.toPlainString(); +// if (Objects.nonNull(salarySobAddUpRule) && Objects.nonNull(salaryAcctResultValue)) { +// value = salaryAcctResultValue.getResultValue() +// .getOrDefault(Util.null2String(salarySobAddUpRule.getSalaryItemId()), BigDecimal.ZERO.toPlainString()); +// } +// valueMap.put(declaredField.getName(), value); +// } +// AddUpSituationPO addUpSituation = AddUpSituationPO.builder() +// .id(IdGenerator.generate()) +// .employeeId(lastSalaryAcctEmployee.getEmployeeId()) +// .employeeType(lastSalaryAcctEmployee.getEmployeeType()) +// .taxAgentId(lastSalaryAcctEmployee.getTaxAgentId()) +// .taxYearMonth(YearMonth.parse(taxDeclaration.getTaxCycle()).atDay(1)) +// .year(YearMonth.parse(taxDeclaration.getTaxCycle()).getYear()) +// .addUpIncome(valueMap.get("addUpIncome")) +// .addUpSocialSecurityTotal(valueMap.get("addUpSocialSecurityTotal")) +// .addUpAccumulationFundTotal(valueMap.get("addUpAccumulationFundTotal")) +// .addUpEnterpriseAndOther(valueMap.get("addUpEnterpriseAndOther")) +// .addUpSubtraction(valueMap.get("addUpSubtraction")) +// .addUpOtherDeduction(valueMap.get("addUpOtherDeduction")) +// .addUpTaxExemptIncome(valueMap.get("addUpTaxExemptIncome")) +// .addUpAllowedDonation(valueMap.get("addUpAllowedDonation")) +// .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) +// .addUpTaxableIncome(valueMap.get("addUpTaxableIncome")) +// .modifier(taxDeclaration.getCreator()) +// .creator(taxDeclaration.getCreator()) +// .createTime(taxDeclaration.getCreateTime()) +// .updateTime(taxDeclaration.getUpdateTime()) +// .tenantKey(taxDeclaration.getTenantKey()) +// .deleteType(taxDeclaration.getDeleteType()) +// .build(); +// addUpSituations.add(addUpSituation); +// } +// return addUpSituations; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java new file mode 100644 index 000000000..711a67c48 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * @description: 个税申报表计算过程中产生的结果 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/2 9:25 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationGenerateResult { + + /** + * 往期累计清空 + */ + private List addUpSituations; + /** + * 个税申报明细 + */ + private List taxDeclarationValues; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java new file mode 100644 index 000000000..45de69cf4 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -0,0 +1,165 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.engine.salary.report.enums.IncomeCategoryEnum; +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//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.*; +// +///** +// * @description: 个税申报 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/11/2 11:18 AM +// * @version:v1.0 +// */ +//public class TaxDeclarationRequest { +// +// public static Map convert2RequestParam(List taxReportColumns, +// List taxDeclarations, +// List taxDeclarationValues, +// List employeeDeclares) { +// Map> objRequestParam = Maps.newHashMap(); +// Map>> listRequestParam = Maps.newHashMap(); +// Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); +// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); +// Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); +// for (TaxDeclarationPO taxDeclaration : taxDeclarations) { +// List values = taxDeclarationValueMap.get(taxDeclaration.getId()); +// for (TaxDeclarationValuePO taxDeclarationValue : values) { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); +// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); +// if (employeeDeclare == null || incomeCategoryEnum == null) { +// continue; +// } +// List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); +// Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); +// if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) { +// Map paramMap = objRequestParam.computeIfAbsent("zcgzxj", k -> { +// Map param = new HashMap<>(); +// // 正常工资薪金列表 +// param.put("zcgzxjlb", Lists.newArrayList()); +// // 正常工资薪金是否需要专项 +// param.put("zcgzxjsfxyzx", 0); +// // 正常工资薪金是否传入专项累计 +// param.put("zcgzxjsfcrlj", 1); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zcgzxjlb", K -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { +// // 全年一次性奖金收入 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("qnycxjjsslb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_RETIRE) { +// // 内退一次性补偿金 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("ntycxbcjlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_DISMISS) { +// // 解除劳动合同一次性补偿金 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE) { +// // 个人股权激励收入 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("grgqjl", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.ANNUITY_RECEIPT) { +// // 处理"是否一次性领取"(接口只能传0和1但是接口的错误返回信息告知只能填写是和否,所以需要转一下) +// String sfycxlq = Util.null2String(employeeRequestParam.get("sfycxlq")); +// employeeRequestParam.put("sfycxlq", Objects.equals("是", sfycxlq) ? "1" : "0"); +// // 年金领取 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("qynj", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_LABOR) { +// // 一般劳务报酬所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN) { +// // 保险营销员佣金收入 +// Map paramMap = objRequestParam.computeIfAbsent("bxyxy", k -> { +// Map param = new HashMap<>(); +// param.put("bxyxylwbclb", Lists.newArrayList()); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("bxyxylwbclb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER) { +// // 证券经纪人佣金收入 +// Map paramMap = objRequestParam.computeIfAbsent("zqjjr", k -> { +// Map param = new HashMap<>(); +// param.put("zqjjrsdlb", Lists.newArrayList()); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zqjjrsdlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) { +// // 其他连续劳务报酬所得 +// Map paramMap = objRequestParam.computeIfAbsent("qtlxlwbc", k -> { +// Map param = new HashMap<>(); +// param.put("qtlxlwbclb", Lists.newArrayList()); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("qtlxlwbclb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR) { +// // 其他非连续劳务报酬所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("qtflxlwbc", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR) { +// // 稿酬所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("gcsdlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { +// // 特许权使用费所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("txq", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } +// } +// } +// +// Map requestParam = Maps.newHashMap(); +// requestParam.putAll(objRequestParam); +// requestParam.putAll(listRequestParam); +// return requestParam; +// } +// +// private static Map convert2RequestParam(IncomeCategoryEnum incomeCategoryEnum, +// List taxReportColumns, +// TaxDeclarationValuePO taxDeclarationValue, +// EmployeeDeclarePO employeeDeclare) { +// if (CollectionUtils.isEmpty(taxReportColumns)) { +// return Collections.emptyMap(); +// } +// Map 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) { +// String value = taxDeclarationValue.getResultValue().getOrDefault(taxReportColumn.getReportColumnDataIndex(), StringUtils.EMPTY); +// if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { +// value = Util.getBigDecimalValue(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex()), BigDecimal.ZERO).toPlainString(); +// } else if (Objects.equals(taxReportColumn.getDataType(), "integer")) { +// value = Util.getBigDecimalValue(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex()), BigDecimal.ZERO).setScale(0, RoundingMode.HALF_UP).toPlainString(); +// } +// requestParam.put(taxReportColumn.getRequestParamKey(), value); +// } +// return requestParam; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java new file mode 100644 index 000000000..db866e484 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * @description: 生成个税申报表最后要处理的数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/5 6:10 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationResult { + + /** + * 个税申报表 + */ + private List taxDeclarations; + /** + * 个税申报明细 + */ + private List taxDeclarationValues; + /** + * 往期累计情况 + */ + private List addUpSituations; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java new file mode 100644 index 000000000..76e870558 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +/** + * @description: 生成个税申报表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/1 4:47 PM + * @version:v1.0 + */ +public interface TaxDeclarationStrategy { + + /** + * 生成个税申报表 + * + * @param taxDeclareContext + * @param employeeId + * @param tenantKey + * @return + */ + TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey); +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java new file mode 100644 index 000000000..dcb4fe6e8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -0,0 +1,115 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.common.component.table.column.WeaTableColumn; +//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; +//import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; +//import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.teams.domain.hr.SimpleUserInfo; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import lombok.Data; +//import org.apache.commons.collections4.CollectionUtils; +// +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +// +///** +// * @description: 个税申报表详情 +// * @author: xiajun +// * @modified By: xiajun +// * @date: 2022/3/14 18:31 +// * @version:v1.0 +// */ +//@Data +//public class TaxDeclarationValueList { +// +// /** +// * 个税申报表的表头 +// * +// * @param taxReportColumns +// * @return +// */ +// public static List buildTableColumns(List taxReportColumns) { +// List weaTableColumns = Lists.newArrayList(); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum", "120")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username", "120")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(105139, "证件类型"), "cardType", "120")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86318, "证件号码"), "cardNum", "150")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(102786, "所得项目"), "incomeCategory", "120")); +// for (TaxReportColumnPO taxReportColumn : taxReportColumns) { +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(taxReportColumn.getReportColumnLabel(), taxReportColumn.getReportColumnName()), taxReportColumn.getReportColumnDataIndex(), "120")); +// } +// return weaTableColumns; +// } +// +// /** +// * 个税申报表的数据 +// * +// * @param taxReportColumns +// * @param taxDeclarationValues +// * @param simpleEmployees +// * @param simpleUserInfos +// * @param extEmployees +// * @return +// */ +// public static List> buildTableData(IncomeCategoryEnum incomeCategoryEnum, +// List taxReportColumns, +// List taxDeclarationValues, +// List employeeDeclares, +// List simpleEmployees, +// List simpleUserInfos, +// List extEmployees) { +// if (CollectionUtils.isEmpty(simpleEmployees)) { +// return Collections.emptyList(); +// } +// List> tableDataList = Lists.newArrayList(); +// // 员工基本信息按照人员id聚合分类 +// Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// // 员工报送信息按照人员id聚合分类 +// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); +// // 员工个人信息按照人员id聚合分类 +// Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, e -> e.getUser().getId()); +// // 非系统员工按照人员id聚合分类 +// Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId); +// for (TaxDeclarationValuePO taxDeclarationValue : taxDeclarationValues) { +// Map dataMap = Maps.newHashMap(); +// dataMap.put("id", taxDeclarationValue.getId().toString()); +// dataMap.put("employeeId", taxDeclarationValue.getEmployeeId() + ""); +// dataMap.put("incomeCategory", incomeCategoryEnum.getDefaultLabel()); +// for (TaxReportColumnPO taxReportColumn : taxReportColumns) { +// dataMap.put(taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); +// } +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); +// if (employeeDeclare != null) { +// dataMap.put("jobNum", employeeDeclare.getJobNum()); +// dataMap.put("username", employeeDeclare.getEmployeeName()); +// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); +// dataMap.put("cardNum", employeeDeclare.getCardNum()); +// } else if (Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); +// SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(taxDeclarationValue.getEmployeeId()); +// dataMap.put("jobNum", simpleEmployee.getJobNum()); +// dataMap.put("username", simpleEmployee.getUsername()); +// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); +// dataMap.put("cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); +// } else { +// ExtEmployeePO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); +// dataMap.put("jobNum", ""); +// dataMap.put("username", extEmployee.getUsername()); +// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); +// dataMap.put("cardNum", extEmployee.getCardNum()); +// } +// tableDataList.add(dataMap); +// } +// return tableDataList; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java new file mode 100644 index 000000000..991166356 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java @@ -0,0 +1,60 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//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.salaryitem.po.SalaryItemPO; +//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +//import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +//import lombok.Data; +//import lombok.experimental.Accessors; +// +//import java.util.List; +//import java.util.Map; +// +///** +// * @description: 生成个税申报表所需的数据 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/12/2 2:29 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//public class TaxDeclareContext { +// +// /** +// * 薪资核算记录 +// */ +// private Map salaryAcctRecordMap; +// /** +// * 薪资核算人员 +// */ +// private List salaryAcctEmployees; +// /** +// * 薪资核算结果 +// */ +// private List salaryAcctResultValues; +// /** +// * 个税申报表 +// */ +// private TaxDeclarationPO taxDeclaration; +// /** +// * 个税申报表字段 +// */ +// private List taxReportColumns; +// /** +// * 薪资账套的个税申报表规则。key:薪资账套id-个税申报表字段索引、value:薪资账套的个税申报表规则 +// */ +// private Map salarySobTaxReportRuleMap; +// /** +// * 薪资账套的累计字段对应关系。key:薪资账套id-往期累计情况的字段索引、value:薪资账套的累计字段对应关系 +// */ +// private Map salarySobAddUpRuleMap; +// /** +// * 薪资项目 +// */ +// private List salaryItems; +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java new file mode 100644 index 000000000..0f1b6e5a6 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -0,0 +1,88 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +//import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +//import com.google.common.collect.Lists; +//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; +//import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; +//import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryEnumUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.teams.domain.hr.SimpleUserInfo; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import org.apache.commons.collections4.CollectionUtils; +// +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +//import java.util.function.Function; +//import java.util.stream.Collectors; +// +///** +// * @description: 个税申报明细表中的人员 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/11/10 4:20 PM +// * @version:v1.0 +// */ +//public class TaxDeclareEmployeeBO { +// +// public static List convert2AbnormalEmployee(List taxDeclareEmployees, +// List employeeDeclares, +// List simpleEmployees, +// List simpleUserInfos, +// List extEmployees) { +// if (CollectionUtils.isEmpty(taxDeclareEmployees)) { +// return Collections.emptyList(); +// } +// List abnormalEmployeeList = Lists.newArrayList(); +// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); +// Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// Map simpleUserInfoMap = simpleUserInfos.stream() +// .filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser())) +// .collect(Collectors.toMap(simpleUserInfo -> simpleUserInfo.getUser().getId(), Function.identity(), (a, b) -> a)); +// Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId); +// for (TaxDeclareEmployeePO taxDeclareEmployee : taxDeclareEmployees) { +// AbnormalEmployeeListDTO abnormalEmployeeListDTO = new AbnormalEmployeeListDTO() +// .setId(taxDeclareEmployee.getEmployeeId()) +// .setEmployeeId(taxDeclareEmployee.getEmployeeId()) +// .setEmployeeType(taxDeclareEmployee.getEmployeeType()); +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclareEmployee.getEmployeeId()); +// if (employeeDeclare != null) { +// DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class); +// abnormalEmployeeListDTO +// .setEmployeeName(employeeDeclare.getEmployeeName()) +// .setJobNum(employeeDeclare.getJobNum()) +// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) +// .setCardNum(employeeDeclare.getCardNum()) +// .setDeclareStatus(declareStatusEnum) +// .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); +// } else if (Objects.equals(taxDeclareEmployee.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclareEmployee.getEmployeeId()); +// SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(taxDeclareEmployee.getEmployeeId()); +// abnormalEmployeeListDTO +// .setEmployeeName(simpleEmployee.getUsername()) +// .setJobNum(simpleEmployee.getJobNum()) +// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) +// .setCardNum(simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()) +// .setDeclareStatus(null) +// .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); +// } else { +// ExtEmployeePO extEmployee = extEmployeePOMap.get(taxDeclareEmployee.getEmployeeId()); +// abnormalEmployeeListDTO +// .setEmployeeName(extEmployee.getUsername()) +// .setJobNum("") +// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) +// .setCardNum(extEmployee.getCardNum()) +// .setDeclareStatus(null) +// .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); +// } +// abnormalEmployeeList.add(abnormalEmployeeListDTO); +// } +// return abnormalEmployeeList; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java new file mode 100644 index 000000000..7df1fe6dd --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java @@ -0,0 +1,41 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Map; + +/** + * @description: 个税申报相关接口的请求参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/2/6 5:24 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclareRequest { + + /** + * 供应商信息 + */ + private TaxDeclarationApiConfigPO taxDeclarationApiConfig; + + /** + * 个税扣缴义务人 + */ + private TaxAgentPO taxAgent; + + /** + * 个税申报记录 + */ + private TaxDeclareRecordPO taxDeclareRecord; + + /** + * 请求参数 + */ + private Map requestParam; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java new file mode 100644 index 000000000..9be4d4bba --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -0,0 +1,78 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.table.type.WeaTableTypeEnum; +import com.weaver.hrm.salary.annotation.SalaryTable; +import com.weaver.hrm.salary.annotation.SalaryTableColumn; +import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; +import org.codehaus.jackson.map.annotate.JsonSerialize; +import org.codehaus.jackson.map.ser.std.ToStringSerializer; + +/** + * @description: 个税申报-校验异常的人员列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 2:28 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +@SalaryTable(tableType = WeaTableTypeEnum.NONE, pageUid = "abnormalEmployeeList") +public class AbnormalEmployeeListDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("关联人员类型") + private Integer employeeType; + + @ApiModelProperty("关联人员id") + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + @SalaryTableColumn( + label = "姓名", + labelId = 85429, + width = "150" + ) + @ApiModelProperty("姓名") + private String employeeName; + + @SalaryTableColumn( + label = "工号", + labelId = 86317, + width = "150" + ) + @ApiModelProperty("工号") + private String jobNum; + + @SalaryTableColumn( + label = "证件类型", + labelId = 105139, + width = "150" + ) + @ApiModelProperty("证件类型") + private String cardType; + + @SalaryTableColumn( + label = "证件号码", + labelId = 86318, + width = "150" + ) + @ApiModelProperty("证件号码") + private String cardNum; + + @ApiModelProperty("报送状态") + private DeclareStatusEnum declareStatus; + + @SalaryTableColumn( + label = "报送状态", + labelId = 177862, + width = "150" + ) + @ApiModelProperty("报送状态") + private String declareStatusDesc; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java new file mode 100644 index 000000000..737011270 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -0,0 +1,71 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.table.type.WeaTableTypeEnum; +import com.weaver.hrm.salary.annotation.SalaryTable; +import com.weaver.hrm.salary.annotation.SalaryTableColumn; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; +import org.codehaus.jackson.map.annotate.JsonSerialize; +import org.codehaus.jackson.map.ser.std.ToStringSerializer; + +/** + * @description: 个税申报-申报失败的人员列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/30 2:22 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +@SalaryTable(tableType = WeaTableTypeEnum.NONE, pageUid = "failEmployeeList") +public class FailEmployeeListDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @SalaryTableColumn( + label = "姓名", + labelId = 85429, + width = "150" + ) + @ApiModelProperty("姓名") + private String employeeName; + + @ApiModelProperty("个税扣缴义务人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @SalaryTableColumn( + label = "个税扣缴义务人名称", + labelId = 91558, + width = "150" + ) + @ApiModelProperty("个税扣缴义务人名称") + private String taxAgentName; + + @SalaryTableColumn( + label = "证件号码", + labelId = 86318, + width = "150" + ) + @ApiModelProperty("证件号码") + private String cardNum; + + @SalaryTableColumn( + label = "失败原因", + labelId = 156405, + width = "150" + ) + @ApiModelProperty("失败原因") + private String errorMsg; + + @SalaryTableColumn( + label = "所得项目", + labelId = 102786, + width = "150" + ) + @ApiModelProperty("所得项目") + private String incomeCategory; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java new file mode 100644 index 000000000..a261ad1b0 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * @description: + * @author: xiajun + * @modified By: xiajun + * @date: 2022/7/12 11:39 + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationRateDTO implements Serializable { + + private static final long serialVersionUID = 8478996890743085394L; + + @ApiModelProperty("缓存索引") + private String index; + @ApiModelProperty("提示信息") + private String msg; + @ApiModelProperty("状态") + private boolean status; + @ApiModelProperty("是否已经完成") + private boolean finish; + @ApiModelProperty("提示信息是否自动消失") + private boolean msgPersist; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java new file mode 100644 index 000000000..dc2d6fd56 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @description: 个税申报表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 11:40 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationTabDTO { + + @ApiModelProperty("Tab页签的名称") + private String tabName; + + @ApiModelProperty("收入所得类型") + private IncomeCategoryEnum incomeCategory; + + @ApiModelProperty("个税申报表id") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxDeclarationId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java new file mode 100644 index 000000000..53ef3bd27 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.table.column.WeaTableColumn; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Map; + +/** + * @description: 个税申报表详情列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/6 1:28 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationValueListDTO { + + /** + * 个税申报表表头 + */ + private List columns; + + /** + * 个税申报表数据 + */ + private List> data; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java new file mode 100644 index 000000000..b856568ad --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -0,0 +1,64 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.form.item.WeaFormItemType; +import com.weaver.hrm.salary.annotation.SalaryForm; +import com.weaver.hrm.salary.annotation.SalaryFormItem; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; +import java.util.List; +import java.util.Map; + +/** + * @description: 个税申报记录表单 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/15/21 9:40 AM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("个税申报记录表单") +public class TaxDeclareRecordFormDTO { + + @SalaryForm( + label = "薪资所属月", + labelId = 87614, + items = @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) + ) + @ApiModelProperty("薪资所属月") + private YearMonth salaryMonth; + + @SalaryForm( + label = "个税扣缴义务人范围", + labelId = 160476, + items = @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = TaxAgentRangeEnum.class) + ) + @ApiModelProperty("个税扣缴义务人范围") + private TaxAgentRangeEnum taxAgentRange; + + @SalaryForm( + label = "个税扣缴义务人", + labelId = 86184, + items = @SalaryFormItem(itemType = WeaFormItemType.BROWSER, required = true, browserModule = "hrmsalary", + browserType = "TaxAgentBrowser", browserMultiple = true) + ) + @ApiModelProperty("个税扣缴义务人id") + private List> taxAgentIds; + + @SalaryForm( + label = "备注", + labelId = 84961, + items = @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "30") + ) + @ApiModelProperty("备注") + private String description; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java new file mode 100644 index 000000000..6aa26d4af --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -0,0 +1,121 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.weaver.common.component.table.type.WeaTableTypeEnum; +import com.weaver.hrm.salary.annotation.SalaryTable; +import com.weaver.hrm.salary.annotation.SalaryTableColumn; +import com.weaver.hrm.salary.annotation.SalaryTableOperate; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @description: 个税申报记录列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 9:25 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +@SalaryTable(value = { + @SalaryTableOperate(index = 0, text = "查看详情", labelId = 93216, outer = true), + @SalaryTableOperate(index = 1, text = "删除", labelId = 87061, outer = true) +}, tableType = WeaTableTypeEnum.NONE, pageUid = "taxAgentDeclareList") +public class TaxDeclareRecordListDTO { + + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("个税扣缴义务人") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @SalaryTableColumn( + label = "个税扣缴义务人", + labelId = 86184, + width = "15%" + ) + @ApiModelProperty("个税扣缴义务人名称") + private String taxAgentName; + + @SalaryTableColumn( + label = "薪资所属月", + labelId = 87614, + width = "10%" + ) + @ApiModelProperty("薪资所属月") + private String salaryMonth; + + @SalaryTableColumn( + label = "税款所属期", + labelId = 86176, + width = "10%" + ) + @ApiModelProperty("税款所属期") + private String taxCycle; + + @ApiModelProperty("申报类型") + private TaxDeclareTypeEnum taxDeclareType; + + @SalaryTableColumn( + label = "申报类型", + labelId = 177641, + width = "10%" + ) + @ApiModelProperty("申报类型") + private String taxDeclareTypeDesc; + + @ApiModelProperty("申报状态") + private TaxDeclareStatusEnum taxDeclareStatus; + + @SalaryTableColumn( + label = "申报状态", + labelId = 156414, + width = "10%" + ) + @ApiModelProperty("申报状态") + private String taxDeclareStatusDesc; + + @SalaryTableColumn( + label = "已缴金额", + labelId = 179035, + width = "10%" + ) + @ApiModelProperty("已缴金额") + private String taxPaidAmount; + + @ApiModelProperty("操作人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long operateEmployeeId; + + @SalaryTableColumn( + label = "操作人", + labelId = 85435, + width = "10%" + ) + @ApiModelProperty("操作人名称") + private String operateEmployeeName; + + @SalaryTableColumn( + label = "操作时间", + labelId = 85436, + width = "15%" + ) + @ApiModelProperty("操作时间") + private String operateTime; + + @SalaryTableColumn( + label = "备注", + labelId = 84961, + width = "10%" + ) + @ApiModelProperty("备注") + private String description; + + @ApiModelProperty("是否展示图标") + private boolean displayIcon; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java new file mode 100644 index 000000000..25cdbd25a --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.weaver.hrm.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @description: 个税申报-异常数据-未报送人员列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 1:54 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class AbnormalEmployeeListQueryParam extends BaseQueryParam { + + @ApiModelProperty("工号、姓名、身份证号码") + private String keyword; + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; + + @JsonIgnore + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @JsonIgnore + @ApiModelProperty("税款所属期") + private String taxCycle; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java new file mode 100644 index 000000000..19d514e52 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.weaver.hrm.salary.common.BaseQueryParam; +import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报记录详情列表查询参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/15/21 3:21 PM + * @version:v1.0 + */ +@Data +@ApiModel("个税申报表记录列表查询参数") +public class TaxDeclarationValueListQueryParam extends BaseQueryParam { + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; + + @ApiModelProperty("个税申报表id") + private Long taxDeclarationId; + + @ApiModelProperty("收入所得项目") + private IncomeCategoryEnum incomeCategory; + + @ApiModelProperty("导出excel时加密的密码") + private String sharePassword; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java new file mode 100644 index 000000000..de2728047 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/11 2:56 PM + * @version:v1.0 + */ +@Data +public class TaxDeclareRecordParam { + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java new file mode 100644 index 000000000..53231ebf8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java @@ -0,0 +1,90 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 个税申报相关api配置 + * + * @author chengliming + * @date 2022-11-09 09:49:08 + */ +@Data +@Accessors(chain = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_declare_api_config") +public class TaxDeclarationApiConfigPO implements Serializable { + + private static final long serialVersionUID = 2287550079146871129L; + + /** + * 主键id + */ + private Long id; + + /** + * 接口host + */ + private String host; + /** + * app key + */ + private String appKey; + /** + * 密钥 + */ + private String appSecret; + + /** + * 是否开启使用 + */ + private Integer enableUse; + + /** + * 总流量 + */ + private Long totality; + + /** + * 剩余流量 + */ + private Long remain; + + /** + * 流量最后更新时间 + */ + private LocalDateTime lastUpdateTime; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java new file mode 100644 index 000000000..d65bacb06 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java @@ -0,0 +1,65 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.enums.taxdeclaration.TaxDeclareApiProfileEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 个税申报相关api配置 + * + * @author chengliming + * @date 2022-11-09 09:49:08 + */ +@Data +@Accessors(chain = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_declare_api_profile") +public class TaxDeclarationApiProfilePO implements Serializable { + + private static final long serialVersionUID = 8281861662866222040L; + + /** + * 主键id + */ + private Long id; + + /** + * 接口环境 + * + * @see TaxDeclareApiProfileEnum + */ + private Integer apiProfile; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java new file mode 100644 index 000000000..39fc3f89c --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -0,0 +1,80 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; + +/** + * @description: 个税申报表的值 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/27/22 5:03 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//hrsa_tax_declaration_value") +public class TaxDeclarationValuePO implements Serializable { + /** + * 主键id + */ + private Long id; + + /** + * 个税申报表id + */ + private Long taxDeclarationId; + + /** + * 个税申报记录id + */ + private Long taxDeclareRecordId; + + /** + * 人员类型 + */ + private Integer employeeType; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 薪资核算结果 + */ + private Map resultValue; + + /** + * 薪资核算结果(只在加密解密中使用) + */ + private String resultValueJson; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java new file mode 100644 index 000000000..b692fc532 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报中的人员 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 4:03 PM + * @version:v1.0 + */ +@Data +public class TaxDeclareEmployeePO { + + @ApiModelProperty("人员id") + private Long employeeId; + + @ApiModelProperty("人员类型") + private Integer employeeType; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java new file mode 100644 index 000000000..1c1127159 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java @@ -0,0 +1,57 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.report.enums.IncomeCategoryEnum; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * @description: 个税申报失败数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/30 11:38 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//hrsa_tax_declare_fail") +public class TaxDeclareFailPO implements Serializable { + + private static final long serialVersionUID = -7908151391741544058L; + + private Long id; + + private Long taxDeclareRecordId; + + /** + * @see IncomeCategoryEnum + */ + //所得项目") + private String incomeCategory; + + //姓名") + private String employeeName; + + //证件号码") + private String cardNum; + + //失败原因") + private String errorMsg; + + //租户key", ignore = true) + private String tenantKey; + + //创建人id", ignore = true) + private Long creator; + + //是否删除", ignore = true) + private Integer deleteType; + + //创建时间", ignore = true) + private Date createTime; + + //更新时间", ignore = true) + private Date updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java new file mode 100644 index 000000000..59ba8eb32 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -0,0 +1,111 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/2 5:40 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//hrsa_tax_declare_record") +//个税申报记录") +public class TaxDeclareRecordPO implements Serializable { + + private static final long serialVersionUID = -1891927328401341853L; + /** + * 主键id + */ + //主键id") + private Long id; + /** + * 个税扣缴义务人id + */ + //个税扣缴义务人") + private Long taxAgentId; + /** + * 薪资所属月 + */ + //薪资所属月") + private String salaryMonth; + /** + * 税款所属期 + */ + //税款所属期") + private String taxCycle; + /** + * 申报类型 + */ + //申报类型") + private Integer taxDeclareType; + /** + * 申报状态 + */ + //申报状态") + private Integer taxDeclareStatus; + /** + * 申报失败的错误信息 + */ + //申报失败的错误信息") + private String taxDeclareErrorMsg; + /** + * 请求的requestId + */ + //请求的requestId") + private String requestId; + /** + * 备注 + */ + //备注") + private String remark; + + //应缴金额") + private String taxPayAmount; + + //实缴总额") + private String taxPaidAmount; + + //实缴税额(不含滞纳金等)") + private String taxPurePaidAmount; + + //申报人数") + private Integer personNum; + + /** + * 个税申报表的待刷新数据的标识 + */ + //个税申报表的待刷新数据的标识") + private Integer displayUpdateIcon; + /** + * 租户key + */ + //租户key", ignore = true) + private String tenantKey; + /** + * 创建人id + */ + //创建人id", ignore = true) + private Long creator; + /** + * 是否删除 + */ + //是否删除", ignore = true) + private Integer deleteType; + /** + * 创建时间 + */ + //创建时间", ignore = true) + private LocalDateTime createTime; + /** + * 更新时间 + */ + //更新时间", ignore = true) + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java new file mode 100644 index 000000000..43598e736 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @description: 个税申报表表头 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/28 5:28 PM + * @version:v1.0 + */ +@Data +//name = "个税申报表表头") +//hrsa_tax_report_column") +public class TaxReportColumnPO { + + //name = "主键id") + private Long id; + //name = "报表类型") + private String taxReportType; + //name = "所得项目") + private String incomeCategory; + //name = "申报表的列名") + private String reportColumnName; + //name = "申报表的列名多语言标签") + private Integer reportColumnLabel; + //name = "申报表的列索引") + private String reportColumnDataIndex; + //name = "数值类型") + private String dataType; + //name = "个税对接时的参数key") + private String requestParamKey; + //name = "租户key", ignore = true) + private String tenantKey; + //name = "创建人id", ignore = true) + private Long creator; + //name = "是否删除", ignore = true) + private Integer deleteType; + //name = "创建时间", ignore = true) + private LocalDateTime createTime; + //name = "更新时间", ignore = true) + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java new file mode 100644 index 000000000..b00a2d9d6 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @description: 作废申报的反馈 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:32 AM + * @version:v1.0 + */ +@Data +public class CancelDeclareFeedbackResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口状态") + private Map body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java new file mode 100644 index 000000000..75956a672 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 作废申报的返回数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:17 AM + * @version:v1.0 + */ +@Data +public class CancelDeclareResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口数据") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java new file mode 100644 index 000000000..de5292d7a --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @description: 申报个税的反馈 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:32 AM + * @version:v1.0 + */ +@Data +public class DeclareTaxFeedbackResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口状态") + private Map body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java new file mode 100644 index 000000000..fd68013db --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报的返回数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:17 AM + * @version:v1.0 + */ +@Data +public class DeclareTaxResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口数据") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java new file mode 100644 index 000000000..6d37b2695 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 更正申报的返回数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/15 2:45 PM + * @version:v1.0 + */ +@Data +@ApiModel("更正申报的返回数据") +public class UpdateDeclareResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java index 233313c66..d8ab743e9 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.taxpayment.dto; -import com.weaver.common.component.form.WeaForm; import io.swagger.annotations.ApiModel; import lombok.AllArgsConstructor; import lombok.Builder; @@ -22,7 +21,7 @@ import java.util.Map; @ApiModel("查询缴费信息") public class TaxAgreementFormDTO extends TaxFeedbackResultDTO { - private WeaForm form; +// private WeaForm form; private Map count; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java index fc1f777d4..b0fc09ca7 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -1,58 +1,58 @@ -package com.engine.salary.entity.taxpayment.dto; - -import com.weaver.common.component.form.item.WeaFormItemType; -import com.weaver.hrm.salary.annotation.SalaryForm; -import com.weaver.hrm.salary.annotation.SalaryFormItem; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 查询缴费信息 - * - * @author chengliming - * @date 2022-12-27 13:25:42 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@ApiModel("查询缴费信息") -public class TaxAmountFormDTO { - - @SalaryForm( - label = "个税扣缴义务人", - labelId = 86184, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) - } - ) - @ApiModelProperty("个税扣缴义务人") - private String taxAgent; - - @SalaryForm( - label = "应缴金额", - labelId = 175126, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) - } - ) - @ApiModelProperty("应缴金额") - private String amount; - - @SalaryForm( - label = "申报人数", - labelId = 175128, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) - } - ) - @ApiModelProperty("申报人数") - private String personNum; -} +//package com.engine.salary.entity.taxpayment.dto; +// +//import com.weaver.common.component.form.item.WeaFormItemType; +//import com.weaver.hrm.salary.annotation.SalaryForm; +//import com.weaver.hrm.salary.annotation.SalaryFormItem; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +///** +// * 查询缴费信息 +// * +// * @author chengliming +// * @date 2022-12-27 13:25:42 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("查询缴费信息") +//public class TaxAmountFormDTO { +// +// @SalaryForm( +// label = "个税扣缴义务人", +// labelId = 86184, +// labelSpan = 8, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) +// } +// ) +// @ApiModelProperty("个税扣缴义务人") +// private String taxAgent; +// +// @SalaryForm( +// label = "应缴金额", +// labelId = 175126, +// labelSpan = 8, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) +// } +// ) +// @ApiModelProperty("应缴金额") +// private String amount; +// +// @SalaryForm( +// label = "申报人数", +// labelId = 175128, +// labelSpan = 8, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) +// } +// ) +// @ApiModelProperty("申报人数") +// private String personNum; +//} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java index 942ef4423..628200104 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java @@ -1,9 +1,5 @@ package com.engine.salary.entity.taxpayment.dto; -import com.weaver.common.component.form.item.WeaFormItemType; -import com.weaver.hrm.salary.annotation.SalaryForm; -import com.weaver.hrm.salary.annotation.SalaryFormItem; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -24,14 +20,6 @@ import lombok.NoArgsConstructor; @ApiModel("查询缴费信息") public class TaxPayTypeFormDTO { - @SalaryForm( - label = "缴款方式", - labelId = 175127, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = TaxPaymentTypeEnum.class) - } - ) @ApiModelProperty("缴款方式") private String type; diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java index e0b38be9f..36b234da2 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java @@ -13,7 +13,7 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor @ApiModel("查询缴费凭证") -public class TaxWithholdingVoucherFeedbackDTO extends TaxFeedbackResultDTO{ +public class TaxWithholdingVoucherFeedbackDTO extends TaxFeedbackResultDTO { /** * 申报类型代码 */ diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index 2b57b8a1b..dd3f86edb 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.taxpayment.param; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -31,7 +30,7 @@ public class TaxPaymentQueryParam { private Long taxDeclareRecordId; /** - * @see TaxPaymentServiceTypeEnum + * TaxPaymentServiceTypeEnum */ @ApiModelProperty("业务类型") private Integer type; diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 246630568..614c5ee70 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -1,7 +1,5 @@ package com.engine.salary.entity.taxpayment.po; -import com.baomidou.mybatisplus.annotation.TableName; -import com.weaver.common.elog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -21,85 +19,85 @@ import java.time.LocalDateTime; @Builder @NoArgsConstructor @AllArgsConstructor -@TableName("hrsa_tax_payment_request") -@ElogTransform(name = "个税辅助缴款-请求信息") +//hrsa_tax_payment_request") +//个税辅助缴款-请求信息") public class TaxPaymentRequestPO implements Serializable { private static final long serialVersionUID = -203732044881927518L; /** * 主键id */ - @ElogTransform(name = "主键id") + //主键id") private Long id; /** * 个税扣缴义务人的主键id */ - @ElogTransform(name = "个税扣缴义务人的主键id") + //个税扣缴义务人的主键id") private Long taxAgentId; /** * 个税申报记录ID */ - @ElogTransform(name = "个税申报记录id") + //个税申报记录id") private Long taxDeclareRecordId; /** * 税款所属期 */ - @ElogTransform(name = "税款所属期") + //税款所属期") private LocalDate taxYearMonth; /** * 异步请求ID */ - @ElogTransform(name = "异步请求ID") + //异步请求ID") private String requestId; /** * 请求类型 * - * @see com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum + * com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum */ - @ElogTransform(name = "异步请求ID") + //异步请求ID") private Integer requestType; /** * 是否已获取反馈 * - * @see com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum + * com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum */ - @ElogTransform(name = "是否已获取反馈") + //是否已获取反馈") private Integer feedback; /** * 租户key */ - @ElogTransform(name = "租户key", ignore = true) + //租户key", ignore = true) private String tenantKey; /** * 创建人id */ - @ElogTransform(name = "创建人id", ignore = true) + //创建人id", ignore = true) private Long creator; /** * 是否删除 */ - @ElogTransform(name = "是否删除", ignore = true) + //是否删除", ignore = true) private Integer deleteType; /** * 创建时间 */ - @ElogTransform(name = "创建时间", ignore = true) + //创建时间", ignore = true) private LocalDateTime createTime; /** * 更新时间 */ - @ElogTransform(name = "更新时间", ignore = true) + //更新时间", ignore = true) private LocalDateTime updateTime; } diff --git a/src/com/engine/salary/enums/SalaryOnOffEnum.java b/src/com/engine/salary/enums/SalaryOnOffEnum.java index 7afb5aab0..75b2c4184 100644 --- a/src/com/engine/salary/enums/SalaryOnOffEnum.java +++ b/src/com/engine/salary/enums/SalaryOnOffEnum.java @@ -1,6 +1,7 @@ package com.engine.salary.enums; +import java.util.Objects; /** * @description: 是、否 @@ -40,4 +41,14 @@ public enum SalaryOnOffEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static SalaryOnOffEnum parseByValue(int value) { + for (SalaryOnOffEnum onOffEnum : SalaryOnOffEnum.values()) { + if (Objects.equals(onOffEnum.getValue(), value)) { + return onOffEnum; + } + } + return null; + } + } diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java new file mode 100644 index 000000000..d0f20caa1 --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java @@ -0,0 +1,51 @@ +package com.engine.salary.enums.taxagent; + +import java.util.Objects; + +/** + * 个人扣缴义务人-报税信息-验证类型 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnCheckTypeEnum { + + /** + * 报税信息验证 + */ + MAIN_CHECK(1, "报税信息验证"), + /** + * 登记序号+税号验证 + */ + REGISTRATION_CHECK(2, "登记序号+税号验证"), + /** + * 部门编码验证 + */ + DEPARTMENT_CHECK(3, "部门编码验证"); + + private final int value; + + private final String defaultLabel; + + TaxAgentTaxReturnCheckTypeEnum(int value, String defaultLabel) { + this.value = value; + this.defaultLabel = defaultLabel; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxAgentTaxReturnCheckTypeEnum parseByValue(int value) { + for (TaxAgentTaxReturnCheckTypeEnum typeEnum : TaxAgentTaxReturnCheckTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java new file mode 100644 index 000000000..710265f77 --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.taxagent; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 个人扣缴义务人-报税信息-密码校验类型 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnPasswordTypeEnum implements BaseEnum { + + /** + * 个税网报密码 + */ + TAX_NET_PASSWORD(0, "个税网报密码", 144391), + /** + * 实名账号密码 + */ + REAL_NAME_PASSWORD(2, "实名账号密码", 144392); + + private final int value; + + private final String defaultLabel; + + private final int labelId; + + TaxAgentTaxReturnPasswordTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static TaxAgentTaxReturnPasswordTypeEnum parseByValue(int value) { + for (TaxAgentTaxReturnPasswordTypeEnum typeEnum : TaxAgentTaxReturnPasswordTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java new file mode 100644 index 000000000..8f576d7ed --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java @@ -0,0 +1,57 @@ +package com.engine.salary.enums.taxagent; + +import java.util.Objects; + +/** + * 个人扣缴义务人-报税信息-验证状态 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnStatusEnum { + + /** + * 未验证 + */ + NOT_COMMIT(10, "未验证", 154753), + /** + * 成功 + */ + SUCCESS(20, "成功", 154751), + /** + * 失败 + */ + FAIL(30, "失败", 154752); + + private final Integer value; + + private final String desc; + + private final Integer labelId; + + TaxAgentTaxReturnStatusEnum(Integer value, String desc, Integer labelId) { + this.value = value; + this.desc = desc; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return desc; + } + + public static TaxAgentTaxReturnStatusEnum parseByValue(Integer value) { + if (value == null) { + return TaxAgentTaxReturnStatusEnum.NOT_COMMIT; + } + for (TaxAgentTaxReturnStatusEnum statusEnum : TaxAgentTaxReturnStatusEnum.values()) { + if (Objects.equals(statusEnum.getValue(), value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java new file mode 100644 index 000000000..9918aca0f --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java @@ -0,0 +1,44 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 作废申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/11 5:34 PM + * @version:v1.0 + */ +public enum CancelDeclareStatusEnum implements BaseEnum { + + CANCEL_SUCCESS(8, "作废成功", 160490), + CANCEL_FAIL(10, "作废失败", 160491); + + + CancelDeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java new file mode 100644 index 000000000..2396b34a2 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java @@ -0,0 +1,46 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 申报反馈状态 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 2:13 PM + * @version:v1.0 + */ +public enum DeclareFeedBackStatusEnum implements BaseEnum { + + DECLARE_SUCCESS_NO_PAY(1, "申报成功,无需缴款", 160492), + DECLARE_SUCCESS_UNPAID(2, "申报成功,未缴款", 160493), + DECLARE_FAIL(4, "申报失败", 160494), + DECLARE_SUCCESS_PAID(5, "已缴款", 160498), + ; + + DeclareFeedBackStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java b/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java new file mode 100644 index 000000000..b4d6d3128 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java @@ -0,0 +1,45 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 个税申报对接 - 接口业务类型 + * + * @author chengliming + * @date 2022-11-22 10:39:39 + */ +@SuppressWarnings("squid:S00115") +public enum EnumDeclareApiBusinessType implements BaseEnum { + + ADD_UP_DEDUCTION(1, "累计专项附加扣除", 85380), + EMPLOYEE_DECLARATION(2, "人员信息报送", 158769), + TAX_DECLARATION(3, "个税申报", 95835); + + private final Integer value; + + private final String defaultLabel; + + private final Integer labelId; + + EnumDeclareApiBusinessType(Integer value, String defaultLabel, Integer labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public Integer getValue() { + return value; + } + +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java new file mode 100644 index 000000000..42d758508 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java @@ -0,0 +1,44 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 个税扣缴义务人范围 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/17 10:46 AM + * @version:v1.0 + */ +public enum TaxAgentRangeEnum implements BaseEnum { + + ALL_TAX_AGENT(1, "所有个税扣缴义务人", 107731), + ADMIN_TAX_AGENT(2, "作为管理员的个税扣缴义务人", 177858), + SELECT_TAX_AGENT(3, "选择个税扣缴义务人", 177859); + + TaxAgentRangeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java new file mode 100644 index 000000000..ba892090a --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java @@ -0,0 +1,42 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 个税对接接口环境 + * + * @author chengliming + * @date 2023-01-04 14:18:36 + */ +public enum TaxDeclareApiProfileEnum implements BaseEnum { + + TEST(0, "测试地址", 0), + PROD(1, "正式地址", 0); + + TaxDeclareApiProfileEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java new file mode 100644 index 000000000..6bad22d9a --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java @@ -0,0 +1,49 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 申报状态 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 1:58 PM + * @version:v1.0 + */ +public enum TaxDeclareStatusEnum implements BaseEnum { + + NOT_DECLARE(1, "未申报", 160495), + DECLARING(2, "申报中", 160496), + DECLARE_FAIL(3, "申报失败", 160494), + DECLARE_CANCELLING(4, "作废中", 160497), + DECLARE_SUCCESS_NO_PAY(5, "申报成功,无需缴款", 160492), + DECLARE_SUCCESS_UNPAID(6, "申报成功,未缴款", 160493), + DECLARE_SUCCESS_PAID(7, "已缴款", 160498), + DECLARE_SUCCESS_PAYING(8, "缴款中", 160499); + + TaxDeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java new file mode 100644 index 000000000..c9a39aabe --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java @@ -0,0 +1,43 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 申报类型 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 1:41 PM + * @version:v1.0 + */ +public enum TaxDeclareTypeEnum implements BaseEnum { + + NORMAL_DECLARE(0, "正常申报", 177857), + UPDATE_DECLARE(1, "更正申报", 177637); + + TaxDeclareTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java new file mode 100644 index 000000000..58662abc7 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.taxdeclaration; + +import java.util.Objects; + +/** + * 个税辅助缴款-请求类型 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentServiceTypeEnum { + + /** + * 获取企业的三方信息 + */ + QUERY_AGREEMENT(1, "企业三方信息", 174411), + /** + * 三方协议缴款反馈 + */ + WITHHOLDING_PAY(2, "三方缴款", 174411), + /** + * 缴款凭证反馈 + */ + WITHHOLDING_VOUCHER(3, "银行端缴款凭证", 192313), + /** + * 完税证明 + */ + WITHHELD_VOUCHER(4, "完税证明", 184013), + ; + + private final int value; + + private final String defaultLabel; + + private int labelId; + + TaxPaymentServiceTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentServiceTypeEnum parseByValue(int value) { + for (TaxPaymentServiceTypeEnum typeEnum : TaxPaymentServiceTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java new file mode 100644 index 000000000..32872d0a6 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java @@ -0,0 +1,53 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 个税辅助缴款状态 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentStatusEnum implements BaseEnum { + SUCCESS(0, "扣款成功", 0), + VERIFY_INFO_FAIL(1, "信息校验失败", 0), + DONT_NEED(2, "无欠费记录", 0), + FAIL(3, "扣款失败", 0), + ; + + private final int value; + + private final String defaultLabel; + + private final int labelId; + + TaxPaymentStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return this.labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentStatusEnum parseByValue(int value) { + for (TaxPaymentStatusEnum typeEnum : TaxPaymentStatusEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java new file mode 100644 index 000000000..b3aeeed48 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java @@ -0,0 +1,57 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 个税辅助缴款-请求类型 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentTypeEnum implements BaseEnum { + /** + * 三方协议缴款反馈 + */ + WITHHOLDING_PAY(1, "三方缴款", 174411), + /** + * 缴款凭证反馈 + */ + WITHHOLDING_VOUCHER(2, "缴款凭证打印", 192313), + ; + + private final int value; + + private final String defaultLabel; + + private int labelId; + + TaxPaymentTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return this.labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentTypeEnum parseByValue(int value) { + for (TaxPaymentTypeEnum typeEnum : TaxPaymentTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java index 437d8376e..f770c4369 100644 --- a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java +++ b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java @@ -6,280 +6,281 @@ import com.engine.salary.util.SalaryI18nUtil; import org.apache.commons.compress.utils.Lists; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; import java.util.LinkedList; import java.util.List; -@Component public class ExcelFuncs { - protected final Logger logger = LoggerFactory.getLogger(getClass()); - final static private String ALLFORM="all"; - final static private String CURRENTDATA="current_data"; - static String normalStr="{\"key\":\"\",\"fieldId\":\"\",\"componentKey\":\"\",\"term\":\"\",\"formId\":\"\",\"content\":\"\",\"fieldType\":\"\"}"; - static public JSONObject normalJson= JSON.parseObject(normalStr); - static private String[] nullParamDatas=new String[]{}; - static private String[] paramDatas=new String[]{}; - static private String[] allParamDatas=new String[]{"{}","[]"}; - static private String[] moduleList=new String[]{"biaoge","workflow"}; - private FuncDescUtil funcDescUtil; - public List getCompList(){ - //比较操作符 - List compList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc(">",SalaryI18nUtil.getI18nLabel(12132,"大于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + protected final Logger logger = LoggerFactory.getLogger(getClass()); + final static private String ALLFORM = "all"; + final static private String CURRENTDATA = "current_data"; + static String normalStr = "{\"key\":\"\",\"fieldId\":\"\",\"componentKey\":\"\",\"term\":\"\",\"formId\":\"\",\"content\":\"\",\"fieldType\":\"\"}"; + static public JSONObject normalJson = JSON.parseObject(normalStr); + static private String[] nullParamDatas = new String[]{}; + static private String[] paramDatas = new String[]{}; + static private String[] allParamDatas = new String[]{"{}", "[]"}; + static private String[] moduleList = new String[]{"biaoge", "workflow"}; + private FuncDescUtil funcDescUtil; - excelFunc=new ExcelFunc(">=",SalaryI18nUtil.getI18nLabel(27694,"大于等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + public List getCompList() { + //比较操作符 + List compList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc(">", SalaryI18nUtil.getI18nLabel(12132, "大于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - excelFunc=new ExcelFunc("<",SalaryI18nUtil.getI18nLabel(20009,"小于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc(">=", SalaryI18nUtil.getI18nLabel(27694, "大于等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - excelFunc=new ExcelFunc("<=",SalaryI18nUtil.getI18nLabel(15251,"小于等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc("<", SalaryI18nUtil.getI18nLabel(20009, "小于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("=",SalaryI18nUtil.getI18nLabel(15112,"等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc("<=", SalaryI18nUtil.getI18nLabel(15251, "小于等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897,"不等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("=", SalaryI18nUtil.getI18nLabel(15112, "等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - return compList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897, "不等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - /** - * 日期函数的列表 - * @return - */ - public List getDateList(){ - //日期函数 - List dateList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("TODAY",SalaryI18nUtil.getI18nLabel(94924,"当前日期"), funcDescUtil.get("TODAY"),"TODAY()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + return compList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NOW",SalaryI18nUtil.getI18nLabel(94925,"当前日期时间"), funcDescUtil.get("NOW"),"NOW()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + /** + * 日期函数的列表 + * + * @return + */ + public List getDateList() { + //日期函数 + List dateList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("TODAY", SalaryI18nUtil.getI18nLabel(94924, "当前日期"), funcDescUtil.get("TODAY"), "TODAY()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEADD",SalaryI18nUtil.getI18nLabel(94926,"对日期加减年、月、日"), funcDescUtil.get("DATEADD"),"DATEADD(日期, 数值, ['单位'])",nullParamDatas,paramArray,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NOW", SalaryI18nUtil.getI18nLabel(94925, "当前日期时间"), funcDescUtil.get("NOW"), "NOW()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEDIFF",SalaryI18nUtil.getI18nLabel(94927,"返回两个日期的差值"), funcDescUtil.get("DATEDIFF"),"DATEDIFF(日期1, 日期2, ['单位'])",nullParamDatas,paramArray,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEADD", SalaryI18nUtil.getI18nLabel(94926, "对日期加减年、月、日"), funcDescUtil.get("DATEADD"), "DATEADD(日期, 数值, ['单位'])", nullParamDatas, paramArray, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEFORMAT",SalaryI18nUtil.getI18nLabel(94928,"返回指定格式的日期"), funcDescUtil.get("DATEFORMAT"),"DATEFORMAT(日期, '可选格式')",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEDIFF", SalaryI18nUtil.getI18nLabel(94927, "返回两个日期的差值"), funcDescUtil.get("DATEDIFF"), "DATEDIFF(日期1, 日期2, ['单位'])", nullParamDatas, paramArray, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("YEAR",SalaryI18nUtil.getI18nLabel(94929,"返回日期中的年"), funcDescUtil.get("YEAR"),"YEAR(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEFORMAT", SalaryI18nUtil.getI18nLabel(94928, "返回指定格式的日期"), funcDescUtil.get("DATEFORMAT"), "DATEFORMAT(日期, '可选格式')", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{"String"}; - excelFunc=new ExcelFunc("MONTH",SalaryI18nUtil.getI18nLabel(94930,"返回日期中的月"), funcDescUtil.get("MONTH"),"MONTH(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("YEAR", SalaryI18nUtil.getI18nLabel(94929, "返回日期中的年"), funcDescUtil.get("YEAR"), "YEAR(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DAY",SalaryI18nUtil.getI18nLabel(94931,"返回日期中的日"), funcDescUtil.get("DAY"),"DAY(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{"String"}; + excelFunc = new ExcelFunc("MONTH", SalaryI18nUtil.getI18nLabel(94930, "返回日期中的月"), funcDescUtil.get("MONTH"), "MONTH(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("HOUR",SalaryI18nUtil.getI18nLabel(94932,"返回日期中的小时"), funcDescUtil.get("HOUR"),"HOUR(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DAY", SalaryI18nUtil.getI18nLabel(94931, "返回日期中的日"), funcDescUtil.get("DAY"), "DAY(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MINUTE",SalaryI18nUtil.getI18nLabel(94933,"返回日期中的分钟"), funcDescUtil.get("MINUTE"),"MINUTE(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("HOUR", SalaryI18nUtil.getI18nLabel(94932, "返回日期中的小时"), funcDescUtil.get("HOUR"), "HOUR(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SECOND",SalaryI18nUtil.getI18nLabel(94934,"返回日期中的秒"), funcDescUtil.get("SECOND"),"SECOND(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MINUTE", SalaryI18nUtil.getI18nLabel(94933, "返回日期中的分钟"), funcDescUtil.get("MINUTE"), "MINUTE(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("WEEKNUM",SalaryI18nUtil.getI18nLabel(94936,"返回日期为第几周"), funcDescUtil.get("WEEKNUM"),"WEEKNUM(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SECOND", SalaryI18nUtil.getI18nLabel(94934, "返回日期中的秒"), funcDescUtil.get("SECOND"), "SECOND(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("WEEKDAY",SalaryI18nUtil.getI18nLabel(94937,"返回日期为星期几"), funcDescUtil.get("WEEKDAY"),"WEEKDAY(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("WEEKNUM", SalaryI18nUtil.getI18nLabel(94936, "返回日期为第几周"), funcDescUtil.get("WEEKNUM"), "WEEKNUM(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NETWORKDAYSPI",SalaryI18nUtil.getI18nLabel(94938,"返回指定日期之间包含的工作日天数(仅限的过去时间)"), funcDescUtil.get("NETWORKDAYSPI"),"NETWORKDAYSPI(日期1, 日期2, 成员)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("WEEKDAY", SalaryI18nUtil.getI18nLabel(94937, "返回日期为星期几"), funcDescUtil.get("WEEKDAY"), "WEEKDAY(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("EOMONTH",SalaryI18nUtil.getI18nLabel(94939,"返回某月最后一天日期"), funcDescUtil.get("EOMONTH"),"EOMONTH(日期,指定日期之前或之后的月数)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NETWORKDAYSPI", SalaryI18nUtil.getI18nLabel(94938, "返回指定日期之间包含的工作日天数(仅限的过去时间)"), funcDescUtil.get("NETWORKDAYSPI"), "NETWORKDAYSPI(日期1, 日期2, 成员)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRYEAR",SalaryI18nUtil.getI18nLabel(101059,"返回当前年份"), funcDescUtil.get("CURRYEAR"),"CURRYEAR()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("EOMONTH", SalaryI18nUtil.getI18nLabel(94939, "返回某月最后一天日期"), funcDescUtil.get("EOMONTH"), "EOMONTH(日期,指定日期之前或之后的月数)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRMONTH",SalaryI18nUtil.getI18nLabel(101060,"返回当前月份"), funcDescUtil.get("CURRMONTH"),"CURRMONTH()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRYEAR", SalaryI18nUtil.getI18nLabel(101059, "返回当前年份"), funcDescUtil.get("CURRYEAR"), "CURRYEAR()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRDAY",SalaryI18nUtil.getI18nLabel(101061,"返回当前第几日(当月)"), funcDescUtil.get("CURRDAY"),"CURRDAY()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRMONTH", SalaryI18nUtil.getI18nLabel(101060, "返回当前月份"), funcDescUtil.get("CURRMONTH"), "CURRMONTH()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRWEEK",SalaryI18nUtil.getI18nLabel(101062,"返回当前是周几"), funcDescUtil.get("CURRWEEK"),"CURRWEEK()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRDAY", SalaryI18nUtil.getI18nLabel(101061, "返回当前第几日(当月)"), funcDescUtil.get("CURRDAY"), "CURRDAY()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRHOUR",SalaryI18nUtil.getI18nLabel(101063,"返回当前小时"), funcDescUtil.get("CURRHOUR"),"CURRHOUR()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRWEEK", SalaryI18nUtil.getI18nLabel(101062, "返回当前是周几"), funcDescUtil.get("CURRWEEK"), "CURRWEEK()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRMINUTE",SalaryI18nUtil.getI18nLabel(101064,"返回当前分"), funcDescUtil.get("CURRMINUTE"),"CURRMINUTE()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRHOUR", SalaryI18nUtil.getI18nLabel(101063, "返回当前小时"), funcDescUtil.get("CURRHOUR"), "CURRHOUR()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRSECOND",SalaryI18nUtil.getI18nLabel(101065,"返回当前秒"), funcDescUtil.get("CURRSECOND"),"CURRSECOND()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MAXDATE",SalaryI18nUtil.getI18nLabel(100803,"返回一组日期中的最大值"), funcDescUtil.get("MAXDATE"),"MAXDATE(日期1,日期2,……)",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRMINUTE", SalaryI18nUtil.getI18nLabel(101064, "返回当前分"), funcDescUtil.get("CURRMINUTE"), "CURRMINUTE()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MINDATE",SalaryI18nUtil.getI18nLabel(100805,"返回一组日期中的最小值"), funcDescUtil.get("MINDATE"),"MINDATE(日期1,日期2,……)",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); - return dateList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRSECOND", SalaryI18nUtil.getI18nLabel(101065, "返回当前秒"), funcDescUtil.get("CURRSECOND"), "CURRSECOND()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MAXDATE", SalaryI18nUtil.getI18nLabel(100803, "返回一组日期中的最大值"), funcDescUtil.get("MAXDATE"), "MAXDATE(日期1,日期2,……)", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - /** - * 逻辑函数的列表 - * @return - */ - public List getLogicList(){ - //逻辑函数 - List logicList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("IF",SalaryI18nUtil.getI18nLabel(94940,"如果条件为真,则...否则..."), funcDescUtil.get("IF"),"IF(条件, 表达式1, 表达式2)",paramArray,nullParamDatas,"Object",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MINDATE", SalaryI18nUtil.getI18nLabel(100805, "返回一组日期中的最小值"), funcDescUtil.get("MINDATE"), "MINDATE(日期1,日期2,……)", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); + return dateList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("AND",SalaryI18nUtil.getI18nLabel(51100,"且"), funcDescUtil.get("AND"),"AND(条件1, 条件2, [条件3, …])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + /** + * 逻辑函数的列表 + * + * @return + */ + public List getLogicList() { + //逻辑函数 + List logicList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("IF", SalaryI18nUtil.getI18nLabel(94940, "如果条件为真,则...否则..."), funcDescUtil.get("IF"), "IF(条件, 表达式1, 表达式2)", paramArray, nullParamDatas, "Object", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("OR",SalaryI18nUtil.getI18nLabel(35824,"或"), funcDescUtil.get("OR"),"OR(条件1, 条件2, [条件3, …])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("AND", SalaryI18nUtil.getI18nLabel(51100, "且"), funcDescUtil.get("AND"), "AND(条件1, 条件2, [条件3, …])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NOT",SalaryI18nUtil.getI18nLabel(94942,"反转真假结果"), funcDescUtil.get("NOT"),"NOT(逻辑结果)",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("OR", SalaryI18nUtil.getI18nLabel(35824, "或"), funcDescUtil.get("OR"), "OR(条件1, 条件2, [条件3, …])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IN",SalaryI18nUtil.getI18nLabel(94943,"变量是否包含在一组结果中"), funcDescUtil.get("IN"),"IN(变量, [变量1, 变量2, …])",paramArray,allParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NOT", SalaryI18nUtil.getI18nLabel(94942, "反转真假结果"), funcDescUtil.get("NOT"), "NOT(逻辑结果)", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LIKE",SalaryI18nUtil.getI18nLabel(94944,"文本是否包含任意一个关键字"), funcDescUtil.get("LIKE"),"LIKE(文本, [文本1, 文本2, …])",paramArray,allParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IN", SalaryI18nUtil.getI18nLabel(94943, "变量是否包含在一组结果中"), funcDescUtil.get("IN"), "IN(变量, [变量1, 变量2, …])", paramArray, allParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISEMPTY",SalaryI18nUtil.getI18nLabel(94945,"是否为空"), funcDescUtil.get("ISEMPTY"),"ISEMPTY(变量)",paramArray,paramDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LIKE", SalaryI18nUtil.getI18nLabel(94944, "文本是否包含任意一个关键字"), funcDescUtil.get("LIKE"), "LIKE(文本, [文本1, 文本2, …])", paramArray, allParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRUE",SalaryI18nUtil.getI18nLabel(94946,"返回真"), funcDescUtil.get("TRUE"),"TRUE()",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISEMPTY", SalaryI18nUtil.getI18nLabel(94945, "是否为空"), funcDescUtil.get("ISEMPTY"), "ISEMPTY(变量)", paramArray, paramDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("FALSE",SalaryI18nUtil.getI18nLabel(94947,"返回假"), funcDescUtil.get("FALSE"),"FALSE()",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRUE", SalaryI18nUtil.getI18nLabel(94946, "返回真"), funcDescUtil.get("TRUE"), "TRUE()", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IFS",SalaryI18nUtil.getI18nLabel(94948,"多条件"), funcDescUtil.get("IFS"),"IFS({条件1},{结果1},{条件2},{结果2}...{默认结果})",paramArray,nullParamDatas,"Object",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("FALSE", SalaryI18nUtil.getI18nLabel(94947, "返回假"), funcDescUtil.get("FALSE"), "FALSE()", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("FIND",SalaryI18nUtil.getI18nLabel(31835,"查找"), funcDescUtil.get("FIND"),"FIND([{查找值1},{查找值2}...{查找值N}],[{查找目标1},{查找目标2}...{查找目标N}])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); - return logicList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IFS", SalaryI18nUtil.getI18nLabel(94948, "多条件"), funcDescUtil.get("IFS"), "IFS({条件1},{结果1},{条件2},{结果2}...{默认结果})", paramArray, nullParamDatas, "Object", CURRENTDATA); + logicList.add(excelFunc); - /** - * 字符函数的列表 - * @return - */ - public List getStringList(){ - //字符函数 - List stringList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("CONCAT",SalaryI18nUtil.getI18nLabel(94949,"链接多个文本"), funcDescUtil.get("CONCAT"),"CONCAT(文本1, 文本2, [文本3, …])",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("FIND", SalaryI18nUtil.getI18nLabel(31835, "查找"), funcDescUtil.get("FIND"), "FIND([{查找值1},{查找值2}...{查找值N}],[{查找目标1},{查找目标2}...{查找目标N}])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); + return logicList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TEXT",SalaryI18nUtil.getI18nLabel(94950,"将变量转为文本"), funcDescUtil.get("TEXT"),"TEXT(变量)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + /** + * 字符函数的列表 + * + * @return + */ + public List getStringList() { + //字符函数 + List stringList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("CONCAT", SalaryI18nUtil.getI18nLabel(94949, "链接多个文本"), funcDescUtil.get("CONCAT"), "CONCAT(文本1, 文本2, [文本3, …])", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("VALUE",SalaryI18nUtil.getI18nLabel(94951,"将文本转为数字"), funcDescUtil.get("VALUE"),"VALUE(文本)",paramArray,nullParamDatas,"Number",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TEXT", SalaryI18nUtil.getI18nLabel(94950, "将变量转为文本"), funcDescUtil.get("TEXT"), "TEXT(变量)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LEN",SalaryI18nUtil.getI18nLabel(94952,"返回文本长度"), funcDescUtil.get("LEN"),"LEN(文本)",paramArray,nullParamDatas,"Number",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("VALUE", SalaryI18nUtil.getI18nLabel(94951, "将文本转为数字"), funcDescUtil.get("VALUE"), "VALUE(文本)", paramArray, nullParamDatas, "Number", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SEARCH",SalaryI18nUtil.getI18nLabel(94953,"在文本中查找关键字"), funcDescUtil.get("SEARCH"),"SEARCH(关键字, 文本, [搜索开始位置])",paramArray,nullParamDatas,"Number",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LEN", SalaryI18nUtil.getI18nLabel(94952, "返回文本长度"), funcDescUtil.get("LEN"), "LEN(文本)", paramArray, nullParamDatas, "Number", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("REPLACE",SalaryI18nUtil.getI18nLabel(94954,"替换文本中的字"), funcDescUtil.get("REPLACE"),"REPLACE(原文本, 替换开始位置, 替换字符数, 新文本)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SEARCH", SalaryI18nUtil.getI18nLabel(94953, "在文本中查找关键字"), funcDescUtil.get("SEARCH"), "SEARCH(关键字, 文本, [搜索开始位置])", paramArray, nullParamDatas, "Number", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("REPT",SalaryI18nUtil.getI18nLabel(94955,"将文本重复指定次数"), funcDescUtil.get("REPT"),"REPT(文本, 重复次数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("REPLACE", SalaryI18nUtil.getI18nLabel(94954, "替换文本中的字"), funcDescUtil.get("REPLACE"), "REPLACE(原文本, 替换开始位置, 替换字符数, 新文本)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("PAD",SalaryI18nUtil.getI18nLabel(94956,"将文本填充至指定长度"), funcDescUtil.get("PAD"),"PAD(原文本, 长度, 填充用的文本, ['填充位置'])",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("REPT", SalaryI18nUtil.getI18nLabel(94955, "将文本重复指定次数"), funcDescUtil.get("REPT"), "REPT(文本, 重复次数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRIM",SalaryI18nUtil.getI18nLabel(94957,"清除前后空格"), funcDescUtil.get("TRIM"),"TRIM(文本)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("PAD", SalaryI18nUtil.getI18nLabel(94956, "将文本填充至指定长度"), funcDescUtil.get("PAD"), "PAD(原文本, 长度, 填充用的文本, ['填充位置'])", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LEFT",SalaryI18nUtil.getI18nLabel(94958,"返回文本左侧开始的文字"), funcDescUtil.get("LEFT"),"LEFT(文本, 截取字符数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRIM", SalaryI18nUtil.getI18nLabel(94957, "清除前后空格"), funcDescUtil.get("TRIM"), "TRIM(文本)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("RIGHT",SalaryI18nUtil.getI18nLabel(94959,"返回文本右侧开始的文字"), funcDescUtil.get("RIGHT"),"RIGHT(文本, 截取字符数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LEFT", SalaryI18nUtil.getI18nLabel(94958, "返回文本左侧开始的文字"), funcDescUtil.get("LEFT"), "LEFT(文本, 截取字符数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MID",SalaryI18nUtil.getI18nLabel(94960,"返回文本指定位置开始的文字"), funcDescUtil.get("MID"),"MID(文本, 指定位置, 截取字符数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("RIGHT", SalaryI18nUtil.getI18nLabel(94959, "返回文本右侧开始的文字"), funcDescUtil.get("RIGHT"), "RIGHT(文本, 截取字符数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SCORE",SalaryI18nUtil.getI18nLabel(94961,"获取选项型控件分数"), funcDescUtil.get("SCORE"),"SCORE({选项型控件})",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MID", SalaryI18nUtil.getI18nLabel(94960, "返回文本指定位置开始的文字"), funcDescUtil.get("MID"), "MID(文本, 指定位置, 截取字符数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IDCARD",SalaryI18nUtil.getI18nLabel(94962,"身份证函数"), funcDescUtil.get("IDCARD"),"IDCARD({身份证号码}, {查找类型})",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SCORE", SalaryI18nUtil.getI18nLabel(94961, "获取选项型控件分数"), funcDescUtil.get("SCORE"), "SCORE({选项型控件})", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); + + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IDCARD", SalaryI18nUtil.getI18nLabel(94962, "身份证函数"), funcDescUtil.get("IDCARD"), "IDCARD({身份证号码}, {查找类型})", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISSTRING",SalaryI18nUtil.getI18nLabel(0,"是否是字符串"), funcDescUtil.get("ISSTRING"),"ISSTRING({任意控件})",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISSTRING", SalaryI18nUtil.getI18nLabel(0, "是否是字符串"), funcDescUtil.get("ISSTRING"), "ISSTRING({任意控件})", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); // paramArray=new String[]{}; // excelFunc=new ExcelFunc("SUBSTRING",SalaryI18nUtil.getI18nLabel(97524,"字符截取函数"), funcDescUtil.get("SUBSTRING"),"SUBSTRING({源字符}, {截取开始位置},{截取结束位置})",paramArray,nullParamDatas,"String",CURRENTDATA); @@ -296,123 +297,129 @@ public class ExcelFuncs { // paramArray=new String[]{}; // excelFunc=new ExcelFunc("EXACT",SalaryI18nUtil.getI18nLabel(97528,"字符比较函数"), funcDescUtil.get("EXACT"),"EXACT({字符1}, {字符2})",paramArray,nullParamDatas,"String",CURRENTDATA); // stringList.add(excelFunc); - return stringList; - } + return stringList; + } - /** - * 数学函数的列表 - * @return - */ - public List getMathList(){ - List mathList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUNDUP",SalaryI18nUtil.getI18nLabel(94963,"向上舍入"), funcDescUtil.get("ROUNDUP"),"ROUNDUP(数值, [小数位精确度])",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + /** + * 数学函数的列表 + * + * @return + */ + public List getMathList() { + List mathList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUNDUP", SalaryI18nUtil.getI18nLabel(94963, "向上舍入"), funcDescUtil.get("ROUNDUP"), "ROUNDUP(数值, [小数位精确度])", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUND",SalaryI18nUtil.getI18nLabel(17392,"四舍五入"), funcDescUtil.get("ROUND"),"ROUND(数值, [小数位精确度])",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUND", SalaryI18nUtil.getI18nLabel(17392, "四舍五入"), funcDescUtil.get("ROUND"), "ROUND(数值, [小数位精确度])", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUNDDOWN",SalaryI18nUtil.getI18nLabel(94964,"向下舍入"), funcDescUtil.get("ROUNDDOWN"),"ROUNDDOWN(数值, [小数位精确度])",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUNDDOWN", SalaryI18nUtil.getI18nLabel(94964, "向下舍入"), funcDescUtil.get("ROUNDDOWN"), "ROUNDDOWN(数值, [小数位精确度])", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("AGGREGATION",SalaryI18nUtil.getI18nLabel(94965,"聚合运算"), funcDescUtil.get("AGGREGATION"),"AGGREGATION({数字}...,{聚合运算类型})",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("AGGREGATION", SalaryI18nUtil.getI18nLabel(94965, "聚合运算"), funcDescUtil.get("AGGREGATION"), "AGGREGATION({数字}...,{聚合运算类型})", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MOD",SalaryI18nUtil.getI18nLabel(94966,"求余"), funcDescUtil.get("MOD"),"ROUNDDOWN({数字},{数字})",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MOD", SalaryI18nUtil.getI18nLabel(94966, "求余"), funcDescUtil.get("MOD"), "ROUNDDOWN({数字},{数字})", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRUNC",SalaryI18nUtil.getI18nLabel(94967,"数字格式化"), funcDescUtil.get("TRUNC"),"ROUNDDOWN({数字},{精度})",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRUNC", SalaryI18nUtil.getI18nLabel(94967, "数字格式化"), funcDescUtil.get("TRUNC"), "ROUNDDOWN({数字},{精度})", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISINT",SalaryI18nUtil.getI18nLabel(0,"字符内容是否是整数"), funcDescUtil.get("ISINT"),"ISINT({字符})",paramArray,nullParamDatas,"String",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISINT", SalaryI18nUtil.getI18nLabel(0, "字符内容是否是整数"), funcDescUtil.get("ISINT"), "ISINT({字符})", paramArray, nullParamDatas, "String", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISNUMBER",SalaryI18nUtil.getI18nLabel(0,"字符内容是否是数字"), funcDescUtil.get("ISNUMBER"),"ISNUMBER({字符})",paramArray,nullParamDatas,"String",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISNUMBER", SalaryI18nUtil.getI18nLabel(0, "字符内容是否是数字"), funcDescUtil.get("ISNUMBER"), "ISNUMBER({字符})", paramArray, nullParamDatas, "String", CURRENTDATA); + mathList.add(excelFunc); - return mathList; + return mathList; - } + } - /** - * 查找函数的列表 - * @return - */ - public List getFindList(){ - List findList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("CHOOSE",SalaryI18nUtil.getI18nLabel(94968,"返回索引范围内指定的值"), funcDescUtil.get("CHOOSE"),"CHOOSE(数据源,[条件])",paramArray,nullParamDatas,"Array",CURRENTDATA); - findList.add(excelFunc); + /** + * 查找函数的列表 + * + * @return + */ + public List getFindList() { + List findList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("CHOOSE", SalaryI18nUtil.getI18nLabel(94968, "返回索引范围内指定的值"), funcDescUtil.get("CHOOSE"), "CHOOSE(数据源,[条件])", paramArray, nullParamDatas, "Array", CURRENTDATA); + findList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("VLOOKUPS",SalaryI18nUtil.getI18nLabel(94969,"按列查找,返回所需值"), funcDescUtil.get("VLOOKUPS"),"VLOOKUPS(表,[条件],[返回参数])",paramArray,nullParamDatas,"Array",CURRENTDATA); - findList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("VLOOKUPS", SalaryI18nUtil.getI18nLabel(94969, "按列查找,返回所需值"), funcDescUtil.get("VLOOKUPS"), "VLOOKUPS(表,[条件],[返回参数])", paramArray, nullParamDatas, "Array", CURRENTDATA); + findList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MATCH",SalaryI18nUtil.getI18nLabel(94970,"返回指定数值在指定数组区域中的位置"), funcDescUtil.get("MATCH"),"MATCH(值,[数组])",paramArray,nullParamDatas,"Number",CURRENTDATA); - findList.add(excelFunc); - return findList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MATCH", SalaryI18nUtil.getI18nLabel(94970, "返回指定数值在指定数组区域中的位置"), funcDescUtil.get("MATCH"), "MATCH(值,[数组])", paramArray, nullParamDatas, "Number", CURRENTDATA); + findList.add(excelFunc); + return findList; + } - /** - * 聚合函数 COUNT(表格, [统计条件]) - * @return - */ - public List getAggList(){ - List aggList=new LinkedList<>(); - ExcelFunc excelFunc=null; + /** + * 聚合函数 COUNT(表格, [统计条件]) + * + * @return + */ + public List getAggList() { + List aggList = new LinkedList<>(); + ExcelFunc excelFunc = null; - String [] paramArray=new String[]{"Form","Number","Boolean"}; - excelFunc=new ExcelFunc("COUNT", SalaryI18nUtil.getI18nLabel(16654,"计数"), funcDescUtil.get("COUNT"),"COUNT(表格)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + String[] paramArray = new String[]{"Form", "Number", "Boolean"}; + excelFunc = new ExcelFunc("COUNT", SalaryI18nUtil.getI18nLabel(16654, "计数"), funcDescUtil.get("COUNT"), "COUNT(表格)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("SUM",SalaryI18nUtil.getI18nLabel(95012,"求和") , funcDescUtil.get("SUM"),"SUM(数字字段)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("SUM", SalaryI18nUtil.getI18nLabel(95012, "求和"), funcDescUtil.get("SUM"), "SUM(数字字段)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("AVG",SalaryI18nUtil.getI18nLabel(19550,"平均值"), funcDescUtil.get("AVG"),"AVG(数字字段)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("AVG", SalaryI18nUtil.getI18nLabel(19550, "平均值"), funcDescUtil.get("AVG"), "AVG(数字字段)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("MIN",SalaryI18nUtil.getI18nLabel(12318,"最小值"), funcDescUtil.get("MIN"),"MIN(表格)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("MIN", SalaryI18nUtil.getI18nLabel(12318, "最小值"), funcDescUtil.get("MIN"), "MIN(表格)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("MAX",SalaryI18nUtil.getI18nLabel(66750,"最大值"), funcDescUtil.get("MAX"),"MAX(表格)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); - return aggList; - } + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("MAX", SalaryI18nUtil.getI18nLabel(66750, "最大值"), funcDescUtil.get("MAX"), "MAX(表格)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); + return aggList; + } - /** - * 财务类函数列表 - * @return - */ - public Object getFinanceList(){ - ExcelFunc excelFunc = null; - List funcs = Lists.newArrayList(); - excelFunc = new ExcelFunc("GETMONEY",SalaryI18nUtil.getI18nLabel(0,"获取锁给定数字的金额大写"), funcDescUtil.get("GETMONEY"),"GETMONEY({数字})",null,nullParamDatas,"",CURRENTDATA); - funcs.add(excelFunc); + /** + * 财务类函数列表 + * + * @return + */ + public Object getFinanceList() { + ExcelFunc excelFunc = null; + List funcs = Lists.newArrayList(); + excelFunc = new ExcelFunc("GETMONEY", SalaryI18nUtil.getI18nLabel(0, "获取锁给定数字的金额大写"), funcDescUtil.get("GETMONEY"), "GETMONEY({数字})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - return funcs; - } - /** - * 数据库函数列表 - * @return - */ - public Object getDataBaseList() { - ExcelFunc excelFunc = null; - List funcs = Lists.newArrayList(); + return funcs; + } + + /** + * 数据库函数列表 + * + * @return + */ + public Object getDataBaseList() { + ExcelFunc excelFunc = null; + List funcs = Lists.newArrayList(); // excelFunc = new ExcelFunc("GETHRMLOGINID",SalaryI18nUtil.getI18nLabel(100807,"返回指定人员系统账号"), funcDescUtil.get("GETHRMLOGINID"),"GETHRMLOGINID({表单.人员})",null,nullParamDatas,"",CURRENTDATA); // funcs.add(excelFunc); @@ -456,12 +463,12 @@ public class ExcelFuncs { // excelFunc = new ExcelFunc("GETALLSUPERSUBCOMPANY",SalaryI18nUtil.getI18nLabel(100833,"返回指定分部所有上级分部"), funcDescUtil.get("GETALLSUPERSUBCOMPANY"),"GETALLSUPERSUBCOMPANY({表单.分部})",null,nullParamDatas,"",CURRENTDATA); // funcs.add(excelFunc); - excelFunc = new ExcelFunc("GETHRMNAME",SalaryI18nUtil.getI18nLabel(100833,"获取人员名称"), funcDescUtil.get("GETHRMNAME"),"GETHRMNAME({人员})",null,nullParamDatas,"",CURRENTDATA); - funcs.add(excelFunc); + excelFunc = new ExcelFunc("GETHRMNAME", SalaryI18nUtil.getI18nLabel(100833, "获取人员名称"), funcDescUtil.get("GETHRMNAME"), "GETHRMNAME({人员})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - excelFunc = new ExcelFunc("GETHRMMOBILE",SalaryI18nUtil.getI18nLabel(100833,"获取人员手机号码"), funcDescUtil.get("GETHRMMOBILE"),"GETHRMMOBILE({人员})",null,nullParamDatas,"",CURRENTDATA); - funcs.add(excelFunc); + excelFunc = new ExcelFunc("GETHRMMOBILE", SalaryI18nUtil.getI18nLabel(100833, "获取人员手机号码"), funcDescUtil.get("GETHRMMOBILE"), "GETHRMMOBILE({人员})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - return funcs; - } + return funcs; + } } diff --git a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java index d4e5fcee3..666135c26 100644 --- a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java +++ b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.Map; -@Component + public class FuncDescUtil { protected final Logger logger = LoggerFactory.getLogger(FuncDescUtil.class); Map funcMap = new HashMap(); diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java new file mode 100644 index 000000000..c6cf9f5f0 --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java @@ -0,0 +1,72 @@ +package com.engine.salary.mapper.taxagent; + +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; + +import java.util.List; + +/** + * 个税扣缴义务人报税信息 + * + * @author chengliming + * @date: 2022-08-31 11:20:32 + */ +public interface TaxAgentTaxReturnMapper { + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxAgentTaxReturnPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param TaxAgentTaxReturnPO 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 修改,修改所有字段 + * + * @param TaxAgentTaxReturnPO 修改的记录 + * @return 返回影响行数 + */ + int update(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 修改,忽略null字段 + * + * @param TaxAgentTaxReturnPO 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 删除记录 + * + * @param TaxAgentTaxReturnPO 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + TaxAgentTaxReturnPO selectOneByTaxAgentId(Long taxAgentId); + + void updateByTaxAgentId(TaxAgentTaxReturnPO po); +} diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml new file mode 100644 index 000000000..6468afdac --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -0,0 +1,422 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + area_code + , t.check_status + , t.city + , t.create_time + , t.creator + , t.delete_type + , t.department_code + , t.department_name + , t.fail_reason + , t.id + , t.nation + , t.password_type + , t.province + , t.pwd + , t.real_account + , t.tax_agent_id + , t.tax_code + , t.tax_registration_number + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_agent_tax_return + + + + area_code, + + + check_status, + + + city, + + + create_time, + + + creator, + + + delete_type, + + + department_code, + + + department_name, + + + fail_reason, + + + id, + + + nation, + + + password_type, + + + province, + + + pwd, + + + real_account, + + + tax_agent_id, + + + tax_code, + + + tax_registration_number, + + + tenant_key, + + + update_time, + + + + + #{areaCode}, + + + #{checkStatus}, + + + #{city}, + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{departmentCode}, + + + #{departmentName}, + + + #{failReason}, + + + #{id}, + + + #{nation}, + + + #{passwordType}, + + + #{province}, + + + #{pwd}, + + + #{realAccount}, + + + #{taxAgentId}, + + + #{taxCode}, + + + #{taxRegistrationNumber}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_tax_agent_tax_return + + area_code=#{areaCode}, + check_status=#{checkStatus}, + city=#{city}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + department_code=#{departmentCode}, + department_name=#{departmentName}, + fail_reason=#{failReason}, + nation=#{nation}, + password_type=#{passwordType}, + province=#{province}, + pwd=#{pwd}, + real_account=#{realAccount}, + tax_agent_id=#{taxAgentId}, + tax_code=#{taxCode}, + tax_registration_number=#{taxRegistrationNumber}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + + + area_code=#{areaCode}, + + + check_status=#{checkStatus}, + + + city=#{city}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + department_code=#{departmentCode}, + + + department_name=#{departmentName}, + + + fail_reason=#{failReason}, + + + nation=#{nation}, + + + password_type=#{passwordType}, + + + province=#{province}, + + + pwd=#{pwd}, + + + real_account=#{realAccount}, + + + tax_agent_id=#{taxAgentId}, + + + tax_code=#{taxCode}, + + + tax_registration_number=#{taxRegistrationNumber}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + + area_code=#{areaCode}, + check_status=#{checkStatus}, + city=#{city}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + department_code=#{departmentCode}, + department_name=#{departmentName}, + fail_reason=#{failReason}, + nation=#{nation}, + password_type=#{passwordType}, + province=#{province}, + pwd=#{pwd}, + real_account=#{realAccount}, + tax_code=#{taxCode}, + tax_registration_number=#{taxRegistrationNumber}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE tax_agent_id=#{taxAgentId} AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java new file mode 100644 index 000000000..5161e3ad9 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java @@ -0,0 +1,21 @@ +package com.engine.salary.mapper.taxapiflow; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; + +/** + * 个税申报-接口流量使用记录 + * + * @author chengliming + * @date 2022-08-31 11:20:32 + */ +public interface TaxDeclarationApiFlowRecordMapper { + /** + * 批量插入 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); +} diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml new file mode 100644 index 000000000..146c5b5e5 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml @@ -0,0 +1,92 @@ + + + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + (#{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + + + select + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + from dual + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java new file mode 100644 index 000000000..8d3d174c8 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java @@ -0,0 +1,23 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; + +/** + * 个税申报-接口流量使用记录 + * + * @author chengliming + * @date 2022-08-31 11:20:32 + */ +@Mapper +public interface TaxDeclarationApiFlowRecordMapper { + /** + * 批量插入 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml new file mode 100644 index 000000000..3db4b36b3 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml @@ -0,0 +1,92 @@ + + + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + (#{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + + + select + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + from dual + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java new file mode 100644 index 000000000..93cde6c3b --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java @@ -0,0 +1,13 @@ +package com.engine.salary.mapper.taxdeclaration; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 流量不足提醒配置 + * + * @author chengliming + * @date 2022-11-21 16:39:10 + */ +@Mapper +public interface TaxDeclarationApiFlowWarnConfigMapper { +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java new file mode 100644 index 000000000..893cd22db --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java @@ -0,0 +1,67 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiProfilePO; + +import java.util.List; + +public interface TaxDeclarationApiProfileMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationApiProfilePO getById(Long id); + + /** + * 新增,插入所有字段 + * + * @param taxDeclareApiProfile 新增的记录 + * @return 返回影响行数 + */ + int insert(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareApiProfile 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareApiProfile 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 修改,忽略null字段 + * + * @param taxDeclareApiProfile 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 删除记录 + * + * @param taxDeclareApiProfile 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + TaxDeclarationApiProfilePO getOne(); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml new file mode 100644 index 000000000..0dffb4ff8 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.api_profile + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_api_profile + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + api_profile, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{apiProfile}, + + + + + + + UPDATE hrsa_tax_declare_api_profile + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + api_profile=#{apiProfile}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_profile + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + api_profile=#{apiProfile}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_profile + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_api_profile + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java new file mode 100644 index 000000000..0848295ab --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java @@ -0,0 +1,75 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareApiConfigMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationApiConfigPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareApiConfig 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareApiConfig 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 修改,忽略null字段 + * + * @param taxDeclareApiConfig 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 删除记录 + * + * @param taxDeclareApiConfig 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + TaxDeclarationApiConfigPO getOne(); + +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml new file mode 100644 index 000000000..b6b64d359 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.host + , t.app_key + , t.app_secret + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_api_config + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + host, + + + app_key, + + + app_secret, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{host}, + + + #{appKey}, + + + #{appSecret}, + + + + + + + UPDATE hrsa_tax_declare_api_config + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + host=#{host}, + app_key=#{appKey}, + app_secret=#{appSecret}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_config + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + host=#{host}, + + + app_key=#{appKey}, + + + app_secret=#{appSecret}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_config + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_api_config + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java new file mode 100644 index 000000000..c15930dd4 --- /dev/null +++ b/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java @@ -0,0 +1,48 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; + +import java.util.List; + +/** + * 报税信息验证service接口 + * + * @author chengliming + * @date 2022-09-02 9:26 AM + **/ +public interface TaxAgentTaxReturnCheckService { + /** + * 获取验证类型 + * + * @return + */ + int getCheckType(); + + /** + * 验证报税信息 + * + * @param saveParam + * @return + */ + TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + /** + * 检查税友返回的数据 + * + * + * @param apiConfig + * @param saveParam + * @param po + * @param registerInfoResponse + * @return + */ + List verifyCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, + TaxAgentTaxReturnSaveParam saveParam, + TaxAgentTaxReturnPO po, + CompanyRegisterInfoResponse registerInfoResponse); +} diff --git a/src/com/engine/salary/service/TaxAgentTaxReturnService.java b/src/com/engine/salary/service/TaxAgentTaxReturnService.java new file mode 100644 index 000000000..6009b455a --- /dev/null +++ b/src/com/engine/salary/service/TaxAgentTaxReturnService.java @@ -0,0 +1,56 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; + +import java.util.Collection; +import java.util.List; + +/** + * 个税扣缴义务人-报税信息service接口 + * + * @author chengliming + * @date 2022-09-02 9:26 AM + **/ +public interface TaxAgentTaxReturnService { + /** + * 根据个税扣缴义务人id获取报税信息 + * + * @param taxAgentId + * @return + */ + TaxAgentTaxReturnPO getByTaxAgentId(Long taxAgentId); + + /** + * 保存报税信息 + * + * @param saveParam + * @return + */ + TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + /** + * 根据id列表获取 + * + * @param taxAgentIds + * @return + */ + List getByTaxAgentIds(Collection taxAgentIds); + + /** + * 根据税号获取纳税主体 + * + * @param taxCode + * @return + */ + List getByTaxCode(String taxCode); + + /** + * 根据多个税号获取 + * + * @param taxCodes + * @return + */ + List getByTaxCodes(Collection taxCodes); +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java new file mode 100644 index 000000000..dec7a27be --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -0,0 +1,50 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.page.PageInfo; + +import java.util.List; +import java.util.Map; + +/** + * 个税申报计费service + * + * @author chengliming + * @date 2022-11-11 14:54:14 + */ +public interface TaxDeclarationApiBillingService { + + /** + * 更新当前租户的流量使用情况 + * + * @param updateWrapper + */ + void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); + + /** + * 获取流量使用记录(分页) + * + * @param queryParam + * @return + */ + PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + + /** + * 获取流量使用记录(不分页) + * + * @param queryParam + * @return + */ + List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + + /** + * 导出流量使用记录 + * + * @param queryParam + * @param map + */ + void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map); + +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java new file mode 100644 index 000000000..69de5ffd3 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java @@ -0,0 +1,44 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; + +/** + * 个税申报api配置service + * + * @author chengliming + * @date 2022-11-09 10:09:22 + */ +public interface TaxDeclarationApiConfigService { + + /** + * 根据服务厂商获取配置 + * + * @param needExist 是否要检验存在 + * @return + */ + TaxDeclarationApiConfigPO getConfig( boolean needExist); + + /** + * 保存 + * + * @param config + */ + void insert(TaxDeclarationApiConfigPO config); + + /** + * 更新 + * + * @param config + */ + void update(TaxDeclarationApiConfigPO config); + + /** + * 修改开关状态 + * + * @param saveParam + */ + void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam); + + void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam); +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java new file mode 100644 index 000000000..47335fa71 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -0,0 +1,99 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; + +import java.util.List; + +/** + * 流量不足提醒 + * + * @author chengliming + * @date 2022-11-11 14:54:14 + */ +public interface TaxDeclarationApiFlowWarnService { + + /** + * 获取流量不足提醒设置 + * + * @param currentTenantKey + * @return + */ + TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey); + + /** + * 获取流量不足提醒对象列表 + * + * @param warnConfigId + * @param currentTenantKey + * @return + */ + List getWarnReceiverList(Long warnConfigId, String currentTenantKey); + + /** + * 删除流量不足提醒对象 + * + * @param id + * @param currentTenantKey + */ + void deleteReceiver(Long id, String currentTenantKey); + + /** + * 获取提醒对象 + * + * @param id + * @param currentEmployeeId + * @param currentTenantKey + * @return + */ + TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id, Long currentEmployeeId, String currentTenantKey); + + /** + * 保存或编辑提醒对象 + * + * @param param + * @param currentEmployeeId + * @param currentTenantKey + */ + void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param, Long currentEmployeeId, String currentTenantKey); + + /** + * 创建提醒规则 + * + * @param param + * @param currentEmployeeId + * @param currentTenantKey + */ + void createMessageRule(CreateMessageRuleParam param, Long currentEmployeeId, String currentTenantKey); + + /** + * 保存流量不足提醒配置 + * + * @param param + * @param currentEmployeeId + * @param currentTenantKey + * @return + */ + String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param, Long currentEmployeeId, String currentTenantKey); + + /** + * 获取推送规则的业务ID + * + * @param currentTenantKey + * @return + */ + Long getRuleBusinessId(String currentTenantKey); + + /** + * 发送提醒 + * + * @param updateWrapper + */ + void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); + +} diff --git a/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java new file mode 100644 index 000000000..f1ca117ab --- /dev/null +++ b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java @@ -0,0 +1,50 @@ +//package com.engine.salary.service.factory; +// +//import com.weaver.hrm.salary.entity.salaryacct.bo.SalaryCalcItem; +//import com.weaver.hrm.salary.exception.SalaryRunTimeException; +//import com.weaver.hrm.salary.service.SalaryCalcRunService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.Map; +//import java.util.Objects; +//import java.util.concurrent.ConcurrentHashMap; +// +///** +// * @description: SalaryCalcRunService的策略选择工厂 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2023/5/19 16:17 +// * @version:v1.0 +// */ +// +//public class SalaryCalcRunServiceFactory { +// +// private final Map serviceMap = new ConcurrentHashMap<>(); +// +// @Autowired +// public SalaryCalcRunServiceFactory(Map map) { +// for (Map.Entry entry : map.entrySet()) { +// serviceMap.put(entry.getValue().getCalcType(), entry.getValue()); +// } +// } +// +// public SalaryCalcRunService get(SalaryCalcItem salaryCalcItem) { +// String calcType = ""; +// if (Objects.equals(salaryCalcItem.getUseInEmployeeSalary(), 1) +// && salaryCalcItem.getExpressFormula() == null) { +// calcType = "SPECIAL"; +// } else if (salaryCalcItem.getExpressFormula() != null && salaryCalcItem.getExpression() != null) { +// calcType = "EXPRESSION"; +// } else if (salaryCalcItem.getExpressFormula() != null) { +// calcType = "EXPRESS_FORMULA"; +// } else { +// calcType = "INPUT"; +// } +// SalaryCalcRunService salaryCalcRunService = serviceMap.get(calcType); +// if (salaryCalcRunService == null) { +// throw new SalaryRunTimeException("SalaryCalcRunService can not be null"); +// } +// return salaryCalcRunService; +// } +//} diff --git a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java new file mode 100644 index 000000000..769c58ba2 --- /dev/null +++ b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java @@ -0,0 +1,47 @@ +package com.engine.salary.service.factory; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.service.TaxAgentTaxReturnCheckService; +import com.engine.salary.service.impl.AbstractTaxAgentTaxReturnCheckService; +import com.engine.salary.service.impl.TaxReturnCheckDepartmentServiceImpl; +import com.engine.salary.service.impl.TaxReturnCheckMainServiceImpl; +import com.engine.salary.service.impl.TaxReturnCheckRegistrationServiceImpl; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author chengliming + * @date 2022-09-09 2:09 PM + **/ + +public class TaxAgentTaxReturnCheckServiceFactory extends Service { + private final Map serviceMap = new ConcurrentHashMap<>(); + + public TaxAgentTaxReturnCheckServiceFactory(Map map) { + for (Map.Entry entry : map.entrySet()) { + serviceMap.putIfAbsent(entry.getValue().getCheckType(), entry.getValue()); + } + } + + public TaxAgentTaxReturnCheckService get(Integer type) { +// TaxAgentTaxReturnCheckService service = serviceMap.get(type); +// if (service == null) { +// throw new SalaryRunTimeException("TaxAgentTaxReturnCheckService is null"); +// } +// return service; + + //验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码 + AbstractTaxAgentTaxReturnCheckService service = null; + if (type == 1) { + service = ServiceUtil.getService(TaxReturnCheckMainServiceImpl.class, user); + } else if (type == 2) { + service = ServiceUtil.getService(TaxReturnCheckRegistrationServiceImpl.class, user); + } else { + service = ServiceUtil.getService(TaxReturnCheckDepartmentServiceImpl.class, user); + } + + return service; + } +} diff --git a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java new file mode 100644 index 000000000..dde22b970 --- /dev/null +++ b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java @@ -0,0 +1,33 @@ +//package com.engine.salary.service.factory; +// +//import com.weaver.hrm.salary.exception.SalaryRunTimeException; +//import com.weaver.hrm.salary.service.TaxPaymentService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.Map; +//import java.util.concurrent.ConcurrentHashMap; +// +///** +// * @author chengliming +// * @date 2022-12-08 19:05:16 +// **/ +// +//public class TaxPaymentServiceFactory { +// private final Map serviceMap = new ConcurrentHashMap<>(); +// +// @Autowired +// public TaxPaymentServiceFactory(Map map) { +// for (Map.Entry entry : map.entrySet()) { +// serviceMap.putIfAbsent(entry.getValue().getServiceType(), entry.getValue()); +// } +// } +// +// public TaxPaymentService get(Integer type) { +// TaxPaymentService service = serviceMap.get(type); +// if (service == null) { +// throw new SalaryRunTimeException("TaxPaymentService is null"); +// } +// return service; +// } +//} diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java new file mode 100644 index 000000000..a1cd19da2 --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -0,0 +1,203 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnCheckService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +import dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + * 税友相关公共方法 + * + * @author chengliming + * @date 2022-09-15 5:23 PM + **/ +@Slf4j +public abstract class AbstractTaxAgentTaxReturnCheckService extends Service implements TaxAgentTaxReturnCheckService { + protected TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + protected TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + protected TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + protected TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + /** + * 获取验证类型 + * + * @return + */ + @Override + public abstract int getCheckType(); + + /** + * 保存报税信息 + * + * @param saveParam + * @return + */ + @Override + public abstract TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + @Override + public List verifyCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam, TaxAgentTaxReturnPO po, CompanyRegisterInfoResponse response) { + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()); + po.setUpdateTime(new Date()); + // 如果税友返回错误信息 + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || CollectionUtils.isEmpty(response.getBody())) { + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + po.setFailReason(response.getHead().getMsg()); + return new ArrayList<>(); + } + // 如果税友返回验证信息 + List checkFormDTOList = buildCheckDTO(saveParam, response.getBody()); + if (checkFormDTOList.size() == 1) { + po.setTaxRegistrationNumber(checkFormDTOList.get(0).getTaxRegistrationNumber()); + if (SalaryOnOffEnum.OFF.equals(checkFormDTOList.get(0).getDivideFiling())) { + // 如果只有一条记录且没有分部门备案,则直接视为验证成功,继续检查密码是否正确 + CheckPasswordResponse checkPasswordResponse = getCheckPasswordResponse(apiConfig, po, saveParam); + verifyCheckPasswordResponse(po, checkPasswordResponse); + } + } + return checkFormDTOList; + } + + /** + * 企业注册接口 + * + * @param apiConfig + * @param taxAgentTaxReturnPO + * @param saveParam + * @return + */ + protected CompanyRegisterInfoResponse getCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentTaxReturnPO.getTaxAgentId()); + if (taxAgentPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + } + String url = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_URL; + Map requestParam = new HashMap<>(4); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentPO.getName()); + requestParam.put("nsrsbh", taxAgentTaxReturnPO.getTaxCode()); + requestParam.put("areaid", taxAgentTaxReturnPO.getAreaCode()); + if (StringUtils.isNotEmpty(saveParam.getTaxRegistrationNumber())) { + requestParam.put("djxhid", saveParam.getTaxRegistrationNumber()); + } + String reqJson = JsonUtil.toJsonString(requestParam); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("getCompanyRegisterInfo === res : {}", res); + return JsonUtil.parseBean(res, CompanyRegisterInfoResponse.class); + } + + private List buildCheckDTO(TaxAgentTaxReturnSaveParam saveParam, List registerInfos) { + List checkFormDTOList = new ArrayList<>(); + for (int i = 1; i <= registerInfos.size(); i++) { + CompanyRegisterInfoResponse.CompanyRegisterInfo registerInfo = registerInfos.get(i - 1); + SalaryAssert.notNull(registerInfo.getFbmba(), "税局接口异常,请稍后重试"); + TaxAgentTaxReturnCheckFormDTO checkFormDTO = TaxAgentTaxReturnCheckFormDTO.builder().taxAgentName(registerInfo.getQymc()).taxAgentId(saveParam.getTaxAgentId()).taxCode(saveParam.getTaxCode()).businessAddress(registerInfo.getScjydz()).legalPersonName(registerInfo.getFrxm()).mobile(registerInfo.getLxdh()).industryName(registerInfo.getHymc()).taxAuthorities(registerInfo.getZgswjgmc()).taxBranch(registerInfo.getZgswjgskmc()).taxRegistrationNumber(registerInfo.getDjxhid()).divideFiling(SalaryOnOffEnum.parseByValue(Integer.parseInt(registerInfo.getFbmba()))).index((long) i).build(); + checkFormDTOList.add(checkFormDTO); + } + return checkFormDTOList; + } + + /** + * 校验密码 + * + * @param apiConfig + * @param taxAgentTaxReturnPO + * @param saveParam + * @return + */ + protected CheckPasswordResponse getCheckPasswordResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentTaxReturnPO.getTaxAgentId()); + if (taxAgentPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + } + String url = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_URL; + Map requestParam = new HashMap<>(16); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentPO.getName()); + requestParam.put("mmlx", taxAgentTaxReturnPO.getPasswordType()); + requestParam.put("djxhid", taxAgentTaxReturnPO.getTaxRegistrationNumber()); + requestParam.put("nsrsbh", taxAgentTaxReturnPO.getTaxCode()); + requestParam.put("areaid", taxAgentTaxReturnPO.getAreaCode()); + if (TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxAgentTaxReturnPO.getPasswordType())) { + requestParam.put("sbmm", taxAgentTaxReturnPO.getPwd()); + requestParam.put("jmsbmm", "1"); + } else { + requestParam.put("smzh", taxAgentTaxReturnPO.getRealAccount()); + requestParam.put("smmm", taxAgentTaxReturnPO.getPwd()); + requestParam.put("jmsmmm", "1"); + } + if (StringUtils.isNotEmpty(saveParam.getDepartmentCode()) && StringUtils.isNotEmpty(saveParam.getDepartmentName())) { + requestParam.put("bmbh", saveParam.getDepartmentCode()); + requestParam.put("bmmc", saveParam.getDepartmentName()); + } + String reqJson = JsonUtil.toJsonString(requestParam); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("checkPassword === res : {}", res); + return JsonUtil.parseObject(res, CheckPasswordResponse.class); + } + + /** + * 检查校验密码接口数据 + * + * @param po + * @param response + * @return + */ + protected void verifyCheckPasswordResponse(TaxAgentTaxReturnPO po, CheckPasswordResponse response) { + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + po.setUpdateTime(new Date()); + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || !response.isBody()) { + // 如果返回错误 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + po.setFailReason(response.getHead().getMsg()); + } else { + // 如果返回成功 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()); + } + } +} diff --git a/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java new file mode 100644 index 000000000..6efad07ac --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java @@ -0,0 +1,53 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.factory.TaxAgentTaxReturnCheckServiceFactory; +import com.engine.salary.util.db.MapperProxyFactory; +import weaver.hrm.User; + +import java.util.Collection; +import java.util.List; + +/** + * @author chengliming + * @date 2022-09-02 9:27 AM + **/ +public class TaxAgentTaxReturnServiceImpl extends Service implements TaxAgentTaxReturnService { + private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + private TaxAgentTaxReturnCheckServiceFactory getTaxAgentTaxReturnCheckServiceFactory(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnCheckServiceFactory.class, user); + } + @Override + public TaxAgentTaxReturnPO getByTaxAgentId(Long taxAgentId) { + return getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + return getTaxAgentTaxReturnCheckServiceFactory(user).get(saveParam.getType()).verify(saveParam); + } + + @Override + public List getByTaxAgentIds(Collection taxAgentIds) { + return getTaxAgentTaxReturnMapper().listSome(TaxAgentTaxReturnPO.builder().taxAgentIds(taxAgentIds).build()); + } + + @Override + public List getByTaxCode(String taxCode) { + return null; + } + + @Override + public List getByTaxCodes(Collection taxCodes) { + return getTaxAgentTaxReturnMapper().listSome(TaxAgentTaxReturnPO.builder().taxCodes(taxCodes).build()); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java new file mode 100644 index 000000000..c7a0c9098 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -0,0 +1,225 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationApiBillingService; +import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.google.common.collect.Lists; +import com.weaver.common.batch.context.BatchExportContext; +import com.weaver.common.batch.entity.BatchCallbackMessage; +import com.weaver.common.batch.handler.BatchExportHandler; +import com.weaver.common.cache.tablecache.impl.ComInfoCache; +import com.weaver.common.component.table.page.Page; +import com.weaver.common.hrm.cache.HrmEmployeeComInfo; +import com.weaver.hrm.salary.common.SalaryPage; +import com.weaver.hrm.salary.common.excel.ExportWrapper; +import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO; +import com.weaver.hrm.salary.entity.taxapiflow.dto.*; +import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +import com.weaver.hrm.salary.service.*; +import com.weaver.hrm.salary.util.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.time.LocalDate; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * @author chengliming + * @date 2022-11-11 2:57 PM + **/ +@Slf4j +public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBillingService { + + private TaxDeclarationApiFlowRecordMapper taxDeclarationApiFlowRecordMapper; + + private TaxAgentService taxAgentService; + + private SalaryEmployeeService salaryEmployeeService; + +// private SalaryBatchService salaryBatchService; + + private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService; + +// private ComInfoCache comInfoCache; + +// private ExtEmployeeService extEmployeeService; + + @Override + public void updateApiFlowInfo(ApiFlowUpdateWrapper updateWrapper) { + // 保存流量使用详情 + saveApiFlowRecord(updateWrapper); + // 流量不足提醒 + taxDeclarationApiFlowWarnService.sendFlowWarnMessage(updateWrapper); + } + + private void saveApiFlowRecord(ApiFlowUpdateWrapper updateWrapper) { + if (!updateWrapper.getApiFlowDetailPOList().isEmpty()) { + List> failPartition = Lists.partition(updateWrapper.getApiFlowDetailPOList(), 1000); + failPartition.forEach(list -> taxDeclarationApiFlowRecordMapper.batchInsert(list)); + } + } + + @Override + public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + Page flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); + List records = flowRecordPOPage.getRecords(); + if (records.isEmpty()) { + return new PageInfo<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); + // 转换数据 + AtomicInteger indexNum = new AtomicInteger(1); + List listDTOS = records.stream().map(e -> + TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) + ).collect(Collectors.toList()); + return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS); + } + + @Override + public List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + List list = queryChainWrapper.list(); + if (list.isEmpty()) { + return new ArrayList<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); + // 转换数据 + AtomicInteger indexNum = new AtomicInteger(1); + return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); + } + + private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list, String currentTenantKey) { + Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); + // 获取人员信息 + List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); + Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); + Map empIdNoMap = salaryEmployeeService.mapByEmployeeIds(employeeTaxAgentMap.keySet()); + List extEmployeePOS = extEmployeeService.listAll(currentTenantKey); + Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); + // 获取个税扣缴义务人信息 + List taxAgentPOS = taxAgentService.listByIds(new HashSet<>(employeeTaxAgentMap.values())); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); + return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); + } + + private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { + LambdaQueryChainWrapper chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper) + .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(TaxDeclarationApiFlowRecordPO::getTenantKey) + .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId()) + .eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType()) + .eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult()); + if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) { + chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate()) + .le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate()); + } + return chainWrapper; + } + + @Override + public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map) { + ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); + // 表头 + List headers = exportWrapper.getHeaders(); + headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间")); + headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); + headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员")); + headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号")); + headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务")); + headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人")); + headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果")); + exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); + // 获取数据 + List dtoList = listFlowRecord(queryParam, employeeId, tenantKey); + // 组装数据 + for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getCreateTime()); + row.add(dto.getTaxAgentName()); + row.add(dto.getEmployeeName()); + row.add(dto.getIdCardNo()); + row.add(dto.getBusinessTypeName()); + row.add(dto.getCreator()); + row.add(dto.getResult()); + exportWrapper.getRows().add(row); + } + // 生成表格 + buildExcelData(exportWrapper); + } + + /** + * 构建excel数据 + * + * @param wrapper + */ + private void buildExcelData(ExportWrapper wrapper) { + wrapper.getExcelSheetData().setRows(wrapper.getRows()); + wrapper.getSheetList().add(wrapper.getExcelSheetData()); + salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); + } + + @BatchExportHandler("exportFlowRecord") + public void exportFlowRecordHandler() { + BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); + log.info("接收到流量使用记录导出的结果:{}", JSONObject.toJSONString(message)); + } + + /** + * 封装一些临时的集合类,便于方法复用 + */ + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class TempPropertiesWrapper { + // 姓名 + private Map empNameMap; + // 身份证 + private Map empIdNoMap; + // 获取个税扣缴义务人信息 + private Map taxAgentNameMap; + // 获取非系统人员 + private Map extEmployeeMap; + } + + @Data + public static class ApiFlowUpdateWrapper { + private String tenantKey; + private Long currentEmployeeId; + // 税款所属期 + private LocalDate taxYearMonth; + // api流量使用情况 + private List apiFlowDetailPOList; + // 当前租户的api接口配置 + private TaxDeclarationApiConfigPO apiConfig; + // 接口类型 + private EnumDeclareApiBusinessType businessType; + + public ApiFlowUpdateWrapper(String tenantKey, Long currentEmployeeId, LocalDate taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { + this.tenantKey = tenantKey; + this.currentEmployeeId = currentEmployeeId; + this.taxYearMonth = taxYearMonth; + this.apiFlowDetailPOList = new ArrayList<>(); + this.apiConfig = apiConfig; + this.businessType = businessType; + } + } + +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java new file mode 100644 index 000000000..f114d7330 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -0,0 +1,127 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiProfilePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareApiProfileEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiProfileMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * @author chengliming + * @date 2022-11-09 10:09 AM + **/ +@Slf4j +public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService { + + private TaxDeclareApiConfigMapper taxDeclareApiConfigMapper; + + private TaxDeclarationApiProfileMapper taxDeclarationApiProfileMapper; + + @Override + public TaxDeclarationApiConfigPO getConfig(boolean needValid) { + TaxDeclarationApiConfigPO configPO = taxDeclareApiConfigMapper.getOne(); + if (needValid) { + String tips1 = SalaryI18nUtil.getI18nLabel(183786, "当前用户智能算薪尚未配置,请先前往[设置] -> [智能算薪]中配置"); + String tips2 = SalaryI18nUtil.getI18nLabel(183787, "当前用户智能算薪尚未启用,请先前往[设置] -> [智能算薪]中启用该配置"); + String tips3 = SalaryI18nUtil.getI18nLabel(183788, "当前用户智能算薪账号或密码为空,请前往[设置] -> [智能算薪]中检查账号密码是否填写"); + SalaryAssert.isTrue(configPO != null, tips1); + SalaryAssert.isTrue(SalaryOnOffEnum.ON.getValue().equals(configPO.getEnableUse()), tips2); + SalaryAssert.isTrue(StringUtils.isNotEmpty(StringUtils.trim(configPO.getAppKey())) + && StringUtils.isNotEmpty(StringUtils.trim(configPO.getAppSecret())), tips3); + } + if (configPO != null) { + configPO.setAppKey(StringUtils.trim(configPO.getAppKey())); + configPO.setAppSecret(StringUtils.trim(configPO.getAppSecret())); + } + return configPO; + } + + @Override + public void insert(TaxDeclarationApiConfigPO configPO) { + taxDeclareApiConfigMapper.insertIgnoreNull(configPO); + } + + @Override + public void update(TaxDeclarationApiConfigPO config) { + taxDeclareApiConfigMapper.updateIgnoreNull(config); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + TaxDeclarationApiConfigPO config = this.getConfig(false); + if (config != null) { + config.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .setUpdateTime(LocalDateTime.now()); + update(config); + } else { + config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); + config.setHost(getApiHost()); + insert(config); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + TaxDeclarationApiConfigPO config = this.getConfig(false); + if (config != null) { + config.setAppKey(saveParam.getAppKey()) + .setAppSecret(saveParam.getAppSecret()) + .setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .setUpdateTime(LocalDateTime.now()); + update(config); + } else { + config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); + config.setHost(getApiHost()); + insert(config); + } + if (StringUtils.isNotEmpty(config.getAppKey()) && StringUtils.isNotEmpty(config.getAppSecret())) { + QuerySpecialAmountFeedbackResponse response = getQuerySpecialAmountFeedbackResponse(config); + // 校验请求结果 + String responseCode = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + + if (SzyhApiConstant.ERROR_CODE.equals(responseCode) + || SzyhApiConstant.APP_DISABLED_CODE.equals(responseCode) + || SzyhApiConstant.APP_PAUSED_CODE.equals(responseCode)) { + throw new SalaryRunTimeException("账号密码错误或账号已停用"); + } + } + } + + private String getApiHost() { + List apiProfiles = taxDeclarationApiProfileMapper.listAll(); + if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { + return SzyhApiConstant.HOST_URL; + } + return SzyhApiConstant.TEST_HOST_URL; + } + + public QuerySpecialAmountFeedbackResponse getQuerySpecialAmountFeedbackResponse(TaxDeclarationApiConfigPO apiConfig) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_QUERY_SPECIAL_AMOUNT_FEEDBACK; + Map params = new HashMap<>(1); + params.put("requestId", ""); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + return JsonUtil.parseObject(res, QuerySpecialAmountFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java new file mode 100644 index 000000000..12ea4afa5 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -0,0 +1,257 @@ +//package com.engine.salary.service.impl; +// +//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +//import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowWarnConfigMapper; +//import com.engine.salary.service.SalaryEmployeeService; +//import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +//import com.weaver.common.base.entity.result.WeaResult; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.framework.spring.annotation.AopClass; +//import com.weaver.hrm.salary.common.OptionDTO; +//import com.weaver.hrm.salary.dao.TaxDeclarationApiFlowWarnReceiverMapper; +//import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentEmployeePO; +//import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; +//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +//import com.weaver.hrm.salary.entity.taxapiflow.param.CreateMessageRuleParam; +//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; +//import com.weaver.hrm.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; +//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +//import com.weaver.hrm.salary.service.TaxAgentService; +//import com.weaver.hrm.salary.service.TaxDeclarationApiFlowStatisticService; +//import com.weaver.hrm.salary.util.SalaryAssert; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.mc.api.async.AsyncSystemMessageRest; +//import com.weaver.mc.api.entity.*; +//import com.weaver.mc.api.rest.RuleRest; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.commons.lang3.StringUtils; +//import org.springframework.stereotype.Service; +//import org.springframework.transaction.annotation.Transactional; +// +//import java.time.LocalDateTime; +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +//import java.util.stream.Collectors; +// +///** +// * @author chengliming +// * @date 2022-11-11 2:57 PM +// **/ +//@Service +//@Slf4j +//@AopClass +//public class TaxDeclarationApiFlowWarnServiceImpl implements TaxDeclarationApiFlowWarnService { +// private TaxDeclarationApiFlowWarnConfigMapper taxDeclarationApiFlowWarnConfigMapper; +// private TaxDeclarationApiFlowWarnReceiverMapper taxDeclarationApiFlowWarnReceiverMapper; +// private SalaryEmployeeService salaryEmployeeService; +// private RuleRest ruleRest; +// private AsyncSystemMessageRest asyncSystemMessageRest; +// private TaxAgentService taxAgentService; +// private TaxDeclarationApiFlowStatisticService taxDeclarationApiFlowStatisticService; +// +// @Override +// public TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey) { +// return new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnConfigMapper) +// .eq(TaxDeclarationApiFlowWarnConfigPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnConfigPO::getTenantKey, currentTenantKey) +// .one(); +// } +// +// @Override +// public List getWarnReceiverList(Long warnConfigId, String currentTenantKey) { +// List receiverPOList = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getWarnConfigId, warnConfigId) +// .list(); +// +// List salaryEmployees = taxAgentService.listEmployees(currentTenantKey); +// Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, TaxAgentEmployeePO::getEmployeeId, TaxAgentEmployeePO::getUsername); +// +// return receiverPOList.stream().map(e -> TaxDeclarationApiFlowWarnReceiverListDTO.builder() +// .employeeName(salaryEmployeeMap.get(e.getEmployeeId())) +// .employeeId(e.getEmployeeId()) +// .mobile(e.getMobile()) +// .email(e.getEmail()) +// .id(e.getId()) +// .build()).collect(Collectors.toList()); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void deleteReceiver(Long id, String currentTenantKey) { +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id, currentTenantKey); +// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); +// new LambdaUpdateChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .set(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getId, id) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .update(); +// } +// +// @Override +// public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id, Long currentEmployeeId, String currentTenantKey) { +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id, currentTenantKey); +// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); +// // 查找人员信息 +// List simpleEmployees = salaryEmployeeService.listAll(currentTenantKey); +// Map empMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// SimpleEmployee simpleEmployee = empMap.get(receiverPO.getEmployeeId()); +// SalaryAssert.notNull(simpleEmployee, SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 139811, "人员不存在")); +// +// return TaxDeclarationApiFlowWarnReceiverFormDTO.builder() +// .id(receiverPO.getId()) +// .employee(Collections.singletonList(new OptionDTO(receiverPO.getEmployeeId().toString(), simpleEmployee.getUsername()))) +// .email(receiverPO.getEmail()) +// .mobile(receiverPO.getMobile()) +// .emailOptions(StringUtils.isNotEmpty(simpleEmployee.getEmail()) ? Collections.singletonList(simpleEmployee.getEmail()) : null) +// .build(); +// } +// +// private TaxDeclarationApiFlowWarnReceiverPO getWarnReceiverPOById(Long id, String currentTenantKey) { +// return new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getId, id) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .one(); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param, Long currentEmployeeId, String currentTenantKey) { +// if (param.getId() != null) { +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(param.getId(), currentTenantKey); +// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); +// if (param.getEmployeeId() != null && !receiverPO.getEmployeeId().equals(param.getEmployeeId())) { +// filterByEmpId(param, currentTenantKey); +// receiverPO.setEmployeeId(param.getEmployeeId()); +// } +// receiverPO.setUpdateTime(LocalDateTime.now()); +// receiverPO.setEmail(param.getEmail()); +// receiverPO.setMobile(param.getMobile()); +// taxDeclarationApiFlowWarnReceiverMapper.updateById(receiverPO); +// } else { +// filterByEmpId(param, currentTenantKey); +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = TaxDeclarationApiFlowWarnReceiverPO.builder() +// .id(IdGenerator.generate()) +// .email(param.getEmail()) +// .mobile(param.getMobile()) +// .employeeId(param.getEmployeeId()) +// .warnConfigId(param.getWarnConfigId()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .tenantKey(currentTenantKey) +// .creator(currentEmployeeId) +// .build(); +// taxDeclarationApiFlowWarnReceiverMapper.insert(receiverPO); +// } +// } +// +// private void filterByEmpId(TaxDeclarationApiFlowWarnReceiverSaveParam param, String currentTenantKey) { +// List another = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getWarnConfigId, param.getWarnConfigId()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getEmployeeId, param.getEmployeeId()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .list(); +// SalaryAssert.isEmpty(another, SalaryI18nUtil.getI18nLabel(184007, "当前人员对应的提醒对象已存在,请更换人员后尝试")); +// } +// +// @Override +// public void createMessageRule(CreateMessageRuleParam param, Long currentEmployeeId, String currentTenantKey) { +// CreateRuleEntity createRule = new CreateRuleEntity() +// .setBusinessId(param.getBusinessId()) +// .setEvent(MessageEvent.PAYROLL) +// .setModule(MessageModule.HRSA) +// .setConfig(param.getConfig()); +// log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); +// WeaResult weaResult = ruleRest.createRuleV2(createRule); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC接口创建规则失败")); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param, Long currentEmployeeId, String currentTenantKey) { +// TaxDeclarationApiFlowWarnConfigPO warnConfigPO; +// if (param.getId() != null) { +// warnConfigPO = taxDeclarationApiFlowWarnConfigMapper.selectById(param.getId()); +// SalaryAssert.notNull(warnConfigPO, "提醒规则不存在,请先保存"); +// warnConfigPO.setThreshold(param.getThreshold()); +// warnConfigPO.setEnableWarn(param.getEnable() ? 1 : 0); +// warnConfigPO.setUpdateTime(LocalDateTime.now()); +// taxDeclarationApiFlowWarnConfigMapper.updateById(warnConfigPO); +// } else { +// warnConfigPO = TaxDeclarationApiFlowWarnConfigPO.builder() +// .id(IdGenerator.generate()) +// .businessId(param.getBusinessId()) +// .threshold(param.getThreshold()) +// .enableWarn(param.getEnable() ? 1 : 0) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .tenantKey(currentTenantKey) +// .build(); +// taxDeclarationApiFlowWarnConfigMapper.insert(warnConfigPO); +// } +// if (StringUtils.isNotEmpty(param.getConfig())) { +// CreateRuleEntity createRule = new CreateRuleEntity() +// .setName(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 159146, "流量不足提醒")) +// .setUser(new UserEntity(currentEmployeeId, currentTenantKey)) +// .setModule(MessageModule.HRSA) +// .setEvent(MessageEvent.PAYROLL) +// .setBusinessId(param.getBusinessId().toString()) +// .setConfig(param.getConfig()); +// log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); +// WeaResult weaResult = ruleRest.createRuleV2(createRule); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC接口创建规则失败")); +// } +// return warnConfigPO.getId().toString(); +// } +// +// @Override +// public Long getRuleBusinessId(String currentTenantKey) { +// TaxDeclarationApiFlowWarnConfigPO warnConfig = this.getWarnConfig(currentTenantKey); +// return warnConfig == null ? IdGenerator.generate() : warnConfig.getBusinessId(); +// } +// +// @Override +// public void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { +// TaxDeclarationApiFlowWarnConfigPO warnConfig = getWarnConfig(updateWrapper.getTenantKey()); +// // 未配置或开关关闭 +// if (Objects.isNull(warnConfig) || SalaryOnOffEnum.OFF.getValue().equals(warnConfig.getEnableWarn())) { +// return; +// } +// QueryAccountBalanceResponse response = taxDeclarationApiFlowStatisticService.getQueryAccountBalanceResponse(updateWrapper.getApiConfig()); +// // 剩余流量大于阈值无需提醒 +// if (StringUtils.isNotEmpty(response.getBody().getSurplus()) && Long.parseLong(response.getBody().getSurplus()) > warnConfig.getThreshold()) { +// return; +// } +// List warnReceiverList = getWarnReceiverList(warnConfig.getId(), updateWrapper.getTenantKey()); +// if (warnReceiverList.isEmpty()) { +// log.info("warnReceiverList is empty, send msg fail"); +// return; +// } +// List receivers = warnReceiverList.stream().map(e -> +// new UserEntity(e.getEmployeeId(), updateWrapper.getTenantKey()) +// .setEmail(e.getEmail()).setPhone(e.getMobile()).setLanguage(6) +// ).collect(Collectors.toList()); +// // 组装消息对象 +// SendMessageEntity smg = TaxApiFlowBO.buildSendMessageEntity(warnConfig, receivers, updateWrapper); +// // 发送消息 +// WeaResult weaResult = asyncSystemMessageRest.sendMsg(smg); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184009, "流量不足提醒发送失败")); +// } +//} diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java new file mode 100644 index 000000000..dd2c2af07 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java @@ -0,0 +1,43 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import lombok.extern.slf4j.Slf4j; + +/** + * 验证部门编码相关方法 + * + * @author chengliming + * @date 2022-09-15 17:21:41 + */ +@Slf4j +public class TaxReturnCheckDepartmentServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + // 调用神州云合API + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + CheckPasswordResponse response = getCheckPasswordResponse(apiConfig, po, saveParam); + verifyCheckPasswordResponse(po, response); + po.setDepartmentCode(saveParam.getDepartmentCode()); + po.setDepartmentName(saveParam.getDepartmentName()); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 返回结果 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java new file mode 100644 index 000000000..9ab875746 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java @@ -0,0 +1,87 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.Sm4Utils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; + +import java.util.List; +import java.util.Objects; + +/** + * 验证主题报税信息相关方法 + * + * @author chengliming + * @date 2022-09-15 17:21:23 + */ +@Slf4j +public class TaxReturnCheckMainServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.MAIN_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + try { + po = saveOrUpdate(apiConfig, po, saveParam); + if (NumberUtils.INTEGER_TWO.equals(saveParam.getRequestType())) { + return new TaxAgentTaxReturnCheckDTO().setStatus(po.getCheckStatus()).setMessage(po.getFailReason()); + } + } catch (Exception e) { + log.error("TaxReturnCheckMainServiceImpl.saveOrUpdate() ----------- error :{}", e.getMessage()); + } + // 调用神州云合API + CompanyRegisterInfoResponse response = getCompanyRegisterInfoResponse(apiConfig, po, saveParam); + List checkFormDTOS = verifyCompanyRegisterInfoResponse(apiConfig, saveParam, po, response); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 构建结果 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setRecords(checkFormDTOS); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } + + private boolean hasChanged(TaxAgentTaxReturnSaveParam saveParam, TaxAgentTaxReturnPO po, TaxDeclarationApiConfigPO apiConfig) throws Exception { + return !(Objects.equals(po.getTaxCode(), saveParam.getTaxCode()) + && Objects.equals(po.getAreaCode(), saveParam.getAreaCode()) + && Objects.equals(po.getPasswordType(), TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + && Objects.equals(po.getPwd(), Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + && Objects.equals(po.getRealAccount(), saveParam.getAccount())); + } + + private TaxAgentTaxReturnPO saveOrUpdate(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + if (Objects.nonNull(po)) { + if (hasChanged(saveParam, po, apiConfig)) { + // 数据有变化,则状态更新为未验证 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()); + po.setTaxRegistrationNumber(null); + po.setDepartmentCode(null); + po.setDepartmentName(null); + po.setFailReason(null); + } + TaxAgentTaxReturnBO.convertParam2Po4Update(apiConfig, po, saveParam); + getTaxAgentTaxReturnMapper().updateByTaxAgentId(po); + } else { + po = TaxAgentTaxReturnBO.convertParam2Po4Insert(apiConfig, saveParam) + .setCreator((long) user.getUID()).setTenantKey(""); + getTaxAgentTaxReturnMapper().insertIgnoreNull(po); + } + return po; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java new file mode 100644 index 000000000..aabb3e2f9 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java @@ -0,0 +1,44 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; + +import java.util.List; + +/** + * 验证税号+序号相关方法 + * + * @author chengliming + * @date 2022-09-15 17:22:14 + */ +public class TaxReturnCheckRegistrationServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.REGISTRATION_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + // 调用神州云合API + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + CompanyRegisterInfoResponse response = getCompanyRegisterInfoResponse(apiConfig, po, saveParam); + List checkFormDTOS = verifyCompanyRegisterInfoResponse(apiConfig, saveParam, po, response); + po.setTaxRegistrationNumber(saveParam.getTaxRegistrationNumber()); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 构建结果 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setRecords(checkFormDTOS); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/util/SingnatureData.java b/src/com/engine/salary/util/SingnatureData.java new file mode 100644 index 000000000..d6206c2bf --- /dev/null +++ b/src/com/engine/salary/util/SingnatureData.java @@ -0,0 +1,90 @@ +package com.engine.salary.util; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.net.URLEncoder; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.SignatureException; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; +import java.util.UUID; + +/** + * @author jie.zhou + * @version 1.0 + * @date 2021/1/14 15:27 + */ +@Slf4j +public class SingnatureData { + + /** + * 初始化延签头信息(GET) + * + * @param param + * @param appKey + * @param appSecret + * @return + */ + public static Map initHeader(Map param, String appKey, String appSecret) { + String version = "1.0.0"; + long timestamp = System.currentTimeMillis(); + String nonce = UUID.randomUUID().toString().replace("-", ""); + Map head = new HashMap(); + if (param != null && param.size() > 0) head.putAll(param); + head.put("version", version); + head.put("timestamp", Long.toString(timestamp));//TimeStamp + head.put("appKey", appKey);//accessKeyID + head.put("xReqNonce", nonce);//SignatureNonce + String signature = getSign(head, appSecret, "UTF-8"); + head.put("signature", signature.trim()); + return head; + } + + /*** + * 获取签名 + * @param params + * @param appSecret + * @param encoding + * @return + */ + public static String getSign(Map params, String appSecret, String encoding) { + TreeMap treeMap = new TreeMap<>(); + treeMap.put("appSecret", appSecret); + + for (Map.Entry entry : params.entrySet()) { + treeMap.put(entry.getKey(), entry.getValue().toString()); + } + StringBuilder builder = new StringBuilder(); + for (Object parameter : treeMap.values()) { + if (parameter != null) { + builder.append(parameter.toString()); + } + } + String signStr = null; + try { + signStr = sign(URLEncoder.encode(builder.toString(), encoding), appSecret); + } catch (Exception e) { + log.error("获取签名失败", e); + } + return signStr; + } + + public static String sign(String data, String appSecret) throws SignatureException { + try { + Mac mac = Mac.getInstance("HmacSHA256"); + SecretKeySpec signingKey = new SecretKeySpec(appSecret.getBytes(), "HmacSHA256"); + mac.init(signingKey); + byte[] signData = mac.doFinal(data.getBytes()); + return Base64.encodeBase64String(signData); + } catch (NoSuchAlgorithmException e) { + throw new SignatureException("平台不支持" + "HMAC_SHA256" + "摘要方式"); + } catch (InvalidKeyException e) { + throw new SignatureException("Speicified access secret is not valid."); + } + } +} diff --git a/src/com/engine/salary/util/Sm4Utils.java b/src/com/engine/salary/util/Sm4Utils.java new file mode 100644 index 000000000..acaf98881 --- /dev/null +++ b/src/com/engine/salary/util/Sm4Utils.java @@ -0,0 +1,190 @@ +package com.engine.salary.util; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.pqc.math.linearalgebra.ByteUtils; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.security.*; +import java.util.Arrays; + +public class Sm4Utils { + + static { + Security.addProvider(new BouncyCastleProvider()); + } + + private static final String ENCODING = "UTF-8"; + + public static final String ALGORITHM_NAME = "SM4"; + + // 加密算法/分组加密模式/分组填充方式 + // PKCS5Padding-以8个字节为一组进行分组加密 + // 定义分组加密模式使用:PKCS5Padding + public static final String ALGORITHM_NAME_ECB_PADDING = "SM4/ECB/PKCS5Padding"; + + // 128-32位16进制;256-64位16进制 + public static final int DEFAULT_KEY_SIZE = 128; + + /** + * 生成ECB暗号 + * + * @param algorithmName 算法名称 + * @param mode 模式 + * @param key + * @return + * @throws Exception + * @explain ECB模式(电子密码本模式:Electronic codebook) + */ + private static Cipher generateEcbCipher(String algorithmName, int mode, byte[] key) throws Exception { + Cipher cipher = Cipher.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME); + Key sm4Key = new SecretKeySpec(key, ALGORITHM_NAME); + cipher.init(mode, sm4Key); + return cipher; + } + + /** + * 自动生成密钥 + * + * @return + * @throws NoSuchAlgorithmException + * @throws NoSuchProviderException + * @explain + */ + public static byte[] generateKey() throws Exception { + return generateKey(DEFAULT_KEY_SIZE); + } + + /** + * @param keySize + * @return + * @throws Exception + * @explain + */ + public static byte[] generateKey(int keySize) throws Exception { + KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, BouncyCastleProvider.PROVIDER_NAME); + kg.init(keySize, new SecureRandom()); + return kg.generateKey().getEncoded(); + } + + /* * sm4加密 + * @explain 加密模式:ECB + * 密文长度不固定,会随着被加密字符串长度的变化而变化 + * @param hexKey + * 16进制密钥(忽略大小写) + * @param paramStr + * 待加密字符串 + * @return 返回16进制的加密字符串 + * @throws Exception + */ + public static String encryptEcb(String hexKey, String paramStr) throws Exception { + hexKey = strTo16(hexKey); + String cipherText = ""; + // 16进制字符串-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // String-->byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 加密后的数组 + byte[] cipherArray = encrypt_Ecb_Padding(keyData, srcData); + // byte[]-->hexString + cipherText = ByteUtils.toHexString(cipherArray); + return cipherText; + } + + /** + * 加密模式之Ecb + * + * @param key + * @param data + * @return + * @throws Exception + * @explain + */ + public static byte[] encrypt_Ecb_Padding(byte[] key, byte[] data) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * sm4解密 + * + * @param hexKey 16进制密钥 + * @param cipherText 16进制的加密字符串(忽略大小写) + * @return 解密后的字符串 + * @throws Exception + * @explain 解密模式:采用ECB + */ + public static String decryptEcb(String hexKey, String cipherText) throws Exception { + hexKey = strTo16(hexKey); + // 用于接收解密后的字符串 + String decryptStr = ""; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // hexString-->byte[] + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] srcData = decrypt_Ecb_Padding(keyData, cipherData); + // byte[]-->String + decryptStr = new String(srcData, ENCODING); + return decryptStr; + } + + /** + * 解密 + * + * @param key + * @param cipherText + * @return + * @throws Exception + * @explain + */ + public static byte[] decrypt_Ecb_Padding(byte[] key, byte[] cipherText) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.DECRYPT_MODE, key); + return cipher.doFinal(cipherText); + } + + /** + * 校验加密前后的字符串是否为同一数据 + * + * @param hexKey 16进制密钥(忽略大小写) + * @param cipherText 16进制加密后的字符串 + * @param paramStr 加密前的字符串 + * @return 是否为同一数据 + * @throws Exception + * @explain + */ + public static boolean verifyEcb(String hexKey, String cipherText, String paramStr) throws Exception { + hexKey = strTo16(hexKey); + // 用于接收校验结果 + boolean flag = false; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // 将16进制字符串转换成数组 + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] decryptData = decrypt_Ecb_Padding(keyData, cipherData); + // 将原字符串转换成byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 判断2个数组是否一致 + flag = Arrays.equals(decryptData, srcData); + return flag; + } + + /** + * 字符串转化成为16进制 + * + * @param s + * @return + */ + public static String strTo16(String s) { + String str = ""; + for (int i = 0; i < s.length(); i++) { + int ch = (int) s.charAt(i); + String s4 = Integer.toHexString(ch); + str = str + s4; + } + return str.substring(0, 32); + } + +} \ No newline at end of file diff --git a/src/com/engine/salary/web/TaxAgentTaxReturnController.java b/src/com/engine/salary/web/TaxAgentTaxReturnController.java new file mode 100644 index 000000000..c7bacf57a --- /dev/null +++ b/src/com/engine/salary/web/TaxAgentTaxReturnController.java @@ -0,0 +1,93 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.TaxAgentTaxReturnWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 个税扣缴义务人-报税信息 + * + * @author chengliming + * @date: 2022-08-31 11:49:38 + */ +public class TaxAgentTaxReturnController { + + private TaxAgentTaxReturnWrapper getTaxAgentTaxReturnWrapper(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnWrapper.class, user); + } + + + /** + * 获取报税信息表单 + * + * @param taxAgentId + * @return + */ + @GET + @Path("/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("taxAgentId") Long taxAgentId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::getForm, taxAgentId); + } + + /** + * 保存并验证报税信息 + * + * @param saveParam + * @return + */ + @POST + @Path("/saveAndCheck") + @Produces(MediaType.APPLICATION_JSON) + public String saveAndCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.MAIN_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + + /** + * 多个登记序号单选提交 + * + * @param saveParam + * @return + */ + @POST + @Path("/registration/check") + @Produces(MediaType.APPLICATION_JSON) + public String registrationCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.checkParam4Registration(); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.REGISTRATION_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + + /** + * 多个登记序号单选提交 + * + * @param saveParam + * @return + */ + @POST + @Path("/departmentCode/check") + @Produces(MediaType.APPLICATION_JSON) + public String departmentCodeCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.checkParam4Department(); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + +} diff --git a/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java new file mode 100644 index 000000000..63c136151 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java @@ -0,0 +1,152 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnListDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnResultDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +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.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.impl.TaxAgentTaxReturnServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.Sm4Utils; +import com.engine.salary.util.page.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 个税扣缴义务人-报税信息包装类 + * + * @author chengliming + * @date: 2022-08-31 13:29:14 + */ + +@Slf4j +public class TaxAgentTaxReturnWrapper extends Service { + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class,user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class,user); + } + + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class,user); + } + /** + * 请求类型:1.保存并验证 2.仅保存 + */ + private static final Integer[] REQUEST_TYPE = {1, 2}; + /** + * 展示类型:1.展示表单 2.展示列表 3.关闭所有tab + */ + private static final Integer[] COMP_TYPE = {1, 2, 3}; + + /** + * 需要自定义设置的字段名 + */ + private static final Set NEED_CUSTOM_ITEMS = new HashSet<>(Arrays.asList("areaCode", "account", "taxCode", "netPassword", "realNamePassword", "departmentName", "departmentCode")); + + public TaxAgentTaxReturnMainFormDTO getForm(Long taxAgentId) { + TaxAgentTaxReturnMainFormDTO formDTO = new TaxAgentTaxReturnMainFormDTO() + .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD) + .setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT); + // 查询是否填写过报税信息 + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnService(user).getByTaxAgentId(taxAgentId); + if (Objects.nonNull(taxReturnPO)) { + try { + // 密码解密 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); + } catch (Exception e) { + log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); + } + formDTO = TaxAgentTaxReturnBO.convertPo2FormDto(taxReturnPO); + } + // 查询个税扣缴义务人名称 + TaxAgentPO agentPO = getTaxAgentService(user).getById(taxAgentId); + SalaryAssert.notNull(agentPO, SalaryI18nUtil.getI18nLabel( 100545, "个税扣缴义务人不存在")); + formDTO.setName(agentPO.getName()); + return formDTO; + } + + public Object verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnCheckDTO checkDTO = getTaxAgentTaxReturnService(user).verify(saveParam); + // 校验税友验证是否成功 + TaxAgentTaxReturnResultDTO resultDTO = TaxAgentTaxReturnResultDTO.builder() + .checkStatus(TaxAgentTaxReturnStatusEnum.parseByValue(checkDTO.getStatus())) + .failReason(checkDTO.getMessage()) + .message(checkDTO.getMessage()) + .taxRegistrationNumber(checkDTO.getTaxRegistrationNumber()) + .departmentCode(checkDTO.getDepartmentCode()) + .taxAgentId(saveParam.getTaxAgentId().toString()) + .build(); + // 是否为仅保存 + if (REQUEST_TYPE[1].equals(saveParam.getRequestType())) { + return resultDTO; + } + // 是否为校验部门信息的接口 + if (TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue().equals(saveParam.getType()) || checkDTO.getRecords().isEmpty()) { + return resultDTO; + } + // 组装数据 + if (checkDTO.getRecords().size() > 1) { + // 如果返回了多条,创建表格 + return resultDTO.setTable(buildTable(checkDTO)).setCompType(COMP_TYPE[1]); + } else { + // 如果只返回一条,创建表单 + return buildResultForm(checkDTO, resultDTO); + } + } + + private TaxAgentTaxReturnResultDTO buildResultForm(TaxAgentTaxReturnCheckDTO resultDTO, TaxAgentTaxReturnResultDTO result) { +// TaxAgentTaxReturnCheckFormDTO checkDTO = resultDTO.getRecords().get(0); +// WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxAgentTaxReturnCheckFormDTO.class, checkDTO); +// // 如果不是分部门备案,隐藏 +// if (SalaryOnOffEnum.OFF.getValue().equals(checkDTO.getDivideFiling().getValue())) { +// weaForm.getLayout().forEach(e -> e.forEach(layout -> layout.setHide("departmentCode".equals(layout.getId()) || "departmentName".equals(layout.getId())))); +// } +// weaForm.getItems().forEach((k, v) -> { +// if (NEED_CUSTOM_ITEMS.contains(k)) { +// Map otherParams = new HashMap<>(2); +// otherParams.put("showCount", true); +// otherParams.put("autoTrim", true); +// otherParams.put("placeholder", SalaryI18nUtil.getI18nLabel( 85987, "请输入")); +// v.setOtherParams(otherParams); +// } +// }); +// return WeaResult.success(result.setForm(weaForm).setCompType(COMP_TYPE[0])); + return null; + } + + + private PageInfo buildTable(TaxAgentTaxReturnCheckDTO resultDTO) { + PageInfo page = new PageInfo<>(); + List list = resultDTO.getRecords().stream().map(e -> { + TaxAgentTaxReturnListDTO dto = new TaxAgentTaxReturnListDTO(); + BeanUtils.copyProperties(e, dto); + return dto; + }).collect(Collectors.toList()); + page.setList(list); + return page; + } +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java new file mode 100644 index 000000000..01edf018d --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -0,0 +1,77 @@ +package com.engine.salary.wrapper; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.service.TaxDeclarationApiBillingService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 个税申报计费 + * + * @author chengliming + * @date 2022-11-11 15:16:22 + */ +@Slf4j +@Component +public class TaxDeclarationApiFlowBillingWrapper { + + private TaxDeclarationApiBillingService taxDeclarationApiBillingService; + + private TaxDeclarationApiConfigService taxDeclarationApiConfigService; + +// private SalaryBatchService salaryBatchService; + + public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { + taxDeclarationApiConfigService.saveConfig(saveParam); + } + + public TaxDeclarationBillingConfigFormDTO getConfig() { + TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); + if (config == null) { + return TaxDeclarationBillingConfigFormDTO.builder().appKey("").appSecret("").enable(true).build(); + } + return TaxDeclarationBillingConfigFormDTO.builder() + .id(config.getId()) + .appKey(config.getAppKey()) + .appSecret(config.getAppSecret()) + .enable(SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse())) + .build(); + } + +// public WeaTable getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) { +// PageInfo page = taxDeclarationApiBillingService.pageFlowRecord(queryParam); +// return SalaryFormatUtil.getInstance().buildTable(TaxDeclarationApiFlowRecordListDTO.class, page); +// } + +// public Map exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) { +// List dtoList = taxDeclarationApiBillingService.listFlowRecord(queryParam, employeeId, tenantKey); +// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel( 95795, "数据不存在")); +// // 构建异步导出参数 +// Map map = salaryBatchService.buildeExportParam("exportFlowRecord"); +// map.put("sheetName", SalaryI18nUtil.getI18nLabel( 183779, "接口使用记录数据")); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// try { +// taxDeclarationApiBillingService.exportFlowRecord(queryParam, map, employeeId, tenantKey); +// } finally { +// } +// } +// }; +// ThreadPoolUtil.execute(localRunnable); +// return map; +// } + + public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { + taxDeclarationApiConfigService.enableConfig(saveParam); + } + + public Boolean getConfigStatus(String currentTenantKey, Long currentEmployeeId) { + TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); + return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); + } +} From c0660e54769e3d8e5b406ad0b02186c919bbac38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Jul 2023 15:06:42 +0800 Subject: [PATCH 003/298] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SzyhApiConstant.java | 167 ++++++++++++ .../response/CheckPasswordResponse.java | 21 ++ .../response/CompanyRegisterInfoResponse.java | 66 +++++ .../taxagent/response/SzyhResponseHead.java | 26 ++ .../entity/taxpayment/bo/TaxPaymentBO.java | 28 ++ .../dto/TaxAgreementBankFormDTO.java | 29 ++ .../dto/TaxAgreementFeedbackResultDTO.java | 33 +++ .../taxpayment/dto/TaxAgreementFormDTO.java | 28 ++ .../taxpayment/dto/TaxAmountFormDTO.java | 58 ++++ .../taxpayment/dto/TaxFeedbackResultDTO.java | 34 +++ .../taxpayment/dto/TaxPayTypeFormDTO.java | 38 +++ .../dto/TaxWithheldVoucherResultDTO.java | 39 +++ .../dto/TaxWithholdingVoucherFeedbackDTO.java | 89 +++++++ .../param/TaxPaymentQueryParam.java | 47 ++++ .../taxpayment/po/TaxPaymentRequestPO.java | 105 ++++++++ .../AgreementQueryFeedbackResponse.java | 86 ++++++ .../taxpayment/response/BaseResponse.java | 18 ++ .../SyncWithholdingFeedbackResponse.java | 19 ++ .../response/WithheldVoucherResponse.java | 61 +++++ .../response/WithholdingFeedbackResponse.java | 85 ++++++ .../WithholdingVoucherFeedbackResponse.java | 129 +++++++++ src/com/engine/salary/util/HttpUtil.java | 249 ++++++++++++++++++ 22 files changed, 1455 insertions(+) create mode 100644 src/com/engine/salary/constant/SzyhApiConstant.java create mode 100644 src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java create mode 100644 src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java create mode 100644 src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java create mode 100644 src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java create mode 100644 src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java create mode 100644 src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/BaseResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java create mode 100644 src/com/engine/salary/util/HttpUtil.java diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java new file mode 100644 index 000000000..1559b25de --- /dev/null +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -0,0 +1,167 @@ +package com.engine.salary.constant; + +/** + * 神州云合api常量 + * + * @author chengliming + * @date 2022-10-18 11:05 AM + **/ +public class SzyhApiConstant { + + /** + * 接口HOST + */ + public static final String HOST_URL = "https://ddapi.bigfintax.com/"; + + /** + * 测试接口host + */ + public static final String TEST_HOST_URL = "https://ddapi-t.bigfintax.com/"; + + /** + * 企业注册接口 + */ + public static final String GET_REGISTER_INFO_URL = "gateway/iit/declare/getCompanyRegisterInfo"; + + /** + * 校验密码接口 + */ + public static final String CHECK_PASSWORD_URL = "gateway/iit/check/checkPassword"; + + /** + * 人员专项附加扣除信息查询 + */ + public static final String QUERY_SPECIAL_AMOUNT = "gateway/iit/special/querySpecialAmount"; + + /** + * 人员专项附加扣除信息查询反馈 + */ + public static final String GET_QUERY_SPECIAL_AMOUNT_FEEDBACK = "gateway/iit/special/getQuerySpecialAmountFeedback"; + + /** + * 报送人员接口 + */ + public static final String DECLARE_EMPLOYEE_INFO = "gateway/iit/declare/declareEmployeeInfo"; + + /** + * 报送人员获取反馈接口 + */ + public static final String DECLARE_EMPLOYEE_INFO_FEEDBACK = "gateway/iit/declare/getEmployeeInfoFeedback"; + + /** + * 个税申报 + */ + public static final String DECLARE_TAX = "gateway/iit/report/send"; + + /** + * 获取个税申报反馈 + */ + public static final String DECLARE_TAX_FEEDBACK = "gateway/iit/report/getFeedback"; + + /** + * 作废申报 + */ + public static final String CANCEL_DECLARE = "gateway/iit/report/cancel"; + + /** + * 获取作废申报反馈 + */ + public static final String CANCEL_DECLARE_FEEDBACK = "gateway/iit/report/getCancelFeedback"; + + /** + * 更正申报 + */ + public static final String UPDATE_DECLARE = "/gateway/iit/report/correct"; + + /** + * 税局端申报状态查询 + */ + public static final String QUERY_DECLARE_STATUS = "/gateway/iit/report/queryDeclarationRecord"; + + /** + * 企业申报数据明细查询 + */ + public static final String QUERY_COMPANY_INCOMES = "/gateway/iit/report/getCompanyIncomes"; + + /** + * 获取流量统计情况 + */ + public static final String QUERY_ACCOUNT_BALANCE = "gateway/iit/statistic/queryAccountBalance"; + + /** + * 查询税号流量明细 + */ + public static final String QUERY_DETAILS_BY_TAX_NUMBER = "gateway/iit/statistic/queryDetailsByTaxNumber"; + + /** + * 获取企业三方信息 + */ + public static final String QUERY_AGREEMENT = "gateway/iit/payment/queryAgreement"; + + /** + * 获取企业三方信息查询反馈 + */ + public static final String GET_AGREEMENT_QUERY_FEEDBACK = "gateway/iit/payment/getAgreementQueryFeedback"; + + /** + * 三方协议缴款 + */ + public static final String DECLARE_WITH_HOLDING = "gateway/iit/payment/declareWithholding"; + + /** + * 三方协议缴款反馈 + */ + public static final String DECLARE_WITH_HOLDING_FEEDBACK = "gateway/iit/payment/getWithholdingFeedback"; + + /** + * 缴款凭证 + */ + public static final String WITHHOLDING_VOUCHER = "gateway/iit/payment/withholdingVoucher"; + + /** + * 缴款凭证反馈 + */ + public static final String WITHHOLDING_VOUCHER_FEEDBACK = "gateway/iit/payment/getWithholdingVoucherFeedback"; + + /** + * 缴款凭证作废 + */ + public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/payment/cancelWithholdingVoucher"; + /** + * 完税证明 + */ + public static final String GET_WITHHELD_VOUCHER = "gateway/iit/payment/getWithheldVoucher"; + /** + * 刷新缴款状态 + */ + public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; + + + /** + * 请求成功状态码 + */ + public static final String SUCCESS_CODE = "00000000"; + + /** + * 处理中状态码 + */ + public static final String HANDLING_CODE = "000004"; + + /** + * 企业服务不可用 + */ + public static final String APP_DISABLED_CODE = "990006"; + + /** + * 企业服务已停用 + */ + public static final String APP_PAUSED_CODE = "990007"; + /** + * 错误码 + */ + public static final String ERROR_CODE = "ITGCUS0002"; + /** + * 无缴款凭证 + */ + public static final String NONE_VOUCHER_CODE = "200028"; +} diff --git a/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java new file mode 100644 index 000000000..2078bfa08 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +/** + * 神州云合接口返回状态实体 + * + * @author chengliming + * @date 2022-10-18 10:39 AM + **/ +@Data +public class CheckPasswordResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; + /** + * 返回数据 + */ + private boolean body; +} diff --git a/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java new file mode 100644 index 000000000..b3a2557e3 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java @@ -0,0 +1,66 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +import java.util.List; + +/** + * 神州云合接口返回状态实体 + * + * @author chengliming + * @date 2022-10-18 10:39 AM + **/ +@Data +public class CompanyRegisterInfoResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; + /** + * 返回数据 + */ + private List body; + + /** + * 神州云合接口返回状态实体类 + **/ + @Data + public static class CompanyRegisterInfo { + /** + * 登记序号 + */ + private String djxhid; + /** + * 企业名称 + */ + private String qymc; + /** + * 法人姓名 + */ + private String frxm; + /** + * 联系电话 + */ + private String lxdh; + /** + * 生产经营地址 + */ + private String scjydz; + /** + * 行业名称 + */ + private String hymc; + /** + * 主管税务机关名称 + */ + private String zgswjgmc; + /** + * 主管税务分局所科名称 + */ + private String zgswjgskmc; + /** + * 是否分部门备案 + */ + private String fbmba; + } +} diff --git a/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java new file mode 100644 index 000000000..11b1185a0 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +/** + * 神州云合接口返回状态实体 + * + * @author chengliming + * @date 2022-10-18 10:39 AM + **/ +@Data +public class SzyhResponseHead { + private String code; + private String desc; + private String msg; + private String time; + private String status; + + public SzyhResponseHead() { + } + + public SzyhResponseHead(String code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java b/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java new file mode 100644 index 000000000..c1ac514d8 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.taxpayment.bo; + +import com.engine.salary.entity.taxpayment.dto.TaxWithholdingVoucherFeedbackDTO; +import com.engine.salary.entity.taxpayment.response.WithholdingVoucherFeedbackResponse; + +/** + * @author chengliming + * @date 2022-12-07 2:16 PM + **/ +public class TaxPaymentBO { + public static TaxWithholdingVoucherFeedbackDTO buildTaxWithholdingVoucherFeedbackDTO(WithholdingVoucherFeedbackResponse.Feedback synthesize) { + return TaxWithholdingVoucherFeedbackDTO.builder() + .taxDeclareCode(synthesize.getSblxdm()) + .taxDeclareName(synthesize.getSblxmc()) + .voucherNo(synthesize.getJkpzxh()) + .firstPrintDate(synthesize.getDysj()) + .taxCode(synthesize.getNsrsbh()) + .taxAgentName(synthesize.getNsrxm()) + .taxAuthoritiesNo(synthesize.getSwjgdm()) + .taxAuthoritiesName(synthesize.getSwjgmc()) + .deadline(synthesize.getXjrq()) + .lowerFormatAmount(synthesize.getXxjehj()) + .upperFormatAmount(synthesize.getDxjehj()) + .remark(synthesize.getBz()) + .printNum(synthesize.getDycs()) + .build(); + } +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java new file mode 100644 index 000000000..d2cece365 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxAgreementBankFormDTO { + + + @ApiModelProperty("开户行") + private String bank; + + @ApiModelProperty("开户账号") + private String bankNo; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java new file mode 100644 index 000000000..f7ac03735 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + + +/** + * 获取三方查询反馈结果 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("获取三方查询反馈结果") +public class TaxAgreementFeedbackResultDTO extends TaxFeedbackResultDTO { + @ApiModelProperty("实缴金额") + private String payAmount; + + @ApiModelProperty("滞纳金等金额") + private String otherAmount; + + @ApiModelProperty("申报人数") + private String personNum; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java new file mode 100644 index 000000000..233313c66 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.taxpayment.dto; + +import com.weaver.common.component.form.WeaForm; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxAgreementFormDTO extends TaxFeedbackResultDTO { + + private WeaForm form; + + private Map count; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java new file mode 100644 index 000000000..fc1f777d4 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -0,0 +1,58 @@ +package com.engine.salary.entity.taxpayment.dto; + +import com.weaver.common.component.form.item.WeaFormItemType; +import com.weaver.hrm.salary.annotation.SalaryForm; +import com.weaver.hrm.salary.annotation.SalaryFormItem; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxAmountFormDTO { + + @SalaryForm( + label = "个税扣缴义务人", + labelId = 86184, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) + } + ) + @ApiModelProperty("个税扣缴义务人") + private String taxAgent; + + @SalaryForm( + label = "应缴金额", + labelId = 175126, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) + } + ) + @ApiModelProperty("应缴金额") + private String amount; + + @SalaryForm( + label = "申报人数", + labelId = 175128, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) + } + ) + @ApiModelProperty("申报人数") + private String personNum; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java new file mode 100644 index 000000000..845e888a9 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + + +/** + * 获取三方查询反馈结果 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("获取反馈结果") +public class TaxFeedbackResultDTO { + @ApiModelProperty("请求id") + private String requestId; + + @ApiModelProperty("提示语") + private String msg; + + @ApiModelProperty("处理结果") + private String result; + + @ApiModelProperty("是否结束轮询") + private Boolean finish; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java new file mode 100644 index 000000000..942ef4423 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java @@ -0,0 +1,38 @@ +package com.engine.salary.entity.taxpayment.dto; + +import com.weaver.common.component.form.item.WeaFormItemType; +import com.weaver.hrm.salary.annotation.SalaryForm; +import com.weaver.hrm.salary.annotation.SalaryFormItem; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxPayTypeFormDTO { + + @SalaryForm( + label = "缴款方式", + labelId = 175127, + labelSpan = 8, + items = { + @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = TaxPaymentTypeEnum.class) + } + ) + @ApiModelProperty("缴款方式") + private String type; + +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java new file mode 100644 index 000000000..fb6cdf770 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java @@ -0,0 +1,39 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; + + +/** + * 获取完税证明 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("获取完税证明") +public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO { + @ApiModelProperty("完税证明") + private List vouchers; + + @Data + @AllArgsConstructor + public static class Voucher { + @ApiModelProperty("名称") + private String name; + + @ApiModelProperty("内容") + private String content; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java new file mode 100644 index 000000000..e0b38be9f --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java @@ -0,0 +1,89 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费凭证") +public class TaxWithholdingVoucherFeedbackDTO extends TaxFeedbackResultDTO{ + /** + * 申报类型代码 + */ + private String taxDeclareCode; + /** + * 申报类型名称 + */ + private String taxDeclareName; + /** + * 缴款凭证序号 + */ + private String voucherNo; + /** + * 首次打印时间 + */ + private String firstPrintDate; + /** + * 纳税人识别号 + */ + private String taxCode; + /** + * 纳税人名称 + */ + private String taxAgentName; + /** + * 税务机关代码 + */ + private String taxAuthoritiesNo; + /** + * 税务机关名称 + */ + private String taxAuthoritiesName; + /** + * 税款限缴日期 + */ + private String deadline; + /** + * 金额合计(小写) + */ + private String lowerFormatAmount; + /** + * 金额合计(大写) + */ + private String upperFormatAmount; + /** + * 备注 + */ + private String remark; + /** + * 打印次数 + */ + private String printNum; + /** + * 缴款凭证明细列表 + */ + private List details; + + @Data + public static class Detail { + /** + * 扣款反馈代码 + */ + private String paymentCode; + /** + * 扣款名称 + */ + private String paymentItem; + /** + * 实缴税额 + */ + private String payAmount; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java new file mode 100644 index 000000000..2b57b8a1b --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -0,0 +1,47 @@ +package com.engine.salary.entity.taxpayment.param; + +import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; + +/** + * 查询企业三方信息 + * + * @author chengliming + * @date: 2022-12-06 17:25:28 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询企业三方信息") +public class TaxPaymentQueryParam { + + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @ApiModelProperty("税款所属期") + private YearMonth taxYearMonth; + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; + + /** + * @see TaxPaymentServiceTypeEnum + */ + @ApiModelProperty("业务类型") + private Integer type; + + @ApiModelProperty("三方协议号") + private String protocolNumber; + + @ApiModelProperty("应缴税额") + private String taxAmount; + + @ApiModelProperty("是否为反馈校验 0否 1是") + private Integer checkFeedback; +} diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java new file mode 100644 index 000000000..246630568 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -0,0 +1,105 @@ +package com.engine.salary.entity.taxpayment.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.weaver.common.elog.annotation.ElogTransform; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 个税辅助缴款-三方缴款请求 + * + * @author chengliming + * @date 2022-12-07 13:41:30 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@TableName("hrsa_tax_payment_request") +@ElogTransform(name = "个税辅助缴款-请求信息") +public class TaxPaymentRequestPO implements Serializable { + + private static final long serialVersionUID = -203732044881927518L; + /** + * 主键id + */ + @ElogTransform(name = "主键id") + private Long id; + + /** + * 个税扣缴义务人的主键id + */ + @ElogTransform(name = "个税扣缴义务人的主键id") + private Long taxAgentId; + + /** + * 个税申报记录ID + */ + @ElogTransform(name = "个税申报记录id") + private Long taxDeclareRecordId; + + /** + * 税款所属期 + */ + @ElogTransform(name = "税款所属期") + private LocalDate taxYearMonth; + + /** + * 异步请求ID + */ + @ElogTransform(name = "异步请求ID") + private String requestId; + + + /** + * 请求类型 + * + * @see com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum + */ + @ElogTransform(name = "异步请求ID") + private Integer requestType; + + /** + * 是否已获取反馈 + * + * @see com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum + */ + @ElogTransform(name = "是否已获取反馈") + private Integer feedback; + + /** + * 租户key + */ + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; + + /** + * 创建人id + */ + @ElogTransform(name = "创建人id", ignore = true) + private Long creator; + + /** + * 是否删除 + */ + @ElogTransform(name = "是否删除", ignore = true) + private Integer deleteType; + + /** + * 创建时间 + */ + @ElogTransform(name = "创建时间", ignore = true) + private LocalDateTime createTime; + + /** + * 更新时间 + */ + @ElogTransform(name = "更新时间", ignore = true) + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java new file mode 100644 index 000000000..b1766074b --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java @@ -0,0 +1,86 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 获取企业欠费信息查询反馈结果 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class AgreementQueryFeedbackResponse extends BaseResponse { + /** + * 返回数据 + */ + private Body body; + + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 三方查询状态 0: 请求成功;1: 校验失败;2:请求失败 + */ + private String sfzt; + /** + * 失败原因 + */ + private String sbyy; + /** + * 三方列表 + */ + private List sflb; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 三方协议号 + **/ + private String sfxyh; + /** + * 银行行别代码 + **/ + private String yhhbdm; + /** + * 银行行别名称 + **/ + private String yhhbmc; + /** + * 银行营业网点代码 + **/ + private String yywddm; + /** + * 银行营业网点名称 + **/ + private String yywdmc; + /** + * 清算行行号 + **/ + private String qshhh; + /** + * 开户行行号 + **/ + private String khhhh; + /** + * 缴款帐号 + **/ + private String jkzh; + /** + * 缴款账户名称 + **/ + private String jkmc; + /** + * 税款所属税务机构代码 + **/ + private String zgswjgdm; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java b/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java new file mode 100644 index 000000000..382c546c2 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxpayment.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +/** + * 接口响应值 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class BaseResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java new file mode 100644 index 000000000..de5d979ee --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java @@ -0,0 +1,19 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 完税证明 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class SyncWithholdingFeedbackResponse extends BaseResponse { + /** + * 返回数据 + */ + private WithholdingFeedbackResponse.Feedback body; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java new file mode 100644 index 000000000..98401e525 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java @@ -0,0 +1,61 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 完税证明 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithheldVoucherResponse extends BaseResponse { + /** + * 返回数据 + */ + private Body body; + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 综合所得 + **/ + private Feedback zhsd; + /** + * 分类所得 + **/ + private Feedback flsd; + /** + * 非居民所得 + **/ + private Feedback fjmsd; + /** + * 限售股所得 + **/ + private Feedback xsgsd; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 缴款反馈状态 0成功 1失败 + */ + private String jkzt; + /** + * 扣款失败原因 + */ + private String jksbyy; + /** + * 完税证明列表 + */ + private List wszmlb; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java new file mode 100644 index 000000000..de1f72221 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java @@ -0,0 +1,85 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 三方协议缴款反馈 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithholdingFeedbackResponse extends BaseResponse { + + /** + * 返回数据 + */ + private Body body; + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 综合所得 + **/ + private Feedback zhsdjk; + /** + * 分类所得 + **/ + private Feedback flsdjk; + /** + * 非居民所得 + **/ + private Feedback fjmsdjk; + /** + * 限售股所得 + **/ + private Feedback xsgsdjk; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 申报状态 + **/ + private String sbzt; + + /** + * 扣款状态 0:扣款成功:1:信息校验失败;2:无欠费记录;3:扣款失败 + **/ + private String jkzt; + + /** + * 扣款失败原因 + **/ + private String jksbyy; + + /** + * 扣款详情列表 + **/ + private List kkfhlb; + } + + @Data + public static class Detail { + /** + * 扣款反馈代码 + */ + private String kkfhDm; + /** + * 扣款名称 + */ + private String kkfhmc; + /** + * 实缴税额 + */ + private String sjse; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java new file mode 100644 index 000000000..e49c10f80 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java @@ -0,0 +1,129 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 缴款凭证反馈 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithholdingVoucherFeedbackResponse extends BaseResponse { + /** + * 返回数据 + */ + private Body body; + + /** + * 反馈结果body + */ + @Data + public static class Body { + /** + * 综合所得 + **/ + private Feedback zhsd; + /** + * 分类所得 + **/ + private Feedback flsd; + /** + * 非居民所得 + **/ + private Feedback fjmsd; + /** + * 限售股所得 + **/ + private Feedback xsgsd; + } + + /** + * 反馈结果 + **/ + @Data + public static class Feedback { + /** + * 申报类型代码 + */ + private String sblxdm; + /** + * 申报类型名称 + */ + private String sblxmc; + /** + * 缴款凭证序号 + */ + private String jkpzxh; + /** + * 首次打印时间 + */ + private String dysj; + /** + * 纳税人识别号 + */ + private String nsrsbh; + /** + * 纳税人名称 + */ + private String nsrxm; + /** + * 税务机关代码 + */ + private String swjgdm; + /** + * 税务机关名称 + */ + private String swjgmc; + /** + * 税款限缴日期 + */ + private String xjrq; + /** + * 金额合计(小写) + */ + private String xxjehj; + /** + * 金额合计(大写) + */ + private String dxjehj; + /** + * 备注 + */ + private String bz; + /** + * 打印次数 + */ + private String dycs; + /** + * 缴款凭证明细列表 + */ + private List jkpzmxlb; + /** + * 反馈状态 0:成功 1:失败 + */ + private String fkzt; + /** + * 反馈描述 + */ + private String fkms; + } + + @Data + public static class Detail { + /** + * 扣款反馈代码 + */ + private String zsxmmc; + /** + * 扣款名称 + */ + private String zspmmc; + /** + * 实缴税额 + */ + private String yjse; + } +} diff --git a/src/com/engine/salary/util/HttpUtil.java b/src/com/engine/salary/util/HttpUtil.java new file mode 100644 index 000000000..6f99cf590 --- /dev/null +++ b/src/com/engine/salary/util/HttpUtil.java @@ -0,0 +1,249 @@ +package com.engine.salary.util; + + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.AuthSchemes; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.util.EntityUtils; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.Arrays; +import java.util.Collections; +import java.util.Map; + +/** + * Http调用处理类 + * + * @author Terry + */ +@Slf4j +public class HttpUtil { + + public static final String TEXT_TYPE = "text/plain"; + public static final String JSON_TYPE = "application/json"; + public static final String XML_TYPE = "text/xml"; + public static final String HTML_TYPE = "text/html"; + + public static final String EXCEL_TYPE = "application/vnd.ms-excel"; + public static final String STREAM_TYPE = "application/octet-stream"; + public static final int SLEEP_TIME = 1000; + public static final int IAS_SUCCESS = 400; + + public static HttpClient httpsTrustClient() { + try { + // 在调用SSL之前需要重写验证方法,取消检测SSL + X509TrustManager trustManager = new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] xcs, String str) { + } + + @Override + public void checkServerTrusted(X509Certificate[] xcs, String str) { + } + }; + SSLContext ctx = SSLContext.getInstance(SSLConnectionSocketFactory.TLS); + ctx.init(null, new TrustManager[]{trustManager}, null); + SSLConnectionSocketFactory socketFactory = + new SSLConnectionSocketFactory(ctx, NoopHostnameVerifier.INSTANCE); + // 创建Registry + RequestConfig requestConfig = + RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD_STRICT).setExpectContinueEnabled(Boolean.TRUE) + .setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST)) + .setProxyPreferredAuthSchemes(Collections.singletonList(AuthSchemes.BASIC)).build(); + Registry socketFactoryRegistry = RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.INSTANCE).register("https", socketFactory).build(); + // 创建ConnectionManager,添加Connection配置信息 + PoolingHttpClientConnectionManager connectionManager = + new PoolingHttpClientConnectionManager(socketFactoryRegistry); + + return HttpClients.custom().setConnectionManager(connectionManager) + .setDefaultRequestConfig(requestConfig).build(); + } catch (KeyManagementException | NoSuchAlgorithmException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 获取 HttpClient + * + * @param path + * @return + */ + public static HttpClient wrapClient(String path) { + HttpClient httpClient = HttpClientBuilder.create().build(); + if (path != null && path.startsWith("https://")) { + return httpsTrustClient(); + } + return httpClient; + } + + /** + * 设置http超时时间 + * + * @param requestConfig + * @return + */ + private static RequestConfig setTimeOutConfig(RequestConfig requestConfig) { + if (requestConfig == null) { + requestConfig = RequestConfig.DEFAULT; + } + return RequestConfig.copy(requestConfig).setConnectionRequestTimeout(900000).setConnectTimeout(900000) + .setSocketTimeout(900000).build(); + } + + /** + * get 请求 + * + * @param url + * @param header + * @param params + * @return + */ + public static String getRequest(String url, Map header, Map params) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + + StringBuilder urlStr = new StringBuilder(); + urlStr.append(url).append("?"); + + int i = params.size(); + for (Map.Entry map : params.entrySet()) { + urlStr.append(map.getKey()).append("=").append(map.getValue()); + if ((--i) == 0) { + continue; + } + urlStr.append("&"); + } + try { + httpClient = (CloseableHttpClient) wrapClient(url); + HttpGet httpGet = new HttpGet(urlStr.toString()); + if (null != header && !header.isEmpty()) { + for (String key : header.keySet()) { + httpGet.setHeader(key, header.get(key)); + } + } + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(20000) + .setConnectionRequestTimeout(20000).setSocketTimeout(40000).build(); + httpGet.setConfig(requestConfig); + response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + result = EntityUtils.toString(entity); + httpGet.abort(); + EntityUtils.consume(entity); + } catch (IOException e) { + log.error("发起GET请求失败", e); + result = getTimeoutErrorResponse(result, e); + } finally { + if (null != response) { + try { + httpClient.close(); + response.close(); + } catch (IOException e) { + log.error("发起GET请求失败", e); + } + } + + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + log.error("发起GET请求失败", e); + } + } + } + return result; + } + + /** + * HTTP Post 获取内容 + * + * @param url 请求的url地址 ?之前的地址 + * @param params 请求的参数 + * @param header 编码格式 + * @return 页面内容 + */ + public static String doPost(String url, Map header, String params, String contentType) { + String result = null; + try { + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("Connection", "close"); + httpPost.setConfig(setTimeOutConfig(httpPost.getConfig())); + httpPost.setHeader("Content-Type", contentType); + if (null != header && !header.isEmpty()) { + for (String key : header.keySet()) { + httpPost.setHeader(key, header.get(key)); + } + } + if (null != params) { + httpPost.setEntity(new StringEntity(params, Consts.UTF_8)); + } + HttpClient httpClient = wrapClient(url); + HttpResponse response = httpClient.execute(httpPost); + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + httpPost.abort(); + throw new RuntimeException("HttpClient,error status code :" + statusCode); + } + HttpEntity entity = response.getEntity(); + if (entity != null) { + result = EntityUtils.toString(entity, Consts.UTF_8); + } + EntityUtils.consume(entity); + httpPost.abort(); + return result; + } catch (Exception e) { + log.error("发起POST请求失败", e); + result = getTimeoutErrorResponse(result, e); + } + return result; + } + + private static String getTimeoutErrorResponse(String result, Exception e) { + if (e instanceof ConnectTimeoutException) { + BaseResponse baseResponse = new BaseResponse(); + SzyhResponseHead head = new SzyhResponseHead(); + head.setCode("-1"); + head.setMsg(SalaryI18nUtil.getI18nLabel(184072, "抱歉,系统因网络原因无法访问税局个税系统,此功能暂时无法使用,请确保网络情况正常且允许访问外网")); + head.setDesc("失败"); + head.setStatus("N"); + baseResponse.setHead(head); + result = JsonUtil.toJsonString(baseResponse); + } + return result; + } +} From e75d5ab4271b25d4ea16154ca454dba18d0515b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 20 Jul 2023 09:58:27 +0800 Subject: [PATCH 004/298] v1 --- resource/sql/个税对接表.sql | 2 + resource/sqlupgrade/DM/sql202307180103.sql | 34 + resource/sqlupgrade/DM/sql202307180203.sql | 38 ++ resource/sqlupgrade/DM/sql202307180403.sql | 31 + resource/sqlupgrade/GS/sql202307180103.sql | 34 + resource/sqlupgrade/GS/sql202307180203.sql | 38 ++ resource/sqlupgrade/GS/sql202307180403.sql | 31 + resource/sqlupgrade/JC/sql202307180103.sql | 34 + resource/sqlupgrade/JC/sql202307180203.sql | 38 ++ resource/sqlupgrade/JC/sql202307180403.sql | 31 + resource/sqlupgrade/Mysql/sql202307170503.sql | 8 + resource/sqlupgrade/Mysql/sql202307180103.sql | 33 + resource/sqlupgrade/Mysql/sql202307180203.sql | 37 + resource/sqlupgrade/Mysql/sql202307180403.sql | 30 + .../sqlupgrade/Oracle/sql202307180103.sql | 33 + .../sqlupgrade/Oracle/sql202307180203.sql | 37 + .../sqlupgrade/Oracle/sql202307180403.sql | 30 + resource/sqlupgrade/PG/sql202307180103.sql | 33 + resource/sqlupgrade/PG/sql202307180203.sql | 37 + resource/sqlupgrade/PG/sql202307180403.sql | 30 + .../sqlupgrade/SQLServer/sql202307180103.sql | 33 + .../sqlupgrade/SQLServer/sql202307180203.sql | 37 + .../sqlupgrade/SQLServer/sql202307180403.sql | 30 + resource/sqlupgrade/ST/sql202307180103.sql | 34 + resource/sqlupgrade/ST/sql202307180203.sql | 38 ++ resource/sqlupgrade/ST/sql202307180403.sql | 31 + .../web/TaxAgentTaxReturnController.java | 7 + src/com/engine/salary/common/OptionDTO.java | 26 + .../common/taxdeclare/AsyncRequestIdDTO.java | 18 + .../QuerySpecialAmountFeedbackResponse.java | 140 ++++ .../response/QuerySpecialAmountResponse.java | 34 + .../taxagent/bo/TaxAgentTaxReturnBO.java | 100 +++ .../dto/TaxAgentTaxReturnCheckDTO.java | 48 ++ .../dto/TaxAgentTaxReturnCheckFormDTO.java | 74 ++ .../dto/TaxAgentTaxReturnListDTO.java | 56 ++ .../dto/TaxAgentTaxReturnMainFormDTO.java | 73 ++ .../dto/TaxAgentTaxReturnResultDTO.java | 48 ++ .../param/TaxAgentTaxReturnSaveParam.java | 93 +++ .../taxagent/po/TaxAgentTaxReturnPO.java | 151 +++++ .../entity/taxapiflow/bo/TaxApiFlowBO.java | 146 ++++ .../dto/CreateMessageRuleParamDTO.java | 35 + .../TaxDeclarationApiFlowRecordListDTO.java | 62 ++ ...larationApiFlowStatisticDetailListDTO.java | 41 ++ ...TaxDeclarationApiFlowStatisticListDTO.java | 40 ++ .../dto/TaxDeclarationApiFlowTotalDTO.java | 38 ++ ...axDeclarationApiFlowWarnConfigFormDTO.java | 49 ++ ...DeclarationApiFlowWarnReceiverFormDTO.java | 45 ++ ...DeclarationApiFlowWarnReceiverListDTO.java | 42 ++ .../TaxDeclarationBillingConfigFormDTO.java | 37 + .../param/CreateMessageRuleParam.java | 23 + .../TaxDeclarationApiFlowMonthQueryParam.java | 50 ++ ...TaxDeclarationApiFlowRecordQueryParam.java | 40 ++ ...DeclarationApiFlowWarnConfigSaveParam.java | 40 ++ ...clarationApiFlowWarnReceiverSaveParam.java | 36 + .../TaxDeclarationBillingConfigSaveParam.java | 35 + .../po/TaxDeclarationApiFlowRecordPO.java | 100 +++ .../po/TaxDeclarationApiFlowWarnConfigPO.java | 73 ++ .../TaxDeclarationApiFlowWarnReceiverPO.java | 76 +++ .../response/QueryAccountBalanceResponse.java | 52 ++ .../QueryDetailsByTaxNumberResponse.java | 52 ++ .../bo/TaxDeclarationCommon.java | 167 +++++ .../bo/TaxDeclarationGenerateResult.java | 29 + .../bo/TaxDeclarationRequest.java | 165 +++++ .../bo/TaxDeclarationResult.java | 34 + .../bo/TaxDeclarationStrategy.java | 21 + .../bo/TaxDeclarationValueList.java | 115 ++++ .../taxdeclaration/bo/TaxDeclareContext.java | 60 ++ .../bo/TaxDeclareEmployeeBO.java | 88 +++ .../taxdeclaration/bo/TaxDeclareRequest.java | 41 ++ .../dto/AbnormalEmployeeListDTO.java | 78 +++ .../dto/FailEmployeeListDTO.java | 71 ++ .../dto/TaxDeclarationRateDTO.java | 33 + .../dto/TaxDeclarationTabDTO.java | 30 + .../dto/TaxDeclarationValueListDTO.java | 30 + .../dto/TaxDeclareRecordFormDTO.java | 64 ++ .../dto/TaxDeclareRecordListDTO.java | 121 ++++ .../param/AbnormalEmployeeListQueryParam.java | 33 + .../TaxDeclarationValueListQueryParam.java | 31 + .../param/TaxDeclareRecordParam.java | 18 + .../po/TaxDeclarationApiConfigPO.java | 90 +++ .../po/TaxDeclarationApiProfilePO.java | 65 ++ .../po/TaxDeclarationValuePO.java | 80 +++ .../po/TaxDeclareEmployeePO.java | 21 + .../taxdeclaration/po/TaxDeclareFailPO.java | 57 ++ .../taxdeclaration/po/TaxDeclareRecordPO.java | 111 +++ .../taxdeclaration/po/TaxReportColumnPO.java | 45 ++ .../CancelDeclareFeedbackResponse.java | 24 + .../response/CancelDeclareResponse.java | 23 + .../response/DeclareTaxFeedbackResponse.java | 24 + .../response/DeclareTaxResponse.java | 23 + .../response/UpdateDeclareResponse.java | 21 + .../taxpayment/dto/TaxAgreementFormDTO.java | 3 +- .../taxpayment/dto/TaxAmountFormDTO.java | 116 ++-- .../taxpayment/dto/TaxPayTypeFormDTO.java | 12 - .../dto/TaxWithholdingVoucherFeedbackDTO.java | 2 +- .../param/TaxPaymentQueryParam.java | 3 +- .../taxpayment/po/TaxPaymentRequestPO.java | 34 +- .../engine/salary/enums/SalaryOnOffEnum.java | 11 + .../TaxAgentTaxReturnCheckTypeEnum.java | 51 ++ .../TaxAgentTaxReturnPasswordTypeEnum.java | 59 ++ .../taxagent/TaxAgentTaxReturnStatusEnum.java | 57 ++ .../CancelDeclareStatusEnum.java | 44 ++ .../DeclareFeedBackStatusEnum.java | 46 ++ .../EnumDeclareApiBusinessType.java | 45 ++ .../taxdeclaration/TaxAgentRangeEnum.java | 44 ++ .../TaxDeclareApiProfileEnum.java | 42 ++ .../taxdeclaration/TaxDeclareStatusEnum.java | 49 ++ .../taxdeclaration/TaxDeclareTypeEnum.java | 43 ++ .../TaxPaymentServiceTypeEnum.java | 59 ++ .../taxdeclaration/TaxPaymentStatusEnum.java | 53 ++ .../taxdeclaration/TaxPaymentTypeEnum.java | 57 ++ .../formlua/entity/parameter/ExcelFuncs.java | 633 +++++++++--------- .../entity/parameter/FuncDescUtil.java | 2 +- .../taxagent/TaxAgentTaxReturnMapper.java | 72 ++ .../taxagent/TaxAgentTaxReturnMapper.xml | 422 ++++++++++++ .../TaxDeclarationApiFlowRecordMapper.java | 21 + .../TaxDeclarationApiFlowRecordMapper.xml | 92 +++ .../TaxDeclarationApiFlowRecordMapper.java | 23 + .../TaxDeclarationApiFlowRecordMapper.xml | 92 +++ ...TaxDeclarationApiFlowWarnConfigMapper.java | 13 + .../TaxDeclarationApiProfileMapper.java | 67 ++ .../TaxDeclarationApiProfileMapper.xml | 200 ++++++ .../TaxDeclareApiConfigMapper.java | 75 +++ .../TaxDeclareApiConfigMapper.xml | 230 +++++++ .../TaxAgentTaxReturnCheckService.java | 48 ++ .../service/TaxAgentTaxReturnService.java | 56 ++ .../TaxDeclarationApiBillingService.java | 50 ++ .../TaxDeclarationApiConfigService.java | 44 ++ .../TaxDeclarationApiFlowWarnService.java | 99 +++ .../factory/SalaryCalcRunServiceFactory.java | 50 ++ .../TaxAgentTaxReturnCheckServiceFactory.java | 47 ++ .../factory/TaxPaymentServiceFactory.java | 33 + ...AbstractTaxAgentTaxReturnCheckService.java | 203 ++++++ .../impl/TaxAgentTaxReturnServiceImpl.java | 53 ++ .../TaxDeclarationApiBillingServiceImpl.java | 225 +++++++ .../TaxDeclarationApiConfigServiceImpl.java | 127 ++++ .../TaxDeclarationApiFlowWarnServiceImpl.java | 257 +++++++ .../TaxReturnCheckDepartmentServiceImpl.java | 43 ++ .../impl/TaxReturnCheckMainServiceImpl.java | 87 +++ ...TaxReturnCheckRegistrationServiceImpl.java | 44 ++ .../engine/salary/util/SingnatureData.java | 90 +++ src/com/engine/salary/util/Sm4Utils.java | 190 ++++++ .../web/TaxAgentTaxReturnController.java | 93 +++ .../wrapper/TaxAgentTaxReturnWrapper.java | 152 +++++ .../TaxDeclarationApiFlowBillingWrapper.java | 77 +++ 145 files changed, 9048 insertions(+), 407 deletions(-) create mode 100644 resource/sql/个税对接表.sql create mode 100644 resource/sqlupgrade/DM/sql202307180103.sql create mode 100644 resource/sqlupgrade/DM/sql202307180203.sql create mode 100644 resource/sqlupgrade/DM/sql202307180403.sql create mode 100644 resource/sqlupgrade/GS/sql202307180103.sql create mode 100644 resource/sqlupgrade/GS/sql202307180203.sql create mode 100644 resource/sqlupgrade/GS/sql202307180403.sql create mode 100644 resource/sqlupgrade/JC/sql202307180103.sql create mode 100644 resource/sqlupgrade/JC/sql202307180203.sql create mode 100644 resource/sqlupgrade/JC/sql202307180403.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307170503.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307180103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307180203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307180403.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307180103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307180203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307180403.sql create mode 100644 resource/sqlupgrade/PG/sql202307180103.sql create mode 100644 resource/sqlupgrade/PG/sql202307180203.sql create mode 100644 resource/sqlupgrade/PG/sql202307180403.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307180103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307180203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307180403.sql create mode 100644 resource/sqlupgrade/ST/sql202307180103.sql create mode 100644 resource/sqlupgrade/ST/sql202307180203.sql create mode 100644 resource/sqlupgrade/ST/sql202307180403.sql create mode 100644 src/com/api/salary/web/TaxAgentTaxReturnController.java create mode 100644 src/com/engine/salary/common/OptionDTO.java create mode 100644 src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java create mode 100644 src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java create mode 100644 src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java create mode 100644 src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java create mode 100644 src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java create mode 100644 src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java create mode 100644 src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java create mode 100644 src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java create mode 100644 src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java create mode 100644 src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java create mode 100644 src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml create mode 100644 src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java create mode 100644 src/com/engine/salary/service/TaxAgentTaxReturnService.java create mode 100644 src/com/engine/salary/service/TaxDeclarationApiBillingService.java create mode 100644 src/com/engine/salary/service/TaxDeclarationApiConfigService.java create mode 100644 src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java create mode 100644 src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java create mode 100644 src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java create mode 100644 src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java create mode 100644 src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java create mode 100644 src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java create mode 100644 src/com/engine/salary/util/SingnatureData.java create mode 100644 src/com/engine/salary/util/Sm4Utils.java create mode 100644 src/com/engine/salary/web/TaxAgentTaxReturnController.java create mode 100644 src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java create mode 100644 src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java diff --git a/resource/sql/个税对接表.sql b/resource/sql/个税对接表.sql new file mode 100644 index 000000000..18eaca552 --- /dev/null +++ b/resource/sql/个税对接表.sql @@ -0,0 +1,2 @@ +hrsa_tax_declare_api_profile + diff --git a/resource/sqlupgrade/DM/sql202307180103.sql b/resource/sqlupgrade/DM/sql202307180103.sql new file mode 100644 index 000000000..86cf943b7 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/DM/sql202307180203.sql b/resource/sqlupgrade/DM/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/DM/sql202307180403.sql b/resource/sqlupgrade/DM/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/GS/sql202307180103.sql b/resource/sqlupgrade/GS/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/GS/sql202307180203.sql b/resource/sqlupgrade/GS/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/GS/sql202307180403.sql b/resource/sqlupgrade/GS/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/JC/sql202307180103.sql b/resource/sqlupgrade/JC/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/JC/sql202307180203.sql b/resource/sqlupgrade/JC/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/JC/sql202307180403.sql b/resource/sqlupgrade/JC/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202307170503.sql b/resource/sqlupgrade/Mysql/sql202307170503.sql new file mode 100644 index 000000000..34a291882 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307170503.sql @@ -0,0 +1,8 @@ +alter table hrsa_tax_agent add tax_cycle_type int +; + +alter table hrsa_tax_agent modify column tax_cycle_type int default 3 +; + +update hrsa_tax_agent set tax_cycle_type = 3 where tax_cycle_type is null +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180103.sql b/resource/sqlupgrade/Mysql/sql202307180103.sql new file mode 100644 index 000000000..7464e0877 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + api_profile int comment 'ӿڻ' +) +; + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +; + +create table hrsa_tax_payment_request +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint not null comment '˰۽ID' , + tax_declare_record_id bigint comment '˰걨¼' , + tax_year_month date not null comment '˰' , + request_id varchar(50) not null comment 'id' , + request_type int not null comment '' +) +; + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180203.sql b/resource/sqlupgrade/Mysql/sql202307180203.sql new file mode 100644 index 000000000..ee05310cf --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + host varchar(255) comment 'ӿhost' , + app_key varchar(255) comment 'appKey' , + app_secret varchar(255) comment 'appSecret' +) +; + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +; + +alter table hrsa_tax_declare_api_config modify host varchar(255) not null +; + +alter table hrsa_tax_declare_api_config modify app_key varchar(255) not null +; + +alter table hrsa_tax_declare_api_config modify app_secret varchar(255) not null +; + +alter table hrsa_tax_declare_api_config add enable_use int +; + +alter table hrsa_tax_declare_api_config add totality bigint +; + +alter table hrsa_tax_declare_api_config add remain bigint +; + +alter table hrsa_tax_declare_api_config add last_update_time datetime +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180403.sql b/resource/sqlupgrade/Mysql/sql202307180403.sql new file mode 100644 index 000000000..a063f8f8d --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint not null comment '˰۽ID' , + tax_code varchar(50) not null comment '˰' , + tax_registration_number varchar(50) not null comment 'Ǽ' , + department_code varchar(50) comment 'ű' , + department_name varchar(50) comment '' , + nation varchar(50) comment '' , + province varchar(50) comment 'ʡ' , + city varchar(50) comment 'м' , + area_code varchar(50) not null comment '' , + password_type int(2) not null comment 'У' , + real_account varchar(50) comment 'ʵ˺' , + pwd varchar(50) not null comment '' , + check_status int(2) not null comment '˰֤״̬' , + fail_reason varchar(255) comment 'һ֤ʧԭ' +) +; + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +; + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180103.sql b/resource/sqlupgrade/Oracle/sql202307180103.sql new file mode 100644 index 000000000..c0a1672eb --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +) +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +) +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180203.sql b/resource/sqlupgrade/Oracle/sql202307180203.sql new file mode 100644 index 000000000..6ab4e5d58 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +) +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +/ + +alter table hrsa_tax_declare_api_config modify host not null +/ + +alter table hrsa_tax_declare_api_config modify app_key not null +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null +/ + +alter table hrsa_tax_declare_api_config add enable_use int +/ + +alter table hrsa_tax_declare_api_config add totality number +/ + +alter table hrsa_tax_declare_api_config add remain number +/ + +alter table hrsa_tax_declare_api_config add last_update_time date +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180403.sql b/resource/sqlupgrade/Oracle/sql202307180403.sql new file mode 100644 index 000000000..b713207b6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +) +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180103.sql b/resource/sqlupgrade/PG/sql202307180103.sql new file mode 100644 index 000000000..bae5ae375 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_declare_record_id bigint, + tax_year_month date not null, + request_id varchar(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180203.sql b/resource/sqlupgrade/PG/sql202307180203.sql new file mode 100644 index 000000000..367cd19a4 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + host varchar(255), + app_key varchar(255), + app_secret varchar(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config alter column host set not null ; +/ + +alter table hrsa_tax_declare_api_config alter column app_key set not null ; +/ + +alter table hrsa_tax_declare_api_config alter column app_secret set not null ; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality bigint; +/ + +alter table hrsa_tax_declare_api_config add remain bigint; +/ + +alter table hrsa_tax_declare_api_config add last_update_time timestamp; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180403.sql b/resource/sqlupgrade/PG/sql202307180403.sql new file mode 100644 index 000000000..bc4ebcfa6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_code varchar(50) not null, + tax_registration_number varchar(50) not null, + department_code varchar(50), + department_name varchar(50), + nation varchar(50), + province varchar(50), + city varchar(50), + area_code varchar(50) not null, + password_type int not null, + real_account varchar(50), + pwd varchar(50) not null, + check_status int not null, + fail_reason varchar(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180103.sql b/resource/sqlupgrade/SQLServer/sql202307180103.sql new file mode 100644 index 000000000..d69852a1e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + api_profile int +) +GO + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +GO + +create table hrsa_tax_payment_request +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_declare_record_id bigint, + tax_year_month datetime not null, + request_id nvarchar(50) not null, + request_type int not null +) +GO + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180203.sql b/resource/sqlupgrade/SQLServer/sql202307180203.sql new file mode 100644 index 000000000..06b82d4db --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + host nvarchar(255), + app_key nvarchar(255), + app_secret nvarchar(255) +) +GO + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +GO + +alter table hrsa_tax_declare_api_config alter column host nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config alter column app_key nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config alter column app_secret nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config add enable_use int +GO + +alter table hrsa_tax_declare_api_config add totality bigint +GO + +alter table hrsa_tax_declare_api_config add remain bigint +GO + +alter table hrsa_tax_declare_api_config add last_update_time datetime +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180403.sql b/resource/sqlupgrade/SQLServer/sql202307180403.sql new file mode 100644 index 000000000..8d807cf33 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_code nvarchar(50) not null, + tax_registration_number nvarchar(50) not null, + department_code nvarchar(50), + department_name nvarchar(50), + nation nvarchar(50), + province nvarchar(50), + city nvarchar(50), + area_code nvarchar(50) not null, + password_type int not null, + real_account nvarchar(50) , + pwd nvarchar(50) not null, + check_status int not null, + fail_reason nvarchar(255) +) +GO + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +GO + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202307180103.sql b/resource/sqlupgrade/ST/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/ST/sql202307180203.sql b/resource/sqlupgrade/ST/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/ST/sql202307180403.sql b/resource/sqlupgrade/ST/sql202307180403.sql new file mode 100644 index 000000000..3a72f6ecc --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) not null, + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/src/com/api/salary/web/TaxAgentTaxReturnController.java b/src/com/api/salary/web/TaxAgentTaxReturnController.java new file mode 100644 index 000000000..85af9c074 --- /dev/null +++ b/src/com/api/salary/web/TaxAgentTaxReturnController.java @@ -0,0 +1,7 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/taxAgent/taxReturn") +public class TaxAgentTaxReturnController extends com.engine.salary.web.TaxAgentTaxReturnController{ +} diff --git a/src/com/engine/salary/common/OptionDTO.java b/src/com/engine/salary/common/OptionDTO.java new file mode 100644 index 000000000..6ec60f48c --- /dev/null +++ b/src/com/engine/salary/common/OptionDTO.java @@ -0,0 +1,26 @@ +package com.engine.salary.common; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 人员选项 + * + * @author chengliming + * @date: 2022-09-06 16:57:23 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel("人员选项") +public class OptionDTO { + + @ApiModelProperty("人员ID") + private String id; + + @ApiModelProperty("人员姓名") + private String content; +} diff --git a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java new file mode 100644 index 000000000..6f20b5f65 --- /dev/null +++ b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java @@ -0,0 +1,18 @@ +package com.engine.salary.common.taxdeclare; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 异步接口中的requestId + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/10/25 4:50 PM + * @version:v1.0 + */ +@Data +public class AsyncRequestIdDTO { + + @ApiModelProperty("异步接口中的requestId") + private String requestId; +} diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java new file mode 100644 index 000000000..f94fe1cf0 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java @@ -0,0 +1,140 @@ +package com.engine.salary.entity.datacollection.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 人员专项附加扣除信息查询结果 + * + * @author chengliming + * @date 2022-10-27 10:00 AM + **/ +@Data +public class QuerySpecialAmountFeedbackResponse extends BaseResponse { + + /** + * 返回数据 + */ + private Body body; + + + /** + * 人员专项附加扣除信息查询反馈结果body + */ + @Data + public static class Body { + /** + * 结果列表 + */ + private List ryxxlb; + } + + /** + * 人员专项附加扣除信息查询反馈结果 + **/ + @Data + public static class Feedback { + /** + * 员工姓名 + */ + private String xm; + + /** + * 证件类型 + */ + private String zzlx; + + /** + * 证件号码 + */ + private String zzhm; + + /** + * 代报状态 + */ + private String sbzt; + + /** + * 失败原因 + */ + private String sbyy; + + /** + * 累计子女教育支出 + */ + private BigDecimal ljznjyzc; + + /** + * 累计租房租金支出 + */ + private BigDecimal ljzfzjzc; + + /** + * 累计住房贷款利息支出 + */ + private BigDecimal ljzfdklxzc; + + /** + * 累计赡养老人支出 + */ + private BigDecimal ljsylrzc; + + /** + * 累计继续教育支出 + */ + private BigDecimal ljjxjyzc; + + /** + * 累计非学历继续教育支出 + */ + private BigDecimal ljfxljxjyzc; + + /** + * 累计学历继续教育支出 + */ + private BigDecimal ljxljxjyzc; + + /** + * 累计3岁以下婴幼儿照护支出 + */ + private BigDecimal ljyyezhzc; + + /** + * 子女教育支出 + */ + private BigDecimal znjyzc; + + /** + * 赡养老人支出 + */ + private BigDecimal sylrzc; + + /** + * 住房贷款利息支出 + */ + private BigDecimal zfdklxzc; + + /** + * 住房租金支出 + */ + private BigDecimal zfzjzc; + + /** + * 继续教育支出 + */ + private BigDecimal jxjyzc; + + /** + * 非学历继续教育支出 + */ + private BigDecimal fxljxjyzc; + + /** + * 3岁以下婴幼儿照护支出 + */ + private BigDecimal yyezhzc; + } +} diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java new file mode 100644 index 000000000..9dfbc2cec --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.datacollection.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +/** + * 人员专项附加扣除信息查询结果 + * + * @author chengliming + * @date 2022-10-27 10:00 AM + **/ +@Data +public class QuerySpecialAmountResponse extends BaseResponse { + + /** + * 返回数据 + */ + private QuerySpecialAmountBody body; + + /** + * 人员专项附加扣除信息查询结果body + **/ + @Data + public static class QuerySpecialAmountBody { + /** + * 请求查询ID + */ + private String requestId; + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + } +} diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java new file mode 100644 index 000000000..c19abcd52 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -0,0 +1,100 @@ +package com.engine.salary.entity.taxagent.bo; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +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.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.Sm4Utils; +import dm.jdbc.util.IdGenerator; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * 报税信息BO + * + * @author chengliming + * @date: 2022-09-02 11:06:41 + */ +public class TaxAgentTaxReturnBO { + + public static TaxAgentTaxReturnMainFormDTO convertPo2FormDto(TaxAgentTaxReturnPO taxReturnPO) { + return new TaxAgentTaxReturnMainFormDTO() + .setId(taxReturnPO.getId()) + .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.parseByValue(taxReturnPO.getPasswordType())) + .setCity(taxReturnPO.getCity()) + .setProvince(taxReturnPO.getProvince()) + .setNation(taxReturnPO.getNation()) + .setAreaCode(taxReturnPO.getAreaCode()) + .setTaxCode(taxReturnPO.getTaxCode()) + .setAccount(taxReturnPO.getRealAccount()) + .setNetPassword(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null) + .setRealNamePassword(TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null) + .setTaxRegistrationNumber(taxReturnPO.getTaxRegistrationNumber()) + .setDepartmentCode(taxReturnPO.getDepartmentCode()) + .setCheckStatus(TaxAgentTaxReturnStatusEnum.parseByValue(taxReturnPO.getCheckStatus())) + .setFailReason(taxReturnPO.getFailReason()); + } + + public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + return TaxAgentTaxReturnPO.builder() + .taxAgentId(saveParam.getTaxAgentId()) + .taxCode(saveParam.getTaxCode()) + .nation(saveParam.getNation()) + .city(saveParam.getCity()) + .province(saveParam.getProvince()) + .areaCode(saveParam.getAreaCode()) + .realAccount(saveParam.getAccount()) + .passwordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + .pwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + .failReason("") + .id(IdGenerator.generate()) + .checkStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(LocalDateTime.now()) + .updateTime(LocalDateTime.now()) + .build(); + } + + public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + po.setTaxCode(saveParam.getTaxCode()) + .setNation(saveParam.getNation()) + .setCity(saveParam.getCity()) + .setProvince(saveParam.getProvince()) + .setAreaCode(saveParam.getAreaCode()) + .setRealAccount(saveParam.getAccount()) + .setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + .setTaxAgentId(saveParam.getTaxAgentId()) + .setUpdateTime(LocalDateTime.now()); + } + + public static Map convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) { + Map requestMap = new HashMap<>(); + requestMap.put("bizNo", UUID.randomUUID().toString().replace("-", "")); + requestMap.put("qymc", taxAgent.getName()); + requestMap.put("mmlx", taxAgentTaxReturn.getPasswordType()); + requestMap.put("smzh", taxAgentTaxReturn.getRealAccount()); + requestMap.put("smmm", taxAgentTaxReturn.getPwd()); + requestMap.put("jmsmmm", "1"); + requestMap.put("sbmm", taxAgentTaxReturn.getPwd()); + requestMap.put("jmsbmm", "1"); + requestMap.put("djxhid", taxAgentTaxReturn.getTaxRegistrationNumber()); + requestMap.put("nsrsbh", taxAgentTaxReturn.getTaxCode()); + requestMap.put("areaid", taxAgentTaxReturn.getAreaCode()); + requestMap.put("bmbh", ""); + requestMap.put("bmmc", ""); + return requestMap; + } + + @Override + public String toString() { + return super.toString(); + } +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java new file mode 100644 index 000000000..fbb47d85e --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.SalaryI18nUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + + +/** + * 税友验证成功信息 + * + * @author chengliming + * @date: 2022-08-31 15:25:44 + */ +@Data +@Accessors(chain = true) +@ApiModel("税友验证成功信息") +public class TaxAgentTaxReturnCheckDTO { + /** + * 验证状态 + * @see TaxAgentTaxReturnStatusEnum + */ + @ApiModelProperty("验证状态") + private Integer status; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("部门编号") + private String departmentCode; + + @ApiModelProperty("验证提示信息") + private String message; + + @ApiModelProperty("详细数据") + private List records; + + public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) { + this.message = message; + if (TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(status) || TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue().equals(status)) { + this.message = SalaryI18nUtil.getI18nLabel( 153350, "验证成功,报税主体信息已与税局系统进行认证确认"); + } + } +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java new file mode 100644 index 000000000..67b5a8f5e --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java @@ -0,0 +1,74 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * 税友验证信息表单 + * + * @author chengliming + * @date: 2022-08-31 15:25:44 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ApiModel("税友验证信息") +public class TaxAgentTaxReturnCheckFormDTO { + + @ApiModelProperty("税号") + private String taxCode; + + @ApiModelProperty("验证信息id") + @JsonSerialize(using = ToStringSerializer.class) + private Long index; + + @ApiModelProperty("个税扣缴义务人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @ApiModelProperty("个税扣缴义务人") + private String taxAgentName; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("纳税人状态") + private String taxpayerStatus; + + @ApiModelProperty("法人姓名") + private String legalPersonName; + + @ApiModelProperty("联系电话") + private String mobile; + + @ApiModelProperty("生产经营地址") + private String businessAddress; + + @ApiModelProperty("行业名称") + private String industryName; + + @ApiModelProperty("主管税务机关") + private String taxAuthorities; + + @ApiModelProperty("主管税务科所") + private String taxBranch; + + + @ApiModelProperty("是否分部门备案") + private SalaryOnOffEnum divideFiling; + + @ApiModelProperty("部门名称") + private String departmentName; + + @ApiModelProperty("部门编码") + private String departmentCode; +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java new file mode 100644 index 000000000..3d38a1772 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java @@ -0,0 +1,56 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 税友报税信息列表 + * + * @author chengliming + * @date: 2022-09-02 15:31:10 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//税友报税信息列表 +public class TaxAgentTaxReturnListDTO { + + //序号 + @JsonSerialize(using = ToStringSerializer.class) + private Long index; + + //税号 + private String taxCode; + + //个税扣缴义务人 + private String taxAgentName; + + //登记序号 + private String taxRegistrationNumber; + + //纳税人状态 + private String taxpayerStatus; + + //主管税务机关 + private String taxAuthorities; + + //主管税务科所 + private String taxBranch; + + //生产经营地址 + private String businessAddress; + + //行业名称 + private String industryName; + + //法人姓名 + private String legalPersonName; + + //联系电话 + private String mobile; +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java new file mode 100644 index 000000000..291f90835 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java @@ -0,0 +1,73 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 报税信息表单 + * + * @author chengliming + * @date: 2022-09-02 09:39:05 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("报税信息表单") +public class TaxAgentTaxReturnMainFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("名称") + private String name; + + @ApiModelProperty("税号") + private String taxCode; + + @ApiModelProperty("报税所属区域") + private String city; + + @ApiModelProperty("省份") + private String province; + + @ApiModelProperty("国家") + private String nation; + + @ApiModelProperty("行政区划代码") + private String areaCode; + + @ApiModelProperty("密码校验类型") + private TaxAgentTaxReturnPasswordTypeEnum passwordType; + + @ApiModelProperty("个税网报密码") + private String netPassword; + + @ApiModelProperty("实名账号") + private String account; + + @ApiModelProperty("实名账号密码") + private String realNamePassword; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("部门编码") + private String departmentCode; + + @ApiModelProperty("报税信息验证状态") + private TaxAgentTaxReturnStatusEnum checkStatus; + + @ApiModelProperty("失败原因") + private String failReason; + +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java new file mode 100644 index 000000000..24b12c7d6 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.page.PageInfo; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.Accessors; + + +/** + * 税友验证成功信息 + * + * @author chengliming + * @date: 2022-08-31 15:25:44 + */ +@Data +@Accessors(chain = true) +@Builder +//税友验证成功信息") +public class TaxAgentTaxReturnResultDTO { + + //展示类型:1、展示表单 2、展示列表 3、关闭所有tab") + private Integer compType; + + //验证状态") + private TaxAgentTaxReturnStatusEnum checkStatus; + + //失败原因") + private String failReason; + + //验证提示信息") + private String message; + + //个税扣缴义务人ID") + private String taxAgentId; + + //登记序号") + private String taxRegistrationNumber; + + //部门编号") + private String departmentCode; + + //表单") + private TaxAgentTaxReturnListDTO form; + + //列表") + private PageInfo table; +} diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java new file mode 100644 index 000000000..23dfe7a42 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java @@ -0,0 +1,93 @@ +package com.engine.salary.entity.taxagent.param; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author chengliming + * @desc: 个税扣缴义务人-报税信息-保存参数 + * @date: 2022-08-31 10:23:29 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("个税扣缴义务人-报税信息-保存参数") +public class TaxAgentTaxReturnSaveParam { + + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @ApiModelProperty("税号") + private String taxCode; + + @ApiModelProperty("登记序号") + private String taxRegistrationNumber; + + @ApiModelProperty("省级") + private String province; + + @ApiModelProperty("市级") + private String city; + + @ApiModelProperty("国家") + private String nation; + + @ApiModelProperty("密码校验类型") + private String passwordType; + + @ApiModelProperty("密码") + private String password; + + @ApiModelProperty("实名账号") + private String account; + + @ApiModelProperty("部门编码,分部门备案时填入") + private String departmentCode; + + @ApiModelProperty("部门名称,分部门备案时填入") + private String departmentName; + + @ApiModelProperty("请求类型 1.保存并验证 2.仅保存") + private Integer requestType = 1; + + @ApiModelProperty("验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码") + @JsonIgnore + private Integer type; + + @ApiModelProperty("地区编码") + private String areaCode; + + public void checkParam() { + String notEmpty = SalaryI18nUtil.getI18nLabel(100577, "不能为空"); + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "个税扣缴义务人id不能为空")); + SalaryAssert.notBlank(this.taxCode, SalaryI18nUtil.getI18nLabel(144388, "税号") + notEmpty); + SalaryAssert.notBlank(this.nation, SalaryI18nUtil.getI18nLabel(144408, "国家") + notEmpty); + SalaryAssert.notBlank(this.province, SalaryI18nUtil.getI18nLabel(144407, "省份") + notEmpty); + SalaryAssert.notBlank(this.city, SalaryI18nUtil.getI18nLabel(144388, "城市") + notEmpty); + SalaryAssert.notNull(this.passwordType, SalaryI18nUtil.getI18nLabel(144390, "密码校验类型") + notEmpty); + if (TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.toString().equals(this.passwordType)) { + SalaryAssert.notBlank(this.password, SalaryI18nUtil.getI18nLabel(144391, "个税网报密码") + notEmpty); + } + if (TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.toString().equals(this.passwordType)) { + SalaryAssert.notBlank(this.password, SalaryI18nUtil.getI18nLabel(144392, "实名账号密码") + notEmpty); + } + } + + public void checkParam4Registration() { + String notEmpty = SalaryI18nUtil.getI18nLabel(100577, "不能为空"); + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "个税扣缴义务人id不能为空")); + SalaryAssert.notBlank(this.taxCode, SalaryI18nUtil.getI18nLabel(144388, "税号") + notEmpty); + SalaryAssert.notBlank(this.taxRegistrationNumber, SalaryI18nUtil.getI18nLabel(144400, "登记序号") + notEmpty); + } + + public void checkParam4Department() { + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "个税扣缴义务人id不能为空")); + } +} diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java new file mode 100644 index 000000000..98bafb451 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -0,0 +1,151 @@ +package com.engine.salary.entity.taxagent.po; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 个税扣缴义务人-报税信息 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_agent_tax_return +public class TaxAgentTaxReturnPO implements Serializable { + + private static final long serialVersionUID = -5077833887846911337L; + + /** + * 主键id + */ + private Long id; + + /** + * 个税扣缴义务人ID + */ + private Long taxAgentId; + + /** + * 税号 + */ + private String taxCode; + + /** + * 登记序号 + */ + private String taxRegistrationNumber; + + /** + * 部门编号 + */ + private String departmentCode; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 国家 + */ + private String nation; + + /** + * 省份 + */ + private String province; + + /** + * 省级行政编码 + */ + private String provinceCode; + + /** + * 市级 + */ + private String city; + + /** + * 市级 + */ + private String cityCode; + + /** + * 行政区划代码 + */ + private String areaCode; + + /** + * 密码校验类型 + * + * @see TaxAgentTaxReturnPasswordTypeEnum + */ + private Integer passwordType; + + /** + * 实名账号 + */ + private String realAccount; + + /** + * 密码 + */ + private String pwd; + + /** + * 税友验证状态 + * + * @see TaxAgentTaxReturnStatusEnum + */ + private Integer checkStatus; + + /** + * 最近一次验证失败原因 + */ + private String failReason; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + + //查询条件 + private Collection taxAgentIds; + private Collection taxCodes; +} diff --git a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java new file mode 100644 index 000000000..879f68bb5 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java @@ -0,0 +1,146 @@ +//package com.engine.salary.entity.taxapiflow.bo; +// +//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +//import com.engine.salary.enums.sicategory.DeleteTypeEnum; +//import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +//import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; +//import com.weaver.hrm.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +//import com.weaver.hrm.salary.util.SalaryDateUtil; +//import com.weaver.hrm.salary.util.SalaryEnumUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.mc.api.entity.*; +//import com.weaver.mc.util.StringUtils; +//import com.weaver.teams.domain.EntityType; +// +//import java.time.LocalDate; +//import java.time.LocalDateTime; +//import java.util.*; +//import java.util.concurrent.atomic.AtomicInteger; +// +///** +// * @author chengliming +// * @date 2022-11-16 1:41 PM +// **/ +//public class TaxApiFlowBO { +// +// /** +// * 流量使用情况 +// * +// * @param wrapper 包装类 +// * @param taxAgentId +// * @param employeeId +// * @return +// */ +// public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper, +// Long taxAgentId, +// Long employeeId) { +// return TaxDeclarationApiFlowRecordPO.builder() +// .id(IdGenerator.generate()) +// .deduct(null) +// .businessType(wrapper.getBusinessType().getValue()) +// .taxMonth(wrapper.getTaxYearMonth()) +// .useTime(LocalDate.now()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .employeeId(employeeId) +// .taxAgentId(taxAgentId) +// .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .tenantKey(wrapper.getTenantKey()) +// .creator(wrapper.getCurrentEmployeeId()) +// .build(); +// } +// +// public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) { +// String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId()); +// String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId()); +// String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getUsername(); +// String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getCardNum(); +// String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator()); +// String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId()); +// +// boolean isInternal = StringUtils.isNotEmpty(internalUsername); +// return TaxDeclarationApiFlowRecordListDTO.builder() +// .id(e.getId()) +// .indexNum(indexNum.getAndIncrement()) +// .createTime(SalaryDateUtil.DATE_TIME_FORMATTER.format(e.getCreateTime())) +// .taxAgentName(taxAgentName) +// .employeeName(isInternal ? internalUsername : externalUsername) +// .employeeType(isInternal ? "inside" : "external") +// .idCardNo(isInternal ? idNo : externalIdNo) +// .employeeId(e.getEmployeeId()) +// .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel()) +// .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel()) +// .creator(creator) +// .creatorId(e.getCreator()) +// .build(); +// } +// +// public static SendMessageEntity buildSendMessageEntity(TaxDeclarationApiFlowWarnConfigPO warnConfig, List receivers, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { +// String title = SalaryI18nUtil.getI18nLabel(160389, "智能算薪流量不足提醒"); +// String desc = String.format(SalaryI18nUtil.getI18nLabel(184069, "智能算薪流量已不足%s,请及时采购续费,避免次月无法使用。"), warnConfig.getThreshold()); +// Entity entity = new Entity() +// .setId(IdGenerator.generate() + "") +// .setModule(EntityType.hrmsalary.name()) +// .setName(title) +// .setCreatorId(updateWrapper.getCurrentEmployeeId()) +// .setCreateTime(new Date()); +// +// SendMessageEntity smg = new SendMessageEntity(); +// // 模块 +// smg.setModule(MessageModule.HRSA); +// // 事件 +// smg.setEvent(MessageEvent.PAYROLL); +// // 业务id +// smg.setBusinessId(warnConfig.getBusinessId().toString()); +// // 发送者 +// smg.setSender(UserEntity.SYSTEM_USER); +// // 接收者 +// smg.setReceivers(receivers); +// // 发送内容(短信&IM的自定义变量) +// Map params = new HashMap<>(); +// params.put("flowThreshold", warnConfig.getThreshold().toString()); +// smg.setDynamicParams(params); +// smg.setTitle(title); +// smg.setEntity(entity); +// smg.setText(desc); +// smg.setContent(desc); +// // 邮箱 +// EmailEntity emailEntity = new EmailEntity(); +// emailEntity.setEmailSubject(title); +// emailEntity.setEmailContent(desc); +// emailEntity.setMailUserAccountId(0); +// smg.setEmailInfo(emailEntity); +// return smg; +// } +// +// public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam, +// Long currentEmployeeId, +// String currentTenantKey) { +// saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" ")); +// saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" ")); +// return TaxDeclarationApiConfigPO.builder() +// .id(IdGenerator.generate()) +// .appKey(saveParam.getAppKey()) +// .appSecret(saveParam.getAppSecret()) +// .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .tenantKey(currentTenantKey) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .build(); +// } +// +// @Override +// public String toString() { +// return "TaxApiFlowBO{}"; +// } +//} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java new file mode 100644 index 000000000..3de26dafa --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量提醒-创建规则参数 + * + * @author chengliming + * @date 2022-11-22 11:25:48 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量提醒-创建规则参数") +public class CreateMessageRuleParamDTO { + @ApiModelProperty("模块") + @JsonSerialize(using = ToStringSerializer.class) + private Integer moduleId; + + @ApiModelProperty("事件") + @JsonSerialize(using = ToStringSerializer.class) + private Integer eventId; + + @ApiModelProperty("业务") + @JsonSerialize(using = ToStringSerializer.class) + private Long businessId; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java new file mode 100644 index 000000000..47281e693 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java @@ -0,0 +1,62 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量使用记录 + * + * @author chengliming + * @date 2022-11-21 16:51:10 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量使用记录") +public class TaxDeclarationApiFlowRecordListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("序号") + private Integer indexNum; + + @ApiModelProperty("使用时间") + private String createTime; + + @ApiModelProperty("个税扣缴义务人") + private String taxAgentName; + + @ApiModelProperty("人员") + private String employeeName; + + @ApiModelProperty("人员类型") + private String employeeType; + + @ApiModelProperty("人员id") + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + @ApiModelProperty("创建人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long creatorId; + + @ApiModelProperty("身份证号码") + private String idCardNo; + + @ApiModelProperty("接口业务") + private String businessTypeName; + + @ApiModelProperty("操作人") + private String creator; + + @ApiModelProperty("结果") + private String result; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java new file mode 100644 index 000000000..8f0897b70 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java @@ -0,0 +1,41 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量统计-月度详情 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量统计-月度详情") +public class TaxDeclarationApiFlowStatisticDetailListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @JsonIgnore + private Long taxAgentId; + + @JsonIgnore + private String taxAgentName; + + @ApiModelProperty("税款所属期") + private String taxMonth; + + @ApiModelProperty("月使用流量数") + private Integer used; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java new file mode 100644 index 000000000..f027f899d --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量统计 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量统计") +public class TaxDeclarationApiFlowStatisticListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("序号") + private Integer indexNum; + + @ApiModelProperty("个税扣缴义务人") + private String taxAgentName; + + @ApiModelProperty("个税扣缴义务人ID") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @ApiModelProperty("已使用") + private Integer used; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java new file mode 100644 index 000000000..139950acc --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java @@ -0,0 +1,38 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量统计 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量统计") +public class TaxDeclarationApiFlowTotalDTO { + @ApiModelProperty("总流量") + @JsonSerialize(using = ToStringSerializer.class) + private Long total; + + @ApiModelProperty("剩余流量") + @JsonSerialize(using = ToStringSerializer.class) + private Long remain; + + @ApiModelProperty("已使用流量") + @JsonSerialize(using = ToStringSerializer.class) + private Long used; + + @ApiModelProperty("最后更新时间") + private String lastUpdateTime; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java new file mode 100644 index 000000000..7910b6dbd --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-流量不足提醒-表单 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量不足提醒-表单") +public class TaxDeclarationApiFlowWarnConfigFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("提醒开关") + private Boolean enable; + + @ApiModelProperty("提醒规则") + private Integer threshold; + + @ApiModelProperty("提醒推送方式") + private String config; + + @ApiModelProperty("业务ID") + @JsonSerialize(using = ToStringSerializer.class) + private Long businessId; + + @ApiModelProperty("模块") + @JsonSerialize(using = ToStringSerializer.class) + private String moduleId; + + @ApiModelProperty("事件") + @JsonSerialize(using = ToStringSerializer.class) + private String eventId; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java new file mode 100644 index 000000000..2f3c38d1b --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.engine.salary.common.OptionDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 智能算税-流量不足提醒对象-表单 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量不足提醒对象-表单") +public class TaxDeclarationApiFlowWarnReceiverFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("提醒对象") + private List employee; + + @ApiModelProperty("手机号") + private String mobile; + + @ApiModelProperty("邮箱列表") + private String email; + + @ApiModelProperty("邮箱列表下拉框") + @JsonIgnore + private List emailOptions; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java new file mode 100644 index 000000000..d5afc26f5 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.minidev.json.annotate.JsonIgnore; + +/** + * 智能算税-流量提醒对象 + * + * @author chengliming + * @date 2022-11-22 11:25:48 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-流量提醒对象") + +public class TaxDeclarationApiFlowWarnReceiverListDTO { + @ApiModelProperty("id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("提醒对象") + private String employeeName; + + @JsonIgnore + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + @ApiModelProperty("手机号") + private String mobile; + + @ApiModelProperty("邮箱") + private String email; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java new file mode 100644 index 000000000..1604b8e96 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算税-启用设置-表单 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算税-启用设置-表单") +public class TaxDeclarationBillingConfigFormDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("appKey") + private String appKey; + + @ApiModelProperty("appSecret") + private String appSecret; + + @ApiModelProperty("智能算薪开关") + private Boolean enable; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java new file mode 100644 index 000000000..15deaba5f --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 创建推送规则 + * + * @author chengliming + * @date 2022-11-24 10:50 AM + **/ +@Data +public class CreateMessageRuleParam { + @ApiModelProperty("业务ID") + @NotNull(message = "业务ID不能为空") + private String businessId; + + @ApiModelProperty("详细规则") + @NotNull(message = "详细规则不能为空") + private String config; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java new file mode 100644 index 000000000..50e83b5f3 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java @@ -0,0 +1,50 @@ +package com.engine.salary.entity.taxapiflow.param; + +import com.engine.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; +import java.time.YearMonth; + +/** + * 流量月度详情查询参数 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量月度详情查询参数") +public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam { + + @ApiModelProperty("个税扣缴义务人id") + @NotNull(message = "个税扣缴义务人不能为空") + private Long taxAgentId; + + @ApiModelProperty("税款所属期开始时间") + private YearMonth startTaxMonth; + + @ApiModelProperty("税款所属期结束时间") + private YearMonth endTaxMonth; + + public Integer getStartTaxMonth() { + if (startTaxMonth == null) { + return 0; + } + return Integer.parseInt(startTaxMonth.toString().replace("-", "")); + } + + public Integer getEndTaxMonth() { + if (endTaxMonth == null) { + return Integer.MAX_VALUE; + } + return Integer.parseInt(endTaxMonth.toString().replace("-", "")); + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java new file mode 100644 index 000000000..8a5f7be71 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.param; + +import com.engine.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +/** + * 流量月度详情查询参数 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量月度详情查询参数") +public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam { + + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @ApiModelProperty("开始时间") + private LocalDate startDate; + + @ApiModelProperty("结束时间") + private LocalDate endDate; + + @ApiModelProperty("业务接口类型") + private Integer businessType; + + @ApiModelProperty("结果") + private Integer result; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java new file mode 100644 index 000000000..482c76195 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +/** + * 流量不足提醒规则创建 + * + * @author chengliming + * @date 2022-11-24 11:17:31 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量不足提醒规则创建") +public class TaxDeclarationApiFlowWarnConfigSaveParam { + @ApiModelProperty("提醒对象Id") + private Long id; + + @ApiModelProperty("提醒阈值") + @NotNull(message = "提醒规则不能为空") + private Long threshold; + + @ApiModelProperty("提醒开关是否打开") + private Boolean enable; + + @ApiModelProperty("业务ID") + @NotNull(message = "推送方式不能为空") + private Long businessId; + + @ApiModelProperty("规则") + private String config; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java new file mode 100644 index 000000000..345cc3ac7 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 流量不足提醒对象 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("流量不足提醒对象") +public class TaxDeclarationApiFlowWarnReceiverSaveParam { + @ApiModelProperty("提醒对象Id") + private Long id; + + @ApiModelProperty("提醒配置Id") + private Long warnConfigId; + + @ApiModelProperty("人员Id") + private Long employeeId; + + @ApiModelProperty("邮箱") + private String email; + + @ApiModelProperty("手机号") + private String mobile; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java new file mode 100644 index 000000000..afb9c15e1 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 智能算薪配置参数 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("智能算薪配置参数") +public class TaxDeclarationBillingConfigSaveParam { + + @ApiModelProperty("appKey") + private String appKey; + + @ApiModelProperty("appSecret") + private String appSecret; + + @ApiModelProperty("enable") + private String enable; + + @ApiModelProperty("配置ID") + private Long configId; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java new file mode 100644 index 000000000..ef1c9ba5b --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java @@ -0,0 +1,100 @@ +package com.engine.salary.entity.taxapiflow.po; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 个税申报-接口流量使用记录 + * + * @author chengliming + * @date 2022-11-11 17:36:16 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_record") +//"个税申报-接口流量使用记录") +public class TaxDeclarationApiFlowRecordPO implements Serializable { + + private static final long serialVersionUID = 5899885019997144301L; + /** + * 主键 + */ + private Long id; + + /** + * 个税扣缴义务人的主键id + */ + private Long taxAgentId; + + /** + * 税款所属期 + */ + private Date taxMonth; + + /** + * 使用时间 + */ + private Date useTime; + + /** + * 是否扣流量 + * + * @see SalaryOnOffEnum + */ + private Integer deduct; + + /** + * 人员ID + */ + private Long employeeId; + + /** + * 接口业务类型 + * + * @see EnumDeclareApiBusinessType + */ + private Integer businessType; + + /** + * 结果 + * + * @see TaxAgentTaxReturnStatusEnum + */ + private Integer resultStatus; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建人 + */ + private Long creator; + + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + /** + * 租户ID + */ + private String tenantKey; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java new file mode 100644 index 000000000..ca12c4476 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java @@ -0,0 +1,73 @@ +package com.engine.salary.entity.taxapiflow.po; + +import com.engine.salary.enums.SalaryOnOffEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 个税申报对接 - 流量不足提醒 + * + * @author chengliming + * @date 2022-11-14 11:26:02 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_warn_config") +//个税申报对接流量不足提醒") +public class TaxDeclarationApiFlowWarnConfigPO implements Serializable { + + private static final long serialVersionUID = -5502227652635855096L; + + /** + * 主键 + */ + private Long id; + + /** + * 是否提醒 + * @see SalaryOnOffEnum + */ + private Integer enableWarn; + + /** + * 提醒阈值 + */ + private Long threshold; + + /** + * 业务ID + */ + private Long businessId; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建人 + */ + private Long creator; + + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + /** + * 租户ID + */ + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java new file mode 100644 index 000000000..e546a8edb --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java @@ -0,0 +1,76 @@ +package com.engine.salary.entity.taxapiflow.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 流量不足提醒对象 + * + * @author chengliming + * @date 2022-11-14 11:26:02 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_receiver") +//流量不足提醒对象") +public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable { + + private static final long serialVersionUID = -5502227652635855096L; + + /** + * 主键 + */ + private Long id; + + /** + * 提醒配置的id + */ + private Long warnConfigId; + + /** + * 接受人id + */ + private Long employeeId; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号 + */ + private String mobile; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long creator; + + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + /** + * 租户ID + */ + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java new file mode 100644 index 000000000..67779fd42 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.taxapiflow.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +import java.util.List; + +/** + * 查询流量统计 + * + * @author chengliming + * @date 2022-11-16 3:17 PM + **/ +@Data +public class QueryAccountBalanceResponse { + + private SzyhResponseHead head; + + private Body body; + + @Data + public static class Body { + /** + * 已购买总流量 + **/ + private String total; + /** + * 已使用流量 + **/ + private String used; + /** + * 剩余流量 + **/ + private String surplus; + /** + * 使用明细 + */ + private List taxList; + } + + @Data + public static class Detail { + /** + * 税号 + */ + private String taxNumber; + /** + * 已使用流量 + */ + private String used; + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java new file mode 100644 index 000000000..413f7e546 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.taxapiflow.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +import java.util.List; + +/** + * 查询流量统计 + * + * @author chengliming + * @date 2022-11-16 3:17 PM + **/ +@Data +public class QueryDetailsByTaxNumberResponse { + + private SzyhResponseHead head; + + private Body body; + + @Data + public static class Body { + /** + * 税号 + **/ + private String taxNumber; + /** + * 已使用流量 + **/ + private String used; + /** + * 使用明细 + */ + private List detail; + } + + @Data + public static class Detail { + /** + * 月份 + */ + private String month; + /** + * 已使用流量 + */ + private String used; + + public Integer getMonthValue() { + return Integer.parseInt(month); + } + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java new file mode 100644 index 000000000..cbd849012 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -0,0 +1,167 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +//import com.engine.salary.util.SalaryEntityUtil; +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.common.elog.util.Util; +//import com.weaver.hrm.salary.annotation.SalaryFormulaVar; +//import com.weaver.hrm.salary.entity.datacollection.po.AddUpSituationPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultValuePO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; +//import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +// +//import java.lang.reflect.Field; +//import java.math.BigDecimal; +//import java.time.LocalDateTime; +//import java.time.YearMonth; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +// +///** +// * @description: 通用:一般劳务报酬所得、全年一次性奖金 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/12/2 3:16 PM +// * @version:v1.0 +// */ +//public class TaxDeclarationCommon implements TaxDeclarationStrategy { +// +// @Override +// public TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey) { +// LocalDateTime now = LocalDateTime.now(); +// // 薪资核算结果按照薪资核算人员id聚合分类 +// Map salaryAcctResultValueMap = SalaryEntityUtil.convert2Map( +// taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); +// // 薪资核算人员按照人员id聚合分类 +// Map> employeeIdKeyMap = SalaryEntityUtil.group2Map( +// taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); +// +// List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); +// for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { +// // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 +// SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); +// for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { +// SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); +// SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); +// if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { +// lastSalaryAcctEmployee = salaryAcctEmployee; +// } +// } +// Map valueMap = Maps.newHashMap(); +// for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) { +// SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() +// .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); +// SalaryAcctResultValuePO salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); +// String defaultValue = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0" : ""; +// String value = defaultValue; +// if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { +// value = salaryAcctResultValue.getResultValue().getOrDefault(Util.null2String(salarySobTaxReportRule.getSalaryItemId()), defaultValue); +// } +// valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); +// } +// TaxDeclarationValuePO taxDeclarationValue = new TaxDeclarationValuePO() +// .setId(IdGenerator.generate()) +// .setTaxDeclareRecordId(taxDeclareContext.getTaxDeclaration().getTaxDeclareRecordId()) +// .setTaxDeclarationId(taxDeclareContext.getTaxDeclaration().getId()) +// .setEmployeeType(employeeIdEntry.getValue().get(0).getEmployeeType()) +// .setEmployeeId(employeeIdEntry.getKey()) +// .setResultValue(valueMap) +// .setTenantKey(tenantKey) +// .setCreator(employeeId) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// taxDeclarationValues.add(taxDeclarationValue); +// } +// // 生成累计数据 +// List addUpSituations = generateAddUpSituation(taxDeclareContext, salaryAcctResultValueMap, employeeIdKeyMap); +// return new TaxDeclarationGenerateResult() +// .setTaxDeclarationValues(taxDeclarationValues) +// .setAddUpSituations(addUpSituations); +// } +// +// /** +// * 生成往期累计数据 +// * +// * @param taxDeclareContext +// * @param salaryAcctResultValueMap +// * @param employeeIdKeyMap +// * @return +// */ +// private List generateAddUpSituation(TaxDeclareContext taxDeclareContext, +// Map salaryAcctResultValueMap, +// Map> employeeIdKeyMap) { +// List addUpSituations = Lists.newArrayList(); +// // 只有「工资工资薪金」、「保险营销员佣金收入」、「证券经纪人佣金收入」、「其他连续劳务报酬所得」需要累计计税 +// TaxDeclarationPO taxDeclaration = taxDeclareContext.getTaxDeclaration(); +// if (!Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) +// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN.getValue()) +// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER.getValue()) +// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR.getValue())) { +// return addUpSituations; +// } +// for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { +// // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 +// SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); +// for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { +// SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); +// SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); +// if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { +// lastSalaryAcctEmployee = salaryAcctEmployee; +// } +// } +// SalaryAcctResultValuePO salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); +// Map valueMap = Maps.newHashMap(); +// for (Field declaredField : AddUpSituationPO.class.getDeclaredFields()) { +// if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { +// continue; +// } +// SalarySobAddUpRulePO salarySobAddUpRule = taxDeclareContext.getSalarySobAddUpRuleMap() +// .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + declaredField.getName()); +// String value = BigDecimal.ZERO.toPlainString(); +// if (Objects.nonNull(salarySobAddUpRule) && Objects.nonNull(salaryAcctResultValue)) { +// value = salaryAcctResultValue.getResultValue() +// .getOrDefault(Util.null2String(salarySobAddUpRule.getSalaryItemId()), BigDecimal.ZERO.toPlainString()); +// } +// valueMap.put(declaredField.getName(), value); +// } +// AddUpSituationPO addUpSituation = AddUpSituationPO.builder() +// .id(IdGenerator.generate()) +// .employeeId(lastSalaryAcctEmployee.getEmployeeId()) +// .employeeType(lastSalaryAcctEmployee.getEmployeeType()) +// .taxAgentId(lastSalaryAcctEmployee.getTaxAgentId()) +// .taxYearMonth(YearMonth.parse(taxDeclaration.getTaxCycle()).atDay(1)) +// .year(YearMonth.parse(taxDeclaration.getTaxCycle()).getYear()) +// .addUpIncome(valueMap.get("addUpIncome")) +// .addUpSocialSecurityTotal(valueMap.get("addUpSocialSecurityTotal")) +// .addUpAccumulationFundTotal(valueMap.get("addUpAccumulationFundTotal")) +// .addUpEnterpriseAndOther(valueMap.get("addUpEnterpriseAndOther")) +// .addUpSubtraction(valueMap.get("addUpSubtraction")) +// .addUpOtherDeduction(valueMap.get("addUpOtherDeduction")) +// .addUpTaxExemptIncome(valueMap.get("addUpTaxExemptIncome")) +// .addUpAllowedDonation(valueMap.get("addUpAllowedDonation")) +// .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) +// .addUpTaxableIncome(valueMap.get("addUpTaxableIncome")) +// .modifier(taxDeclaration.getCreator()) +// .creator(taxDeclaration.getCreator()) +// .createTime(taxDeclaration.getCreateTime()) +// .updateTime(taxDeclaration.getUpdateTime()) +// .tenantKey(taxDeclaration.getTenantKey()) +// .deleteType(taxDeclaration.getDeleteType()) +// .build(); +// addUpSituations.add(addUpSituation); +// } +// return addUpSituations; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java new file mode 100644 index 000000000..711a67c48 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * @description: 个税申报表计算过程中产生的结果 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/2 9:25 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationGenerateResult { + + /** + * 往期累计清空 + */ + private List addUpSituations; + /** + * 个税申报明细 + */ + private List taxDeclarationValues; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java new file mode 100644 index 000000000..45de69cf4 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -0,0 +1,165 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.engine.salary.report.enums.IncomeCategoryEnum; +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//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.*; +// +///** +// * @description: 个税申报 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/11/2 11:18 AM +// * @version:v1.0 +// */ +//public class TaxDeclarationRequest { +// +// public static Map convert2RequestParam(List taxReportColumns, +// List taxDeclarations, +// List taxDeclarationValues, +// List employeeDeclares) { +// Map> objRequestParam = Maps.newHashMap(); +// Map>> listRequestParam = Maps.newHashMap(); +// Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); +// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); +// Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); +// for (TaxDeclarationPO taxDeclaration : taxDeclarations) { +// List values = taxDeclarationValueMap.get(taxDeclaration.getId()); +// for (TaxDeclarationValuePO taxDeclarationValue : values) { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); +// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); +// if (employeeDeclare == null || incomeCategoryEnum == null) { +// continue; +// } +// List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); +// Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); +// if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) { +// Map paramMap = objRequestParam.computeIfAbsent("zcgzxj", k -> { +// Map param = new HashMap<>(); +// // 正常工资薪金列表 +// param.put("zcgzxjlb", Lists.newArrayList()); +// // 正常工资薪金是否需要专项 +// param.put("zcgzxjsfxyzx", 0); +// // 正常工资薪金是否传入专项累计 +// param.put("zcgzxjsfcrlj", 1); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zcgzxjlb", K -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { +// // 全年一次性奖金收入 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("qnycxjjsslb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_RETIRE) { +// // 内退一次性补偿金 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("ntycxbcjlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_DISMISS) { +// // 解除劳动合同一次性补偿金 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE) { +// // 个人股权激励收入 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("grgqjl", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.ANNUITY_RECEIPT) { +// // 处理"是否一次性领取"(接口只能传0和1但是接口的错误返回信息告知只能填写是和否,所以需要转一下) +// String sfycxlq = Util.null2String(employeeRequestParam.get("sfycxlq")); +// employeeRequestParam.put("sfycxlq", Objects.equals("是", sfycxlq) ? "1" : "0"); +// // 年金领取 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("qynj", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_LABOR) { +// // 一般劳务报酬所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN) { +// // 保险营销员佣金收入 +// Map paramMap = objRequestParam.computeIfAbsent("bxyxy", k -> { +// Map param = new HashMap<>(); +// param.put("bxyxylwbclb", Lists.newArrayList()); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("bxyxylwbclb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER) { +// // 证券经纪人佣金收入 +// Map paramMap = objRequestParam.computeIfAbsent("zqjjr", k -> { +// Map param = new HashMap<>(); +// param.put("zqjjrsdlb", Lists.newArrayList()); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zqjjrsdlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) { +// // 其他连续劳务报酬所得 +// Map paramMap = objRequestParam.computeIfAbsent("qtlxlwbc", k -> { +// Map param = new HashMap<>(); +// param.put("qtlxlwbclb", Lists.newArrayList()); +// return param; +// }); +// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("qtlxlwbclb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR) { +// // 其他非连续劳务报酬所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("qtflxlwbc", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR) { +// // 稿酬所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("gcsdlb", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { +// // 特许权使用费所得 +// List> employeeRequestParams = listRequestParam.computeIfAbsent("txq", k -> Lists.newArrayList()); +// employeeRequestParams.add(employeeRequestParam); +// } +// } +// } +// +// Map requestParam = Maps.newHashMap(); +// requestParam.putAll(objRequestParam); +// requestParam.putAll(listRequestParam); +// return requestParam; +// } +// +// private static Map convert2RequestParam(IncomeCategoryEnum incomeCategoryEnum, +// List taxReportColumns, +// TaxDeclarationValuePO taxDeclarationValue, +// EmployeeDeclarePO employeeDeclare) { +// if (CollectionUtils.isEmpty(taxReportColumns)) { +// return Collections.emptyMap(); +// } +// Map 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) { +// String value = taxDeclarationValue.getResultValue().getOrDefault(taxReportColumn.getReportColumnDataIndex(), StringUtils.EMPTY); +// if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { +// value = Util.getBigDecimalValue(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex()), BigDecimal.ZERO).toPlainString(); +// } else if (Objects.equals(taxReportColumn.getDataType(), "integer")) { +// value = Util.getBigDecimalValue(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex()), BigDecimal.ZERO).setScale(0, RoundingMode.HALF_UP).toPlainString(); +// } +// requestParam.put(taxReportColumn.getRequestParamKey(), value); +// } +// return requestParam; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java new file mode 100644 index 000000000..db866e484 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * @description: 生成个税申报表最后要处理的数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/5 6:10 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationResult { + + /** + * 个税申报表 + */ + private List taxDeclarations; + /** + * 个税申报明细 + */ + private List taxDeclarationValues; + /** + * 往期累计情况 + */ + private List addUpSituations; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java new file mode 100644 index 000000000..76e870558 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +/** + * @description: 生成个税申报表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/1 4:47 PM + * @version:v1.0 + */ +public interface TaxDeclarationStrategy { + + /** + * 生成个税申报表 + * + * @param taxDeclareContext + * @param employeeId + * @param tenantKey + * @return + */ + TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey); +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java new file mode 100644 index 000000000..dcb4fe6e8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -0,0 +1,115 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.common.component.table.column.WeaTableColumn; +//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; +//import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; +//import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.teams.domain.hr.SimpleUserInfo; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import lombok.Data; +//import org.apache.commons.collections4.CollectionUtils; +// +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +// +///** +// * @description: 个税申报表详情 +// * @author: xiajun +// * @modified By: xiajun +// * @date: 2022/3/14 18:31 +// * @version:v1.0 +// */ +//@Data +//public class TaxDeclarationValueList { +// +// /** +// * 个税申报表的表头 +// * +// * @param taxReportColumns +// * @return +// */ +// public static List buildTableColumns(List taxReportColumns) { +// List weaTableColumns = Lists.newArrayList(); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum", "120")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username", "120")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(105139, "证件类型"), "cardType", "120")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86318, "证件号码"), "cardNum", "150")); +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(102786, "所得项目"), "incomeCategory", "120")); +// for (TaxReportColumnPO taxReportColumn : taxReportColumns) { +// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(taxReportColumn.getReportColumnLabel(), taxReportColumn.getReportColumnName()), taxReportColumn.getReportColumnDataIndex(), "120")); +// } +// return weaTableColumns; +// } +// +// /** +// * 个税申报表的数据 +// * +// * @param taxReportColumns +// * @param taxDeclarationValues +// * @param simpleEmployees +// * @param simpleUserInfos +// * @param extEmployees +// * @return +// */ +// public static List> buildTableData(IncomeCategoryEnum incomeCategoryEnum, +// List taxReportColumns, +// List taxDeclarationValues, +// List employeeDeclares, +// List simpleEmployees, +// List simpleUserInfos, +// List extEmployees) { +// if (CollectionUtils.isEmpty(simpleEmployees)) { +// return Collections.emptyList(); +// } +// List> tableDataList = Lists.newArrayList(); +// // 员工基本信息按照人员id聚合分类 +// Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// // 员工报送信息按照人员id聚合分类 +// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); +// // 员工个人信息按照人员id聚合分类 +// Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, e -> e.getUser().getId()); +// // 非系统员工按照人员id聚合分类 +// Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId); +// for (TaxDeclarationValuePO taxDeclarationValue : taxDeclarationValues) { +// Map dataMap = Maps.newHashMap(); +// dataMap.put("id", taxDeclarationValue.getId().toString()); +// dataMap.put("employeeId", taxDeclarationValue.getEmployeeId() + ""); +// dataMap.put("incomeCategory", incomeCategoryEnum.getDefaultLabel()); +// for (TaxReportColumnPO taxReportColumn : taxReportColumns) { +// dataMap.put(taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); +// } +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); +// if (employeeDeclare != null) { +// dataMap.put("jobNum", employeeDeclare.getJobNum()); +// dataMap.put("username", employeeDeclare.getEmployeeName()); +// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); +// dataMap.put("cardNum", employeeDeclare.getCardNum()); +// } else if (Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); +// SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(taxDeclarationValue.getEmployeeId()); +// dataMap.put("jobNum", simpleEmployee.getJobNum()); +// dataMap.put("username", simpleEmployee.getUsername()); +// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); +// dataMap.put("cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); +// } else { +// ExtEmployeePO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); +// dataMap.put("jobNum", ""); +// dataMap.put("username", extEmployee.getUsername()); +// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); +// dataMap.put("cardNum", extEmployee.getCardNum()); +// } +// tableDataList.add(dataMap); +// } +// return tableDataList; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java new file mode 100644 index 000000000..991166356 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java @@ -0,0 +1,60 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//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.salaryitem.po.SalaryItemPO; +//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +//import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +//import lombok.Data; +//import lombok.experimental.Accessors; +// +//import java.util.List; +//import java.util.Map; +// +///** +// * @description: 生成个税申报表所需的数据 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/12/2 2:29 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//public class TaxDeclareContext { +// +// /** +// * 薪资核算记录 +// */ +// private Map salaryAcctRecordMap; +// /** +// * 薪资核算人员 +// */ +// private List salaryAcctEmployees; +// /** +// * 薪资核算结果 +// */ +// private List salaryAcctResultValues; +// /** +// * 个税申报表 +// */ +// private TaxDeclarationPO taxDeclaration; +// /** +// * 个税申报表字段 +// */ +// private List taxReportColumns; +// /** +// * 薪资账套的个税申报表规则。key:薪资账套id-个税申报表字段索引、value:薪资账套的个税申报表规则 +// */ +// private Map salarySobTaxReportRuleMap; +// /** +// * 薪资账套的累计字段对应关系。key:薪资账套id-往期累计情况的字段索引、value:薪资账套的累计字段对应关系 +// */ +// private Map salarySobAddUpRuleMap; +// /** +// * 薪资项目 +// */ +// private List salaryItems; +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java new file mode 100644 index 000000000..0f1b6e5a6 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -0,0 +1,88 @@ +//package com.engine.salary.entity.taxdeclaration.bo; +// +//import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +//import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +//import com.google.common.collect.Lists; +//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; +//import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; +//import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryEnumUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.teams.domain.hr.SimpleUserInfo; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import org.apache.commons.collections4.CollectionUtils; +// +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +//import java.util.function.Function; +//import java.util.stream.Collectors; +// +///** +// * @description: 个税申报明细表中的人员 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/11/10 4:20 PM +// * @version:v1.0 +// */ +//public class TaxDeclareEmployeeBO { +// +// public static List convert2AbnormalEmployee(List taxDeclareEmployees, +// List employeeDeclares, +// List simpleEmployees, +// List simpleUserInfos, +// List extEmployees) { +// if (CollectionUtils.isEmpty(taxDeclareEmployees)) { +// return Collections.emptyList(); +// } +// List abnormalEmployeeList = Lists.newArrayList(); +// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); +// Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// Map simpleUserInfoMap = simpleUserInfos.stream() +// .filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser())) +// .collect(Collectors.toMap(simpleUserInfo -> simpleUserInfo.getUser().getId(), Function.identity(), (a, b) -> a)); +// Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId); +// for (TaxDeclareEmployeePO taxDeclareEmployee : taxDeclareEmployees) { +// AbnormalEmployeeListDTO abnormalEmployeeListDTO = new AbnormalEmployeeListDTO() +// .setId(taxDeclareEmployee.getEmployeeId()) +// .setEmployeeId(taxDeclareEmployee.getEmployeeId()) +// .setEmployeeType(taxDeclareEmployee.getEmployeeType()); +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclareEmployee.getEmployeeId()); +// if (employeeDeclare != null) { +// DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class); +// abnormalEmployeeListDTO +// .setEmployeeName(employeeDeclare.getEmployeeName()) +// .setJobNum(employeeDeclare.getJobNum()) +// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) +// .setCardNum(employeeDeclare.getCardNum()) +// .setDeclareStatus(declareStatusEnum) +// .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); +// } else if (Objects.equals(taxDeclareEmployee.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclareEmployee.getEmployeeId()); +// SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(taxDeclareEmployee.getEmployeeId()); +// abnormalEmployeeListDTO +// .setEmployeeName(simpleEmployee.getUsername()) +// .setJobNum(simpleEmployee.getJobNum()) +// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) +// .setCardNum(simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()) +// .setDeclareStatus(null) +// .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); +// } else { +// ExtEmployeePO extEmployee = extEmployeePOMap.get(taxDeclareEmployee.getEmployeeId()); +// abnormalEmployeeListDTO +// .setEmployeeName(extEmployee.getUsername()) +// .setJobNum("") +// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) +// .setCardNum(extEmployee.getCardNum()) +// .setDeclareStatus(null) +// .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); +// } +// abnormalEmployeeList.add(abnormalEmployeeListDTO); +// } +// return abnormalEmployeeList; +// } +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java new file mode 100644 index 000000000..7df1fe6dd --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java @@ -0,0 +1,41 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Map; + +/** + * @description: 个税申报相关接口的请求参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/2/6 5:24 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclareRequest { + + /** + * 供应商信息 + */ + private TaxDeclarationApiConfigPO taxDeclarationApiConfig; + + /** + * 个税扣缴义务人 + */ + private TaxAgentPO taxAgent; + + /** + * 个税申报记录 + */ + private TaxDeclareRecordPO taxDeclareRecord; + + /** + * 请求参数 + */ + private Map requestParam; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java new file mode 100644 index 000000000..9be4d4bba --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -0,0 +1,78 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.table.type.WeaTableTypeEnum; +import com.weaver.hrm.salary.annotation.SalaryTable; +import com.weaver.hrm.salary.annotation.SalaryTableColumn; +import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; +import org.codehaus.jackson.map.annotate.JsonSerialize; +import org.codehaus.jackson.map.ser.std.ToStringSerializer; + +/** + * @description: 个税申报-校验异常的人员列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 2:28 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +@SalaryTable(tableType = WeaTableTypeEnum.NONE, pageUid = "abnormalEmployeeList") +public class AbnormalEmployeeListDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("关联人员类型") + private Integer employeeType; + + @ApiModelProperty("关联人员id") + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + @SalaryTableColumn( + label = "姓名", + labelId = 85429, + width = "150" + ) + @ApiModelProperty("姓名") + private String employeeName; + + @SalaryTableColumn( + label = "工号", + labelId = 86317, + width = "150" + ) + @ApiModelProperty("工号") + private String jobNum; + + @SalaryTableColumn( + label = "证件类型", + labelId = 105139, + width = "150" + ) + @ApiModelProperty("证件类型") + private String cardType; + + @SalaryTableColumn( + label = "证件号码", + labelId = 86318, + width = "150" + ) + @ApiModelProperty("证件号码") + private String cardNum; + + @ApiModelProperty("报送状态") + private DeclareStatusEnum declareStatus; + + @SalaryTableColumn( + label = "报送状态", + labelId = 177862, + width = "150" + ) + @ApiModelProperty("报送状态") + private String declareStatusDesc; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java new file mode 100644 index 000000000..737011270 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -0,0 +1,71 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.table.type.WeaTableTypeEnum; +import com.weaver.hrm.salary.annotation.SalaryTable; +import com.weaver.hrm.salary.annotation.SalaryTableColumn; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; +import org.codehaus.jackson.map.annotate.JsonSerialize; +import org.codehaus.jackson.map.ser.std.ToStringSerializer; + +/** + * @description: 个税申报-申报失败的人员列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/30 2:22 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +@SalaryTable(tableType = WeaTableTypeEnum.NONE, pageUid = "failEmployeeList") +public class FailEmployeeListDTO { + + @ApiModelProperty("主键id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @SalaryTableColumn( + label = "姓名", + labelId = 85429, + width = "150" + ) + @ApiModelProperty("姓名") + private String employeeName; + + @ApiModelProperty("个税扣缴义务人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @SalaryTableColumn( + label = "个税扣缴义务人名称", + labelId = 91558, + width = "150" + ) + @ApiModelProperty("个税扣缴义务人名称") + private String taxAgentName; + + @SalaryTableColumn( + label = "证件号码", + labelId = 86318, + width = "150" + ) + @ApiModelProperty("证件号码") + private String cardNum; + + @SalaryTableColumn( + label = "失败原因", + labelId = 156405, + width = "150" + ) + @ApiModelProperty("失败原因") + private String errorMsg; + + @SalaryTableColumn( + label = "所得项目", + labelId = 102786, + width = "150" + ) + @ApiModelProperty("所得项目") + private String incomeCategory; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java new file mode 100644 index 000000000..a261ad1b0 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * @description: + * @author: xiajun + * @modified By: xiajun + * @date: 2022/7/12 11:39 + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationRateDTO implements Serializable { + + private static final long serialVersionUID = 8478996890743085394L; + + @ApiModelProperty("缓存索引") + private String index; + @ApiModelProperty("提示信息") + private String msg; + @ApiModelProperty("状态") + private boolean status; + @ApiModelProperty("是否已经完成") + private boolean finish; + @ApiModelProperty("提示信息是否自动消失") + private boolean msgPersist; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java new file mode 100644 index 000000000..dc2d6fd56 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @description: 个税申报表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 11:40 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationTabDTO { + + @ApiModelProperty("Tab页签的名称") + private String tabName; + + @ApiModelProperty("收入所得类型") + private IncomeCategoryEnum incomeCategory; + + @ApiModelProperty("个税申报表id") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxDeclarationId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java new file mode 100644 index 000000000..53ef3bd27 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.table.column.WeaTableColumn; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Map; + +/** + * @description: 个税申报表详情列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/6 1:28 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclarationValueListDTO { + + /** + * 个税申报表表头 + */ + private List columns; + + /** + * 个税申报表数据 + */ + private List> data; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java new file mode 100644 index 000000000..b856568ad --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -0,0 +1,64 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.weaver.common.component.form.item.WeaFormItemType; +import com.weaver.hrm.salary.annotation.SalaryForm; +import com.weaver.hrm.salary.annotation.SalaryFormItem; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; +import java.util.List; +import java.util.Map; + +/** + * @description: 个税申报记录表单 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/15/21 9:40 AM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("个税申报记录表单") +public class TaxDeclareRecordFormDTO { + + @SalaryForm( + label = "薪资所属月", + labelId = 87614, + items = @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) + ) + @ApiModelProperty("薪资所属月") + private YearMonth salaryMonth; + + @SalaryForm( + label = "个税扣缴义务人范围", + labelId = 160476, + items = @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = TaxAgentRangeEnum.class) + ) + @ApiModelProperty("个税扣缴义务人范围") + private TaxAgentRangeEnum taxAgentRange; + + @SalaryForm( + label = "个税扣缴义务人", + labelId = 86184, + items = @SalaryFormItem(itemType = WeaFormItemType.BROWSER, required = true, browserModule = "hrmsalary", + browserType = "TaxAgentBrowser", browserMultiple = true) + ) + @ApiModelProperty("个税扣缴义务人id") + private List> taxAgentIds; + + @SalaryForm( + label = "备注", + labelId = 84961, + items = @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "30") + ) + @ApiModelProperty("备注") + private String description; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java new file mode 100644 index 000000000..6aa26d4af --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -0,0 +1,121 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.weaver.common.component.table.type.WeaTableTypeEnum; +import com.weaver.hrm.salary.annotation.SalaryTable; +import com.weaver.hrm.salary.annotation.SalaryTableColumn; +import com.weaver.hrm.salary.annotation.SalaryTableOperate; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @description: 个税申报记录列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 9:25 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +@SalaryTable(value = { + @SalaryTableOperate(index = 0, text = "查看详情", labelId = 93216, outer = true), + @SalaryTableOperate(index = 1, text = "删除", labelId = 87061, outer = true) +}, tableType = WeaTableTypeEnum.NONE, pageUid = "taxAgentDeclareList") +public class TaxDeclareRecordListDTO { + + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @ApiModelProperty("个税扣缴义务人") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + @SalaryTableColumn( + label = "个税扣缴义务人", + labelId = 86184, + width = "15%" + ) + @ApiModelProperty("个税扣缴义务人名称") + private String taxAgentName; + + @SalaryTableColumn( + label = "薪资所属月", + labelId = 87614, + width = "10%" + ) + @ApiModelProperty("薪资所属月") + private String salaryMonth; + + @SalaryTableColumn( + label = "税款所属期", + labelId = 86176, + width = "10%" + ) + @ApiModelProperty("税款所属期") + private String taxCycle; + + @ApiModelProperty("申报类型") + private TaxDeclareTypeEnum taxDeclareType; + + @SalaryTableColumn( + label = "申报类型", + labelId = 177641, + width = "10%" + ) + @ApiModelProperty("申报类型") + private String taxDeclareTypeDesc; + + @ApiModelProperty("申报状态") + private TaxDeclareStatusEnum taxDeclareStatus; + + @SalaryTableColumn( + label = "申报状态", + labelId = 156414, + width = "10%" + ) + @ApiModelProperty("申报状态") + private String taxDeclareStatusDesc; + + @SalaryTableColumn( + label = "已缴金额", + labelId = 179035, + width = "10%" + ) + @ApiModelProperty("已缴金额") + private String taxPaidAmount; + + @ApiModelProperty("操作人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long operateEmployeeId; + + @SalaryTableColumn( + label = "操作人", + labelId = 85435, + width = "10%" + ) + @ApiModelProperty("操作人名称") + private String operateEmployeeName; + + @SalaryTableColumn( + label = "操作时间", + labelId = 85436, + width = "15%" + ) + @ApiModelProperty("操作时间") + private String operateTime; + + @SalaryTableColumn( + label = "备注", + labelId = 84961, + width = "10%" + ) + @ApiModelProperty("备注") + private String description; + + @ApiModelProperty("是否展示图标") + private boolean displayIcon; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java new file mode 100644 index 000000000..25cdbd25a --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.weaver.hrm.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @description: 个税申报-异常数据-未报送人员列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 1:54 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class AbnormalEmployeeListQueryParam extends BaseQueryParam { + + @ApiModelProperty("工号、姓名、身份证号码") + private String keyword; + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; + + @JsonIgnore + @ApiModelProperty("个税扣缴义务人id") + private Long taxAgentId; + + @JsonIgnore + @ApiModelProperty("税款所属期") + private String taxCycle; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java new file mode 100644 index 000000000..19d514e52 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.weaver.hrm.salary.common.BaseQueryParam; +import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报记录详情列表查询参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/15/21 3:21 PM + * @version:v1.0 + */ +@Data +@ApiModel("个税申报表记录列表查询参数") +public class TaxDeclarationValueListQueryParam extends BaseQueryParam { + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; + + @ApiModelProperty("个税申报表id") + private Long taxDeclarationId; + + @ApiModelProperty("收入所得项目") + private IncomeCategoryEnum incomeCategory; + + @ApiModelProperty("导出excel时加密的密码") + private String sharePassword; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java new file mode 100644 index 000000000..de2728047 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/11 2:56 PM + * @version:v1.0 + */ +@Data +public class TaxDeclareRecordParam { + + @ApiModelProperty("个税申报记录id") + private Long taxDeclareRecordId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java new file mode 100644 index 000000000..53231ebf8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java @@ -0,0 +1,90 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 个税申报相关api配置 + * + * @author chengliming + * @date 2022-11-09 09:49:08 + */ +@Data +@Accessors(chain = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_declare_api_config") +public class TaxDeclarationApiConfigPO implements Serializable { + + private static final long serialVersionUID = 2287550079146871129L; + + /** + * 主键id + */ + private Long id; + + /** + * 接口host + */ + private String host; + /** + * app key + */ + private String appKey; + /** + * 密钥 + */ + private String appSecret; + + /** + * 是否开启使用 + */ + private Integer enableUse; + + /** + * 总流量 + */ + private Long totality; + + /** + * 剩余流量 + */ + private Long remain; + + /** + * 流量最后更新时间 + */ + private LocalDateTime lastUpdateTime; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java new file mode 100644 index 000000000..d65bacb06 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java @@ -0,0 +1,65 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.enums.taxdeclaration.TaxDeclareApiProfileEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 个税申报相关api配置 + * + * @author chengliming + * @date 2022-11-09 09:49:08 + */ +@Data +@Accessors(chain = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_declare_api_profile") +public class TaxDeclarationApiProfilePO implements Serializable { + + private static final long serialVersionUID = 8281861662866222040L; + + /** + * 主键id + */ + private Long id; + + /** + * 接口环境 + * + * @see TaxDeclareApiProfileEnum + */ + private Integer apiProfile; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java new file mode 100644 index 000000000..39fc3f89c --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -0,0 +1,80 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; + +/** + * @description: 个税申报表的值 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/27/22 5:03 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//hrsa_tax_declaration_value") +public class TaxDeclarationValuePO implements Serializable { + /** + * 主键id + */ + private Long id; + + /** + * 个税申报表id + */ + private Long taxDeclarationId; + + /** + * 个税申报记录id + */ + private Long taxDeclareRecordId; + + /** + * 人员类型 + */ + private Integer employeeType; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 薪资核算结果 + */ + private Map resultValue; + + /** + * 薪资核算结果(只在加密解密中使用) + */ + private String resultValueJson; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java new file mode 100644 index 000000000..b692fc532 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报中的人员 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 4:03 PM + * @version:v1.0 + */ +@Data +public class TaxDeclareEmployeePO { + + @ApiModelProperty("人员id") + private Long employeeId; + + @ApiModelProperty("人员类型") + private Integer employeeType; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java new file mode 100644 index 000000000..1c1127159 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java @@ -0,0 +1,57 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.report.enums.IncomeCategoryEnum; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * @description: 个税申报失败数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/30 11:38 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//hrsa_tax_declare_fail") +public class TaxDeclareFailPO implements Serializable { + + private static final long serialVersionUID = -7908151391741544058L; + + private Long id; + + private Long taxDeclareRecordId; + + /** + * @see IncomeCategoryEnum + */ + //所得项目") + private String incomeCategory; + + //姓名") + private String employeeName; + + //证件号码") + private String cardNum; + + //失败原因") + private String errorMsg; + + //租户key", ignore = true) + private String tenantKey; + + //创建人id", ignore = true) + private Long creator; + + //是否删除", ignore = true) + private Integer deleteType; + + //创建时间", ignore = true) + private Date createTime; + + //更新时间", ignore = true) + private Date updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java new file mode 100644 index 000000000..59ba8eb32 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -0,0 +1,111 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/2 5:40 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//hrsa_tax_declare_record") +//个税申报记录") +public class TaxDeclareRecordPO implements Serializable { + + private static final long serialVersionUID = -1891927328401341853L; + /** + * 主键id + */ + //主键id") + private Long id; + /** + * 个税扣缴义务人id + */ + //个税扣缴义务人") + private Long taxAgentId; + /** + * 薪资所属月 + */ + //薪资所属月") + private String salaryMonth; + /** + * 税款所属期 + */ + //税款所属期") + private String taxCycle; + /** + * 申报类型 + */ + //申报类型") + private Integer taxDeclareType; + /** + * 申报状态 + */ + //申报状态") + private Integer taxDeclareStatus; + /** + * 申报失败的错误信息 + */ + //申报失败的错误信息") + private String taxDeclareErrorMsg; + /** + * 请求的requestId + */ + //请求的requestId") + private String requestId; + /** + * 备注 + */ + //备注") + private String remark; + + //应缴金额") + private String taxPayAmount; + + //实缴总额") + private String taxPaidAmount; + + //实缴税额(不含滞纳金等)") + private String taxPurePaidAmount; + + //申报人数") + private Integer personNum; + + /** + * 个税申报表的待刷新数据的标识 + */ + //个税申报表的待刷新数据的标识") + private Integer displayUpdateIcon; + /** + * 租户key + */ + //租户key", ignore = true) + private String tenantKey; + /** + * 创建人id + */ + //创建人id", ignore = true) + private Long creator; + /** + * 是否删除 + */ + //是否删除", ignore = true) + private Integer deleteType; + /** + * 创建时间 + */ + //创建时间", ignore = true) + private LocalDateTime createTime; + /** + * 更新时间 + */ + //更新时间", ignore = true) + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java new file mode 100644 index 000000000..43598e736 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @description: 个税申报表表头 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/28 5:28 PM + * @version:v1.0 + */ +@Data +//name = "个税申报表表头") +//hrsa_tax_report_column") +public class TaxReportColumnPO { + + //name = "主键id") + private Long id; + //name = "报表类型") + private String taxReportType; + //name = "所得项目") + private String incomeCategory; + //name = "申报表的列名") + private String reportColumnName; + //name = "申报表的列名多语言标签") + private Integer reportColumnLabel; + //name = "申报表的列索引") + private String reportColumnDataIndex; + //name = "数值类型") + private String dataType; + //name = "个税对接时的参数key") + private String requestParamKey; + //name = "租户key", ignore = true) + private String tenantKey; + //name = "创建人id", ignore = true) + private Long creator; + //name = "是否删除", ignore = true) + private Integer deleteType; + //name = "创建时间", ignore = true) + private LocalDateTime createTime; + //name = "更新时间", ignore = true) + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java new file mode 100644 index 000000000..b00a2d9d6 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @description: 作废申报的反馈 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:32 AM + * @version:v1.0 + */ +@Data +public class CancelDeclareFeedbackResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口状态") + private Map body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java new file mode 100644 index 000000000..75956a672 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 作废申报的返回数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:17 AM + * @version:v1.0 + */ +@Data +public class CancelDeclareResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口数据") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java new file mode 100644 index 000000000..de5292d7a --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @description: 申报个税的反馈 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:32 AM + * @version:v1.0 + */ +@Data +public class DeclareTaxFeedbackResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口状态") + private Map body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java new file mode 100644 index 000000000..fd68013db --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 个税申报的返回数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 11:17 AM + * @version:v1.0 + */ +@Data +public class DeclareTaxResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口数据") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java new file mode 100644 index 000000000..6d37b2695 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 更正申报的返回数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/15 2:45 PM + * @version:v1.0 + */ +@Data +@ApiModel("更正申报的返回数据") +public class UpdateDeclareResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java index 233313c66..d8ab743e9 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.taxpayment.dto; -import com.weaver.common.component.form.WeaForm; import io.swagger.annotations.ApiModel; import lombok.AllArgsConstructor; import lombok.Builder; @@ -22,7 +21,7 @@ import java.util.Map; @ApiModel("查询缴费信息") public class TaxAgreementFormDTO extends TaxFeedbackResultDTO { - private WeaForm form; +// private WeaForm form; private Map count; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java index fc1f777d4..b0fc09ca7 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -1,58 +1,58 @@ -package com.engine.salary.entity.taxpayment.dto; - -import com.weaver.common.component.form.item.WeaFormItemType; -import com.weaver.hrm.salary.annotation.SalaryForm; -import com.weaver.hrm.salary.annotation.SalaryFormItem; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 查询缴费信息 - * - * @author chengliming - * @date 2022-12-27 13:25:42 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@ApiModel("查询缴费信息") -public class TaxAmountFormDTO { - - @SalaryForm( - label = "个税扣缴义务人", - labelId = 86184, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) - } - ) - @ApiModelProperty("个税扣缴义务人") - private String taxAgent; - - @SalaryForm( - label = "应缴金额", - labelId = 175126, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) - } - ) - @ApiModelProperty("应缴金额") - private String amount; - - @SalaryForm( - label = "申报人数", - labelId = 175128, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) - } - ) - @ApiModelProperty("申报人数") - private String personNum; -} +//package com.engine.salary.entity.taxpayment.dto; +// +//import com.weaver.common.component.form.item.WeaFormItemType; +//import com.weaver.hrm.salary.annotation.SalaryForm; +//import com.weaver.hrm.salary.annotation.SalaryFormItem; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +///** +// * 查询缴费信息 +// * +// * @author chengliming +// * @date 2022-12-27 13:25:42 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("查询缴费信息") +//public class TaxAmountFormDTO { +// +// @SalaryForm( +// label = "个税扣缴义务人", +// labelId = 86184, +// labelSpan = 8, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) +// } +// ) +// @ApiModelProperty("个税扣缴义务人") +// private String taxAgent; +// +// @SalaryForm( +// label = "应缴金额", +// labelId = 175126, +// labelSpan = 8, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) +// } +// ) +// @ApiModelProperty("应缴金额") +// private String amount; +// +// @SalaryForm( +// label = "申报人数", +// labelId = 175128, +// labelSpan = 8, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) +// } +// ) +// @ApiModelProperty("申报人数") +// private String personNum; +//} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java index 942ef4423..628200104 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java @@ -1,9 +1,5 @@ package com.engine.salary.entity.taxpayment.dto; -import com.weaver.common.component.form.item.WeaFormItemType; -import com.weaver.hrm.salary.annotation.SalaryForm; -import com.weaver.hrm.salary.annotation.SalaryFormItem; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -24,14 +20,6 @@ import lombok.NoArgsConstructor; @ApiModel("查询缴费信息") public class TaxPayTypeFormDTO { - @SalaryForm( - label = "缴款方式", - labelId = 175127, - labelSpan = 8, - items = { - @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = TaxPaymentTypeEnum.class) - } - ) @ApiModelProperty("缴款方式") private String type; diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java index e0b38be9f..36b234da2 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java @@ -13,7 +13,7 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor @ApiModel("查询缴费凭证") -public class TaxWithholdingVoucherFeedbackDTO extends TaxFeedbackResultDTO{ +public class TaxWithholdingVoucherFeedbackDTO extends TaxFeedbackResultDTO { /** * 申报类型代码 */ diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index 2b57b8a1b..dd3f86edb 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.taxpayment.param; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -31,7 +30,7 @@ public class TaxPaymentQueryParam { private Long taxDeclareRecordId; /** - * @see TaxPaymentServiceTypeEnum + * TaxPaymentServiceTypeEnum */ @ApiModelProperty("业务类型") private Integer type; diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 246630568..614c5ee70 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -1,7 +1,5 @@ package com.engine.salary.entity.taxpayment.po; -import com.baomidou.mybatisplus.annotation.TableName; -import com.weaver.common.elog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -21,85 +19,85 @@ import java.time.LocalDateTime; @Builder @NoArgsConstructor @AllArgsConstructor -@TableName("hrsa_tax_payment_request") -@ElogTransform(name = "个税辅助缴款-请求信息") +//hrsa_tax_payment_request") +//个税辅助缴款-请求信息") public class TaxPaymentRequestPO implements Serializable { private static final long serialVersionUID = -203732044881927518L; /** * 主键id */ - @ElogTransform(name = "主键id") + //主键id") private Long id; /** * 个税扣缴义务人的主键id */ - @ElogTransform(name = "个税扣缴义务人的主键id") + //个税扣缴义务人的主键id") private Long taxAgentId; /** * 个税申报记录ID */ - @ElogTransform(name = "个税申报记录id") + //个税申报记录id") private Long taxDeclareRecordId; /** * 税款所属期 */ - @ElogTransform(name = "税款所属期") + //税款所属期") private LocalDate taxYearMonth; /** * 异步请求ID */ - @ElogTransform(name = "异步请求ID") + //异步请求ID") private String requestId; /** * 请求类型 * - * @see com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum + * com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum */ - @ElogTransform(name = "异步请求ID") + //异步请求ID") private Integer requestType; /** * 是否已获取反馈 * - * @see com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum + * com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum */ - @ElogTransform(name = "是否已获取反馈") + //是否已获取反馈") private Integer feedback; /** * 租户key */ - @ElogTransform(name = "租户key", ignore = true) + //租户key", ignore = true) private String tenantKey; /** * 创建人id */ - @ElogTransform(name = "创建人id", ignore = true) + //创建人id", ignore = true) private Long creator; /** * 是否删除 */ - @ElogTransform(name = "是否删除", ignore = true) + //是否删除", ignore = true) private Integer deleteType; /** * 创建时间 */ - @ElogTransform(name = "创建时间", ignore = true) + //创建时间", ignore = true) private LocalDateTime createTime; /** * 更新时间 */ - @ElogTransform(name = "更新时间", ignore = true) + //更新时间", ignore = true) private LocalDateTime updateTime; } diff --git a/src/com/engine/salary/enums/SalaryOnOffEnum.java b/src/com/engine/salary/enums/SalaryOnOffEnum.java index 7afb5aab0..75b2c4184 100644 --- a/src/com/engine/salary/enums/SalaryOnOffEnum.java +++ b/src/com/engine/salary/enums/SalaryOnOffEnum.java @@ -1,6 +1,7 @@ package com.engine.salary.enums; +import java.util.Objects; /** * @description: 是、否 @@ -40,4 +41,14 @@ public enum SalaryOnOffEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static SalaryOnOffEnum parseByValue(int value) { + for (SalaryOnOffEnum onOffEnum : SalaryOnOffEnum.values()) { + if (Objects.equals(onOffEnum.getValue(), value)) { + return onOffEnum; + } + } + return null; + } + } diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java new file mode 100644 index 000000000..d0f20caa1 --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java @@ -0,0 +1,51 @@ +package com.engine.salary.enums.taxagent; + +import java.util.Objects; + +/** + * 个人扣缴义务人-报税信息-验证类型 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnCheckTypeEnum { + + /** + * 报税信息验证 + */ + MAIN_CHECK(1, "报税信息验证"), + /** + * 登记序号+税号验证 + */ + REGISTRATION_CHECK(2, "登记序号+税号验证"), + /** + * 部门编码验证 + */ + DEPARTMENT_CHECK(3, "部门编码验证"); + + private final int value; + + private final String defaultLabel; + + TaxAgentTaxReturnCheckTypeEnum(int value, String defaultLabel) { + this.value = value; + this.defaultLabel = defaultLabel; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxAgentTaxReturnCheckTypeEnum parseByValue(int value) { + for (TaxAgentTaxReturnCheckTypeEnum typeEnum : TaxAgentTaxReturnCheckTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java new file mode 100644 index 000000000..710265f77 --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.taxagent; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 个人扣缴义务人-报税信息-密码校验类型 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnPasswordTypeEnum implements BaseEnum { + + /** + * 个税网报密码 + */ + TAX_NET_PASSWORD(0, "个税网报密码", 144391), + /** + * 实名账号密码 + */ + REAL_NAME_PASSWORD(2, "实名账号密码", 144392); + + private final int value; + + private final String defaultLabel; + + private final int labelId; + + TaxAgentTaxReturnPasswordTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static TaxAgentTaxReturnPasswordTypeEnum parseByValue(int value) { + for (TaxAgentTaxReturnPasswordTypeEnum typeEnum : TaxAgentTaxReturnPasswordTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java new file mode 100644 index 000000000..8f576d7ed --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java @@ -0,0 +1,57 @@ +package com.engine.salary.enums.taxagent; + +import java.util.Objects; + +/** + * 个人扣缴义务人-报税信息-验证状态 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnStatusEnum { + + /** + * 未验证 + */ + NOT_COMMIT(10, "未验证", 154753), + /** + * 成功 + */ + SUCCESS(20, "成功", 154751), + /** + * 失败 + */ + FAIL(30, "失败", 154752); + + private final Integer value; + + private final String desc; + + private final Integer labelId; + + TaxAgentTaxReturnStatusEnum(Integer value, String desc, Integer labelId) { + this.value = value; + this.desc = desc; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return desc; + } + + public static TaxAgentTaxReturnStatusEnum parseByValue(Integer value) { + if (value == null) { + return TaxAgentTaxReturnStatusEnum.NOT_COMMIT; + } + for (TaxAgentTaxReturnStatusEnum statusEnum : TaxAgentTaxReturnStatusEnum.values()) { + if (Objects.equals(statusEnum.getValue(), value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java new file mode 100644 index 000000000..9918aca0f --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java @@ -0,0 +1,44 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 作废申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/11 5:34 PM + * @version:v1.0 + */ +public enum CancelDeclareStatusEnum implements BaseEnum { + + CANCEL_SUCCESS(8, "作废成功", 160490), + CANCEL_FAIL(10, "作废失败", 160491); + + + CancelDeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java new file mode 100644 index 000000000..2396b34a2 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java @@ -0,0 +1,46 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 申报反馈状态 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 2:13 PM + * @version:v1.0 + */ +public enum DeclareFeedBackStatusEnum implements BaseEnum { + + DECLARE_SUCCESS_NO_PAY(1, "申报成功,无需缴款", 160492), + DECLARE_SUCCESS_UNPAID(2, "申报成功,未缴款", 160493), + DECLARE_FAIL(4, "申报失败", 160494), + DECLARE_SUCCESS_PAID(5, "已缴款", 160498), + ; + + DeclareFeedBackStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java b/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java new file mode 100644 index 000000000..b4d6d3128 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java @@ -0,0 +1,45 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 个税申报对接 - 接口业务类型 + * + * @author chengliming + * @date 2022-11-22 10:39:39 + */ +@SuppressWarnings("squid:S00115") +public enum EnumDeclareApiBusinessType implements BaseEnum { + + ADD_UP_DEDUCTION(1, "累计专项附加扣除", 85380), + EMPLOYEE_DECLARATION(2, "人员信息报送", 158769), + TAX_DECLARATION(3, "个税申报", 95835); + + private final Integer value; + + private final String defaultLabel; + + private final Integer labelId; + + EnumDeclareApiBusinessType(Integer value, String defaultLabel, Integer labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public Integer getValue() { + return value; + } + +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java new file mode 100644 index 000000000..42d758508 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java @@ -0,0 +1,44 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 个税扣缴义务人范围 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/17 10:46 AM + * @version:v1.0 + */ +public enum TaxAgentRangeEnum implements BaseEnum { + + ALL_TAX_AGENT(1, "所有个税扣缴义务人", 107731), + ADMIN_TAX_AGENT(2, "作为管理员的个税扣缴义务人", 177858), + SELECT_TAX_AGENT(3, "选择个税扣缴义务人", 177859); + + TaxAgentRangeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java new file mode 100644 index 000000000..ba892090a --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java @@ -0,0 +1,42 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 个税对接接口环境 + * + * @author chengliming + * @date 2023-01-04 14:18:36 + */ +public enum TaxDeclareApiProfileEnum implements BaseEnum { + + TEST(0, "测试地址", 0), + PROD(1, "正式地址", 0); + + TaxDeclareApiProfileEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java new file mode 100644 index 000000000..6bad22d9a --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java @@ -0,0 +1,49 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 申报状态 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 1:58 PM + * @version:v1.0 + */ +public enum TaxDeclareStatusEnum implements BaseEnum { + + NOT_DECLARE(1, "未申报", 160495), + DECLARING(2, "申报中", 160496), + DECLARE_FAIL(3, "申报失败", 160494), + DECLARE_CANCELLING(4, "作废中", 160497), + DECLARE_SUCCESS_NO_PAY(5, "申报成功,无需缴款", 160492), + DECLARE_SUCCESS_UNPAID(6, "申报成功,未缴款", 160493), + DECLARE_SUCCESS_PAID(7, "已缴款", 160498), + DECLARE_SUCCESS_PAYING(8, "缴款中", 160499); + + TaxDeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java new file mode 100644 index 000000000..c9a39aabe --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java @@ -0,0 +1,43 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 申报类型 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/3 1:41 PM + * @version:v1.0 + */ +public enum TaxDeclareTypeEnum implements BaseEnum { + + NORMAL_DECLARE(0, "正常申报", 177857), + UPDATE_DECLARE(1, "更正申报", 177637); + + TaxDeclareTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java new file mode 100644 index 000000000..58662abc7 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.taxdeclaration; + +import java.util.Objects; + +/** + * 个税辅助缴款-请求类型 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentServiceTypeEnum { + + /** + * 获取企业的三方信息 + */ + QUERY_AGREEMENT(1, "企业三方信息", 174411), + /** + * 三方协议缴款反馈 + */ + WITHHOLDING_PAY(2, "三方缴款", 174411), + /** + * 缴款凭证反馈 + */ + WITHHOLDING_VOUCHER(3, "银行端缴款凭证", 192313), + /** + * 完税证明 + */ + WITHHELD_VOUCHER(4, "完税证明", 184013), + ; + + private final int value; + + private final String defaultLabel; + + private int labelId; + + TaxPaymentServiceTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentServiceTypeEnum parseByValue(int value) { + for (TaxPaymentServiceTypeEnum typeEnum : TaxPaymentServiceTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java new file mode 100644 index 000000000..32872d0a6 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java @@ -0,0 +1,53 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 个税辅助缴款状态 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentStatusEnum implements BaseEnum { + SUCCESS(0, "扣款成功", 0), + VERIFY_INFO_FAIL(1, "信息校验失败", 0), + DONT_NEED(2, "无欠费记录", 0), + FAIL(3, "扣款失败", 0), + ; + + private final int value; + + private final String defaultLabel; + + private final int labelId; + + TaxPaymentStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return this.labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentStatusEnum parseByValue(int value) { + for (TaxPaymentStatusEnum typeEnum : TaxPaymentStatusEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java new file mode 100644 index 000000000..b3aeeed48 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java @@ -0,0 +1,57 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 个税辅助缴款-请求类型 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentTypeEnum implements BaseEnum { + /** + * 三方协议缴款反馈 + */ + WITHHOLDING_PAY(1, "三方缴款", 174411), + /** + * 缴款凭证反馈 + */ + WITHHOLDING_VOUCHER(2, "缴款凭证打印", 192313), + ; + + private final int value; + + private final String defaultLabel; + + private int labelId; + + TaxPaymentTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return this.labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentTypeEnum parseByValue(int value) { + for (TaxPaymentTypeEnum typeEnum : TaxPaymentTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java index 437d8376e..f770c4369 100644 --- a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java +++ b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java @@ -6,280 +6,281 @@ import com.engine.salary.util.SalaryI18nUtil; import org.apache.commons.compress.utils.Lists; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; import java.util.LinkedList; import java.util.List; -@Component public class ExcelFuncs { - protected final Logger logger = LoggerFactory.getLogger(getClass()); - final static private String ALLFORM="all"; - final static private String CURRENTDATA="current_data"; - static String normalStr="{\"key\":\"\",\"fieldId\":\"\",\"componentKey\":\"\",\"term\":\"\",\"formId\":\"\",\"content\":\"\",\"fieldType\":\"\"}"; - static public JSONObject normalJson= JSON.parseObject(normalStr); - static private String[] nullParamDatas=new String[]{}; - static private String[] paramDatas=new String[]{}; - static private String[] allParamDatas=new String[]{"{}","[]"}; - static private String[] moduleList=new String[]{"biaoge","workflow"}; - private FuncDescUtil funcDescUtil; - public List getCompList(){ - //比较操作符 - List compList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc(">",SalaryI18nUtil.getI18nLabel(12132,"大于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + protected final Logger logger = LoggerFactory.getLogger(getClass()); + final static private String ALLFORM = "all"; + final static private String CURRENTDATA = "current_data"; + static String normalStr = "{\"key\":\"\",\"fieldId\":\"\",\"componentKey\":\"\",\"term\":\"\",\"formId\":\"\",\"content\":\"\",\"fieldType\":\"\"}"; + static public JSONObject normalJson = JSON.parseObject(normalStr); + static private String[] nullParamDatas = new String[]{}; + static private String[] paramDatas = new String[]{}; + static private String[] allParamDatas = new String[]{"{}", "[]"}; + static private String[] moduleList = new String[]{"biaoge", "workflow"}; + private FuncDescUtil funcDescUtil; - excelFunc=new ExcelFunc(">=",SalaryI18nUtil.getI18nLabel(27694,"大于等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + public List getCompList() { + //比较操作符 + List compList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc(">", SalaryI18nUtil.getI18nLabel(12132, "大于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - excelFunc=new ExcelFunc("<",SalaryI18nUtil.getI18nLabel(20009,"小于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc(">=", SalaryI18nUtil.getI18nLabel(27694, "大于等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - excelFunc=new ExcelFunc("<=",SalaryI18nUtil.getI18nLabel(15251,"小于等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc("<", SalaryI18nUtil.getI18nLabel(20009, "小于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("=",SalaryI18nUtil.getI18nLabel(15112,"等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc("<=", SalaryI18nUtil.getI18nLabel(15251, "小于等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897,"不等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("=", SalaryI18nUtil.getI18nLabel(15112, "等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - return compList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897, "不等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - /** - * 日期函数的列表 - * @return - */ - public List getDateList(){ - //日期函数 - List dateList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("TODAY",SalaryI18nUtil.getI18nLabel(94924,"当前日期"), funcDescUtil.get("TODAY"),"TODAY()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + return compList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NOW",SalaryI18nUtil.getI18nLabel(94925,"当前日期时间"), funcDescUtil.get("NOW"),"NOW()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + /** + * 日期函数的列表 + * + * @return + */ + public List getDateList() { + //日期函数 + List dateList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("TODAY", SalaryI18nUtil.getI18nLabel(94924, "当前日期"), funcDescUtil.get("TODAY"), "TODAY()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEADD",SalaryI18nUtil.getI18nLabel(94926,"对日期加减年、月、日"), funcDescUtil.get("DATEADD"),"DATEADD(日期, 数值, ['单位'])",nullParamDatas,paramArray,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NOW", SalaryI18nUtil.getI18nLabel(94925, "当前日期时间"), funcDescUtil.get("NOW"), "NOW()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEDIFF",SalaryI18nUtil.getI18nLabel(94927,"返回两个日期的差值"), funcDescUtil.get("DATEDIFF"),"DATEDIFF(日期1, 日期2, ['单位'])",nullParamDatas,paramArray,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEADD", SalaryI18nUtil.getI18nLabel(94926, "对日期加减年、月、日"), funcDescUtil.get("DATEADD"), "DATEADD(日期, 数值, ['单位'])", nullParamDatas, paramArray, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEFORMAT",SalaryI18nUtil.getI18nLabel(94928,"返回指定格式的日期"), funcDescUtil.get("DATEFORMAT"),"DATEFORMAT(日期, '可选格式')",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEDIFF", SalaryI18nUtil.getI18nLabel(94927, "返回两个日期的差值"), funcDescUtil.get("DATEDIFF"), "DATEDIFF(日期1, 日期2, ['单位'])", nullParamDatas, paramArray, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("YEAR",SalaryI18nUtil.getI18nLabel(94929,"返回日期中的年"), funcDescUtil.get("YEAR"),"YEAR(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEFORMAT", SalaryI18nUtil.getI18nLabel(94928, "返回指定格式的日期"), funcDescUtil.get("DATEFORMAT"), "DATEFORMAT(日期, '可选格式')", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{"String"}; - excelFunc=new ExcelFunc("MONTH",SalaryI18nUtil.getI18nLabel(94930,"返回日期中的月"), funcDescUtil.get("MONTH"),"MONTH(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("YEAR", SalaryI18nUtil.getI18nLabel(94929, "返回日期中的年"), funcDescUtil.get("YEAR"), "YEAR(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DAY",SalaryI18nUtil.getI18nLabel(94931,"返回日期中的日"), funcDescUtil.get("DAY"),"DAY(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{"String"}; + excelFunc = new ExcelFunc("MONTH", SalaryI18nUtil.getI18nLabel(94930, "返回日期中的月"), funcDescUtil.get("MONTH"), "MONTH(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("HOUR",SalaryI18nUtil.getI18nLabel(94932,"返回日期中的小时"), funcDescUtil.get("HOUR"),"HOUR(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DAY", SalaryI18nUtil.getI18nLabel(94931, "返回日期中的日"), funcDescUtil.get("DAY"), "DAY(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MINUTE",SalaryI18nUtil.getI18nLabel(94933,"返回日期中的分钟"), funcDescUtil.get("MINUTE"),"MINUTE(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("HOUR", SalaryI18nUtil.getI18nLabel(94932, "返回日期中的小时"), funcDescUtil.get("HOUR"), "HOUR(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SECOND",SalaryI18nUtil.getI18nLabel(94934,"返回日期中的秒"), funcDescUtil.get("SECOND"),"SECOND(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MINUTE", SalaryI18nUtil.getI18nLabel(94933, "返回日期中的分钟"), funcDescUtil.get("MINUTE"), "MINUTE(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("WEEKNUM",SalaryI18nUtil.getI18nLabel(94936,"返回日期为第几周"), funcDescUtil.get("WEEKNUM"),"WEEKNUM(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SECOND", SalaryI18nUtil.getI18nLabel(94934, "返回日期中的秒"), funcDescUtil.get("SECOND"), "SECOND(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("WEEKDAY",SalaryI18nUtil.getI18nLabel(94937,"返回日期为星期几"), funcDescUtil.get("WEEKDAY"),"WEEKDAY(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("WEEKNUM", SalaryI18nUtil.getI18nLabel(94936, "返回日期为第几周"), funcDescUtil.get("WEEKNUM"), "WEEKNUM(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NETWORKDAYSPI",SalaryI18nUtil.getI18nLabel(94938,"返回指定日期之间包含的工作日天数(仅限的过去时间)"), funcDescUtil.get("NETWORKDAYSPI"),"NETWORKDAYSPI(日期1, 日期2, 成员)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("WEEKDAY", SalaryI18nUtil.getI18nLabel(94937, "返回日期为星期几"), funcDescUtil.get("WEEKDAY"), "WEEKDAY(日期)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("EOMONTH",SalaryI18nUtil.getI18nLabel(94939,"返回某月最后一天日期"), funcDescUtil.get("EOMONTH"),"EOMONTH(日期,指定日期之前或之后的月数)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NETWORKDAYSPI", SalaryI18nUtil.getI18nLabel(94938, "返回指定日期之间包含的工作日天数(仅限的过去时间)"), funcDescUtil.get("NETWORKDAYSPI"), "NETWORKDAYSPI(日期1, 日期2, 成员)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRYEAR",SalaryI18nUtil.getI18nLabel(101059,"返回当前年份"), funcDescUtil.get("CURRYEAR"),"CURRYEAR()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("EOMONTH", SalaryI18nUtil.getI18nLabel(94939, "返回某月最后一天日期"), funcDescUtil.get("EOMONTH"), "EOMONTH(日期,指定日期之前或之后的月数)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRMONTH",SalaryI18nUtil.getI18nLabel(101060,"返回当前月份"), funcDescUtil.get("CURRMONTH"),"CURRMONTH()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRYEAR", SalaryI18nUtil.getI18nLabel(101059, "返回当前年份"), funcDescUtil.get("CURRYEAR"), "CURRYEAR()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRDAY",SalaryI18nUtil.getI18nLabel(101061,"返回当前第几日(当月)"), funcDescUtil.get("CURRDAY"),"CURRDAY()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRMONTH", SalaryI18nUtil.getI18nLabel(101060, "返回当前月份"), funcDescUtil.get("CURRMONTH"), "CURRMONTH()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRWEEK",SalaryI18nUtil.getI18nLabel(101062,"返回当前是周几"), funcDescUtil.get("CURRWEEK"),"CURRWEEK()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRDAY", SalaryI18nUtil.getI18nLabel(101061, "返回当前第几日(当月)"), funcDescUtil.get("CURRDAY"), "CURRDAY()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRHOUR",SalaryI18nUtil.getI18nLabel(101063,"返回当前小时"), funcDescUtil.get("CURRHOUR"),"CURRHOUR()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRWEEK", SalaryI18nUtil.getI18nLabel(101062, "返回当前是周几"), funcDescUtil.get("CURRWEEK"), "CURRWEEK()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRMINUTE",SalaryI18nUtil.getI18nLabel(101064,"返回当前分"), funcDescUtil.get("CURRMINUTE"),"CURRMINUTE()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRHOUR", SalaryI18nUtil.getI18nLabel(101063, "返回当前小时"), funcDescUtil.get("CURRHOUR"), "CURRHOUR()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRSECOND",SalaryI18nUtil.getI18nLabel(101065,"返回当前秒"), funcDescUtil.get("CURRSECOND"),"CURRSECOND()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MAXDATE",SalaryI18nUtil.getI18nLabel(100803,"返回一组日期中的最大值"), funcDescUtil.get("MAXDATE"),"MAXDATE(日期1,日期2,……)",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRMINUTE", SalaryI18nUtil.getI18nLabel(101064, "返回当前分"), funcDescUtil.get("CURRMINUTE"), "CURRMINUTE()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MINDATE",SalaryI18nUtil.getI18nLabel(100805,"返回一组日期中的最小值"), funcDescUtil.get("MINDATE"),"MINDATE(日期1,日期2,……)",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); - return dateList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRSECOND", SalaryI18nUtil.getI18nLabel(101065, "返回当前秒"), funcDescUtil.get("CURRSECOND"), "CURRSECOND()", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MAXDATE", SalaryI18nUtil.getI18nLabel(100803, "返回一组日期中的最大值"), funcDescUtil.get("MAXDATE"), "MAXDATE(日期1,日期2,……)", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - /** - * 逻辑函数的列表 - * @return - */ - public List getLogicList(){ - //逻辑函数 - List logicList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("IF",SalaryI18nUtil.getI18nLabel(94940,"如果条件为真,则...否则..."), funcDescUtil.get("IF"),"IF(条件, 表达式1, 表达式2)",paramArray,nullParamDatas,"Object",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MINDATE", SalaryI18nUtil.getI18nLabel(100805, "返回一组日期中的最小值"), funcDescUtil.get("MINDATE"), "MINDATE(日期1,日期2,……)", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); + return dateList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("AND",SalaryI18nUtil.getI18nLabel(51100,"且"), funcDescUtil.get("AND"),"AND(条件1, 条件2, [条件3, …])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + /** + * 逻辑函数的列表 + * + * @return + */ + public List getLogicList() { + //逻辑函数 + List logicList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("IF", SalaryI18nUtil.getI18nLabel(94940, "如果条件为真,则...否则..."), funcDescUtil.get("IF"), "IF(条件, 表达式1, 表达式2)", paramArray, nullParamDatas, "Object", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("OR",SalaryI18nUtil.getI18nLabel(35824,"或"), funcDescUtil.get("OR"),"OR(条件1, 条件2, [条件3, …])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("AND", SalaryI18nUtil.getI18nLabel(51100, "且"), funcDescUtil.get("AND"), "AND(条件1, 条件2, [条件3, …])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NOT",SalaryI18nUtil.getI18nLabel(94942,"反转真假结果"), funcDescUtil.get("NOT"),"NOT(逻辑结果)",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("OR", SalaryI18nUtil.getI18nLabel(35824, "或"), funcDescUtil.get("OR"), "OR(条件1, 条件2, [条件3, …])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IN",SalaryI18nUtil.getI18nLabel(94943,"变量是否包含在一组结果中"), funcDescUtil.get("IN"),"IN(变量, [变量1, 变量2, …])",paramArray,allParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NOT", SalaryI18nUtil.getI18nLabel(94942, "反转真假结果"), funcDescUtil.get("NOT"), "NOT(逻辑结果)", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LIKE",SalaryI18nUtil.getI18nLabel(94944,"文本是否包含任意一个关键字"), funcDescUtil.get("LIKE"),"LIKE(文本, [文本1, 文本2, …])",paramArray,allParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IN", SalaryI18nUtil.getI18nLabel(94943, "变量是否包含在一组结果中"), funcDescUtil.get("IN"), "IN(变量, [变量1, 变量2, …])", paramArray, allParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISEMPTY",SalaryI18nUtil.getI18nLabel(94945,"是否为空"), funcDescUtil.get("ISEMPTY"),"ISEMPTY(变量)",paramArray,paramDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LIKE", SalaryI18nUtil.getI18nLabel(94944, "文本是否包含任意一个关键字"), funcDescUtil.get("LIKE"), "LIKE(文本, [文本1, 文本2, …])", paramArray, allParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRUE",SalaryI18nUtil.getI18nLabel(94946,"返回真"), funcDescUtil.get("TRUE"),"TRUE()",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISEMPTY", SalaryI18nUtil.getI18nLabel(94945, "是否为空"), funcDescUtil.get("ISEMPTY"), "ISEMPTY(变量)", paramArray, paramDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("FALSE",SalaryI18nUtil.getI18nLabel(94947,"返回假"), funcDescUtil.get("FALSE"),"FALSE()",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRUE", SalaryI18nUtil.getI18nLabel(94946, "返回真"), funcDescUtil.get("TRUE"), "TRUE()", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IFS",SalaryI18nUtil.getI18nLabel(94948,"多条件"), funcDescUtil.get("IFS"),"IFS({条件1},{结果1},{条件2},{结果2}...{默认结果})",paramArray,nullParamDatas,"Object",CURRENTDATA); - logicList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("FALSE", SalaryI18nUtil.getI18nLabel(94947, "返回假"), funcDescUtil.get("FALSE"), "FALSE()", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("FIND",SalaryI18nUtil.getI18nLabel(31835,"查找"), funcDescUtil.get("FIND"),"FIND([{查找值1},{查找值2}...{查找值N}],[{查找目标1},{查找目标2}...{查找目标N}])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); - return logicList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IFS", SalaryI18nUtil.getI18nLabel(94948, "多条件"), funcDescUtil.get("IFS"), "IFS({条件1},{结果1},{条件2},{结果2}...{默认结果})", paramArray, nullParamDatas, "Object", CURRENTDATA); + logicList.add(excelFunc); - /** - * 字符函数的列表 - * @return - */ - public List getStringList(){ - //字符函数 - List stringList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("CONCAT",SalaryI18nUtil.getI18nLabel(94949,"链接多个文本"), funcDescUtil.get("CONCAT"),"CONCAT(文本1, 文本2, [文本3, …])",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("FIND", SalaryI18nUtil.getI18nLabel(31835, "查找"), funcDescUtil.get("FIND"), "FIND([{查找值1},{查找值2}...{查找值N}],[{查找目标1},{查找目标2}...{查找目标N}])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); + return logicList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TEXT",SalaryI18nUtil.getI18nLabel(94950,"将变量转为文本"), funcDescUtil.get("TEXT"),"TEXT(变量)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + /** + * 字符函数的列表 + * + * @return + */ + public List getStringList() { + //字符函数 + List stringList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("CONCAT", SalaryI18nUtil.getI18nLabel(94949, "链接多个文本"), funcDescUtil.get("CONCAT"), "CONCAT(文本1, 文本2, [文本3, …])", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("VALUE",SalaryI18nUtil.getI18nLabel(94951,"将文本转为数字"), funcDescUtil.get("VALUE"),"VALUE(文本)",paramArray,nullParamDatas,"Number",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TEXT", SalaryI18nUtil.getI18nLabel(94950, "将变量转为文本"), funcDescUtil.get("TEXT"), "TEXT(变量)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LEN",SalaryI18nUtil.getI18nLabel(94952,"返回文本长度"), funcDescUtil.get("LEN"),"LEN(文本)",paramArray,nullParamDatas,"Number",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("VALUE", SalaryI18nUtil.getI18nLabel(94951, "将文本转为数字"), funcDescUtil.get("VALUE"), "VALUE(文本)", paramArray, nullParamDatas, "Number", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SEARCH",SalaryI18nUtil.getI18nLabel(94953,"在文本中查找关键字"), funcDescUtil.get("SEARCH"),"SEARCH(关键字, 文本, [搜索开始位置])",paramArray,nullParamDatas,"Number",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LEN", SalaryI18nUtil.getI18nLabel(94952, "返回文本长度"), funcDescUtil.get("LEN"), "LEN(文本)", paramArray, nullParamDatas, "Number", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("REPLACE",SalaryI18nUtil.getI18nLabel(94954,"替换文本中的字"), funcDescUtil.get("REPLACE"),"REPLACE(原文本, 替换开始位置, 替换字符数, 新文本)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SEARCH", SalaryI18nUtil.getI18nLabel(94953, "在文本中查找关键字"), funcDescUtil.get("SEARCH"), "SEARCH(关键字, 文本, [搜索开始位置])", paramArray, nullParamDatas, "Number", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("REPT",SalaryI18nUtil.getI18nLabel(94955,"将文本重复指定次数"), funcDescUtil.get("REPT"),"REPT(文本, 重复次数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("REPLACE", SalaryI18nUtil.getI18nLabel(94954, "替换文本中的字"), funcDescUtil.get("REPLACE"), "REPLACE(原文本, 替换开始位置, 替换字符数, 新文本)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("PAD",SalaryI18nUtil.getI18nLabel(94956,"将文本填充至指定长度"), funcDescUtil.get("PAD"),"PAD(原文本, 长度, 填充用的文本, ['填充位置'])",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("REPT", SalaryI18nUtil.getI18nLabel(94955, "将文本重复指定次数"), funcDescUtil.get("REPT"), "REPT(文本, 重复次数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRIM",SalaryI18nUtil.getI18nLabel(94957,"清除前后空格"), funcDescUtil.get("TRIM"),"TRIM(文本)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("PAD", SalaryI18nUtil.getI18nLabel(94956, "将文本填充至指定长度"), funcDescUtil.get("PAD"), "PAD(原文本, 长度, 填充用的文本, ['填充位置'])", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LEFT",SalaryI18nUtil.getI18nLabel(94958,"返回文本左侧开始的文字"), funcDescUtil.get("LEFT"),"LEFT(文本, 截取字符数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRIM", SalaryI18nUtil.getI18nLabel(94957, "清除前后空格"), funcDescUtil.get("TRIM"), "TRIM(文本)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("RIGHT",SalaryI18nUtil.getI18nLabel(94959,"返回文本右侧开始的文字"), funcDescUtil.get("RIGHT"),"RIGHT(文本, 截取字符数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LEFT", SalaryI18nUtil.getI18nLabel(94958, "返回文本左侧开始的文字"), funcDescUtil.get("LEFT"), "LEFT(文本, 截取字符数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MID",SalaryI18nUtil.getI18nLabel(94960,"返回文本指定位置开始的文字"), funcDescUtil.get("MID"),"MID(文本, 指定位置, 截取字符数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("RIGHT", SalaryI18nUtil.getI18nLabel(94959, "返回文本右侧开始的文字"), funcDescUtil.get("RIGHT"), "RIGHT(文本, 截取字符数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SCORE",SalaryI18nUtil.getI18nLabel(94961,"获取选项型控件分数"), funcDescUtil.get("SCORE"),"SCORE({选项型控件})",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MID", SalaryI18nUtil.getI18nLabel(94960, "返回文本指定位置开始的文字"), funcDescUtil.get("MID"), "MID(文本, 指定位置, 截取字符数)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IDCARD",SalaryI18nUtil.getI18nLabel(94962,"身份证函数"), funcDescUtil.get("IDCARD"),"IDCARD({身份证号码}, {查找类型})",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SCORE", SalaryI18nUtil.getI18nLabel(94961, "获取选项型控件分数"), funcDescUtil.get("SCORE"), "SCORE({选项型控件})", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); + + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IDCARD", SalaryI18nUtil.getI18nLabel(94962, "身份证函数"), funcDescUtil.get("IDCARD"), "IDCARD({身份证号码}, {查找类型})", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISSTRING",SalaryI18nUtil.getI18nLabel(0,"是否是字符串"), funcDescUtil.get("ISSTRING"),"ISSTRING({任意控件})",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISSTRING", SalaryI18nUtil.getI18nLabel(0, "是否是字符串"), funcDescUtil.get("ISSTRING"), "ISSTRING({任意控件})", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); // paramArray=new String[]{}; // excelFunc=new ExcelFunc("SUBSTRING",SalaryI18nUtil.getI18nLabel(97524,"字符截取函数"), funcDescUtil.get("SUBSTRING"),"SUBSTRING({源字符}, {截取开始位置},{截取结束位置})",paramArray,nullParamDatas,"String",CURRENTDATA); @@ -296,123 +297,129 @@ public class ExcelFuncs { // paramArray=new String[]{}; // excelFunc=new ExcelFunc("EXACT",SalaryI18nUtil.getI18nLabel(97528,"字符比较函数"), funcDescUtil.get("EXACT"),"EXACT({字符1}, {字符2})",paramArray,nullParamDatas,"String",CURRENTDATA); // stringList.add(excelFunc); - return stringList; - } + return stringList; + } - /** - * 数学函数的列表 - * @return - */ - public List getMathList(){ - List mathList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUNDUP",SalaryI18nUtil.getI18nLabel(94963,"向上舍入"), funcDescUtil.get("ROUNDUP"),"ROUNDUP(数值, [小数位精确度])",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + /** + * 数学函数的列表 + * + * @return + */ + public List getMathList() { + List mathList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUNDUP", SalaryI18nUtil.getI18nLabel(94963, "向上舍入"), funcDescUtil.get("ROUNDUP"), "ROUNDUP(数值, [小数位精确度])", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUND",SalaryI18nUtil.getI18nLabel(17392,"四舍五入"), funcDescUtil.get("ROUND"),"ROUND(数值, [小数位精确度])",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUND", SalaryI18nUtil.getI18nLabel(17392, "四舍五入"), funcDescUtil.get("ROUND"), "ROUND(数值, [小数位精确度])", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUNDDOWN",SalaryI18nUtil.getI18nLabel(94964,"向下舍入"), funcDescUtil.get("ROUNDDOWN"),"ROUNDDOWN(数值, [小数位精确度])",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUNDDOWN", SalaryI18nUtil.getI18nLabel(94964, "向下舍入"), funcDescUtil.get("ROUNDDOWN"), "ROUNDDOWN(数值, [小数位精确度])", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("AGGREGATION",SalaryI18nUtil.getI18nLabel(94965,"聚合运算"), funcDescUtil.get("AGGREGATION"),"AGGREGATION({数字}...,{聚合运算类型})",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("AGGREGATION", SalaryI18nUtil.getI18nLabel(94965, "聚合运算"), funcDescUtil.get("AGGREGATION"), "AGGREGATION({数字}...,{聚合运算类型})", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MOD",SalaryI18nUtil.getI18nLabel(94966,"求余"), funcDescUtil.get("MOD"),"ROUNDDOWN({数字},{数字})",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MOD", SalaryI18nUtil.getI18nLabel(94966, "求余"), funcDescUtil.get("MOD"), "ROUNDDOWN({数字},{数字})", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRUNC",SalaryI18nUtil.getI18nLabel(94967,"数字格式化"), funcDescUtil.get("TRUNC"),"ROUNDDOWN({数字},{精度})",paramArray,nullParamDatas,"Number",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRUNC", SalaryI18nUtil.getI18nLabel(94967, "数字格式化"), funcDescUtil.get("TRUNC"), "ROUNDDOWN({数字},{精度})", paramArray, nullParamDatas, "Number", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISINT",SalaryI18nUtil.getI18nLabel(0,"字符内容是否是整数"), funcDescUtil.get("ISINT"),"ISINT({字符})",paramArray,nullParamDatas,"String",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISINT", SalaryI18nUtil.getI18nLabel(0, "字符内容是否是整数"), funcDescUtil.get("ISINT"), "ISINT({字符})", paramArray, nullParamDatas, "String", CURRENTDATA); + mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISNUMBER",SalaryI18nUtil.getI18nLabel(0,"字符内容是否是数字"), funcDescUtil.get("ISNUMBER"),"ISNUMBER({字符})",paramArray,nullParamDatas,"String",CURRENTDATA); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISNUMBER", SalaryI18nUtil.getI18nLabel(0, "字符内容是否是数字"), funcDescUtil.get("ISNUMBER"), "ISNUMBER({字符})", paramArray, nullParamDatas, "String", CURRENTDATA); + mathList.add(excelFunc); - return mathList; + return mathList; - } + } - /** - * 查找函数的列表 - * @return - */ - public List getFindList(){ - List findList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("CHOOSE",SalaryI18nUtil.getI18nLabel(94968,"返回索引范围内指定的值"), funcDescUtil.get("CHOOSE"),"CHOOSE(数据源,[条件])",paramArray,nullParamDatas,"Array",CURRENTDATA); - findList.add(excelFunc); + /** + * 查找函数的列表 + * + * @return + */ + public List getFindList() { + List findList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("CHOOSE", SalaryI18nUtil.getI18nLabel(94968, "返回索引范围内指定的值"), funcDescUtil.get("CHOOSE"), "CHOOSE(数据源,[条件])", paramArray, nullParamDatas, "Array", CURRENTDATA); + findList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("VLOOKUPS",SalaryI18nUtil.getI18nLabel(94969,"按列查找,返回所需值"), funcDescUtil.get("VLOOKUPS"),"VLOOKUPS(表,[条件],[返回参数])",paramArray,nullParamDatas,"Array",CURRENTDATA); - findList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("VLOOKUPS", SalaryI18nUtil.getI18nLabel(94969, "按列查找,返回所需值"), funcDescUtil.get("VLOOKUPS"), "VLOOKUPS(表,[条件],[返回参数])", paramArray, nullParamDatas, "Array", CURRENTDATA); + findList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MATCH",SalaryI18nUtil.getI18nLabel(94970,"返回指定数值在指定数组区域中的位置"), funcDescUtil.get("MATCH"),"MATCH(值,[数组])",paramArray,nullParamDatas,"Number",CURRENTDATA); - findList.add(excelFunc); - return findList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MATCH", SalaryI18nUtil.getI18nLabel(94970, "返回指定数值在指定数组区域中的位置"), funcDescUtil.get("MATCH"), "MATCH(值,[数组])", paramArray, nullParamDatas, "Number", CURRENTDATA); + findList.add(excelFunc); + return findList; + } - /** - * 聚合函数 COUNT(表格, [统计条件]) - * @return - */ - public List getAggList(){ - List aggList=new LinkedList<>(); - ExcelFunc excelFunc=null; + /** + * 聚合函数 COUNT(表格, [统计条件]) + * + * @return + */ + public List getAggList() { + List aggList = new LinkedList<>(); + ExcelFunc excelFunc = null; - String [] paramArray=new String[]{"Form","Number","Boolean"}; - excelFunc=new ExcelFunc("COUNT", SalaryI18nUtil.getI18nLabel(16654,"计数"), funcDescUtil.get("COUNT"),"COUNT(表格)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + String[] paramArray = new String[]{"Form", "Number", "Boolean"}; + excelFunc = new ExcelFunc("COUNT", SalaryI18nUtil.getI18nLabel(16654, "计数"), funcDescUtil.get("COUNT"), "COUNT(表格)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("SUM",SalaryI18nUtil.getI18nLabel(95012,"求和") , funcDescUtil.get("SUM"),"SUM(数字字段)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("SUM", SalaryI18nUtil.getI18nLabel(95012, "求和"), funcDescUtil.get("SUM"), "SUM(数字字段)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("AVG",SalaryI18nUtil.getI18nLabel(19550,"平均值"), funcDescUtil.get("AVG"),"AVG(数字字段)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("AVG", SalaryI18nUtil.getI18nLabel(19550, "平均值"), funcDescUtil.get("AVG"), "AVG(数字字段)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("MIN",SalaryI18nUtil.getI18nLabel(12318,"最小值"), funcDescUtil.get("MIN"),"MIN(表格)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("MIN", SalaryI18nUtil.getI18nLabel(12318, "最小值"), funcDescUtil.get("MIN"), "MIN(表格)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("MAX",SalaryI18nUtil.getI18nLabel(66750,"最大值"), funcDescUtil.get("MAX"),"MAX(表格)",paramArray,paramDatas,"Number",ALLFORM); - aggList.add(excelFunc); - return aggList; - } + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("MAX", SalaryI18nUtil.getI18nLabel(66750, "最大值"), funcDescUtil.get("MAX"), "MAX(表格)", paramArray, paramDatas, "Number", ALLFORM); + aggList.add(excelFunc); + return aggList; + } - /** - * 财务类函数列表 - * @return - */ - public Object getFinanceList(){ - ExcelFunc excelFunc = null; - List funcs = Lists.newArrayList(); - excelFunc = new ExcelFunc("GETMONEY",SalaryI18nUtil.getI18nLabel(0,"获取锁给定数字的金额大写"), funcDescUtil.get("GETMONEY"),"GETMONEY({数字})",null,nullParamDatas,"",CURRENTDATA); - funcs.add(excelFunc); + /** + * 财务类函数列表 + * + * @return + */ + public Object getFinanceList() { + ExcelFunc excelFunc = null; + List funcs = Lists.newArrayList(); + excelFunc = new ExcelFunc("GETMONEY", SalaryI18nUtil.getI18nLabel(0, "获取锁给定数字的金额大写"), funcDescUtil.get("GETMONEY"), "GETMONEY({数字})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - return funcs; - } - /** - * 数据库函数列表 - * @return - */ - public Object getDataBaseList() { - ExcelFunc excelFunc = null; - List funcs = Lists.newArrayList(); + return funcs; + } + + /** + * 数据库函数列表 + * + * @return + */ + public Object getDataBaseList() { + ExcelFunc excelFunc = null; + List funcs = Lists.newArrayList(); // excelFunc = new ExcelFunc("GETHRMLOGINID",SalaryI18nUtil.getI18nLabel(100807,"返回指定人员系统账号"), funcDescUtil.get("GETHRMLOGINID"),"GETHRMLOGINID({表单.人员})",null,nullParamDatas,"",CURRENTDATA); // funcs.add(excelFunc); @@ -456,12 +463,12 @@ public class ExcelFuncs { // excelFunc = new ExcelFunc("GETALLSUPERSUBCOMPANY",SalaryI18nUtil.getI18nLabel(100833,"返回指定分部所有上级分部"), funcDescUtil.get("GETALLSUPERSUBCOMPANY"),"GETALLSUPERSUBCOMPANY({表单.分部})",null,nullParamDatas,"",CURRENTDATA); // funcs.add(excelFunc); - excelFunc = new ExcelFunc("GETHRMNAME",SalaryI18nUtil.getI18nLabel(100833,"获取人员名称"), funcDescUtil.get("GETHRMNAME"),"GETHRMNAME({人员})",null,nullParamDatas,"",CURRENTDATA); - funcs.add(excelFunc); + excelFunc = new ExcelFunc("GETHRMNAME", SalaryI18nUtil.getI18nLabel(100833, "获取人员名称"), funcDescUtil.get("GETHRMNAME"), "GETHRMNAME({人员})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - excelFunc = new ExcelFunc("GETHRMMOBILE",SalaryI18nUtil.getI18nLabel(100833,"获取人员手机号码"), funcDescUtil.get("GETHRMMOBILE"),"GETHRMMOBILE({人员})",null,nullParamDatas,"",CURRENTDATA); - funcs.add(excelFunc); + excelFunc = new ExcelFunc("GETHRMMOBILE", SalaryI18nUtil.getI18nLabel(100833, "获取人员手机号码"), funcDescUtil.get("GETHRMMOBILE"), "GETHRMMOBILE({人员})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - return funcs; - } + return funcs; + } } diff --git a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java index d4e5fcee3..666135c26 100644 --- a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java +++ b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.Map; -@Component + public class FuncDescUtil { protected final Logger logger = LoggerFactory.getLogger(FuncDescUtil.class); Map funcMap = new HashMap(); diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java new file mode 100644 index 000000000..c6cf9f5f0 --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java @@ -0,0 +1,72 @@ +package com.engine.salary.mapper.taxagent; + +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; + +import java.util.List; + +/** + * 个税扣缴义务人报税信息 + * + * @author chengliming + * @date: 2022-08-31 11:20:32 + */ +public interface TaxAgentTaxReturnMapper { + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxAgentTaxReturnPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param TaxAgentTaxReturnPO 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 修改,修改所有字段 + * + * @param TaxAgentTaxReturnPO 修改的记录 + * @return 返回影响行数 + */ + int update(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 修改,忽略null字段 + * + * @param TaxAgentTaxReturnPO 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 删除记录 + * + * @param TaxAgentTaxReturnPO 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + TaxAgentTaxReturnPO selectOneByTaxAgentId(Long taxAgentId); + + void updateByTaxAgentId(TaxAgentTaxReturnPO po); +} diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml new file mode 100644 index 000000000..6468afdac --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -0,0 +1,422 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + area_code + , t.check_status + , t.city + , t.create_time + , t.creator + , t.delete_type + , t.department_code + , t.department_name + , t.fail_reason + , t.id + , t.nation + , t.password_type + , t.province + , t.pwd + , t.real_account + , t.tax_agent_id + , t.tax_code + , t.tax_registration_number + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_agent_tax_return + + + + area_code, + + + check_status, + + + city, + + + create_time, + + + creator, + + + delete_type, + + + department_code, + + + department_name, + + + fail_reason, + + + id, + + + nation, + + + password_type, + + + province, + + + pwd, + + + real_account, + + + tax_agent_id, + + + tax_code, + + + tax_registration_number, + + + tenant_key, + + + update_time, + + + + + #{areaCode}, + + + #{checkStatus}, + + + #{city}, + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{departmentCode}, + + + #{departmentName}, + + + #{failReason}, + + + #{id}, + + + #{nation}, + + + #{passwordType}, + + + #{province}, + + + #{pwd}, + + + #{realAccount}, + + + #{taxAgentId}, + + + #{taxCode}, + + + #{taxRegistrationNumber}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_tax_agent_tax_return + + area_code=#{areaCode}, + check_status=#{checkStatus}, + city=#{city}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + department_code=#{departmentCode}, + department_name=#{departmentName}, + fail_reason=#{failReason}, + nation=#{nation}, + password_type=#{passwordType}, + province=#{province}, + pwd=#{pwd}, + real_account=#{realAccount}, + tax_agent_id=#{taxAgentId}, + tax_code=#{taxCode}, + tax_registration_number=#{taxRegistrationNumber}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + + + area_code=#{areaCode}, + + + check_status=#{checkStatus}, + + + city=#{city}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + department_code=#{departmentCode}, + + + department_name=#{departmentName}, + + + fail_reason=#{failReason}, + + + nation=#{nation}, + + + password_type=#{passwordType}, + + + province=#{province}, + + + pwd=#{pwd}, + + + real_account=#{realAccount}, + + + tax_agent_id=#{taxAgentId}, + + + tax_code=#{taxCode}, + + + tax_registration_number=#{taxRegistrationNumber}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + + area_code=#{areaCode}, + check_status=#{checkStatus}, + city=#{city}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + department_code=#{departmentCode}, + department_name=#{departmentName}, + fail_reason=#{failReason}, + nation=#{nation}, + password_type=#{passwordType}, + province=#{province}, + pwd=#{pwd}, + real_account=#{realAccount}, + tax_code=#{taxCode}, + tax_registration_number=#{taxRegistrationNumber}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE tax_agent_id=#{taxAgentId} AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java new file mode 100644 index 000000000..5161e3ad9 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java @@ -0,0 +1,21 @@ +package com.engine.salary.mapper.taxapiflow; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; + +/** + * 个税申报-接口流量使用记录 + * + * @author chengliming + * @date 2022-08-31 11:20:32 + */ +public interface TaxDeclarationApiFlowRecordMapper { + /** + * 批量插入 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); +} diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml new file mode 100644 index 000000000..146c5b5e5 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml @@ -0,0 +1,92 @@ + + + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + (#{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + + + select + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + from dual + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java new file mode 100644 index 000000000..8d3d174c8 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java @@ -0,0 +1,23 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; + +/** + * 个税申报-接口流量使用记录 + * + * @author chengliming + * @date 2022-08-31 11:20:32 + */ +@Mapper +public interface TaxDeclarationApiFlowRecordMapper { + /** + * 批量插入 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml new file mode 100644 index 000000000..3db4b36b3 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml @@ -0,0 +1,92 @@ + + + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + (#{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + + + select + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + from dual + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java new file mode 100644 index 000000000..93cde6c3b --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java @@ -0,0 +1,13 @@ +package com.engine.salary.mapper.taxdeclaration; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 流量不足提醒配置 + * + * @author chengliming + * @date 2022-11-21 16:39:10 + */ +@Mapper +public interface TaxDeclarationApiFlowWarnConfigMapper { +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java new file mode 100644 index 000000000..893cd22db --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java @@ -0,0 +1,67 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiProfilePO; + +import java.util.List; + +public interface TaxDeclarationApiProfileMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationApiProfilePO getById(Long id); + + /** + * 新增,插入所有字段 + * + * @param taxDeclareApiProfile 新增的记录 + * @return 返回影响行数 + */ + int insert(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareApiProfile 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareApiProfile 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 修改,忽略null字段 + * + * @param taxDeclareApiProfile 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 删除记录 + * + * @param taxDeclareApiProfile 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + TaxDeclarationApiProfilePO getOne(); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml new file mode 100644 index 000000000..0dffb4ff8 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.api_profile + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_api_profile + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + api_profile, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{apiProfile}, + + + + + + + UPDATE hrsa_tax_declare_api_profile + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + api_profile=#{apiProfile}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_profile + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + api_profile=#{apiProfile}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_profile + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_api_profile + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java new file mode 100644 index 000000000..0848295ab --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java @@ -0,0 +1,75 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareApiConfigMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationApiConfigPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareApiConfig 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareApiConfig 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 修改,忽略null字段 + * + * @param taxDeclareApiConfig 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 删除记录 + * + * @param taxDeclareApiConfig 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + TaxDeclarationApiConfigPO getOne(); + +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml new file mode 100644 index 000000000..b6b64d359 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.host + , t.app_key + , t.app_secret + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_api_config + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + host, + + + app_key, + + + app_secret, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{host}, + + + #{appKey}, + + + #{appSecret}, + + + + + + + UPDATE hrsa_tax_declare_api_config + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + host=#{host}, + app_key=#{appKey}, + app_secret=#{appSecret}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_config + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + host=#{host}, + + + app_key=#{appKey}, + + + app_secret=#{appSecret}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_config + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_api_config + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java new file mode 100644 index 000000000..c15930dd4 --- /dev/null +++ b/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java @@ -0,0 +1,48 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; + +import java.util.List; + +/** + * 报税信息验证service接口 + * + * @author chengliming + * @date 2022-09-02 9:26 AM + **/ +public interface TaxAgentTaxReturnCheckService { + /** + * 获取验证类型 + * + * @return + */ + int getCheckType(); + + /** + * 验证报税信息 + * + * @param saveParam + * @return + */ + TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + /** + * 检查税友返回的数据 + * + * + * @param apiConfig + * @param saveParam + * @param po + * @param registerInfoResponse + * @return + */ + List verifyCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, + TaxAgentTaxReturnSaveParam saveParam, + TaxAgentTaxReturnPO po, + CompanyRegisterInfoResponse registerInfoResponse); +} diff --git a/src/com/engine/salary/service/TaxAgentTaxReturnService.java b/src/com/engine/salary/service/TaxAgentTaxReturnService.java new file mode 100644 index 000000000..6009b455a --- /dev/null +++ b/src/com/engine/salary/service/TaxAgentTaxReturnService.java @@ -0,0 +1,56 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; + +import java.util.Collection; +import java.util.List; + +/** + * 个税扣缴义务人-报税信息service接口 + * + * @author chengliming + * @date 2022-09-02 9:26 AM + **/ +public interface TaxAgentTaxReturnService { + /** + * 根据个税扣缴义务人id获取报税信息 + * + * @param taxAgentId + * @return + */ + TaxAgentTaxReturnPO getByTaxAgentId(Long taxAgentId); + + /** + * 保存报税信息 + * + * @param saveParam + * @return + */ + TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + /** + * 根据id列表获取 + * + * @param taxAgentIds + * @return + */ + List getByTaxAgentIds(Collection taxAgentIds); + + /** + * 根据税号获取纳税主体 + * + * @param taxCode + * @return + */ + List getByTaxCode(String taxCode); + + /** + * 根据多个税号获取 + * + * @param taxCodes + * @return + */ + List getByTaxCodes(Collection taxCodes); +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java new file mode 100644 index 000000000..dec7a27be --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -0,0 +1,50 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.page.PageInfo; + +import java.util.List; +import java.util.Map; + +/** + * 个税申报计费service + * + * @author chengliming + * @date 2022-11-11 14:54:14 + */ +public interface TaxDeclarationApiBillingService { + + /** + * 更新当前租户的流量使用情况 + * + * @param updateWrapper + */ + void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); + + /** + * 获取流量使用记录(分页) + * + * @param queryParam + * @return + */ + PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + + /** + * 获取流量使用记录(不分页) + * + * @param queryParam + * @return + */ + List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + + /** + * 导出流量使用记录 + * + * @param queryParam + * @param map + */ + void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map); + +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java new file mode 100644 index 000000000..69de5ffd3 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java @@ -0,0 +1,44 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; + +/** + * 个税申报api配置service + * + * @author chengliming + * @date 2022-11-09 10:09:22 + */ +public interface TaxDeclarationApiConfigService { + + /** + * 根据服务厂商获取配置 + * + * @param needExist 是否要检验存在 + * @return + */ + TaxDeclarationApiConfigPO getConfig( boolean needExist); + + /** + * 保存 + * + * @param config + */ + void insert(TaxDeclarationApiConfigPO config); + + /** + * 更新 + * + * @param config + */ + void update(TaxDeclarationApiConfigPO config); + + /** + * 修改开关状态 + * + * @param saveParam + */ + void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam); + + void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam); +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java new file mode 100644 index 000000000..47335fa71 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -0,0 +1,99 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; + +import java.util.List; + +/** + * 流量不足提醒 + * + * @author chengliming + * @date 2022-11-11 14:54:14 + */ +public interface TaxDeclarationApiFlowWarnService { + + /** + * 获取流量不足提醒设置 + * + * @param currentTenantKey + * @return + */ + TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey); + + /** + * 获取流量不足提醒对象列表 + * + * @param warnConfigId + * @param currentTenantKey + * @return + */ + List getWarnReceiverList(Long warnConfigId, String currentTenantKey); + + /** + * 删除流量不足提醒对象 + * + * @param id + * @param currentTenantKey + */ + void deleteReceiver(Long id, String currentTenantKey); + + /** + * 获取提醒对象 + * + * @param id + * @param currentEmployeeId + * @param currentTenantKey + * @return + */ + TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id, Long currentEmployeeId, String currentTenantKey); + + /** + * 保存或编辑提醒对象 + * + * @param param + * @param currentEmployeeId + * @param currentTenantKey + */ + void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param, Long currentEmployeeId, String currentTenantKey); + + /** + * 创建提醒规则 + * + * @param param + * @param currentEmployeeId + * @param currentTenantKey + */ + void createMessageRule(CreateMessageRuleParam param, Long currentEmployeeId, String currentTenantKey); + + /** + * 保存流量不足提醒配置 + * + * @param param + * @param currentEmployeeId + * @param currentTenantKey + * @return + */ + String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param, Long currentEmployeeId, String currentTenantKey); + + /** + * 获取推送规则的业务ID + * + * @param currentTenantKey + * @return + */ + Long getRuleBusinessId(String currentTenantKey); + + /** + * 发送提醒 + * + * @param updateWrapper + */ + void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); + +} diff --git a/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java new file mode 100644 index 000000000..f1ca117ab --- /dev/null +++ b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java @@ -0,0 +1,50 @@ +//package com.engine.salary.service.factory; +// +//import com.weaver.hrm.salary.entity.salaryacct.bo.SalaryCalcItem; +//import com.weaver.hrm.salary.exception.SalaryRunTimeException; +//import com.weaver.hrm.salary.service.SalaryCalcRunService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.Map; +//import java.util.Objects; +//import java.util.concurrent.ConcurrentHashMap; +// +///** +// * @description: SalaryCalcRunService的策略选择工厂 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2023/5/19 16:17 +// * @version:v1.0 +// */ +// +//public class SalaryCalcRunServiceFactory { +// +// private final Map serviceMap = new ConcurrentHashMap<>(); +// +// @Autowired +// public SalaryCalcRunServiceFactory(Map map) { +// for (Map.Entry entry : map.entrySet()) { +// serviceMap.put(entry.getValue().getCalcType(), entry.getValue()); +// } +// } +// +// public SalaryCalcRunService get(SalaryCalcItem salaryCalcItem) { +// String calcType = ""; +// if (Objects.equals(salaryCalcItem.getUseInEmployeeSalary(), 1) +// && salaryCalcItem.getExpressFormula() == null) { +// calcType = "SPECIAL"; +// } else if (salaryCalcItem.getExpressFormula() != null && salaryCalcItem.getExpression() != null) { +// calcType = "EXPRESSION"; +// } else if (salaryCalcItem.getExpressFormula() != null) { +// calcType = "EXPRESS_FORMULA"; +// } else { +// calcType = "INPUT"; +// } +// SalaryCalcRunService salaryCalcRunService = serviceMap.get(calcType); +// if (salaryCalcRunService == null) { +// throw new SalaryRunTimeException("SalaryCalcRunService can not be null"); +// } +// return salaryCalcRunService; +// } +//} diff --git a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java new file mode 100644 index 000000000..769c58ba2 --- /dev/null +++ b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java @@ -0,0 +1,47 @@ +package com.engine.salary.service.factory; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.service.TaxAgentTaxReturnCheckService; +import com.engine.salary.service.impl.AbstractTaxAgentTaxReturnCheckService; +import com.engine.salary.service.impl.TaxReturnCheckDepartmentServiceImpl; +import com.engine.salary.service.impl.TaxReturnCheckMainServiceImpl; +import com.engine.salary.service.impl.TaxReturnCheckRegistrationServiceImpl; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author chengliming + * @date 2022-09-09 2:09 PM + **/ + +public class TaxAgentTaxReturnCheckServiceFactory extends Service { + private final Map serviceMap = new ConcurrentHashMap<>(); + + public TaxAgentTaxReturnCheckServiceFactory(Map map) { + for (Map.Entry entry : map.entrySet()) { + serviceMap.putIfAbsent(entry.getValue().getCheckType(), entry.getValue()); + } + } + + public TaxAgentTaxReturnCheckService get(Integer type) { +// TaxAgentTaxReturnCheckService service = serviceMap.get(type); +// if (service == null) { +// throw new SalaryRunTimeException("TaxAgentTaxReturnCheckService is null"); +// } +// return service; + + //验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码 + AbstractTaxAgentTaxReturnCheckService service = null; + if (type == 1) { + service = ServiceUtil.getService(TaxReturnCheckMainServiceImpl.class, user); + } else if (type == 2) { + service = ServiceUtil.getService(TaxReturnCheckRegistrationServiceImpl.class, user); + } else { + service = ServiceUtil.getService(TaxReturnCheckDepartmentServiceImpl.class, user); + } + + return service; + } +} diff --git a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java new file mode 100644 index 000000000..dde22b970 --- /dev/null +++ b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java @@ -0,0 +1,33 @@ +//package com.engine.salary.service.factory; +// +//import com.weaver.hrm.salary.exception.SalaryRunTimeException; +//import com.weaver.hrm.salary.service.TaxPaymentService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.Map; +//import java.util.concurrent.ConcurrentHashMap; +// +///** +// * @author chengliming +// * @date 2022-12-08 19:05:16 +// **/ +// +//public class TaxPaymentServiceFactory { +// private final Map serviceMap = new ConcurrentHashMap<>(); +// +// @Autowired +// public TaxPaymentServiceFactory(Map map) { +// for (Map.Entry entry : map.entrySet()) { +// serviceMap.putIfAbsent(entry.getValue().getServiceType(), entry.getValue()); +// } +// } +// +// public TaxPaymentService get(Integer type) { +// TaxPaymentService service = serviceMap.get(type); +// if (service == null) { +// throw new SalaryRunTimeException("TaxPaymentService is null"); +// } +// return service; +// } +//} diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java new file mode 100644 index 000000000..a1cd19da2 --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -0,0 +1,203 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnCheckService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +import dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + * 税友相关公共方法 + * + * @author chengliming + * @date 2022-09-15 5:23 PM + **/ +@Slf4j +public abstract class AbstractTaxAgentTaxReturnCheckService extends Service implements TaxAgentTaxReturnCheckService { + protected TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + protected TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + protected TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + protected TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + /** + * 获取验证类型 + * + * @return + */ + @Override + public abstract int getCheckType(); + + /** + * 保存报税信息 + * + * @param saveParam + * @return + */ + @Override + public abstract TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + @Override + public List verifyCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam, TaxAgentTaxReturnPO po, CompanyRegisterInfoResponse response) { + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()); + po.setUpdateTime(new Date()); + // 如果税友返回错误信息 + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || CollectionUtils.isEmpty(response.getBody())) { + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + po.setFailReason(response.getHead().getMsg()); + return new ArrayList<>(); + } + // 如果税友返回验证信息 + List checkFormDTOList = buildCheckDTO(saveParam, response.getBody()); + if (checkFormDTOList.size() == 1) { + po.setTaxRegistrationNumber(checkFormDTOList.get(0).getTaxRegistrationNumber()); + if (SalaryOnOffEnum.OFF.equals(checkFormDTOList.get(0).getDivideFiling())) { + // 如果只有一条记录且没有分部门备案,则直接视为验证成功,继续检查密码是否正确 + CheckPasswordResponse checkPasswordResponse = getCheckPasswordResponse(apiConfig, po, saveParam); + verifyCheckPasswordResponse(po, checkPasswordResponse); + } + } + return checkFormDTOList; + } + + /** + * 企业注册接口 + * + * @param apiConfig + * @param taxAgentTaxReturnPO + * @param saveParam + * @return + */ + protected CompanyRegisterInfoResponse getCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentTaxReturnPO.getTaxAgentId()); + if (taxAgentPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + } + String url = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_URL; + Map requestParam = new HashMap<>(4); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentPO.getName()); + requestParam.put("nsrsbh", taxAgentTaxReturnPO.getTaxCode()); + requestParam.put("areaid", taxAgentTaxReturnPO.getAreaCode()); + if (StringUtils.isNotEmpty(saveParam.getTaxRegistrationNumber())) { + requestParam.put("djxhid", saveParam.getTaxRegistrationNumber()); + } + String reqJson = JsonUtil.toJsonString(requestParam); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("getCompanyRegisterInfo === res : {}", res); + return JsonUtil.parseBean(res, CompanyRegisterInfoResponse.class); + } + + private List buildCheckDTO(TaxAgentTaxReturnSaveParam saveParam, List registerInfos) { + List checkFormDTOList = new ArrayList<>(); + for (int i = 1; i <= registerInfos.size(); i++) { + CompanyRegisterInfoResponse.CompanyRegisterInfo registerInfo = registerInfos.get(i - 1); + SalaryAssert.notNull(registerInfo.getFbmba(), "税局接口异常,请稍后重试"); + TaxAgentTaxReturnCheckFormDTO checkFormDTO = TaxAgentTaxReturnCheckFormDTO.builder().taxAgentName(registerInfo.getQymc()).taxAgentId(saveParam.getTaxAgentId()).taxCode(saveParam.getTaxCode()).businessAddress(registerInfo.getScjydz()).legalPersonName(registerInfo.getFrxm()).mobile(registerInfo.getLxdh()).industryName(registerInfo.getHymc()).taxAuthorities(registerInfo.getZgswjgmc()).taxBranch(registerInfo.getZgswjgskmc()).taxRegistrationNumber(registerInfo.getDjxhid()).divideFiling(SalaryOnOffEnum.parseByValue(Integer.parseInt(registerInfo.getFbmba()))).index((long) i).build(); + checkFormDTOList.add(checkFormDTO); + } + return checkFormDTOList; + } + + /** + * 校验密码 + * + * @param apiConfig + * @param taxAgentTaxReturnPO + * @param saveParam + * @return + */ + protected CheckPasswordResponse getCheckPasswordResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentTaxReturnPO.getTaxAgentId()); + if (taxAgentPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + } + String url = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_URL; + Map requestParam = new HashMap<>(16); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentPO.getName()); + requestParam.put("mmlx", taxAgentTaxReturnPO.getPasswordType()); + requestParam.put("djxhid", taxAgentTaxReturnPO.getTaxRegistrationNumber()); + requestParam.put("nsrsbh", taxAgentTaxReturnPO.getTaxCode()); + requestParam.put("areaid", taxAgentTaxReturnPO.getAreaCode()); + if (TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxAgentTaxReturnPO.getPasswordType())) { + requestParam.put("sbmm", taxAgentTaxReturnPO.getPwd()); + requestParam.put("jmsbmm", "1"); + } else { + requestParam.put("smzh", taxAgentTaxReturnPO.getRealAccount()); + requestParam.put("smmm", taxAgentTaxReturnPO.getPwd()); + requestParam.put("jmsmmm", "1"); + } + if (StringUtils.isNotEmpty(saveParam.getDepartmentCode()) && StringUtils.isNotEmpty(saveParam.getDepartmentName())) { + requestParam.put("bmbh", saveParam.getDepartmentCode()); + requestParam.put("bmmc", saveParam.getDepartmentName()); + } + String reqJson = JsonUtil.toJsonString(requestParam); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("checkPassword === res : {}", res); + return JsonUtil.parseObject(res, CheckPasswordResponse.class); + } + + /** + * 检查校验密码接口数据 + * + * @param po + * @param response + * @return + */ + protected void verifyCheckPasswordResponse(TaxAgentTaxReturnPO po, CheckPasswordResponse response) { + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + po.setUpdateTime(new Date()); + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || !response.isBody()) { + // 如果返回错误 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + po.setFailReason(response.getHead().getMsg()); + } else { + // 如果返回成功 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()); + } + } +} diff --git a/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java new file mode 100644 index 000000000..6efad07ac --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java @@ -0,0 +1,53 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.factory.TaxAgentTaxReturnCheckServiceFactory; +import com.engine.salary.util.db.MapperProxyFactory; +import weaver.hrm.User; + +import java.util.Collection; +import java.util.List; + +/** + * @author chengliming + * @date 2022-09-02 9:27 AM + **/ +public class TaxAgentTaxReturnServiceImpl extends Service implements TaxAgentTaxReturnService { + private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + private TaxAgentTaxReturnCheckServiceFactory getTaxAgentTaxReturnCheckServiceFactory(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnCheckServiceFactory.class, user); + } + @Override + public TaxAgentTaxReturnPO getByTaxAgentId(Long taxAgentId) { + return getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + return getTaxAgentTaxReturnCheckServiceFactory(user).get(saveParam.getType()).verify(saveParam); + } + + @Override + public List getByTaxAgentIds(Collection taxAgentIds) { + return getTaxAgentTaxReturnMapper().listSome(TaxAgentTaxReturnPO.builder().taxAgentIds(taxAgentIds).build()); + } + + @Override + public List getByTaxCode(String taxCode) { + return null; + } + + @Override + public List getByTaxCodes(Collection taxCodes) { + return getTaxAgentTaxReturnMapper().listSome(TaxAgentTaxReturnPO.builder().taxCodes(taxCodes).build()); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java new file mode 100644 index 000000000..c7a0c9098 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -0,0 +1,225 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationApiBillingService; +import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.google.common.collect.Lists; +import com.weaver.common.batch.context.BatchExportContext; +import com.weaver.common.batch.entity.BatchCallbackMessage; +import com.weaver.common.batch.handler.BatchExportHandler; +import com.weaver.common.cache.tablecache.impl.ComInfoCache; +import com.weaver.common.component.table.page.Page; +import com.weaver.common.hrm.cache.HrmEmployeeComInfo; +import com.weaver.hrm.salary.common.SalaryPage; +import com.weaver.hrm.salary.common.excel.ExportWrapper; +import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO; +import com.weaver.hrm.salary.entity.taxapiflow.dto.*; +import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +import com.weaver.hrm.salary.service.*; +import com.weaver.hrm.salary.util.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.time.LocalDate; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * @author chengliming + * @date 2022-11-11 2:57 PM + **/ +@Slf4j +public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBillingService { + + private TaxDeclarationApiFlowRecordMapper taxDeclarationApiFlowRecordMapper; + + private TaxAgentService taxAgentService; + + private SalaryEmployeeService salaryEmployeeService; + +// private SalaryBatchService salaryBatchService; + + private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService; + +// private ComInfoCache comInfoCache; + +// private ExtEmployeeService extEmployeeService; + + @Override + public void updateApiFlowInfo(ApiFlowUpdateWrapper updateWrapper) { + // 保存流量使用详情 + saveApiFlowRecord(updateWrapper); + // 流量不足提醒 + taxDeclarationApiFlowWarnService.sendFlowWarnMessage(updateWrapper); + } + + private void saveApiFlowRecord(ApiFlowUpdateWrapper updateWrapper) { + if (!updateWrapper.getApiFlowDetailPOList().isEmpty()) { + List> failPartition = Lists.partition(updateWrapper.getApiFlowDetailPOList(), 1000); + failPartition.forEach(list -> taxDeclarationApiFlowRecordMapper.batchInsert(list)); + } + } + + @Override + public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + Page flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); + List records = flowRecordPOPage.getRecords(); + if (records.isEmpty()) { + return new PageInfo<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); + // 转换数据 + AtomicInteger indexNum = new AtomicInteger(1); + List listDTOS = records.stream().map(e -> + TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) + ).collect(Collectors.toList()); + return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS); + } + + @Override + public List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + List list = queryChainWrapper.list(); + if (list.isEmpty()) { + return new ArrayList<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); + // 转换数据 + AtomicInteger indexNum = new AtomicInteger(1); + return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); + } + + private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list, String currentTenantKey) { + Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); + // 获取人员信息 + List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); + Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); + Map empIdNoMap = salaryEmployeeService.mapByEmployeeIds(employeeTaxAgentMap.keySet()); + List extEmployeePOS = extEmployeeService.listAll(currentTenantKey); + Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); + // 获取个税扣缴义务人信息 + List taxAgentPOS = taxAgentService.listByIds(new HashSet<>(employeeTaxAgentMap.values())); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); + return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); + } + + private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { + LambdaQueryChainWrapper chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper) + .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(TaxDeclarationApiFlowRecordPO::getTenantKey) + .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId()) + .eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType()) + .eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult()); + if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) { + chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate()) + .le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate()); + } + return chainWrapper; + } + + @Override + public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map) { + ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); + // 表头 + List headers = exportWrapper.getHeaders(); + headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间")); + headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); + headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员")); + headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号")); + headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务")); + headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人")); + headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果")); + exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); + // 获取数据 + List dtoList = listFlowRecord(queryParam, employeeId, tenantKey); + // 组装数据 + for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getCreateTime()); + row.add(dto.getTaxAgentName()); + row.add(dto.getEmployeeName()); + row.add(dto.getIdCardNo()); + row.add(dto.getBusinessTypeName()); + row.add(dto.getCreator()); + row.add(dto.getResult()); + exportWrapper.getRows().add(row); + } + // 生成表格 + buildExcelData(exportWrapper); + } + + /** + * 构建excel数据 + * + * @param wrapper + */ + private void buildExcelData(ExportWrapper wrapper) { + wrapper.getExcelSheetData().setRows(wrapper.getRows()); + wrapper.getSheetList().add(wrapper.getExcelSheetData()); + salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); + } + + @BatchExportHandler("exportFlowRecord") + public void exportFlowRecordHandler() { + BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); + log.info("接收到流量使用记录导出的结果:{}", JSONObject.toJSONString(message)); + } + + /** + * 封装一些临时的集合类,便于方法复用 + */ + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class TempPropertiesWrapper { + // 姓名 + private Map empNameMap; + // 身份证 + private Map empIdNoMap; + // 获取个税扣缴义务人信息 + private Map taxAgentNameMap; + // 获取非系统人员 + private Map extEmployeeMap; + } + + @Data + public static class ApiFlowUpdateWrapper { + private String tenantKey; + private Long currentEmployeeId; + // 税款所属期 + private LocalDate taxYearMonth; + // api流量使用情况 + private List apiFlowDetailPOList; + // 当前租户的api接口配置 + private TaxDeclarationApiConfigPO apiConfig; + // 接口类型 + private EnumDeclareApiBusinessType businessType; + + public ApiFlowUpdateWrapper(String tenantKey, Long currentEmployeeId, LocalDate taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { + this.tenantKey = tenantKey; + this.currentEmployeeId = currentEmployeeId; + this.taxYearMonth = taxYearMonth; + this.apiFlowDetailPOList = new ArrayList<>(); + this.apiConfig = apiConfig; + this.businessType = businessType; + } + } + +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java new file mode 100644 index 000000000..f114d7330 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -0,0 +1,127 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiProfilePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareApiProfileEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiProfileMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * @author chengliming + * @date 2022-11-09 10:09 AM + **/ +@Slf4j +public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService { + + private TaxDeclareApiConfigMapper taxDeclareApiConfigMapper; + + private TaxDeclarationApiProfileMapper taxDeclarationApiProfileMapper; + + @Override + public TaxDeclarationApiConfigPO getConfig(boolean needValid) { + TaxDeclarationApiConfigPO configPO = taxDeclareApiConfigMapper.getOne(); + if (needValid) { + String tips1 = SalaryI18nUtil.getI18nLabel(183786, "当前用户智能算薪尚未配置,请先前往[设置] -> [智能算薪]中配置"); + String tips2 = SalaryI18nUtil.getI18nLabel(183787, "当前用户智能算薪尚未启用,请先前往[设置] -> [智能算薪]中启用该配置"); + String tips3 = SalaryI18nUtil.getI18nLabel(183788, "当前用户智能算薪账号或密码为空,请前往[设置] -> [智能算薪]中检查账号密码是否填写"); + SalaryAssert.isTrue(configPO != null, tips1); + SalaryAssert.isTrue(SalaryOnOffEnum.ON.getValue().equals(configPO.getEnableUse()), tips2); + SalaryAssert.isTrue(StringUtils.isNotEmpty(StringUtils.trim(configPO.getAppKey())) + && StringUtils.isNotEmpty(StringUtils.trim(configPO.getAppSecret())), tips3); + } + if (configPO != null) { + configPO.setAppKey(StringUtils.trim(configPO.getAppKey())); + configPO.setAppSecret(StringUtils.trim(configPO.getAppSecret())); + } + return configPO; + } + + @Override + public void insert(TaxDeclarationApiConfigPO configPO) { + taxDeclareApiConfigMapper.insertIgnoreNull(configPO); + } + + @Override + public void update(TaxDeclarationApiConfigPO config) { + taxDeclareApiConfigMapper.updateIgnoreNull(config); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + TaxDeclarationApiConfigPO config = this.getConfig(false); + if (config != null) { + config.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .setUpdateTime(LocalDateTime.now()); + update(config); + } else { + config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); + config.setHost(getApiHost()); + insert(config); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + TaxDeclarationApiConfigPO config = this.getConfig(false); + if (config != null) { + config.setAppKey(saveParam.getAppKey()) + .setAppSecret(saveParam.getAppSecret()) + .setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .setUpdateTime(LocalDateTime.now()); + update(config); + } else { + config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); + config.setHost(getApiHost()); + insert(config); + } + if (StringUtils.isNotEmpty(config.getAppKey()) && StringUtils.isNotEmpty(config.getAppSecret())) { + QuerySpecialAmountFeedbackResponse response = getQuerySpecialAmountFeedbackResponse(config); + // 校验请求结果 + String responseCode = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + + if (SzyhApiConstant.ERROR_CODE.equals(responseCode) + || SzyhApiConstant.APP_DISABLED_CODE.equals(responseCode) + || SzyhApiConstant.APP_PAUSED_CODE.equals(responseCode)) { + throw new SalaryRunTimeException("账号密码错误或账号已停用"); + } + } + } + + private String getApiHost() { + List apiProfiles = taxDeclarationApiProfileMapper.listAll(); + if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { + return SzyhApiConstant.HOST_URL; + } + return SzyhApiConstant.TEST_HOST_URL; + } + + public QuerySpecialAmountFeedbackResponse getQuerySpecialAmountFeedbackResponse(TaxDeclarationApiConfigPO apiConfig) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_QUERY_SPECIAL_AMOUNT_FEEDBACK; + Map params = new HashMap<>(1); + params.put("requestId", ""); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + return JsonUtil.parseObject(res, QuerySpecialAmountFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java new file mode 100644 index 000000000..12ea4afa5 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -0,0 +1,257 @@ +//package com.engine.salary.service.impl; +// +//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +//import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowWarnConfigMapper; +//import com.engine.salary.service.SalaryEmployeeService; +//import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +//import com.weaver.common.base.entity.result.WeaResult; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.framework.spring.annotation.AopClass; +//import com.weaver.hrm.salary.common.OptionDTO; +//import com.weaver.hrm.salary.dao.TaxDeclarationApiFlowWarnReceiverMapper; +//import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentEmployeePO; +//import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; +//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +//import com.weaver.hrm.salary.entity.taxapiflow.param.CreateMessageRuleParam; +//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; +//import com.weaver.hrm.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; +//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +//import com.weaver.hrm.salary.service.TaxAgentService; +//import com.weaver.hrm.salary.service.TaxDeclarationApiFlowStatisticService; +//import com.weaver.hrm.salary.util.SalaryAssert; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.mc.api.async.AsyncSystemMessageRest; +//import com.weaver.mc.api.entity.*; +//import com.weaver.mc.api.rest.RuleRest; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.commons.lang3.StringUtils; +//import org.springframework.stereotype.Service; +//import org.springframework.transaction.annotation.Transactional; +// +//import java.time.LocalDateTime; +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +//import java.util.stream.Collectors; +// +///** +// * @author chengliming +// * @date 2022-11-11 2:57 PM +// **/ +//@Service +//@Slf4j +//@AopClass +//public class TaxDeclarationApiFlowWarnServiceImpl implements TaxDeclarationApiFlowWarnService { +// private TaxDeclarationApiFlowWarnConfigMapper taxDeclarationApiFlowWarnConfigMapper; +// private TaxDeclarationApiFlowWarnReceiverMapper taxDeclarationApiFlowWarnReceiverMapper; +// private SalaryEmployeeService salaryEmployeeService; +// private RuleRest ruleRest; +// private AsyncSystemMessageRest asyncSystemMessageRest; +// private TaxAgentService taxAgentService; +// private TaxDeclarationApiFlowStatisticService taxDeclarationApiFlowStatisticService; +// +// @Override +// public TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey) { +// return new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnConfigMapper) +// .eq(TaxDeclarationApiFlowWarnConfigPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnConfigPO::getTenantKey, currentTenantKey) +// .one(); +// } +// +// @Override +// public List getWarnReceiverList(Long warnConfigId, String currentTenantKey) { +// List receiverPOList = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getWarnConfigId, warnConfigId) +// .list(); +// +// List salaryEmployees = taxAgentService.listEmployees(currentTenantKey); +// Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, TaxAgentEmployeePO::getEmployeeId, TaxAgentEmployeePO::getUsername); +// +// return receiverPOList.stream().map(e -> TaxDeclarationApiFlowWarnReceiverListDTO.builder() +// .employeeName(salaryEmployeeMap.get(e.getEmployeeId())) +// .employeeId(e.getEmployeeId()) +// .mobile(e.getMobile()) +// .email(e.getEmail()) +// .id(e.getId()) +// .build()).collect(Collectors.toList()); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void deleteReceiver(Long id, String currentTenantKey) { +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id, currentTenantKey); +// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); +// new LambdaUpdateChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .set(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getId, id) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .update(); +// } +// +// @Override +// public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id, Long currentEmployeeId, String currentTenantKey) { +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id, currentTenantKey); +// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); +// // 查找人员信息 +// List simpleEmployees = salaryEmployeeService.listAll(currentTenantKey); +// Map empMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// SimpleEmployee simpleEmployee = empMap.get(receiverPO.getEmployeeId()); +// SalaryAssert.notNull(simpleEmployee, SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 139811, "人员不存在")); +// +// return TaxDeclarationApiFlowWarnReceiverFormDTO.builder() +// .id(receiverPO.getId()) +// .employee(Collections.singletonList(new OptionDTO(receiverPO.getEmployeeId().toString(), simpleEmployee.getUsername()))) +// .email(receiverPO.getEmail()) +// .mobile(receiverPO.getMobile()) +// .emailOptions(StringUtils.isNotEmpty(simpleEmployee.getEmail()) ? Collections.singletonList(simpleEmployee.getEmail()) : null) +// .build(); +// } +// +// private TaxDeclarationApiFlowWarnReceiverPO getWarnReceiverPOById(Long id, String currentTenantKey) { +// return new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getId, id) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .one(); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param, Long currentEmployeeId, String currentTenantKey) { +// if (param.getId() != null) { +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(param.getId(), currentTenantKey); +// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); +// if (param.getEmployeeId() != null && !receiverPO.getEmployeeId().equals(param.getEmployeeId())) { +// filterByEmpId(param, currentTenantKey); +// receiverPO.setEmployeeId(param.getEmployeeId()); +// } +// receiverPO.setUpdateTime(LocalDateTime.now()); +// receiverPO.setEmail(param.getEmail()); +// receiverPO.setMobile(param.getMobile()); +// taxDeclarationApiFlowWarnReceiverMapper.updateById(receiverPO); +// } else { +// filterByEmpId(param, currentTenantKey); +// TaxDeclarationApiFlowWarnReceiverPO receiverPO = TaxDeclarationApiFlowWarnReceiverPO.builder() +// .id(IdGenerator.generate()) +// .email(param.getEmail()) +// .mobile(param.getMobile()) +// .employeeId(param.getEmployeeId()) +// .warnConfigId(param.getWarnConfigId()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .tenantKey(currentTenantKey) +// .creator(currentEmployeeId) +// .build(); +// taxDeclarationApiFlowWarnReceiverMapper.insert(receiverPO); +// } +// } +// +// private void filterByEmpId(TaxDeclarationApiFlowWarnReceiverSaveParam param, String currentTenantKey) { +// List another = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getWarnConfigId, param.getWarnConfigId()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getEmployeeId, param.getEmployeeId()) +// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) +// .list(); +// SalaryAssert.isEmpty(another, SalaryI18nUtil.getI18nLabel(184007, "当前人员对应的提醒对象已存在,请更换人员后尝试")); +// } +// +// @Override +// public void createMessageRule(CreateMessageRuleParam param, Long currentEmployeeId, String currentTenantKey) { +// CreateRuleEntity createRule = new CreateRuleEntity() +// .setBusinessId(param.getBusinessId()) +// .setEvent(MessageEvent.PAYROLL) +// .setModule(MessageModule.HRSA) +// .setConfig(param.getConfig()); +// log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); +// WeaResult weaResult = ruleRest.createRuleV2(createRule); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC接口创建规则失败")); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param, Long currentEmployeeId, String currentTenantKey) { +// TaxDeclarationApiFlowWarnConfigPO warnConfigPO; +// if (param.getId() != null) { +// warnConfigPO = taxDeclarationApiFlowWarnConfigMapper.selectById(param.getId()); +// SalaryAssert.notNull(warnConfigPO, "提醒规则不存在,请先保存"); +// warnConfigPO.setThreshold(param.getThreshold()); +// warnConfigPO.setEnableWarn(param.getEnable() ? 1 : 0); +// warnConfigPO.setUpdateTime(LocalDateTime.now()); +// taxDeclarationApiFlowWarnConfigMapper.updateById(warnConfigPO); +// } else { +// warnConfigPO = TaxDeclarationApiFlowWarnConfigPO.builder() +// .id(IdGenerator.generate()) +// .businessId(param.getBusinessId()) +// .threshold(param.getThreshold()) +// .enableWarn(param.getEnable() ? 1 : 0) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .tenantKey(currentTenantKey) +// .build(); +// taxDeclarationApiFlowWarnConfigMapper.insert(warnConfigPO); +// } +// if (StringUtils.isNotEmpty(param.getConfig())) { +// CreateRuleEntity createRule = new CreateRuleEntity() +// .setName(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 159146, "流量不足提醒")) +// .setUser(new UserEntity(currentEmployeeId, currentTenantKey)) +// .setModule(MessageModule.HRSA) +// .setEvent(MessageEvent.PAYROLL) +// .setBusinessId(param.getBusinessId().toString()) +// .setConfig(param.getConfig()); +// log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); +// WeaResult weaResult = ruleRest.createRuleV2(createRule); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC接口创建规则失败")); +// } +// return warnConfigPO.getId().toString(); +// } +// +// @Override +// public Long getRuleBusinessId(String currentTenantKey) { +// TaxDeclarationApiFlowWarnConfigPO warnConfig = this.getWarnConfig(currentTenantKey); +// return warnConfig == null ? IdGenerator.generate() : warnConfig.getBusinessId(); +// } +// +// @Override +// public void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { +// TaxDeclarationApiFlowWarnConfigPO warnConfig = getWarnConfig(updateWrapper.getTenantKey()); +// // 未配置或开关关闭 +// if (Objects.isNull(warnConfig) || SalaryOnOffEnum.OFF.getValue().equals(warnConfig.getEnableWarn())) { +// return; +// } +// QueryAccountBalanceResponse response = taxDeclarationApiFlowStatisticService.getQueryAccountBalanceResponse(updateWrapper.getApiConfig()); +// // 剩余流量大于阈值无需提醒 +// if (StringUtils.isNotEmpty(response.getBody().getSurplus()) && Long.parseLong(response.getBody().getSurplus()) > warnConfig.getThreshold()) { +// return; +// } +// List warnReceiverList = getWarnReceiverList(warnConfig.getId(), updateWrapper.getTenantKey()); +// if (warnReceiverList.isEmpty()) { +// log.info("warnReceiverList is empty, send msg fail"); +// return; +// } +// List receivers = warnReceiverList.stream().map(e -> +// new UserEntity(e.getEmployeeId(), updateWrapper.getTenantKey()) +// .setEmail(e.getEmail()).setPhone(e.getMobile()).setLanguage(6) +// ).collect(Collectors.toList()); +// // 组装消息对象 +// SendMessageEntity smg = TaxApiFlowBO.buildSendMessageEntity(warnConfig, receivers, updateWrapper); +// // 发送消息 +// WeaResult weaResult = asyncSystemMessageRest.sendMsg(smg); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184009, "流量不足提醒发送失败")); +// } +//} diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java new file mode 100644 index 000000000..dd2c2af07 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java @@ -0,0 +1,43 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import lombok.extern.slf4j.Slf4j; + +/** + * 验证部门编码相关方法 + * + * @author chengliming + * @date 2022-09-15 17:21:41 + */ +@Slf4j +public class TaxReturnCheckDepartmentServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + // 调用神州云合API + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + CheckPasswordResponse response = getCheckPasswordResponse(apiConfig, po, saveParam); + verifyCheckPasswordResponse(po, response); + po.setDepartmentCode(saveParam.getDepartmentCode()); + po.setDepartmentName(saveParam.getDepartmentName()); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 返回结果 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java new file mode 100644 index 000000000..9ab875746 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java @@ -0,0 +1,87 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.Sm4Utils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; + +import java.util.List; +import java.util.Objects; + +/** + * 验证主题报税信息相关方法 + * + * @author chengliming + * @date 2022-09-15 17:21:23 + */ +@Slf4j +public class TaxReturnCheckMainServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.MAIN_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + try { + po = saveOrUpdate(apiConfig, po, saveParam); + if (NumberUtils.INTEGER_TWO.equals(saveParam.getRequestType())) { + return new TaxAgentTaxReturnCheckDTO().setStatus(po.getCheckStatus()).setMessage(po.getFailReason()); + } + } catch (Exception e) { + log.error("TaxReturnCheckMainServiceImpl.saveOrUpdate() ----------- error :{}", e.getMessage()); + } + // 调用神州云合API + CompanyRegisterInfoResponse response = getCompanyRegisterInfoResponse(apiConfig, po, saveParam); + List checkFormDTOS = verifyCompanyRegisterInfoResponse(apiConfig, saveParam, po, response); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 构建结果 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setRecords(checkFormDTOS); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } + + private boolean hasChanged(TaxAgentTaxReturnSaveParam saveParam, TaxAgentTaxReturnPO po, TaxDeclarationApiConfigPO apiConfig) throws Exception { + return !(Objects.equals(po.getTaxCode(), saveParam.getTaxCode()) + && Objects.equals(po.getAreaCode(), saveParam.getAreaCode()) + && Objects.equals(po.getPasswordType(), TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + && Objects.equals(po.getPwd(), Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + && Objects.equals(po.getRealAccount(), saveParam.getAccount())); + } + + private TaxAgentTaxReturnPO saveOrUpdate(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + if (Objects.nonNull(po)) { + if (hasChanged(saveParam, po, apiConfig)) { + // 数据有变化,则状态更新为未验证 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()); + po.setTaxRegistrationNumber(null); + po.setDepartmentCode(null); + po.setDepartmentName(null); + po.setFailReason(null); + } + TaxAgentTaxReturnBO.convertParam2Po4Update(apiConfig, po, saveParam); + getTaxAgentTaxReturnMapper().updateByTaxAgentId(po); + } else { + po = TaxAgentTaxReturnBO.convertParam2Po4Insert(apiConfig, saveParam) + .setCreator((long) user.getUID()).setTenantKey(""); + getTaxAgentTaxReturnMapper().insertIgnoreNull(po); + } + return po; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java new file mode 100644 index 000000000..aabb3e2f9 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java @@ -0,0 +1,44 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; + +import java.util.List; + +/** + * 验证税号+序号相关方法 + * + * @author chengliming + * @date 2022-09-15 17:22:14 + */ +public class TaxReturnCheckRegistrationServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.REGISTRATION_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + // 调用神州云合API + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + CompanyRegisterInfoResponse response = getCompanyRegisterInfoResponse(apiConfig, po, saveParam); + List checkFormDTOS = verifyCompanyRegisterInfoResponse(apiConfig, saveParam, po, response); + po.setTaxRegistrationNumber(saveParam.getTaxRegistrationNumber()); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 构建结果 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setRecords(checkFormDTOS); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/util/SingnatureData.java b/src/com/engine/salary/util/SingnatureData.java new file mode 100644 index 000000000..d6206c2bf --- /dev/null +++ b/src/com/engine/salary/util/SingnatureData.java @@ -0,0 +1,90 @@ +package com.engine.salary.util; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.net.URLEncoder; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.SignatureException; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; +import java.util.UUID; + +/** + * @author jie.zhou + * @version 1.0 + * @date 2021/1/14 15:27 + */ +@Slf4j +public class SingnatureData { + + /** + * 初始化延签头信息(GET) + * + * @param param + * @param appKey + * @param appSecret + * @return + */ + public static Map initHeader(Map param, String appKey, String appSecret) { + String version = "1.0.0"; + long timestamp = System.currentTimeMillis(); + String nonce = UUID.randomUUID().toString().replace("-", ""); + Map head = new HashMap(); + if (param != null && param.size() > 0) head.putAll(param); + head.put("version", version); + head.put("timestamp", Long.toString(timestamp));//TimeStamp + head.put("appKey", appKey);//accessKeyID + head.put("xReqNonce", nonce);//SignatureNonce + String signature = getSign(head, appSecret, "UTF-8"); + head.put("signature", signature.trim()); + return head; + } + + /*** + * 获取签名 + * @param params + * @param appSecret + * @param encoding + * @return + */ + public static String getSign(Map params, String appSecret, String encoding) { + TreeMap treeMap = new TreeMap<>(); + treeMap.put("appSecret", appSecret); + + for (Map.Entry entry : params.entrySet()) { + treeMap.put(entry.getKey(), entry.getValue().toString()); + } + StringBuilder builder = new StringBuilder(); + for (Object parameter : treeMap.values()) { + if (parameter != null) { + builder.append(parameter.toString()); + } + } + String signStr = null; + try { + signStr = sign(URLEncoder.encode(builder.toString(), encoding), appSecret); + } catch (Exception e) { + log.error("获取签名失败", e); + } + return signStr; + } + + public static String sign(String data, String appSecret) throws SignatureException { + try { + Mac mac = Mac.getInstance("HmacSHA256"); + SecretKeySpec signingKey = new SecretKeySpec(appSecret.getBytes(), "HmacSHA256"); + mac.init(signingKey); + byte[] signData = mac.doFinal(data.getBytes()); + return Base64.encodeBase64String(signData); + } catch (NoSuchAlgorithmException e) { + throw new SignatureException("平台不支持" + "HMAC_SHA256" + "摘要方式"); + } catch (InvalidKeyException e) { + throw new SignatureException("Speicified access secret is not valid."); + } + } +} diff --git a/src/com/engine/salary/util/Sm4Utils.java b/src/com/engine/salary/util/Sm4Utils.java new file mode 100644 index 000000000..acaf98881 --- /dev/null +++ b/src/com/engine/salary/util/Sm4Utils.java @@ -0,0 +1,190 @@ +package com.engine.salary.util; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.pqc.math.linearalgebra.ByteUtils; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.security.*; +import java.util.Arrays; + +public class Sm4Utils { + + static { + Security.addProvider(new BouncyCastleProvider()); + } + + private static final String ENCODING = "UTF-8"; + + public static final String ALGORITHM_NAME = "SM4"; + + // 加密算法/分组加密模式/分组填充方式 + // PKCS5Padding-以8个字节为一组进行分组加密 + // 定义分组加密模式使用:PKCS5Padding + public static final String ALGORITHM_NAME_ECB_PADDING = "SM4/ECB/PKCS5Padding"; + + // 128-32位16进制;256-64位16进制 + public static final int DEFAULT_KEY_SIZE = 128; + + /** + * 生成ECB暗号 + * + * @param algorithmName 算法名称 + * @param mode 模式 + * @param key + * @return + * @throws Exception + * @explain ECB模式(电子密码本模式:Electronic codebook) + */ + private static Cipher generateEcbCipher(String algorithmName, int mode, byte[] key) throws Exception { + Cipher cipher = Cipher.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME); + Key sm4Key = new SecretKeySpec(key, ALGORITHM_NAME); + cipher.init(mode, sm4Key); + return cipher; + } + + /** + * 自动生成密钥 + * + * @return + * @throws NoSuchAlgorithmException + * @throws NoSuchProviderException + * @explain + */ + public static byte[] generateKey() throws Exception { + return generateKey(DEFAULT_KEY_SIZE); + } + + /** + * @param keySize + * @return + * @throws Exception + * @explain + */ + public static byte[] generateKey(int keySize) throws Exception { + KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, BouncyCastleProvider.PROVIDER_NAME); + kg.init(keySize, new SecureRandom()); + return kg.generateKey().getEncoded(); + } + + /* * sm4加密 + * @explain 加密模式:ECB + * 密文长度不固定,会随着被加密字符串长度的变化而变化 + * @param hexKey + * 16进制密钥(忽略大小写) + * @param paramStr + * 待加密字符串 + * @return 返回16进制的加密字符串 + * @throws Exception + */ + public static String encryptEcb(String hexKey, String paramStr) throws Exception { + hexKey = strTo16(hexKey); + String cipherText = ""; + // 16进制字符串-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // String-->byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 加密后的数组 + byte[] cipherArray = encrypt_Ecb_Padding(keyData, srcData); + // byte[]-->hexString + cipherText = ByteUtils.toHexString(cipherArray); + return cipherText; + } + + /** + * 加密模式之Ecb + * + * @param key + * @param data + * @return + * @throws Exception + * @explain + */ + public static byte[] encrypt_Ecb_Padding(byte[] key, byte[] data) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * sm4解密 + * + * @param hexKey 16进制密钥 + * @param cipherText 16进制的加密字符串(忽略大小写) + * @return 解密后的字符串 + * @throws Exception + * @explain 解密模式:采用ECB + */ + public static String decryptEcb(String hexKey, String cipherText) throws Exception { + hexKey = strTo16(hexKey); + // 用于接收解密后的字符串 + String decryptStr = ""; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // hexString-->byte[] + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] srcData = decrypt_Ecb_Padding(keyData, cipherData); + // byte[]-->String + decryptStr = new String(srcData, ENCODING); + return decryptStr; + } + + /** + * 解密 + * + * @param key + * @param cipherText + * @return + * @throws Exception + * @explain + */ + public static byte[] decrypt_Ecb_Padding(byte[] key, byte[] cipherText) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.DECRYPT_MODE, key); + return cipher.doFinal(cipherText); + } + + /** + * 校验加密前后的字符串是否为同一数据 + * + * @param hexKey 16进制密钥(忽略大小写) + * @param cipherText 16进制加密后的字符串 + * @param paramStr 加密前的字符串 + * @return 是否为同一数据 + * @throws Exception + * @explain + */ + public static boolean verifyEcb(String hexKey, String cipherText, String paramStr) throws Exception { + hexKey = strTo16(hexKey); + // 用于接收校验结果 + boolean flag = false; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // 将16进制字符串转换成数组 + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] decryptData = decrypt_Ecb_Padding(keyData, cipherData); + // 将原字符串转换成byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 判断2个数组是否一致 + flag = Arrays.equals(decryptData, srcData); + return flag; + } + + /** + * 字符串转化成为16进制 + * + * @param s + * @return + */ + public static String strTo16(String s) { + String str = ""; + for (int i = 0; i < s.length(); i++) { + int ch = (int) s.charAt(i); + String s4 = Integer.toHexString(ch); + str = str + s4; + } + return str.substring(0, 32); + } + +} \ No newline at end of file diff --git a/src/com/engine/salary/web/TaxAgentTaxReturnController.java b/src/com/engine/salary/web/TaxAgentTaxReturnController.java new file mode 100644 index 000000000..c7bacf57a --- /dev/null +++ b/src/com/engine/salary/web/TaxAgentTaxReturnController.java @@ -0,0 +1,93 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.TaxAgentTaxReturnWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 个税扣缴义务人-报税信息 + * + * @author chengliming + * @date: 2022-08-31 11:49:38 + */ +public class TaxAgentTaxReturnController { + + private TaxAgentTaxReturnWrapper getTaxAgentTaxReturnWrapper(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnWrapper.class, user); + } + + + /** + * 获取报税信息表单 + * + * @param taxAgentId + * @return + */ + @GET + @Path("/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("taxAgentId") Long taxAgentId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::getForm, taxAgentId); + } + + /** + * 保存并验证报税信息 + * + * @param saveParam + * @return + */ + @POST + @Path("/saveAndCheck") + @Produces(MediaType.APPLICATION_JSON) + public String saveAndCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.MAIN_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + + /** + * 多个登记序号单选提交 + * + * @param saveParam + * @return + */ + @POST + @Path("/registration/check") + @Produces(MediaType.APPLICATION_JSON) + public String registrationCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.checkParam4Registration(); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.REGISTRATION_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + + /** + * 多个登记序号单选提交 + * + * @param saveParam + * @return + */ + @POST + @Path("/departmentCode/check") + @Produces(MediaType.APPLICATION_JSON) + public String departmentCodeCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.checkParam4Department(); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + +} diff --git a/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java new file mode 100644 index 000000000..63c136151 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java @@ -0,0 +1,152 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnListDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnResultDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +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.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.impl.TaxAgentTaxReturnServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.Sm4Utils; +import com.engine.salary.util.page.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 个税扣缴义务人-报税信息包装类 + * + * @author chengliming + * @date: 2022-08-31 13:29:14 + */ + +@Slf4j +public class TaxAgentTaxReturnWrapper extends Service { + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class,user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class,user); + } + + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class,user); + } + /** + * 请求类型:1.保存并验证 2.仅保存 + */ + private static final Integer[] REQUEST_TYPE = {1, 2}; + /** + * 展示类型:1.展示表单 2.展示列表 3.关闭所有tab + */ + private static final Integer[] COMP_TYPE = {1, 2, 3}; + + /** + * 需要自定义设置的字段名 + */ + private static final Set NEED_CUSTOM_ITEMS = new HashSet<>(Arrays.asList("areaCode", "account", "taxCode", "netPassword", "realNamePassword", "departmentName", "departmentCode")); + + public TaxAgentTaxReturnMainFormDTO getForm(Long taxAgentId) { + TaxAgentTaxReturnMainFormDTO formDTO = new TaxAgentTaxReturnMainFormDTO() + .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD) + .setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT); + // 查询是否填写过报税信息 + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnService(user).getByTaxAgentId(taxAgentId); + if (Objects.nonNull(taxReturnPO)) { + try { + // 密码解密 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); + } catch (Exception e) { + log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); + } + formDTO = TaxAgentTaxReturnBO.convertPo2FormDto(taxReturnPO); + } + // 查询个税扣缴义务人名称 + TaxAgentPO agentPO = getTaxAgentService(user).getById(taxAgentId); + SalaryAssert.notNull(agentPO, SalaryI18nUtil.getI18nLabel( 100545, "个税扣缴义务人不存在")); + formDTO.setName(agentPO.getName()); + return formDTO; + } + + public Object verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnCheckDTO checkDTO = getTaxAgentTaxReturnService(user).verify(saveParam); + // 校验税友验证是否成功 + TaxAgentTaxReturnResultDTO resultDTO = TaxAgentTaxReturnResultDTO.builder() + .checkStatus(TaxAgentTaxReturnStatusEnum.parseByValue(checkDTO.getStatus())) + .failReason(checkDTO.getMessage()) + .message(checkDTO.getMessage()) + .taxRegistrationNumber(checkDTO.getTaxRegistrationNumber()) + .departmentCode(checkDTO.getDepartmentCode()) + .taxAgentId(saveParam.getTaxAgentId().toString()) + .build(); + // 是否为仅保存 + if (REQUEST_TYPE[1].equals(saveParam.getRequestType())) { + return resultDTO; + } + // 是否为校验部门信息的接口 + if (TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue().equals(saveParam.getType()) || checkDTO.getRecords().isEmpty()) { + return resultDTO; + } + // 组装数据 + if (checkDTO.getRecords().size() > 1) { + // 如果返回了多条,创建表格 + return resultDTO.setTable(buildTable(checkDTO)).setCompType(COMP_TYPE[1]); + } else { + // 如果只返回一条,创建表单 + return buildResultForm(checkDTO, resultDTO); + } + } + + private TaxAgentTaxReturnResultDTO buildResultForm(TaxAgentTaxReturnCheckDTO resultDTO, TaxAgentTaxReturnResultDTO result) { +// TaxAgentTaxReturnCheckFormDTO checkDTO = resultDTO.getRecords().get(0); +// WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxAgentTaxReturnCheckFormDTO.class, checkDTO); +// // 如果不是分部门备案,隐藏 +// if (SalaryOnOffEnum.OFF.getValue().equals(checkDTO.getDivideFiling().getValue())) { +// weaForm.getLayout().forEach(e -> e.forEach(layout -> layout.setHide("departmentCode".equals(layout.getId()) || "departmentName".equals(layout.getId())))); +// } +// weaForm.getItems().forEach((k, v) -> { +// if (NEED_CUSTOM_ITEMS.contains(k)) { +// Map otherParams = new HashMap<>(2); +// otherParams.put("showCount", true); +// otherParams.put("autoTrim", true); +// otherParams.put("placeholder", SalaryI18nUtil.getI18nLabel( 85987, "请输入")); +// v.setOtherParams(otherParams); +// } +// }); +// return WeaResult.success(result.setForm(weaForm).setCompType(COMP_TYPE[0])); + return null; + } + + + private PageInfo buildTable(TaxAgentTaxReturnCheckDTO resultDTO) { + PageInfo page = new PageInfo<>(); + List list = resultDTO.getRecords().stream().map(e -> { + TaxAgentTaxReturnListDTO dto = new TaxAgentTaxReturnListDTO(); + BeanUtils.copyProperties(e, dto); + return dto; + }).collect(Collectors.toList()); + page.setList(list); + return page; + } +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java new file mode 100644 index 000000000..01edf018d --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -0,0 +1,77 @@ +package com.engine.salary.wrapper; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.service.TaxDeclarationApiBillingService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 个税申报计费 + * + * @author chengliming + * @date 2022-11-11 15:16:22 + */ +@Slf4j +@Component +public class TaxDeclarationApiFlowBillingWrapper { + + private TaxDeclarationApiBillingService taxDeclarationApiBillingService; + + private TaxDeclarationApiConfigService taxDeclarationApiConfigService; + +// private SalaryBatchService salaryBatchService; + + public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { + taxDeclarationApiConfigService.saveConfig(saveParam); + } + + public TaxDeclarationBillingConfigFormDTO getConfig() { + TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); + if (config == null) { + return TaxDeclarationBillingConfigFormDTO.builder().appKey("").appSecret("").enable(true).build(); + } + return TaxDeclarationBillingConfigFormDTO.builder() + .id(config.getId()) + .appKey(config.getAppKey()) + .appSecret(config.getAppSecret()) + .enable(SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse())) + .build(); + } + +// public WeaTable getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) { +// PageInfo page = taxDeclarationApiBillingService.pageFlowRecord(queryParam); +// return SalaryFormatUtil.getInstance().buildTable(TaxDeclarationApiFlowRecordListDTO.class, page); +// } + +// public Map exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) { +// List dtoList = taxDeclarationApiBillingService.listFlowRecord(queryParam, employeeId, tenantKey); +// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel( 95795, "数据不存在")); +// // 构建异步导出参数 +// Map map = salaryBatchService.buildeExportParam("exportFlowRecord"); +// map.put("sheetName", SalaryI18nUtil.getI18nLabel( 183779, "接口使用记录数据")); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// try { +// taxDeclarationApiBillingService.exportFlowRecord(queryParam, map, employeeId, tenantKey); +// } finally { +// } +// } +// }; +// ThreadPoolUtil.execute(localRunnable); +// return map; +// } + + public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { + taxDeclarationApiConfigService.enableConfig(saveParam); + } + + public Boolean getConfigStatus(String currentTenantKey, Long currentEmployeeId) { + TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); + return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); + } +} From 38f3461c646a4277356d2a7e8462dfa9a7cb94e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 20 Jul 2023 14:05:19 +0800 Subject: [PATCH 005/298] v1 --- .../bo/TaxDeclarationStrategy.java | 42 +++++++------- .../dto/AbnormalEmployeeListDTO.java | 35 +----------- .../dto/FailEmployeeListDTO.java | 33 +---------- .../dto/TaxDeclarationTabDTO.java | 2 +- .../dto/TaxDeclarationValueListDTO.java | 2 +- .../dto/TaxDeclareRecordFormDTO.java | 26 +-------- .../dto/TaxDeclareRecordListDTO.java | 57 +------------------ .../param/AbnormalEmployeeListQueryParam.java | 2 +- .../TaxDeclarationValueListQueryParam.java | 4 +- .../enums/employeedeclare/CardTypeEnum.java | 42 ++++++++++++++ .../employeedeclare/DeclareStatusEnum.java | 45 +++++++++++++++ .../employeedeclare/EmploymentStatusEnum.java | 43 ++++++++++++++ .../employeedeclare/EmploymentTypeEnum.java | 46 +++++++++++++++ .../enums/employeedeclare/GenderEnum.java | 43 ++++++++++++++ 14 files changed, 253 insertions(+), 169 deletions(-) create mode 100644 src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java create mode 100644 src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java create mode 100644 src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java create mode 100644 src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java create mode 100644 src/com/engine/salary/enums/employeedeclare/GenderEnum.java diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java index 76e870558..09fed43d0 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java @@ -1,21 +1,21 @@ -package com.engine.salary.entity.taxdeclaration.bo; - -/** - * @description: 生成个税申报表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/1 4:47 PM - * @version:v1.0 - */ -public interface TaxDeclarationStrategy { - - /** - * 生成个税申报表 - * - * @param taxDeclareContext - * @param employeeId - * @param tenantKey - * @return - */ - TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey); -} +//package com.engine.salary.entity.taxdeclaration.bo; +// +///** +// * @description: 生成个税申报表 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2022/12/1 4:47 PM +// * @version:v1.0 +// */ +//public interface TaxDeclarationStrategy { +// +// /** +// * 生成个税申报表 +// * +// * @param taxDeclareContext +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey); +//} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java index 9be4d4bba..105f6ebb8 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -1,14 +1,11 @@ package com.engine.salary.entity.taxdeclaration.dto; -import com.weaver.common.component.table.type.WeaTableTypeEnum; -import com.weaver.hrm.salary.annotation.SalaryTable; -import com.weaver.hrm.salary.annotation.SalaryTableColumn; -import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; -import org.codehaus.jackson.map.annotate.JsonSerialize; -import org.codehaus.jackson.map.ser.std.ToStringSerializer; /** * @description: 个税申报-校验异常的人员列表 @@ -19,7 +16,6 @@ import org.codehaus.jackson.map.ser.std.ToStringSerializer; */ @Data @Accessors(chain = true) -@SalaryTable(tableType = WeaTableTypeEnum.NONE, pageUid = "abnormalEmployeeList") public class AbnormalEmployeeListDTO { @ApiModelProperty("主键id") @@ -33,46 +29,21 @@ public class AbnormalEmployeeListDTO { @JsonSerialize(using = ToStringSerializer.class) private Long employeeId; - @SalaryTableColumn( - label = "姓名", - labelId = 85429, - width = "150" - ) @ApiModelProperty("姓名") private String employeeName; - @SalaryTableColumn( - label = "工号", - labelId = 86317, - width = "150" - ) @ApiModelProperty("工号") private String jobNum; - @SalaryTableColumn( - label = "证件类型", - labelId = 105139, - width = "150" - ) @ApiModelProperty("证件类型") private String cardType; - @SalaryTableColumn( - label = "证件号码", - labelId = 86318, - width = "150" - ) @ApiModelProperty("证件号码") private String cardNum; @ApiModelProperty("报送状态") private DeclareStatusEnum declareStatus; - @SalaryTableColumn( - label = "报送状态", - labelId = 177862, - width = "150" - ) @ApiModelProperty("报送状态") private String declareStatusDesc; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index 737011270..5b73b2245 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -1,13 +1,10 @@ package com.engine.salary.entity.taxdeclaration.dto; -import com.weaver.common.component.table.type.WeaTableTypeEnum; -import com.weaver.hrm.salary.annotation.SalaryTable; -import com.weaver.hrm.salary.annotation.SalaryTableColumn; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; -import org.codehaus.jackson.map.annotate.JsonSerialize; -import org.codehaus.jackson.map.ser.std.ToStringSerializer; /** * @description: 个税申报-申报失败的人员列表 @@ -18,18 +15,12 @@ import org.codehaus.jackson.map.ser.std.ToStringSerializer; */ @Data @Accessors(chain = true) -@SalaryTable(tableType = WeaTableTypeEnum.NONE, pageUid = "failEmployeeList") public class FailEmployeeListDTO { @ApiModelProperty("主键id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @SalaryTableColumn( - label = "姓名", - labelId = 85429, - width = "150" - ) @ApiModelProperty("姓名") private String employeeName; @@ -37,35 +28,15 @@ public class FailEmployeeListDTO { @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - @SalaryTableColumn( - label = "个税扣缴义务人名称", - labelId = 91558, - width = "150" - ) @ApiModelProperty("个税扣缴义务人名称") private String taxAgentName; - @SalaryTableColumn( - label = "证件号码", - labelId = 86318, - width = "150" - ) @ApiModelProperty("证件号码") private String cardNum; - @SalaryTableColumn( - label = "失败原因", - labelId = 156405, - width = "150" - ) @ApiModelProperty("失败原因") private String errorMsg; - @SalaryTableColumn( - label = "所得项目", - labelId = 102786, - width = "150" - ) @ApiModelProperty("所得项目") private String incomeCategory; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java index dc2d6fd56..f8604a3da 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java @@ -1,8 +1,8 @@ package com.engine.salary.entity.taxdeclaration.dto; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java index 53ef3bd27..218e91b8a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java @@ -1,6 +1,6 @@ package com.engine.salary.entity.taxdeclaration.dto; -import com.weaver.common.component.table.column.WeaTableColumn; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import lombok.Data; import lombok.experimental.Accessors; diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java index b856568ad..e8db3265e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -1,9 +1,6 @@ package com.engine.salary.entity.taxdeclaration.dto; -import com.weaver.common.component.form.item.WeaFormItemType; -import com.weaver.hrm.salary.annotation.SalaryForm; -import com.weaver.hrm.salary.annotation.SalaryFormItem; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -29,36 +26,15 @@ import java.util.Map; @ApiModel("个税申报记录表单") public class TaxDeclareRecordFormDTO { - @SalaryForm( - label = "薪资所属月", - labelId = 87614, - items = @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) - ) @ApiModelProperty("薪资所属月") private YearMonth salaryMonth; - @SalaryForm( - label = "个税扣缴义务人范围", - labelId = 160476, - items = @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = TaxAgentRangeEnum.class) - ) @ApiModelProperty("个税扣缴义务人范围") private TaxAgentRangeEnum taxAgentRange; - @SalaryForm( - label = "个税扣缴义务人", - labelId = 86184, - items = @SalaryFormItem(itemType = WeaFormItemType.BROWSER, required = true, browserModule = "hrmsalary", - browserType = "TaxAgentBrowser", browserMultiple = true) - ) @ApiModelProperty("个税扣缴义务人id") private List> taxAgentIds; - @SalaryForm( - label = "备注", - labelId = 84961, - items = @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "30") - ) @ApiModelProperty("备注") private String description; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java index 6aa26d4af..dd494dcdc 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -1,13 +1,9 @@ package com.engine.salary.entity.taxdeclaration.dto; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import com.weaver.common.component.table.type.WeaTableTypeEnum; -import com.weaver.hrm.salary.annotation.SalaryTable; -import com.weaver.hrm.salary.annotation.SalaryTableColumn; -import com.weaver.hrm.salary.annotation.SalaryTableOperate; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareStatusEnum; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareTypeEnum; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; @@ -21,10 +17,6 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -@SalaryTable(value = { - @SalaryTableOperate(index = 0, text = "查看详情", labelId = 93216, outer = true), - @SalaryTableOperate(index = 1, text = "删除", labelId = 87061, outer = true) -}, tableType = WeaTableTypeEnum.NONE, pageUid = "taxAgentDeclareList") public class TaxDeclareRecordListDTO { @JsonSerialize(using = ToStringSerializer.class) @@ -34,57 +26,27 @@ public class TaxDeclareRecordListDTO { @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - @SalaryTableColumn( - label = "个税扣缴义务人", - labelId = 86184, - width = "15%" - ) @ApiModelProperty("个税扣缴义务人名称") private String taxAgentName; - @SalaryTableColumn( - label = "薪资所属月", - labelId = 87614, - width = "10%" - ) @ApiModelProperty("薪资所属月") private String salaryMonth; - @SalaryTableColumn( - label = "税款所属期", - labelId = 86176, - width = "10%" - ) @ApiModelProperty("税款所属期") private String taxCycle; @ApiModelProperty("申报类型") private TaxDeclareTypeEnum taxDeclareType; - @SalaryTableColumn( - label = "申报类型", - labelId = 177641, - width = "10%" - ) @ApiModelProperty("申报类型") private String taxDeclareTypeDesc; @ApiModelProperty("申报状态") private TaxDeclareStatusEnum taxDeclareStatus; - @SalaryTableColumn( - label = "申报状态", - labelId = 156414, - width = "10%" - ) @ApiModelProperty("申报状态") private String taxDeclareStatusDesc; - @SalaryTableColumn( - label = "已缴金额", - labelId = 179035, - width = "10%" - ) @ApiModelProperty("已缴金额") private String taxPaidAmount; @@ -92,27 +54,12 @@ public class TaxDeclareRecordListDTO { @JsonSerialize(using = ToStringSerializer.class) private Long operateEmployeeId; - @SalaryTableColumn( - label = "操作人", - labelId = 85435, - width = "10%" - ) @ApiModelProperty("操作人名称") private String operateEmployeeName; - @SalaryTableColumn( - label = "操作时间", - labelId = 85436, - width = "15%" - ) @ApiModelProperty("操作时间") private String operateTime; - @SalaryTableColumn( - label = "备注", - labelId = 84961, - width = "10%" - ) @ApiModelProperty("备注") private String description; diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java index 25cdbd25a..3e8a7743a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -1,7 +1,7 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.common.BaseQueryParam; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.weaver.hrm.salary.common.BaseQueryParam; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java index 19d514e52..1eac68efa 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -1,7 +1,7 @@ package com.engine.salary.entity.taxdeclaration.param; -import com.weaver.hrm.salary.common.BaseQueryParam; -import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; diff --git a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java new file mode 100644 index 000000000..8d8952931 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -0,0 +1,42 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 证件类型 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 1:56 PM + * @version:v1.0 + */ +public enum CardTypeEnum implements BaseEnum { + + RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564); + + CardTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java new file mode 100644 index 000000000..d4d1380c4 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java @@ -0,0 +1,45 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 人员报送状态 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/5/22 10:29 AM + * @version:v1.0 + */ +public enum DeclareStatusEnum implements BaseEnum { + + NOT_DECLARE(1, "待报送", 158772), + DECLARING(2, "报送中", 158773), + DECLARE_FAIL(3, "报送失败", 158770), + DECLARE_SUCCESS(4, "报送成功", 158774); + + DeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java new file mode 100644 index 000000000..7c27bbbdb --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java @@ -0,0 +1,43 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 人员状态 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 10:57 AM + * @version:v1.0 + */ +public enum EmploymentStatusEnum implements BaseEnum { + + NORMAL(0, "正常", 160477), + ABNORMAL(1, "非正常", 160478); + + EmploymentStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java new file mode 100644 index 000000000..a95e36b9c --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java @@ -0,0 +1,46 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 任职受雇从业类型 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 10:59 AM + * @version:v1.0 + */ +public enum EmploymentTypeEnum implements BaseEnum { + + EMPLOYEE(0, "雇员", 160479), + INSURANCE_SALESMAN(1, "保险营销员", 160480), + SECURITIES_BROKER(2, "证券经纪人", 160481), + INTERNSHIP_STUDENTS(3, "实习学生(全日制学历教育)", 181935), + OTHER(4, "其他", 102799); + + EmploymentTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java new file mode 100644 index 000000000..615698604 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java @@ -0,0 +1,43 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * @description: 性别 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 10:33 AM + * @version:v1.0 + */ +public enum GenderEnum implements BaseEnum { + + MALE(0, "男", 102440), + FEMALE(1, "女", 102442); + + GenderEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} From 58eaddc33ecd029731711487b9da5896adbfe2a2 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 8 Aug 2023 09:21:14 +0800 Subject: [PATCH 006/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81temp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/web/EmployeeDeclareController.java | 14 + .../bo/EmployeeDeclareList.java | 151 ++++ .../bo/EmployeeDeclareRefresh.java | 223 ++++++ .../dto/EmployeeDeclareFailListDTO.java | 84 +++ .../dto/EmployeeDeclareFromDTO.java | 249 +++++++ .../dto/EmployeeDeclareInfoDTO.java | 34 + .../dto/EmployeeDeclareListDTO.java | 109 +++ .../dto/EmployeeDeclareRateDTO.java | 36 + .../dto/EmployeeDeclareRefreshDTO.java | 50 ++ .../dto/TaxAgentDeclareListDTO.java | 28 + .../EmployeeDeclareAddListQueryParam.java | 97 +++ .../EmployeeDeclareFailListQueryParam.java | 42 ++ .../param/EmployeeDeclareListQueryParam.java | 87 +++ .../param/EmployeeDeclareParam.java | 35 + .../param/EmployeeDeclareRefreshParam.java | 35 + .../param/TaxAgentDeclareListQueryParam.java | 24 + .../employeedeclare/po/EmployeeDeclarePO.java | 224 ++++++ .../salaryaccounting/EmployeeTypeEnum.java | 11 + .../EmployeeDeclareMapper.java | 107 +++ .../employeedeclare/EmployeeDeclareMapper.xml | 687 ++++++++++++++++++ .../service/EmployeeDeclareService.java | 182 +++++ .../impl/EmployeeDeclareServiceImpl.java | 675 +++++++++++++++++ .../impl/SalaryEmployeeServiceImpl.java | 4 +- .../TaxDeclarationApiBillingServiceImpl.java | 17 +- .../engine/salary/util/SalaryEnumUtil.java | 19 + .../salary/util/valid/SalaryCardUtil.java | 109 +++ .../salary/web/EmployeeDeclareController.java | 334 +++++++++ .../wrapper/EmployeeDeclareWrapper.java | 648 +++++++++++++++++ 28 files changed, 4299 insertions(+), 16 deletions(-) create mode 100644 src/com/api/salary/web/EmployeeDeclareController.java create mode 100644 src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java create mode 100644 src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java create mode 100644 src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java create mode 100644 src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml create mode 100644 src/com/engine/salary/service/EmployeeDeclareService.java create mode 100644 src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java create mode 100644 src/com/engine/salary/util/valid/SalaryCardUtil.java create mode 100644 src/com/engine/salary/web/EmployeeDeclareController.java create mode 100644 src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java diff --git a/src/com/api/salary/web/EmployeeDeclareController.java b/src/com/api/salary/web/EmployeeDeclareController.java new file mode 100644 index 000000000..89158a9ad --- /dev/null +++ b/src/com/api/salary/web/EmployeeDeclareController.java @@ -0,0 +1,14 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * @description: 人员报送 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 3:37 PM + * @version:v1.0 + */ +@Path("/bs/hrmsalary/employeedeclare") +public class EmployeeDeclareController extends com.engine.salary.web.EmployeeDeclareController { +} diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java new file mode 100644 index 000000000..8231332ba --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java @@ -0,0 +1,151 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; + +/** + * @description: 人员报送(人员)列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 4:06 PM + * @version:v1.0 + */ +public class EmployeeDeclareList { + + /** + * 转换成人员报送(人员)列表dto + * + * @param employeeDeclares + * @param taxAgents + * @return + */ + public static List convert(List employeeDeclares, + List taxAgents) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + List dtoList = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class); + EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); + EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); + DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class); + EmployeeDeclareListDTO dto = new EmployeeDeclareListDTO() + .setId(employeeDeclare.getId()) + .setEmployeeId(employeeDeclare.getEmployeeId()) + .setEmployeeType(EmployeeTypeEnum.parseByValue(employeeDeclare.getEmployeeType())) + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setTaxAgentName(taxAgentNameMap.get(employeeDeclare.getTaxAgentId())) + .setCardType(cardTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(cardTypeEnum.getLabelId(), cardTypeEnum.getDefaultLabel())) + .setCardNum(employeeDeclare.getCardNum()) + .setGender(genderEnum == null ? "" : genderEnum.getDefaultLabel()) + .setBirthday(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getBirthday())) + .setEmploymentStatus(employmentStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(employmentStatusEnum.getLabelId(), employmentStatusEnum.getDefaultLabel())) + .setMobile(employeeDeclare.getMobile()) + .setEmploymentType(employmentTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(employmentTypeEnum.getLabelId(), employmentTypeEnum.getDefaultLabel())) + .setEmploymentDate(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate())) + .setDismissDate(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate())) + .setDeclareStatus(declareStatusEnum) + .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())) + .setDeclareErrorMsg(employeeDeclare.getDeclareErrorMsg()); + dtoList.add(dto); + } + return dtoList; + } + + public static List convert2FailListDTO(List employeeDeclares, + Map employeeInfoMap) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + + + List dtos = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(employeeDeclare.getEmployeeType()) == 0; + DataCollectionEmployee employee = employeeInfoMap.get(employeeDeclare.getEmployeeId() + "-" + isExtEmp); + + CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + EmployeeDeclareFailListDTO dto = new EmployeeDeclareFailListDTO() + .setId(employeeDeclare.getId()) + .setEmployeeId(employeeDeclare.getEmployeeId()) + .setEmployeeType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmployeeType(), EmployeeTypeEnum.class)) + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setDepartmentName(employee == null ? "" : employee.getDepartmentName()) + .setCardType(cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel()) + .setCardNum(employeeDeclare.getCardNum()) + .setDeclareErrorMsg(employeeDeclare.getDeclareErrorMsg()); + dtos.add(dto); + } + return dtos; + } + + public static Map> getUpdatedField(List employeeDeclares, List originEmployeeDeclares) { + if (CollectionUtils.isEmpty(employeeDeclares) || CollectionUtils.isEmpty(originEmployeeDeclares)) { + return Collections.emptyMap(); + } + Map> updatedFieldMap = Maps.newHashMap(); + Map originEmployeeDeclareMap = SalaryEntityUtil.convert2Map(originEmployeeDeclares, EmployeeDeclarePO::getEmployeeId); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + Set dataIndexSet = Sets.newHashSet(); + EmployeeDeclarePO originEmployeeDeclare = originEmployeeDeclareMap.get(employeeDeclare.getEmployeeId()); + if (originEmployeeDeclare == null) { + continue; + } + if (!Objects.equals(employeeDeclare.getEmployeeName(), originEmployeeDeclare.getEmployeeName())) { + dataIndexSet.add("employeeName"); + } + if (!Objects.equals(employeeDeclare.getJobNum(), originEmployeeDeclare.getJobNum())) { + dataIndexSet.add("jobNum"); + } + if (!Objects.equals(employeeDeclare.getCardType(), originEmployeeDeclare.getCardType())) { + dataIndexSet.add("cardType"); + } + if (!Objects.equals(employeeDeclare.getCardNum(), originEmployeeDeclare.getCardNum())) { + dataIndexSet.add("cardNum"); + } + if (!Objects.equals(employeeDeclare.getGender(), originEmployeeDeclare.getGender())) { + dataIndexSet.add("gender"); + } + if (!Objects.equals(employeeDeclare.getBirthday(), originEmployeeDeclare.getBirthday())) { + dataIndexSet.add("birthday"); + } + if (!Objects.equals(employeeDeclare.getEmploymentStatus(), originEmployeeDeclare.getEmploymentStatus())) { + dataIndexSet.add("employmentStatus"); + } + if (!Objects.equals(employeeDeclare.getMobile(), originEmployeeDeclare.getMobile())) { + dataIndexSet.add("mobile"); + } + if (!Objects.equals(employeeDeclare.getEmploymentType(), originEmployeeDeclare.getEmploymentType())) { + dataIndexSet.add("employmentType"); + } + if (!Objects.equals(employeeDeclare.getEmploymentDate(), originEmployeeDeclare.getEmploymentDate())) { + dataIndexSet.add("employmentDate"); + } + if (!Objects.equals(employeeDeclare.getDismissDate(), originEmployeeDeclare.getDismissDate())) { + dataIndexSet.add("dismissDate"); + } + updatedFieldMap.put(employeeDeclare.getEmployeeId(), dataIndexSet); + } + return updatedFieldMap; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java new file mode 100644 index 000000000..aa1b60536 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -0,0 +1,223 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.api.formmode.page.util.Util; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.valid.SalaryCardUtil; +import com.google.common.collect.Lists; +import dm.jdbc.util.IdGenerator; +import lombok.Data; +import org.springframework.beans.BeanUtils; + +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @description: + * @author: xiajun + * @modified By: xiajun + * @date: 2022/11/6 15:47 + * @version:v1.0 + */ +public class EmployeeDeclareRefresh { + + public static Result refresh(EmployeeDeclareRefreshDTO dto, Long employeeId) { + Result result = new Result(); + // 本月已有的需要报送的人员 + Set employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId); + // 员工的个人信息 + Map simpleUserInfoMap = dto.getSimpleUserInfos().stream() + .filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser())) + .collect(Collectors.toMap(simpleUserInfo -> simpleUserInfo.getUser().getId(), Function.identity(), (a, b) -> a)); + // 薪资档案的数据(任职受雇从业类型、起始发薪日期、最后发薪日期) + Map salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId); + // 非系统人员的数据(任职受雇从业类型) + Map extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmployeePO::getId); + LocalDateTime now = LocalDateTime.now(); + // 对已有人员处理「人员状态」、「离职日期」、「任职受雇从业类型」 + for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) { + SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); + if (salaryArchive != null && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { + if (Objects.equals(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue()) + || Objects.equals(Util.null2String(employeeDeclare.getDismissDate()), Util.null2String(salaryArchive.getPayEndDate()))) { + employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); + employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setUpdateTime(now); + result.getEmployeeDeclares().add(employeeDeclare); + } + } + if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); + employeeDeclare.setNewEmployeeInfo(1); + } + ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); + if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); + employeeDeclare.setNewEmployeeInfo(1); + } + } + // 自动保存上个月报送成功的人员 + for (EmployeeDeclarePO preTaxCycleEmployeeDeclare : dto.getPreTaxCycleEmployeeDeclare()) { + if (!employeeIds.contains(preTaxCycleEmployeeDeclare.getEmployeeId())) { + EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(preTaxCycleEmployeeDeclare, employeeDeclare); + employeeDeclare.setId(IdGenerator.generate()) + .setTaxCycle(dto.getTaxCycle().toString()) + .setNewEmployeeInfo(0) + .setCreateTime(now) + .setUpdateTime(now); + // 对人员处理「人员状态」、「离职日期」、「任职受雇从业类型」 + SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); + if (salaryArchive != null && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); + employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); + employeeDeclare.setNewEmployeeInfo(1); + } + if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); + employeeDeclare.setNewEmployeeInfo(1); + } + ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); + if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); + employeeDeclare.setNewEmployeeInfo(1); + } + employeeIds.add(employeeDeclare.getEmployeeId()); + result.getNewEmployeeDeclares().add(employeeDeclare); + } + } + // 薪资档案中新增的需报送的人员 + for (HrmEmployeeComInfo hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) { + if (employeeIds.contains(hrmEmployeeComInfo.getId())) { + continue; + } + EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); + SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getId()); + String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo(); + employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getId()) + .setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()) + .setEmployeeName(hrmEmployeeComInfo.getUsername()) + .setJobNum(hrmEmployeeComInfo.getJob_num()) + .setCardNum(idNum) + .setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) + ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()) + .setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateToLocalDate(simpleUserInfo.getBirthday())) + .setMobile(hrmEmployeeComInfo.getMobile()); + if (StringUtils.isEmpty(idNum)) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); + } else if (!SalaryCardUtil.checkIdNum(idNum)) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); + } else { + employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue()); + employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(idNum)); + } + // 对人员处理「人员状态」、「离职日期」 + SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); + if (salaryArchive != null) { + employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); + employeeDeclare.setEmploymentDate(salaryArchive.getPayStartDate()); + if (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { + employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); + employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); + } + } + employeeIds.add(employeeDeclare.getEmployeeId()); + result.getNewEmployeeDeclares().add(employeeDeclare); + } + // 非系统人员中新增的需报送的人员 + for (ExtEmployeePO extEmployee : dto.getExtEmployees()) { + if (employeeIds.contains(extEmployee.getId())) { + continue; + } + EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); + employeeDeclare.setEmployeeId(extEmployee.getId()) + .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) + .setEmployeeName(extEmployee.getUsername()) + .setCardNum(extEmployee.getCardNum()) + .setMobile(extEmployee.getMobile()) + .setEmploymentType(extEmployee.getEmploymentType()) + .setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1)); + if (StringUtils.isEmpty(extEmployee.getCardNum())) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); + } else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); + } else { + employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue()); + employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum())); + } + employeeIds.add(employeeDeclare.getEmployeeId()); + result.getNewEmployeeDeclares().add(employeeDeclare); + } + return result; + } + private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, YearMonth taxCycle, Date now, Long employeeId) { + return new EmployeeDeclarePO() + .setId(IdGenerator.generate()) + .setTaxAgentId(taxAgentId) + .setTaxCycle(taxCycle.toString()) + .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) + .setGender(GenderEnum.MALE.getValue()) + .setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue()) + .setEmploymentType(EmploymentTypeEnum.EMPLOYEE.getValue()) + .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .setDeclareErrorMsg("") + .setDisability(SalaryOnOffEnum.OFF.getValue()) + .setDisabilityCardNo("") + .setLonelyOld(SalaryOnOffEnum.OFF.getValue()) + .setMartyrDependents(SalaryOnOffEnum.OFF.getValue()) + .setMartyrDependentsCardNo("") + .setDeductExpenses(SalaryOnOffEnum.ON.getValue()) + .setSuccessfullyDeclared(0) + .setNewEmployeeInfo(0) + .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator(employeeId) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + } + + @Data + public static class Result { + + /** + * 已有的需要更新的报送人员 + */ + private List employeeDeclares; + + /** + * 新增的报送人员 + */ + private List newEmployeeDeclares; + + public Result() { + this.employeeDeclares = Lists.newArrayList(); + this.newEmployeeDeclares = Lists.newArrayList(); + } + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java new file mode 100644 index 000000000..7bec5e7be --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java @@ -0,0 +1,84 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * @description: 报送人员失败列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/7 10:42 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareFailListDTO { + + // 主键id + private Long id; + + // 人员id + private Long employeeId; + + // 人员类型 + private EmployeeTypeEnum employeeType; + +// @SalaryTableColumn( +// label = "姓名", +// labelId = 85429, +// width = "10%" +// ) + @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + +// @SalaryTableColumn( +// label = "工号", +// labelId = 86317, +// width = "10%" +// ) + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + // 部门id + private String departmentId; + +// @SalaryTableColumn( +// label = "部门", +// labelId = 86185, +// width = "10%" +// ) + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + private String departmentName; + +// @SalaryTableColumn( +// label = "证件类型", +// labelId = 105139, +// width = "10%" +// ) + @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") + private String cardType; + +// @SalaryTableColumn( +// label = "证件号码", +// labelId = 86318, +// width = "20%" +// ) + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + +// @SalaryTableColumn( +// label = "失败原因", +// labelId = 156405, +// width = "40%" +// ) + @TableTitle(title = "失败原因", dataIndex = "declareErrorMsg", key = "declareErrorMsg") + private String declareErrorMsg; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java new file mode 100644 index 000000000..5e8da8b2b --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -0,0 +1,249 @@ +package com.engine.salary.entity.employeedeclare.dto; + + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.employeedeclare.GenderEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDate; + +/** + * @description: 人员报送(人员)表单 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 10:14 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareFromDTO { + + // 人员id + private Long id; + + // 个税扣缴义务人id + + private Long taxAgentId; + +// @SalaryForm( +// label = "系统名称", +// labelId = 160460, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.TYPESBROWSER, browserModule = "hrmsalary", +// browserType = "salaryEmployeeCombinationBrowser", required = true) +// } +// ) + // 系统名称 + @TableTitle(title = "系统名称", dataIndex = "employee", key = "employee") + private String employee; + +// @SalaryForm( +// label = "证件姓名", +// labelId = 160461, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40", required = true) +// } +// ) + // 证件姓名 + @TableTitle(title = "证件姓名", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + +// @SalaryForm( +// label = "工号", +// labelId = 86317, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40") +// } +// ) + // 工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + +// @SalaryForm( +// label = "国籍", +// labelId = 156406, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, readOnly = true) +// } +// ) + // 国籍 + @TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality") + private String nationality; + +// @SalaryForm( +// label = "证件类型", +// labelId = 105139, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.SELECT, readOnly = true, optionsEnum = CardTypeEnum.class, +// required = true) +// } +// ) + // 证件类型 + @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") + private CardTypeEnum cardType; + +// @SalaryForm( +// label = "证件号码", +// labelId = 86318, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true, maxLength = "18") +// } +// ) + // 证件号码 + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + +// @SalaryForm( +// label = "性别", +// labelId = 98622, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = GenderEnum.class) +// } +// ) + // 性别 + @TableTitle(title = "性别", dataIndex = "gender", key = "gender") + private GenderEnum gender; + +// @SalaryForm( +// label = "出生日期", +// labelId = 98624, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) +// } +// ) + // 出生日期 + @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") + private LocalDate birthday; + +// @SalaryForm( +// label = "状态", +// labelId = 91075, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = EmploymentStatusEnum.class) +// } +// ) + // 状态 + @TableTitle(title = "状态", dataIndex = "employmentStatus", key = "employmentStatus") + private EmploymentStatusEnum employmentStatus; + +// @SalaryForm( +// label = "手机号码", +// labelId = 98621, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true) +// } +// ) + // 手机号码 + @TableTitle(title = "手机号码", dataIndex = "mobile", key = "mobile") + private String mobile; + +// @SalaryForm( +// label = "任职受雇从业类型", +// labelId = 156396, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = EmploymentTypeEnum.class) +// } +// ) + // 任职受雇从业类型 + @TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType") + private EmploymentTypeEnum employmentType; + +// @SalaryForm( +// label = "任职受雇从业日期", +// labelId = 156409, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) +// } +// ) + // 任职受雇从业日期 + @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") + private LocalDate employmentDate; + +// @SalaryForm( +// label = "离职日期", +// labelId = 95228, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER) +// } +// ) + // 离职日期 + @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") + private LocalDate dismissDate; + +// @SalaryForm( +// label = "是否残疾", +// labelId = 156399, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) +// } +// ) + // 是否残疾 + @TableTitle(title = "是否残疾", dataIndex = "disability", key = "disability") + private SalaryOnOffEnum disability; + +// @SalaryForm( +// label = "残疾证号", +// labelId = 156412, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT) +// } +// ) + // 残疾证号 + @TableTitle(title = "残疾证号", dataIndex = "disabilityCardNo", key = "disabilityCardNo") + private String disabilityCardNo; + +// @SalaryForm( +// label = "是否孤老", +// labelId = 156400, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) +// } +// ) + // 是否孤老 + @TableTitle(title = "是否孤老", dataIndex = "lonelyOld", key = "lonelyOld") + private SalaryOnOffEnum lonelyOld; + +// @SalaryForm( +// label = "是否是烈属", +// labelId = 156401, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) +// } +// ) + // 是否是烈属 + @TableTitle(title = "是否是烈属", dataIndex = "martyrDependents", key = "martyrDependents") + private SalaryOnOffEnum martyrDependents; + +// @SalaryForm( +// label = "烈属证号", +// labelId = 156413, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.INPUT) +// } +// ) + // 烈属证号 + @TableTitle(title = "烈属证号", dataIndex = "martyrDependentsCardNo", key = "martyrDependentsCardNo") + private String martyrDependentsCardNo; + +// @SalaryForm( +// label = "是否扣除减除费用", +// labelId = 156402, +// items = { +// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) +// } +// ) + // 是否扣除减除费用 + @TableTitle(title = "是否扣除减除费用", dataIndex = "deductExpenses", key = "deductExpenses") + private SalaryOnOffEnum deductExpenses; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java new file mode 100644 index 000000000..98f2bc4ef --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * @description: 报送人员信息 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/8 11:38 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareInfoDTO { + + // 是否修改过员工信息 + private boolean showUpdate; + + // 报送成功的人数 + private Integer declareSuccessSize; + + // 未报送的人数 + private Integer notDeclareSize; + + // 报送失败的人数 + private Integer declareFailSize; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java new file mode 100644 index 000000000..94d8ea0c8 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -0,0 +1,109 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import com.engine.salary.annotation.SalaryTable; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Set; + +/** + * @description: 人员报送(人员)列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 10:45 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +@SalaryTable(pageId = "a4f89287-289scf07669d7a23de0ef8u8s2710oe7") +public class EmployeeDeclareListDTO { + + // 主键id + private Long id; + + // 人员ID + private Long employeeId; + + // 人员类型 + private EmployeeTypeEnum employeeType; + + + // 姓名 + @SalaryTableColumn(text = "姓名", width = "10%", column = "employeeName") + private String employeeName; + + // 分部 + @SalaryTableColumn(text = "分部", width = "10%", column = "subCompanyName") + private String subCompanyName; + + // 部门 + @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") + private String departmentName; + + // 个税扣缴义务人 + @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") + private String taxAgentName; + + // 工号 + @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") + private String jobNum; + + // 证件类型 + @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") + private String cardType; + + // 证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") + private String cardNum; + + // 性别 + @SalaryTableColumn(text = "性别", width = "10%", column = "gender") + private String gender; + + // 出生日期 + @SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday") + private String birthday; + + // 人员状态 + @SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus") + private String employmentStatus; + + // 手机号码 + @SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile") + private String mobile; + + // 任职受雇从业类型 + @SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType") + private String employmentType; + + // 任职受雇从业日期 + @SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate") + private String employmentDate; + + + // 离职日期 + @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") + private String dismissDate; + + // 申报状态 + private DeclareStatusEnum declareStatus; + + // 申报状态 + @SalaryTableColumn(text = "申报状态", width = "10%", column = "declareStatusDesc") + private String declareStatusDesc; + + // 申报失败原因 + private String declareErrorMsg; + + // 编辑过的字段 + private Set updatedDataIndexSet; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java new file mode 100644 index 000000000..d53dc69fb --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * @description: 人员进度 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/23 11:38 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareRateDTO implements Serializable { + + private static final long serialVersionUID = 6096347310269090985L; + + @ApiModelProperty("缓存索引") + private String index; + @ApiModelProperty("提示信息") + private String msg; + @ApiModelProperty("状态") + private boolean status; + @ApiModelProperty("是否已经完成") + private boolean finish; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java new file mode 100644 index 000000000..7d795b5a0 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java @@ -0,0 +1,50 @@ +package com.engine.salary.entity.employeedeclare.dto; + + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.YearMonth; +import java.util.List; + +/** + * @description: 人员报送,刷新数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/23 10:52 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class EmployeeDeclareRefreshDTO { + // 个税扣缴义务人 + private Long taxAgentId; + + // 税款所属期 + private YearMonth taxCycle; + + // 已有的报送人员 + private List employeeDeclares; + + // 上个税款所属期的报送人员 + private List preTaxCycleEmployeeDeclare; + + // 薪资档案中的人员 + private List salaryArchives; + + // 员工基本信息 + private List employeeInfos; + +// // 员工基本信息 +// private List hrmEmployeeComInfos; +// +// // 员工个人信息 +// private List simpleUserInfos; +// +// // 非系统人员 +// private List extEmployees; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java new file mode 100644 index 000000000..6492210c8 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * @description: 人员报送(个税扣缴义务人)列表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 10:35 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class TaxAgentDeclareListDTO { + + // 主键id + private Long id; + + // 个税扣缴义务人 + private String taxAgentName; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java new file mode 100644 index 000000000..d3ba6e893 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java @@ -0,0 +1,97 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.util.valid.DataCheck; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.time.YearMonth; +import java.util.Collection; +import java.util.List; + +/** + * @description: 人员报送(人员)列表查询参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 3:24 PM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareAddListQueryParam extends BaseQueryParam { + + // 列表id + private Collection ids; + + + // 个税扣缴义务人id + @DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + /** + * 参数错误,税款所属期参数格式错误 + */ + @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") + // 税款所属期 + private YearMonth taxCycle; + + // 报送状态 + private DeclareStatusEnum declareStatus; + + // 员工姓名/编号 + private String keyword; + + // 部门 + private Collection departmentIds; + + // 岗位 + private Collection positionIds; + + // 人员状态 + private EmploymentStatusEnum employmentStatus; + + // 任职受雇从业类型 + private EmploymentTypeEnum employmentType; + + // 任职受雇日期开始 + private LocalDate fromEmploymentDate; + + // 任职受雇日期结束 + private LocalDate endEmploymentDate; + + // 离职日期开始 + private LocalDate fromDismissDate; + + // 离职日期结束 + private LocalDate endDismissDate; + + // 是否残疾 + private SalaryOnOffEnum disability; + + // 是否孤老 + private SalaryOnOffEnum lonelyOld; + + // 是否是烈属 + private SalaryOnOffEnum martyrDependents; + + // 是否扣除减除费用 + private SalaryOnOffEnum deductExpenses; + + @JsonIgnore + // 税款所属期(上月) + private String preTaxCycle; + + @ApiModelProperty + private List customColumns; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java new file mode 100644 index 000000000..960f3b1a3 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; +import java.util.Collection; + +/** + * @description: 报送人员失败查询参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/7 11:14 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareFailListQueryParam extends BaseQueryParam { + + /** + * 列表id + */ + private Collection ids; + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + /** + * 税款所属期 + */ + @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") + private YearMonth taxCycle; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java new file mode 100644 index 000000000..b3f8ec99e --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java @@ -0,0 +1,87 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.time.YearMonth; +import java.util.Collection; +import java.util.List; + +/** + * @description: 人员报送(人员)列表查询参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 3:24 PM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareListQueryParam extends BaseQueryParam { + + // 列表id + private Collection ids; + + // 个税扣缴义务人id + @DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + // 税款所属期 + @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") + private YearMonth taxCycle; + + // 报送状态 + private DeclareStatusEnum declareStatus; + + // 员工姓名/编号 + private String keyword; + + // 部门 + private Collection departmentIds; + + // 岗位 + private Collection positionIds; + + // 人员状态 + private EmploymentStatusEnum employmentStatus; + + // 任职受雇从业类型 + private EmploymentTypeEnum employmentType; + + // 任职受雇日期开始 + private LocalDate fromEmploymentDate; + + // 任职受雇日期结束 + private LocalDate endEmploymentDate; + + // 离职日期开始 + private LocalDate fromDismissDate; + + // 离职日期结束 + private LocalDate endDismissDate; + + // 是否残疾 + private SalaryOnOffEnum disability; + + // 是否孤老 + private SalaryOnOffEnum lonelyOld; + + // 是否是烈属 + private SalaryOnOffEnum martyrDependents; + + // 是否扣除减除费用 + private SalaryOnOffEnum deductExpenses; + + + private List customColumns; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java new file mode 100644 index 000000000..8a92df28d --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; + +/** + * @description: 人员报送 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/10/28 6:06 PM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareParam { + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + /** + * 税款所属期 + */ + @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") + private YearMonth taxCycle; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java new file mode 100644 index 000000000..0b94104c7 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; + +/** + * @description: 刷新报送人员 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/11/6 15:17 + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareRefreshParam { + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + /** + * 税款所属期 + */ + @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") + private YearMonth taxCycle; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java new file mode 100644 index 000000000..0e548120d --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @description: 人员报送(个税扣缴义务人)查询条件 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 10:59 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaxAgentDeclareListQueryParam extends BaseQueryParam { + + // "个税扣缴义务人名称" + private String taxAgentName; +} diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java new file mode 100644 index 000000000..794a0bedd --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -0,0 +1,224 @@ +package com.engine.salary.entity.employeedeclare.po; + + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Collection; +import java.util.Date; + + +/** + * @description: 人员报送(人员) + * @TableName(value = "hrsa_employee_declare") + * @ElogTransform(name = "报送人员") + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 9:22 AM + * @version:v1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclarePO { + + /** + * 主键id + */ + private Long id; + + /** + * 个税扣缴义务人 + */ + private Long taxAgentId; + + /** + * 税款所属期 + */ + private String taxCycle; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 人员类型 + */ + private Integer employeeType; + + /** + * 人员名称 + */ + private String employeeName; + + /** + * 工号 + */ + private String jobNum; + + /** + * 证件类型 + */ + private Integer cardType; + + /** + * 证件号码 + */ + private String cardNum; + + /** + * 性别 + */ + private Integer gender; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 状态 + */ + private Integer employmentStatus; + + /** + * 手机号码 + */ + private String mobile; + + /** + * 任职受雇从业类型 + */ + private Integer employmentType; + + /** + * 入职年度就业情形 + */ + private String employmentFirstYear; + + /** + * 任职受雇从业日期 + */ + private Date employmentDate; + + /** + * 离职日期 + */ + private Date dismissDate; + + /** + * 是否残疾 + */ + private Integer disability; + + /** + * 残疾证号 + */ + private String disabilityCardNo; + + /** + * 是否孤老 + */ + private Integer lonelyOld; + + /** + * 是否是烈属 + */ + private Integer martyrDependents; + + /** + * 烈属证号 + */ + private String martyrDependentsCardNo; + + /** + * 是否扣除减除费用 + */ + private Integer deductExpenses; + + /** + * 是否成功报送过 + * 注意:不仅仅是针对某一个月 + * 0:从未报送成功过、1:报送成功过 + */ + private Integer successfullyDeclared; + + /** + * 员工信息是否发生变动: + * 0:本月未改动、1:本月有改动 + */ + private Integer newEmployeeInfo; + + /** + * 申报状态 + */ + private Integer declareStatus; + + /** + * 申报失败的错误信息 + */ + private String declareErrorMsg; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + + public String toCompareString() { + return "EmployeeDeclarePO{" + + "id=" + id + + ", taxAgentId=" + taxAgentId + + ", taxCycle='" + taxCycle + '\'' + + ", employeeId=" + employeeId + + ", employeeType=" + employeeType + + ", employeeName='" + employeeName + '\'' + + ", jobNum='" + jobNum + '\'' + + ", cardType=" + cardType + + ", cardNum='" + cardNum + '\'' + + ", gender=" + gender + + ", birthday=" + birthday + + ", employmentStatus=" + employmentStatus + + ", mobile='" + mobile + '\'' + + ", employmentType=" + employmentType + + ", employmentFirstYear='" + employmentFirstYear + '\'' + + ", employmentDate=" + employmentDate + + ", dismissDate=" + dismissDate + + ", disability=" + disability + + ", disabilityCardNo='" + disabilityCardNo + '\'' + + ", lonelyOld=" + lonelyOld + + ", martyrDependents=" + martyrDependents + + ", martyrDependentsCardNo='" + martyrDependentsCardNo + '\'' + + ", deductExpenses=" + deductExpenses + + '}'; + } + + private Collection ids; + private Collection employeeIds; +} diff --git a/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java b/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java index c110eba77..8c6155dcd 100644 --- a/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java +++ b/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.salaryaccounting; import com.engine.salary.enums.BaseEnum; +import java.util.Objects; + /** * 人员类型 */ @@ -37,4 +39,13 @@ public enum EmployeeTypeEnum implements BaseEnum { public String getDefaultLabel() { return defaultLabel; } + + public static EmployeeTypeEnum parseByValue(Integer value) { + for (EmployeeTypeEnum typeEnum : EmployeeTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } } diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java new file mode 100644 index 000000000..29be31ae8 --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java @@ -0,0 +1,107 @@ +package com.engine.salary.mapper.employeedeclare; + +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareAddListQueryParam; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * @author Harryxzy + * @ClassName EmployeeDeclareMapper + * @date 2023/08/03 13:26 + * @description + */ +public interface EmployeeDeclareMapper { + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(EmployeeDeclarePO employeeDeclare); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + EmployeeDeclarePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param employeeDeclare 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(EmployeeDeclarePO employeeDeclare); + + /** + * 修改,修改所有字段 + * + * @param employeeDeclare 修改的记录 + * @return 返回影响行数 + */ + int update(EmployeeDeclarePO employeeDeclare); + + /** + * 修改,忽略null字段 + * + * @param employeeDeclare 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(EmployeeDeclarePO employeeDeclare); + + /** + * 删除记录 + * + * @param employeeDeclare 待删除的记录 + * @return 返回影响行数 + */ + int delete(EmployeeDeclarePO employeeDeclare); + + + /** + * 查询报送的人员 + * + * @param queryParam + * @return + */ + List listByParam(@Param("param") EmployeeDeclareListQueryParam queryParam ); + + /** + * 查询本月新增的人员 + * + * @param queryParam + * @return + */ + List list4AddByParam(@Param("param") EmployeeDeclareAddListQueryParam queryParam); + + + + /** + * 查询本月变动的人员 + * + * @param queryParam + * @return + */ + List list4UpdateByParam(@Param("param") EmployeeDeclareListQueryParam queryParam); + + /** + * 根据idList删除 + * @param ids + * @param date 删除时间 + */ + void deleteByIds(@Param("ids") Collection ids, @Param("date") Date date); +} diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml new file mode 100644 index 000000000..4a9d04d67 --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -0,0 +1,687 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t.id + , t.tax_agent_id + , t.tax_cycle + , t.employee_id + , t.employee_type + , t.employee_name + , t.job_num + , t.card_type + , t.card_num + , t.gender + , t.birthday + , t.employment_status + , t.mobile + , t.employment_type + , t.employment_first_year + , t.employment_date + , t.dismiss_date + , t.disability + , t.disability_card_no + , t.lonely_old + , t.martyr_dependents + , t.martyr_dependents_card_no + , t.deduct_expenses + , t.successfully_declared + , t.new_employee_info + , t.declare_status + , t.declare_error_msg + , t.tenant_key + , t.creator + , t.delete_type + , t.create_time + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_employee_declare + + + + id, + + + tax_agent_id, + + + tax_cycle, + + + employee_id, + + + employee_type, + + + employee_name, + + + job_num, + + + card_type, + + + card_num, + + + gender, + + + birthday, + + + employment_status, + + + mobile, + + + employment_type, + + + employment_first_year, + + + employment_date, + + + dismiss_date, + + + disability, + + + disability_card_no, + + + lonely_old, + + + martyr_dependents, + + + martyr_dependents_card_no, + + + deduct_expenses, + + + successfully_declared, + + + new_employee_info, + + + declare_status, + + + declare_error_msg, + + + tenant_key, + + + creator, + + + delete_type, + + + create_time, + + + update_time, + + + + + #{id}, + + + #{taxAgentId}, + + + #{taxCycle}, + + + #{employeeId}, + + + #{employeeType}, + + + #{employeeName}, + + + #{jobNum}, + + + #{cardType}, + + + #{cardNum}, + + + #{gender}, + + + #{birthday}, + + + #{employmentStatus}, + + + #{mobile}, + + + #{employmentType}, + + + #{employmentFirstYear}, + + + #{employmentDate}, + + + #{dismissDate}, + + + #{disability}, + + + #{disabilityCardNo}, + + + #{lonelyOld}, + + + #{martyrDependents}, + + + #{martyrDependentsCardNo}, + + + #{deductExpenses}, + + + #{successfullyDeclared}, + + + #{newEmployeeinfo}, + + + #{declareStatus}, + + + #{declareErrorMsg}, + + + #{tenantKey}, + + + #{creator}, + + + #{deleteType}, + + + #{createTime}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_employee_declare + + tax_agent_id=#{taxAgentId}, + tax_cycle=#{taxCycle}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + employee_name=#{employeeName}, + job_num=#{jobNum}, + card_type=#{cardType}, + card_num=#{cardNum}, + gender=#{gender}, + birthday=#{birthday}, + employment_status=#{employmentStatus}, + mobile=#{mobile}, + employment_type=#{employmentType}, + employment_first_year=#{employmentFirstYear}, + employment_date=#{employmentDate}, + dismiss_date=#{dismissDate}, + disability=#{disability}, + disability_card_no=#{disabilityCardNo}, + lonely_old=#{lonelyOld}, + martyr_dependents=#{martyrDependents}, + martyr_dependents_card_no=#{martyrDependentsCardNo}, + deduct_expenses=#{deductExpenses}, + successfully_declared=#{successfullyDeclared}, + new_employee_info=#{newEmployeeinfo}, + declare_status=#{declareStatus}, + declare_error_msg=#{declareErrorMsg}, + tenant_key=#{tenantKey}, + creator=#{creator}, + delete_type=#{deleteType}, + create_time=#{createTime}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare + + + tax_agent_id=#{taxAgentId}, + + + tax_cycle=#{taxCycle}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + employee_name=#{employeeName}, + + + job_num=#{jobNum}, + + + card_type=#{cardType}, + + + card_num=#{cardNum}, + + + gender=#{gender}, + + + birthday=#{birthday}, + + + employment_status=#{employmentStatus}, + + + mobile=#{mobile}, + + + employment_type=#{employmentType}, + + + employment_first_year=#{employmentFirstYear}, + + + employment_date=#{employmentDate}, + + + dismiss_date=#{dismissDate}, + + + disability=#{disability}, + + + disability_card_no=#{disabilityCardNo}, + + + lonely_old=#{lonelyOld}, + + + martyr_dependents=#{martyrDependents}, + + + martyr_dependents_card_no=#{martyrDependentsCardNo}, + + + deduct_expenses=#{deductExpenses}, + + + successfully_declared=#{successfullyDeclared}, + + + new_employee_info=#{newEmployeeinfo}, + + + declare_status=#{declareStatus}, + + + declare_error_msg=#{declareErrorMsg}, + + + tenant_key=#{tenantKey}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + UPDATE hrsa_employee_declare + SET delete_type=1, + update_time = #{date} + WHERE delete_type = 0 + + AND id IN + + #{id} + + + + + + + + AND (employee_name LIKE CONCAT('%',#{param.keyword},'%') OR job_num LIKE CONCAT('%',#{param.keyword},'%')) + + + + + + AND (employee_name LIKE '%'||#{param.keyword}||'%' OR job_num LIKE '%'||#{param.keyword}||'%') + + + + + + AND (employee_name LIKE '%'||#{param.keyword}||'%' OR job_num LIKE '%'||#{param.keyword}||'%') + + + + + + AND (employee_name LIKE '%'+#{param.keyword}+'%' OR job_num LIKE '%'+#{param.keyword}+'%') + + + + + AND tax_agent_id = #{param.taxAgentId} + AND tax_cycle = #{param.taxCycle} + + AND id IN + + #{id} + + + + AND declare_status = #{param.declareStatus.value} + + + AND employment_status = #{param.employmentStatus.value} + + + AND employment_type = #{param.employmentType.value} + + + AND employment_date >= #{param.fromEmploymentDate} + + + AND #{param.endEmploymentDate} >= employment_date + + + AND dismiss_date >= #{param.fromDismissDate} + + + AND #{param.endDismissDate} >= dismiss_date + + + AND disability = #{param.disability.value} + + + AND lonely_old = #{param.lonelyOld.value} + + + AND martyr_dependents = #{param.martyrDependents.value} + + + AND deduct_expenses = #{param.deductExpenses.value} + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java new file mode 100644 index 000000000..cc5590731 --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -0,0 +1,182 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.util.page.PageInfo; + +import java.time.YearMonth; +import java.util.Collection; +import java.util.List; + +/** + * @description: 人员报送(人员) + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 3:16 PM + * @version:v1.0 + */ +public interface EmployeeDeclareService{ + + /** + * 查询人员报送信息 + * + * @param id + * @return + */ + EmployeeDeclarePO getById(Long id); + + /** + * 查询人员报送信息 + * + * @param ids + * @return + */ + List listByIds(Collection ids); + + /** + * 查询人员报送信息 + * + * @param taxCycle + * @param taxAgentId + * @return + */ + List listByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId); + + /** + * 查询人员报送信息 + * + * @param taxCycle + * @param taxAgentId + * @param employeeIds + * @return + */ + List listByTaxCycleAndTaxAgentIdAndEmployeeIds(YearMonth taxCycle, Long taxAgentId, + Collection employeeIds); + + /** + * 查询人员报送信息 + * + * @param queryParam + * @return + */ + List listByParam(EmployeeDeclareListQueryParam queryParam); + + + /** + * 查询人员报送-本月新增 + * * + * + * @param queryParam + * @return + */ + List list4AddByParam(EmployeeDeclareAddListQueryParam queryParam); + + /** + * 本月变动 + * + * @param queryParam + * @return + */ + List list4UpdateByParam(EmployeeDeclareListQueryParam queryParam); + + /** + * 本月信息变动 + * + * @param queryParam + * @return + */ + PageInfo listPage4UpdateByParam(EmployeeDeclareListQueryParam queryParam); + + /** + * 本月报送失败 + * + * @param param + * @param tenantKey + * @return + */ +// List list4FailByParam(EmployeeDeclareFailListQueryParam param); + + /** + * 本月报送失败 + * + * @param param + * @return + */ + PageInfo listPage4FailByParam(EmployeeDeclareFailListQueryParam param); + + /** + * 保存 + * + * @param saveParam + * @param employeeId + * @param tenantKey + */ +// void save(EmployeeDeclareSaveParam saveParam, Long employeeId); + + /** + * 批量编辑 + * + * @param batchUpdateParam + * @param employeeId + * @param tenantKey + */ +// void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId); + + /** + * 删除 + * + * @param ids + */ + void deleteByIds(Collection ids); + + /** + * 人员报送(人员)列表 + * + * @param employeeDeclares + * @return + */ + List convert(List employeeDeclares); + + /** + * 人员报送-失败列表 + * + * @param employeeDeclares + * @return + */ + List convert2FailListDTO(List employeeDeclares); + + /** + * 刷新数据 + * + * @param refreshParam + * @param employeeId + */ + void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId); + + /** + * 获取人员报送的整体情况 + * + * @param employeeDeclareParam + * @return + */ + EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam); + + /** + * 报送人员 + * + * @param param + * @param tenantKey + */ +// void declare(EmployeeDeclareParam param, Long employeeId); + + /** + * 获取报送人员的反馈 + * + * @param param + * @param tenantKey + */ +// void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId); +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java new file mode 100644 index 000000000..0b0f6ca78 --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -0,0 +1,675 @@ +package com.engine.salary.service.impl; + + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.SalaryCycleTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; +import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.SalaryArchiveService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.transaction.annotation.Transactional; +import weaver.hrm.User; + +import java.time.YearMonth; +import java.time.temporal.ChronoUnit; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @description: 人员报送(人员) + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 3:17 PM + * @version:v1.0 + */ +@Slf4j +public class EmployeeDeclareServiceImpl extends Service implements EmployeeDeclareService { + + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + + @Override + public EmployeeDeclarePO getById(Long id) { + return getEmployeeDeclareMapper().getById(id); + } + + @Override + public List listByIds(Collection ids) { + if (CollectionUtils.isEmpty(ids)){ + return Collections.emptyList(); + } + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(ids).build()); + } + + @Override + public List listByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) { + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() + .taxCycle(taxCycle.toString()) + .taxAgentId(taxAgentId) + .build()); + } + + @Override + public List listByTaxCycleAndTaxAgentIdAndEmployeeIds(YearMonth taxCycle, Long taxAgentId, Collection employeeIds) { + if (CollectionUtils.isEmpty(employeeIds)) { + return Collections.emptyList(); + } + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() + .taxCycle(taxCycle.toString()) + .taxAgentId(taxAgentId) + .employeeIds(employeeIds) + .build()); + } + + @Override + public List listByParam(EmployeeDeclareListQueryParam queryParam) { + return getEmployeeDeclareMapper().listByParam(queryParam); + } + + + @Override + public List list4AddByParam(EmployeeDeclareAddListQueryParam queryParam) { + queryParam.setPreTaxCycle(queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS).toString()); + return getEmployeeDeclareMapper().list4AddByParam(queryParam); + } + + @Override + public List list4UpdateByParam(EmployeeDeclareListQueryParam queryParam) { + return getEmployeeDeclareMapper().list4UpdateByParam(queryParam); + } + + @Override + public PageInfo listPage4UpdateByParam(EmployeeDeclareListQueryParam queryParam) { + List list = getEmployeeDeclareMapper().list4UpdateByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, EmployeeDeclarePO.class); + } + +// @Override +// public List list4FailByParam(EmployeeDeclareFailListQueryParam queryParam) { +// return new LambdaQueryChainWrapper<>(employeeDeclareMapper) +// .eq(EmployeeDeclarePO::getTenantKey, tenantKey) +// .eq(EmployeeDeclarePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(EmployeeDeclarePO::getTaxAgentId, queryParam.getTaxAgentId()) +// .eq(EmployeeDeclarePO::getTaxCycle, queryParam.getTaxCycle().toString()) +// .eq(EmployeeDeclarePO::getDeclareStatus, DeclareStatusEnum.DECLARE_FAIL.getValue()) +// .list(); +// } + + @Override + public PageInfo listPage4FailByParam(EmployeeDeclareFailListQueryParam queryParam) { + ValidUtil.doValidator(queryParam); + List list = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() + .taxAgentId(queryParam.getTaxAgentId()) + .taxCycle(queryParam.getTaxCycle().toString()) + .declareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()) + .build()); + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + list, EmployeeDeclarePO.class); + return page; + } + +// @Override +// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId) { +// LocalDateTime now = LocalDateTime.now(); +// EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() +// .setTaxAgentId(saveParam.getTaxAgentId()) +// .setTaxCycle(saveParam.getTaxCycle().toString()) +// .setEmployeeName(saveParam.getEmployeeName()) +// .setJobNum(saveParam.getJobNum()) +// .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) +// .setCardNum(saveParam.getCardNum()) +// .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()) +// .setBirthday(SalaryCardUtil.judgeBirthday(saveParam.getCardNum())) +// .setEmploymentStatus(saveParam.getEmploymentStatus().getValue()) +// .setMobile(saveParam.getMobile()) +// .setEmploymentType(saveParam.getEmploymentType().getValue()) +// .setEmploymentFirstYear("") +// .setEmploymentDate(saveParam.getEmploymentDate()) +// .setDismissDate(saveParam.getDismissDate()) +// .setDisability(saveParam.getDisability().getValue()) +// .setDisabilityCardNo(saveParam.getDisabilityCardNo()) +// .setLonelyOld(saveParam.getLonelyOld().getValue()) +// .setMartyrDependents(saveParam.getMartyrDependents().getValue()) +// .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo()) +// .setDeductExpenses(saveParam.getDeductExpenses().getValue()) +// .setSuccessfullyDeclared(0) +// .setNewEmployeeInfo(0) +// .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) +// .setDeclareErrorMsg(""); +// if (Objects.isNull(saveParam.getId())) { +// employeeDeclare.setId(IdGenerator.generate()) +// .setEmployeeId(saveParam.getEmployeeId()) +// .setEmployeeType(saveParam.getEmployeeType().getValue()) +// .setTenantKey(tenantKey) +// .setCreator(employeeId) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// save(employeeDeclare); +// // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); +// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); +// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName()); +// loggerContext.setNewValues(employeeDeclare); +// employeeDeclareLoggerTemplate.write(loggerContext); +// } else { +// EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId(), tenantKey); +// if (Objects.isNull(originEmployeeDeclare)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除")); +// } +// if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1) +// && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName()) +// && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅")); +// } +// employeeDeclare.setId(originEmployeeDeclare.getId()) +// .setEmployeeId(originEmployeeDeclare.getEmployeeId()) +// .setEmployeeType(originEmployeeDeclare.getEmployeeType()) +// .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()) +// .setUpdateTime(now); +// // 判断本次编辑是否有修改人员信息 +// if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { +// employeeDeclare.setNewEmployeeInfo(1); +// } +// updateById(employeeDeclare); +// // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); +// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员:") + employeeDeclare.getEmployeeName()); +// loggerContext.setOldValues(originEmployeeDeclare); +// loggerContext.setNewValues(employeeDeclare); +// employeeDeclareLoggerTemplate.write(loggerContext); +// } +// } +// +// @Override +// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId) { +// // 查询报送人员 +// List employeeDeclares; +// if (CollectionUtils.isNotEmpty(batchUpdateParam.getIds())) { +// employeeDeclares = listByIds(batchUpdateParam.getIds(), tenantKey); +// } else { +// employeeDeclares = listByParam(batchUpdateParam, tenantKey); +// } +// // 人员为空时,不允许批量编辑 +// if (CollectionUtils.isEmpty(employeeDeclares)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182693, "当前人员列表为空,请选择要批量编辑的人员")); +// } +// LocalDateTime now = LocalDateTime.now(); +// // 校验参数 +// if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentStatus")) { +// EmploymentStatusEnum employmentStatusEnum = null; +// for (EmploymentStatusEnum value : EmploymentStatusEnum.values()) { +// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { +// employmentStatusEnum = value; +// } +// } +// if (employmentStatusEnum == null) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); +// } +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// if (!Objects.equals(employeeDeclare.getEmploymentStatus(), employmentStatusEnum.getValue())) { +// employeeDeclare.setEmploymentStatus(employmentStatusEnum.getValue()); +// employeeDeclare.setNewEmployeeInfo(1); +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setDeclareErrorMsg(""); +// employeeDeclare.setUpdateTime(now); +// } +// } +// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentType")) { +// EmploymentTypeEnum employmentTypeEnum = null; +// for (EmploymentTypeEnum value : EmploymentTypeEnum.values()) { +// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { +// employmentTypeEnum = value; +// } +// } +// if (employmentTypeEnum == null) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); +// } +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// if (!Objects.equals(employeeDeclare.getEmploymentType(), employmentTypeEnum.getValue())) { +// employeeDeclare.setEmploymentType(employmentTypeEnum.getValue()); +// employeeDeclare.setNewEmployeeInfo(1); +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setDeclareErrorMsg(""); +// employeeDeclare.setUpdateTime(now); +// } +// } +// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentDate")) { +// if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); +// } +// LocalDate employmentDate = LocalDate.parse(batchUpdateParam.getItemValue()); +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// if (!Objects.equals(employeeDeclare.getEmploymentDate(), employmentDate)) { +// employeeDeclare.setEmploymentDate(employmentDate); +// employeeDeclare.setNewEmployeeInfo(1); +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setDeclareErrorMsg(""); +// employeeDeclare.setUpdateTime(now); +// } +// } +// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "dismissDate")) { +// if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); +// } +// LocalDate dismissDate = LocalDate.parse(batchUpdateParam.getItemValue()); +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// if (!Objects.equals(employeeDeclare.getDismissDate(), dismissDate)) { +// employeeDeclare.setDismissDate(dismissDate); +// employeeDeclare.setNewEmployeeInfo(1); +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setDeclareErrorMsg(""); +// employeeDeclare.setUpdateTime(now); +// } +// } +// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "deductExpenses")) { +// SalaryOnOffEnum salaryOnOffEnum = null; +// for (SalaryOnOffEnum value : SalaryOnOffEnum.values()) { +// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { +// salaryOnOffEnum = value; +// } +// } +// if (salaryOnOffEnum == null) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); +// } +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// if (!Objects.equals(employeeDeclare.getDeductExpenses(), salaryOnOffEnum.getValue())) { +// employeeDeclare.setDeductExpenses(salaryOnOffEnum.getValue()); +// employeeDeclare.setNewEmployeeInfo(1); +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setDeclareErrorMsg(""); +// employeeDeclare.setUpdateTime(now); +// } +// } +// } +// updateBatchById(employeeDeclares); +// } + + @Override + public void deleteByIds(Collection ids) { + List employeeDeclares = listByIds(ids); + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156466, "参数错误,人员不存在或已被删除")); + } + boolean declareSuccess = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getSuccessfullyDeclared(), 1)); + if (declareSuccess) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156467, "报送成功过的人员不允许删除")); + } + getEmployeeDeclareMapper().deleteByIds(ids, new Date()); + // 记录日志 +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); +// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); +// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员:") + employeeDeclare.getEmployeeName()); +// loggerContext.setNewValues(employeeDeclare); +// employeeDeclareLoggerTemplate.write(loggerContext); +// } + } + + @Override + public List convert(List employeeDeclares) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + + // 查询个税扣缴义务人 + Set taxAgentIds = SalaryEntityUtil.properties(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); + List dtoList = EmployeeDeclareList.convert(employeeDeclares, taxAgents); + // 人员id集合 + List employeeIds = employeeDeclares.stream().map(EmployeeDeclarePO::getEmployeeId).distinct().collect(Collectors.toList()); + // 获取人员部门、分部详细信息 + Map employeeInfoMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds), emp -> emp.getEmployeeId() + "-" + emp.isExtEmp()); + // 补充分部,部门 + dtoList.forEach(po -> { + boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(po.getEmployeeType().getValue()) == 0; + DataCollectionEmployee employee = employeeInfoMap.get(po.getEmployeeId() + "-" + isExtEmp); + if(ObjectUtils.isNotEmpty(employee)){ + po.setSubCompanyName(Optional.ofNullable(employee.getSubcompanyName()).orElse("")); + po.setDepartmentName(Optional.ofNullable(employee.getDepartmentName()).orElse("")); + } + }); + return dtoList; + } + + @Override + public List convert2FailListDTO(List employeeDeclares) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + // 查询人员信息 + List employeeIds = SalaryEntityUtil.properties(employeeDeclares, EmployeeDeclarePO::getEmployeeId, Collectors.toList()); + Map employeeInfoMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds), emp -> emp.getEmployeeId() + "-" + emp.isExtEmp()); + return EmployeeDeclareList.convert2FailListDTO(employeeDeclares, employeeInfoMap); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId) { + // 查询本月已有的需要报送的人员 + List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); + // 查询上月已有的需要报送的人员(只需要正常的) + List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1,ChronoUnit.MONTHS), refreshParam.getTaxAgentId()) + .stream() + .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) + && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) + .collect(Collectors.toList()); + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId()); + // 根据税款所属期计算出薪资周期 + YearMonth salaryCycle; + YearMonth taxCycle = refreshParam.getTaxCycle(); + // TODO:先临时写死本月!!!!需先完成个税扣缴义务人的改造 +// SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryEnumUtil.enumMatchByValue(taxAgent.getTaxCycleType(), SalaryCycleTypeEnum.class); + SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryCycleTypeEnum.THIS_MONTH; + if (salaryCycleTypeEnum == SalaryCycleTypeEnum.BEFORE_LAST_MONTH) { + salaryCycle = taxCycle.plus(2, ChronoUnit.MONTHS); + } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.LAST_MONTH) { + salaryCycle = taxCycle.plus(1, ChronoUnit.MONTHS); + } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.THIS_MONTH) { + salaryCycle = taxCycle; + } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.NEXT_MONTH) { + salaryCycle = taxCycle.plus(-1, ChronoUnit.MONTHS); + } else { + salaryCycle = taxCycle; + } + // 查询薪资档案的发薪人员 + LocalDateRange salaryCycleRange = LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryCycle.atDay(1))).endDate(SalaryDateUtil.localDateToDate(salaryCycle.atEndOfMonth())).build(); + List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salaryCycleRange, Collections.emptyList(), refreshParam.getTaxAgentId()); + List employeeIds = salaryArchiveDataDTOS.stream().map(SalaryArchiveDataDTO::getEmployeeId).collect(Collectors.toList()); + List salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build()); + + // 本月增加了哪些人员 + Set orgEmployeeIds = ((List)CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares)) + .stream() + .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(EmployeeDeclarePO::getEmployeeId) + .collect(Collectors.toSet()); + Set newOrgEmployeeIds = salaryArchiveDataDTOS.stream() + .map(SalaryArchiveDataDTO::getEmployeeId) + .filter(e -> !orgEmployeeIds.contains(e)) + .collect(Collectors.toSet()); + // 查询新增加的人员信息 + List employeeInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(newOrgEmployeeIds)); +// List newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey); +// List newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds)); + // 查询本月增加了哪些非系统人员 +// List extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId(), tenantKey); +// Set extEmployeeIds = employeeDeclares.stream() +// .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) +// .map(EmployeeDeclarePO::getEmployeeId) +// .collect(Collectors.toSet()); +// List newExtEmployees = extEmployees.stream() +// .filter(e -> !extEmployeeIds.contains(e.getId())) +// .collect(Collectors.toList()); + + // 本次新增的需要报送的人员 + EmployeeDeclareRefreshDTO dto = new EmployeeDeclareRefreshDTO() + .setTaxAgentId(taxAgent.getId()) + .setTaxCycle(taxCycle) + .setEmployeeDeclares(employeeDeclares) + .setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares) + .setSalaryArchives(salaryArchivePOS) + .setEmployeeInfos(employeeInfos); +// .setHrmEmployeeComInfos(newHrmEmployeeComInfos) +// .setSimpleUserInfos(newSimpleUserInfos) +// .setExtEmployees(newExtEmployees) + EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId); +// // 保存新增的人员 +// if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) { +// saveBatch(result.getNewEmployeeDeclares()); +// } +// // 更新已有人员 +// if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) { +// updateBatchById(result.getEmployeeDeclares()); +// } +// // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); +// employeeDeclareLoggerTemplate.write(loggerContext); + } + + @Override + public EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam) { + // 查询本月已有的需要报送的人员 + List employeeDeclares = listByTaxCycleAndTaxAgentId(employeeDeclareParam.getTaxCycle(), employeeDeclareParam.getTaxAgentId()); + // 本月是否有修改过人员信息 + boolean updateEmployeeInfo = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getNewEmployeeInfo(), 1) && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.NOT_DECLARE.getValue())); + // 本月报送失败的人数 + Integer declareFailSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())).count(); + // 本月未报送的人数 + Integer notDeclareSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.NOT_DECLARE.getValue())).count(); + // 本月报送成功的人数 + Integer declareSuccessSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())).count(); + return new EmployeeDeclareInfoDTO() + .setShowUpdate(updateEmployeeInfo) + .setDeclareFailSize(declareFailSize) + .setNotDeclareSize(notDeclareSize) + .setDeclareSuccessSize(declareSuccessSize); + } + +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void declare(EmployeeDeclareParam param, Long employeeId) { +// // 获取api配置信息 +// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); +// // 查询个税扣缴义务人 +// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey); +// // 查询个税扣缴义务人关联的企业信息 +// TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(param.getTaxAgentId(), tenantKey); +// if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); +// } +// // 查询需要报送的人员 +// List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); +// if (CollectionUtils.isEmpty(employeeDeclares)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156470, "当前报送人员列表暂无数据")); +// } +// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); +// if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156471, "报送中,稍后请点击【获取报送结果】更新报送状态")); +// } +// // 人员列表 +// List> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); +// // 企业信息 +// Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); +// // 税款所属期 +// requestParam.put("skssq", param.getTaxCycle().toString().replace("-", "")); +// // 人员列表 +// requestParam.put("rylb", employeeInfoMapList); +// +// String reqJson = JsonUtil.toJsonString(requestParam); +// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO; +// Map params = new HashMap<>(1); +// Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); +// String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); +// DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class); +// if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) { +// log.error("服务异常:" + res); +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); +// } +// if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { +// throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg()); +// } +// // 删除原来的人员报送记录 +// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); +// // 保存新的人员报送记录 +// LocalDateTime now = LocalDateTime.now(); +// AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody(); +// employeeDeclareRecord = new EmployeeDeclareRecordPO() +// .setId(IdGenerator.generate()) +// .setTaxAgentId(param.getTaxAgentId()) +// .setTaxCycle(param.getTaxCycle().toString()) +// .setRequestId(asyncRequestIdDTO.getRequestId()) +// .setTenantKey(tenantKey) +// .setCreator(employeeId) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// employeeDeclareRecordService.save(employeeDeclareRecord); +// // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送")); +// employeeDeclareLoggerTemplate.write(loggerContext); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId) { +// // 获取api配置信息 +// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); +// // 查询个税扣缴义务人 +// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey); +// // 查询人员报送记录 +// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); +// if (Objects.isNull(employeeDeclareRecord)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果")); +// } +// if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果")); +// } +// +// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK; +// Map requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); +// Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); +// String res = HttpUtil.getRequest(url, header, requestParam); +// DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class); +// if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) { +// log.error("服务异常:" + res); +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156449, "服务异常")); +// } +// if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { +// throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg()); +// } +// DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody(); +// Map> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "") +// + "-" + e.getOrDefault("zzlx", "") +// + "-" + e.getOrDefault("zzhm", "")); +// // 流量使用情况 +// TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = +// new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(tenantKey +// , employeeId, param.getTaxCycle().atDay(1) +// , apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); +// // 查询申报的人员列表 +// LocalDateTime now = LocalDateTime.now(); +// List needUpdateEmployeeDeclares = Lists.newArrayList(); +// List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); +// String key = employeeDeclare.getEmployeeName() +// + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel()) +// + "-" + employeeDeclare.getCardNum(); +// Map employeeInfoMap = employeeFeedbackMap.get(key); +// if (MapUtil.isEmpty(employeeInfoMap)) { +// continue; +// } +// // 报送状态 +// employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue())); +// // 失败原因 +// employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy"))); +// // 验证状态、银行卡验证状态 +// // 是否报送成功了 +// if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) { +// employeeDeclare.setSuccessfullyDeclared(1); +// } +// employeeDeclare.setUpdateTime(now); +// needUpdateEmployeeDeclares.add(employeeDeclare); +// +// // 流量使用记录 +// TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId()); +// flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue()); +// apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); +// } +// // 更新员工的报送状态 +// if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { +// updateBatchById(needUpdateEmployeeDeclares); +// } +// // 删除原来的人员报送记录 +// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); +// // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈")); +// employeeDeclareLoggerTemplate.write(loggerContext); +// // 更新流量统计 +// taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper); +// // 报送失败的 +// int declareFailSize = (int) needUpdateEmployeeDeclares.stream() +// .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())) +// .count(); +// employeeDeclareRate.setFinish(true); +// if (declareFailSize > 0) { +// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156472, "报送成功{0}条,报送失败{1}条") +// .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize)) +// .replace("{1}", Util.null2String(declareFailSize))); +// } else { +// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size()))); +// } +// } +} diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index d4cbdb8bf..fb2567f0c 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -72,13 +72,13 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee public List listAll(UseEmployeeTypeEnum empType) { List result = new ArrayList<>(); if (empType == UseEmployeeTypeEnum.ORG) { - result = employBiz.listEmployee(); + result = employBiz.listAll(); } if (empType == UseEmployeeTypeEnum.EXT) { result = getExtEmpService(user).listEmployee(); } if (empType == UseEmployeeTypeEnum.ALL) { - result.addAll(employBiz.listEmployee()); + result.addAll(employBiz.listAll()); result.addAll(getExtEmpService(user).listEmployee()); } return result; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index c7a0c9098..da8de675c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -2,34 +2,23 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationApiBillingService; import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.google.common.collect.Lists; -import com.weaver.common.batch.context.BatchExportContext; -import com.weaver.common.batch.entity.BatchCallbackMessage; -import com.weaver.common.batch.handler.BatchExportHandler; -import com.weaver.common.cache.tablecache.impl.ComInfoCache; -import com.weaver.common.component.table.page.Page; -import com.weaver.common.hrm.cache.HrmEmployeeComInfo; -import com.weaver.hrm.salary.common.SalaryPage; -import com.weaver.hrm.salary.common.excel.ExportWrapper; -import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; -import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO; -import com.weaver.hrm.salary.entity.taxapiflow.dto.*; -import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; -import com.weaver.hrm.salary.service.*; -import com.weaver.hrm.salary.util.*; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/src/com/engine/salary/util/SalaryEnumUtil.java b/src/com/engine/salary/util/SalaryEnumUtil.java index 0294bd14c..f9ffcbc08 100644 --- a/src/com/engine/salary/util/SalaryEnumUtil.java +++ b/src/com/engine/salary/util/SalaryEnumUtil.java @@ -35,6 +35,25 @@ public class SalaryEnumUtil { return (T) Arrays.stream(list).filter(item -> Objects.equals(item.getValue(), value)).findFirst().get(); } + /** + * 根据枚举的value获取枚举对象 + * + * @param value + * @param clazz + * @param + * @param + * @return + */ + public static , R> T enumMatchByValue(R value, Class clazz) { + T[] enumConstants = clazz.getEnumConstants(); + for (T enumConstant : enumConstants) { + if (Objects.equals(enumConstant.getValue(), value)) { + return enumConstant; + } + } + return null; + } + /** * 枚举数组转字符串 * diff --git a/src/com/engine/salary/util/valid/SalaryCardUtil.java b/src/com/engine/salary/util/valid/SalaryCardUtil.java new file mode 100644 index 000000000..e61e4d2af --- /dev/null +++ b/src/com/engine/salary/util/valid/SalaryCardUtil.java @@ -0,0 +1,109 @@ +package com.engine.salary.util.valid; + +import com.engine.salary.enums.employeedeclare.GenderEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.SalaryI18nUtil; + +import java.time.LocalDate; +import java.util.regex.Pattern; + +/** + * @description: 身份证 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/10/28 10:10 AM + * @version:v1.0 + */ +public class SalaryCardUtil { + + /** + * 15位的身份证长度 + */ + public static final String CARD_15 = "^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}$"; + /** + * 18位的身份证长度 + */ + public static final String CARD_18 = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$"; + /** + * 手机号码 + */ + public static final String MOBILE = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$"; + + /** + * 校验身份证号码 + * + * @param idNumber + */ + public static boolean checkIdNum(String idNumber) { + Pattern pattern_15 = Pattern.compile(CARD_15); + Pattern pattern_18 = Pattern.compile(CARD_18); + if (!pattern_15.matcher(idNumber).find() && !pattern_18.matcher(idNumber).find()) { + return false; + } + return true; + } + + /** + * 校验手机号码 + * + * @param mobile + * @return + */ + public static boolean checkMobile(String mobile) { + Pattern pattern_mobile = Pattern.compile(MOBILE); + if (!pattern_mobile.matcher(mobile).find()) { + return false; + } + return true; + } + + /** + * 根据身份证号判断性别 + * + * @param idNumber + * @return + */ + public static GenderEnum judgeGender(String idNumber) throws IllegalArgumentException { + if (!checkIdNum(idNumber)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); + } + char sexIndex; + if (idNumber.length() == 18) { + //如果身份证号18位,取身份证号倒数第二位 + sexIndex = idNumber.charAt(idNumber.length() - 2); + } else { + //如果身份证号15位,取身份证号最后一位 + sexIndex = idNumber.charAt(idNumber.length() - 1); + } + int gender = Integer.parseInt(String.valueOf(sexIndex)); + if (gender % 2 == 1) { + return GenderEnum.MALE; + } else { + return GenderEnum.FEMALE; + } + } + + /** + * 根据身份证的号码算出当前身份证持有者的生日 + * + * @return + */ + public static LocalDate judgeBirthday(String idNumber) throws IllegalArgumentException { + if (!checkIdNum(idNumber)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); + } + String year; + String month; + String day; + if (idNumber.length() == 18) { + year = idNumber.substring(6).substring(0, 4);// 得到年份 + month = idNumber.substring(10).substring(0, 2);// 得到月份 + day = idNumber.substring(12).substring(0, 2);//得到日 + } else { + year = "19" + idNumber.substring(6, 8);// 年份 + month = idNumber.substring(8, 10);// 月份 + day = idNumber.substring(10, 12);//日 + } + return LocalDate.parse(year + "-" + month + "-" + day); + } +} diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java new file mode 100644 index 000000000..6fac3b188 --- /dev/null +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -0,0 +1,334 @@ +package com.engine.salary.web; + + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; +import com.engine.salary.entity.employeedeclare.dto.TaxAgentDeclareListDTO; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.EmployeeDeclareWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import oracle.jdbc.proxy.annotation.Post; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Collection; +import java.util.Map; + +/** + * @description: 人员报送 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 3:37 PM + * @version:v1.0 + */ +public class EmployeeDeclareController { + + private EmployeeDeclareWrapper getEmployeeDeclareWrapper(User user) { + return ServiceUtil.getService(EmployeeDeclareWrapper.class, user); + } + +// private SalaryBatchService salaryBatchService; + + /** + * 人员报送-个税扣缴义务人列表 + * + * @param param 查询条件 + * @return + */ + @POST + @Path("/taxAgentDeclareList") + @Produces(MediaType.APPLICATION_JSON) + public String taxAgentDeclareList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentDeclareListQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::taxAgentDeclareList, param); + } + + /** + * 人员报送-全部人员列表 + * + * @param queryParam 查询条件 + * @return + */ + @POST + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list, queryParam); + } + + /** + * 人员报送-本月新增人员列表 + * + * @param queryParam 查询条件 + * @return + */ + @Post + @Path("/list4Add") + @Produces(MediaType.APPLICATION_JSON) + public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Add, queryParam); + } + + /** + * 人员报送-本月信息变动列表 + * + * @param queryParam 查询条件 + * @return + */ + @Post + @Path("/list4Update") + @Produces(MediaType.APPLICATION_JSON) + public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Update, queryParam); + } + + /** + * 人员报送-本月报送失败人员列表 + * + * @param queryParam 查询条件 + * @return + */ + @POST + @Path("/list4Fail") + @Produces(MediaType.APPLICATION_JSON) + public String list4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareFailListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Fail, queryParam); + } + + /** + * 人员报送-获取新建或编辑的表单 + * + * @param id 报送人员列表的主键id + * @return + */ + @GET + @Path("/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::getForm, id); + } + +// @GetMapping("/getBatchUpdateForm") +// @ApiOperation("人员报送-获取批量编辑的表单") +// @WeaPermission +// public WeaResult getBatchUpdateForm() { +// WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm(); +// return WeaResult.success(weaForm); +// } +// +// @GetMapping("/getSearchCondition") +// @ApiOperation("人员报送-获取高级搜索条件") +// @WeaPermission +// public WeaResult getSearchCondition() { +// WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition(); +// return WeaResult.success(searchCondition); +// } +// +// /** +// * 人员报送-新增人员/编辑人员保存 +// * +// * @param saveParam 保存参数 +// * @return +// */ +// @PostMapping("/save") +// @ApiOperation("人员报送-新增人员/编辑人员保存") +// @WeaPermission +// public WeaResult save(@RequestBody @Validated EmployeeDeclareSaveParam saveParam) { +// employeeDeclareWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// /** +// * 人员报送-批量编辑 +// * +// * @param batchUpdateParam 批量编辑参数 +// * @return +// */ +// @PostMapping("/batchUpdate") +// @ApiOperation("人员报送-批量编辑") +// @WeaPermission +// public WeaResult batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) { +// employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } + + /** + * 人员报送-删除 + * + * @param ids 待删除的主键id + * @return + */ + @POST + @Path("/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getEmployeeDeclareWrapper(user)::deleteByIds, ids); + } + + /** + * 人员报送-刷新数据 + * + * @param refreshParam 刷新数据的参数 + * @return + */ + @Post + @Path("/refresh") + @Produces(MediaType.APPLICATION_JSON) + public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::refresh, refreshParam); + } + + /** + * 人员报送-获取整体的报送情况 + * + * @param employeeDeclareParam 获取整体的报送情况的参数 + * @return + */ + @POST + @Path("/getDeclareInfo") + @Produces(MediaType.APPLICATION_JSON) + public String getDeclareInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam); + } + +// /** +// * 人员报送-全部报送 +// * +// * @param employeeDeclareParam 在线报送 +// * @return +// */ +// @PostMapping("/declare") +// @ApiOperation("人员报送-全部报送") +// @WeaPermission +// public WeaResult declare(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) { +// String rateIndex = employeeDeclareWrapper.declare(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(rateIndex); +// } +// +// /** +// * 人员报送-获取报送结果反馈 +// * +// * @param employeeDeclareParam 获取反馈 +// * @return +// */ +// @PostMapping("/getDeclareFeedback") +// @ApiOperation("人员报送-获取报送结果反馈") +// @WeaPermission +// public WeaResult getDeclareFeedback(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) { +// String rateIndex = employeeDeclareWrapper.getDeclareFeedback(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(rateIndex); +// } +// +// /** +// * 人员报送-后端业务逻辑是否已经完成 +// * +// * @param index 进度索引 +// * @return +// */ +// @GetMapping("/getRate") +// @ApiOperation("人员报送-后端业务逻辑是否已经完成") +// @WeaPermission +// public WeaResult getRate(@RequestParam(value = "index") String index) { +// EmployeeDeclareRateDTO rate = employeeDeclareWrapper.getRate(index, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(rate); +// } +// +// /** +// * 人员报送-导出全部人员 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @PostMapping("/export") +// @ApiOperation("人员报送-导出全部人员") +// @WeaPermission +// public WeaResult export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// /** +// * 人员报送-导出本月新增人员 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @PostMapping("/export4Add") +// @ApiOperation("人员报送-导出本月新增人员") +// @WeaPermission +// public WeaResult export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// /** +// * 人员报送-导出本月信息变动人员 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @PostMapping("/export4Update") +// @ApiOperation("人员报送-导出本月信息变动人员") +// @WeaPermission +// public WeaResult export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// /** +// * 人员报送-导出本月报送失败的人员 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @PostMapping("/export4Fail") +// @ApiOperation("人员报送-导出本月报送失败的人员") +// @WeaPermission +// public WeaResult export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// @GetMapping("/getImportParam") +// @ApiOperation("人员报送-获取导入参数") +// @WeaPermission +// public WeaResult getAcctResultImportParams() { +// String tenantKey = TenantContext.getCurrentTenantKey(); +// Long currentEmployeeId = UserContext.getCurrentEmployeeId(); +// return WeaResult.success(salaryBatchService.buildImportParam("importEmployeeDeclare", +// "importEmployeeDeclare", +// SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 158769, "人员信息报送"), +// null, +// null)); +// } +// +// /** +// * 人员报送-导出导入模板 +// * +// * @param importParam 获取导入模板 +// * @return +// */ +// @PostMapping("/exportTemplate") +// @ApiOperation("人员报送-导出导入模板") +// @WeaPermission +// public WeaResult exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) { +// Map exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +} diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java new file mode 100644 index 000000000..608ba0892 --- /dev/null +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -0,0 +1,648 @@ +package com.engine.salary.wrapper; + +import com.cloudstore.dev.api.util.Util_DataCache; +import com.cloudstore.eccom.result.WeaResultMsg; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; +import com.engine.salary.entity.employeedeclare.dto.*; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.impl.EmployeeDeclareServiceImpl; +import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; +import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.Column; +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.weaver.util.threadPool.ThreadPoolUtil; +import com.weaver.util.threadPool.constant.ModulePoolEnum; +import com.weaver.util.threadPool.entity.LocalRunnable; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; + +import java.time.temporal.ChronoUnit; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @description: 人员报送(人员) + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/2/22 3:49 PM + * @version:v1.0 + */ +@Slf4j +public class EmployeeDeclareWrapper extends Service { + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + + /** + * 人员报送的个税扣缴义务人列表 + * + * @param queryParam + * @return + */ + public PageInfo taxAgentDeclareList(TaxAgentDeclareListQueryParam queryParam) { + // 判断是否是“总管理员” + Boolean isChief = getTaxAgentService(user).isChief(Long.valueOf(user.getUID())); + // 是否开启分权 + Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); + // 查询个税扣缴义务人 + List taxAgents = Lists.newArrayList(); + if (!openDevolution || isChief) { + taxAgents = getTaxAgentService(user).listAll(); + } else { + taxAgents = new ArrayList<>(getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID()))); + } + if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { + taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList()); + } + // 分页 + List taxAgentPOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), taxAgents); + List dtoList = Lists.newArrayList(); + for (TaxAgentPO taxAgent : taxAgentPOS) { + TaxAgentDeclareListDTO dto = new TaxAgentDeclareListDTO().setId(taxAgent.getId()).setTaxAgentName(taxAgent.getName()); + dtoList.add(dto); + } + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, TaxAgentDeclareListDTO.class); + } + + + /** + * 人员报送-全部人员列表 + * + * @param queryParam + * @return + */ + public Map list(EmployeeDeclareListQueryParam queryParam) { + ValidUtil.doValidator(queryParam); + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam(queryParam); + employeeDeclarePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), employeeDeclarePOS); + List convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS); + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); + pageInfo.setList(convert); + pageInfo.setTotal(employeeDeclarePOS.size()); + +// // 判断是否开启分部 +// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); +// if (!subcompanySupport) { +// weaTable.getColumns().stream() +// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) +// .findAny() +// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); +// } + SalaryWeaTable table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + Map datas = new HashMap<>(); + datas.put("pageInfo", pageInfo); + datas.put("dataKey", result.getResultMap()); + return datas; + } + + /** + * 人员报送-本月新增人员列表 + * + * @param queryParam + * @return + */ + public Map list4Add(EmployeeDeclareAddListQueryParam queryParam) { + List addPOList = getEmployeeDeclareService(user).list4AddByParam(queryParam); + PageInfo addPoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), addPOList, EmployeeDeclarePO.class); + List addDTOList = getEmployeeDeclareService(user).convert(addPoPageInfo.getList()); + // 分页 + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); + pageInfo.setList(addDTOList); + pageInfo.setTotal(addPOList.size()); + +// // 判断是否开启分部 +// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); +// if (!subcompanySupport) { +// weaTable.getColumns().stream() +// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) +// .findAny() +// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); +// } + + SalaryWeaTable table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + Map datas = new HashMap<>(); + datas.put("pageInfo", pageInfo); + datas.put("dataKey", result.getResultMap()); + return datas; + } + + /** + * 人员报送-本月信息变动人员列表 + * + * @param queryParam + * @return + */ + public Map list4Update(EmployeeDeclareListQueryParam queryParam) { + PageInfo poPageInfo = getEmployeeDeclareService(user).listPage4UpdateByParam(queryParam); + List dtoList = getEmployeeDeclareService(user).convert(poPageInfo.getList()); + PageInfo dtoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, EmployeeDeclareListDTO.class); + dtoPageInfo.setTotal(poPageInfo.getTotal()); + // 查询上个月报送的人员 + Set employeeIds = SalaryEntityUtil.properties(poPageInfo.getList(), EmployeeDeclarePO::getEmployeeId); + List preTaxCycleEmployeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds( + queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), queryParam.getTaxAgentId(), employeeIds); + // 获取修改了哪些字段 + Map> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares); + for (EmployeeDeclareListDTO employeeDeclareListDTO : (List)dtoPageInfo.getList()) { + Set updatedDataIndexSet = updatedFieldMap.get(employeeDeclareListDTO); + employeeDeclareListDTO.setUpdatedDataIndexSet(updatedDataIndexSet); + } +// // 判断是否开启分部 +// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); +// if (!subcompanySupport) { +// weaTable.getColumns().stream() +// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) +// .findAny() +// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); +// } + SalaryWeaTable table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + Map datas = new HashMap<>(); + datas.put("pageInfo", dtoPageInfo); + datas.put("dataKey", result.getResultMap()); + return datas; + } + + /** + * 人员报送-本月报送失败人员列表 + * + * @param queryParam + * @return + */ + public PageInfo list4Fail(EmployeeDeclareFailListQueryParam queryParam) { + PageInfo poPageInfo = getEmployeeDeclareService(user).listPage4FailByParam(queryParam); + List dtoList = getEmployeeDeclareService(user).convert2FailListDTO(poPageInfo.getList()); + PageInfo dtoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + dtoList, EmployeeDeclareFailListDTO.class); + // 判断是否开启分部 +// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); +// if (!subcompanySupport) { +// weaTable.getColumns().stream() +// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) +// .findAny() +// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); +// } + return dtoPageInfo; + } + + /** + * 人员报送-获取新建或编辑的表单 + * + * @param id + * @return + */ + public Map getForm(Long id) { + // 证件类型默认"居民身份证" + EmployeeDeclarePO employeeDeclare; + EmployeeDeclareFromDTO employeeDeclareFrom = new EmployeeDeclareFromDTO() + .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS) + .setGender(GenderEnum.MALE) + .setEmploymentStatus(EmploymentStatusEnum.NORMAL) + .setEmploymentType(EmploymentTypeEnum.EMPLOYEE) + .setDisability(SalaryOnOffEnum.OFF) + .setLonelyOld(SalaryOnOffEnum.OFF) + .setMartyrDependents(SalaryOnOffEnum.OFF) + .setDeductExpenses(SalaryOnOffEnum.ON); + if (Objects.nonNull(id)) { + employeeDeclare = getEmployeeDeclareService(user).getById(id); + // 查询人员信息 + List employeeList = getSalaryEmployeeService(user).getEmployeeByIdsAll(Arrays.asList(employeeDeclare.getEmployeeId())); + Optional employee; + if (Objects.equals(employeeDeclare.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + employee = employeeList.stream().filter(e -> e.isExtEmp() == false).findFirst(); + } else { + employee = employeeList.stream().filter(e -> e.isExtEmp() == true).findFirst(); + } + employeeDeclareFrom.setId(employeeDeclare.getId()) + .setTaxAgentId(employeeDeclare.getTaxAgentId()) + .setEmployee(employee.isPresent() ? employee.get().getUsername() : "") + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setNationality(SalaryI18nUtil.getI18nLabel(94731, "中国")) + .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS) + .setCardNum(employeeDeclare.getCardNum()) + .setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class)) + .setBirthday(SalaryDateUtil.dateToLocalDate(employeeDeclare.getBirthday())) + .setEmploymentStatus(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class)) + .setMobile(employeeDeclare.getMobile()) + .setEmploymentType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class)) + .setEmploymentDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getEmploymentDate())) + .setDismissDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getDismissDate())) + .setDisability(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class)) + .setDisabilityCardNo(employeeDeclare.getDisabilityCardNo()) + .setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class)) + .setMartyrDependents(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class)) + .setMartyrDependentsCardNo(employeeDeclare.getMartyrDependentsCardNo()) + .setDeductExpenses(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class)); + } else { + employeeDeclare = null; + } + PageInfo pageInfo = new PageInfo<>(EmployeeDeclareFromDTO.class); + List columns = pageInfo.getColumns(); + + List readOnlyColumns = new ArrayList<>(); + columns.stream().forEach(column -> { + if (Objects.nonNull(column) && StringUtils.equals(column.getKey(), "employee")) { + readOnlyColumns.add(column.getKey()); + } + if (employeeDeclare != null + && Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue()) + && (StringUtils.equals(column.getKey(), "employeeName") || StringUtils.equals(column.getKey(), "cardNum"))) { + readOnlyColumns.add(column.getKey()); + } + }); + Map datas = new HashMap<>(); + datas.put("data", employeeDeclareFrom); + datas.put("columns", columns); + datas.put("readOnlyColumns", readOnlyColumns); + return datas; + + } + +// /** +// * 人员报送-批量编辑的表单 +// * +// * @return +// */ +// public WeaForm getBatchUpdateForm() { +// WeaForm weaForm = new WeaForm(); +// WeaFormItem batchUpdateItem = new WeaFormItem(WeaFormItemType.SELECT); +// List options = new ArrayList<>(); +// options.add(new WeaFormOption("employmentStatus", SalaryI18nUtil.getI18nLabel(91075, "状态"))); +// options.add(new WeaFormOption("employmentType", SalaryI18nUtil.getI18nLabel(156396, "任职受雇从业类型"))); +// options.add(new WeaFormOption("employmentDate", SalaryI18nUtil.getI18nLabel(156409, "任职受雇从业日期"))); +// options.add(new WeaFormOption("dismissDate", SalaryI18nUtil.getI18nLabel(95228, "离职日期"))); +// options.add(new WeaFormOption("deductExpenses", SalaryI18nUtil.getI18nLabel(156402, "是否扣除减除费用"))); +// batchUpdateItem.setOptions(options); +// +// Map otherParams = new HashMap<>(); +// WeaFormSalaryItem employmentStatus = new WeaFormSalaryItem(WeaFormItemType.SELECT); +// employmentStatus.setRequired(true); +// employmentStatus.setOptions(enum2Option(EmploymentStatusEnum.class)); +// otherParams.put("employmentStatus", employmentStatus); +// WeaFormSalaryItem employmentType = new WeaFormSalaryItem(WeaFormItemType.SELECT); +// employmentType.setRequired(true); +// employmentType.setOptions(enum2Option(EmploymentTypeEnum.class)); +// otherParams.put("employmentType", employmentType); +// WeaFormSalaryItem employmentDate = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER); +// employmentDate.setRequired(true); +// otherParams.put("employmentDate", employmentDate); +// WeaFormSalaryItem dismissDate = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER); +// dismissDate.setRequired(true); +// otherParams.put("dismissDate", dismissDate); +// WeaFormSalaryItem deductExpenses = new WeaFormSalaryItem(WeaFormItemType.RADIO); +// deductExpenses.setRequired(true); +// deductExpenses.setOptions(enum2Option(SalaryOnOffEnum.class)); +// otherParams.put("deductExpenses", deductExpenses); +// batchUpdateItem.setOtherParams(otherParams); +// weaForm.getItems().put("batchUpdateItem", batchUpdateItem); +// +// List firstLine = new ArrayList<>(); +// firstLine.add(new WeaFormLayout("batchUpdateItem", SalaryI18nUtil.getI18nLabel(145214, "批量编辑项目"), new String[]{"batchUpdateItem"})); +// List secondLine = new ArrayList<>(); +// secondLine.add(new WeaFormLayout("itemValue", SalaryI18nUtil.getI18nLabel(145215, "批量编辑为"), new String[]{"itemValue"})); +// weaForm.getLayout().add(firstLine); +// weaForm.getLayout().add(secondLine); +// return weaForm; +// } +// +// private List enum2Option(Class optionsEnum) { +// BaseEnum[] enumConstants = optionsEnum.getEnumConstants(); +// List weaFormOptions = Lists.newArrayListWithExpectedSize(enumConstants.length); +// for (BaseEnum enumConstant : enumConstants) { +// weaFormOptions.add(new WeaFormOption(enumConstant.name(), +// SalaryI18nUtil.getI18nLabel(enumConstant.getLabelId(), enumConstant.getDefaultLabel()))); +// } +// return weaFormOptions; +// } +// +// /** +// * 人员报送-获取高级搜索条件 +// * +// * @return +// */ +// public WeaSearchCondition getSearchCondition() { +// EmployeeDeclareConditionDTO employeeDeclareCondition = new EmployeeDeclareConditionDTO(); +// WeaSearchCondition searchCondition = SalaryFormatUtil.getInstance() +// .buildCondition(EmployeeDeclareConditionDTO.class, employeeDeclareCondition, "employeeDeclareCondition"); +// // "其他条件"不要 +// searchCondition.getGroups().remove(1); +// searchCondition.getItems().forEach((k, v) -> { +// if (Objects.equals(k, "employmentDate") || Objects.equals(k, "dismissDate")) { +// Map otherParams = new HashMap<>(); +// otherParams.put("isRange", "true"); +// v.setOtherParams(otherParams); +// } +// }); +// return searchCondition; +// } +// +// /** +// * 人员报送-新增人员/编辑人员保存 +// * +// * @param saveParam +// * @param employeeId +// * @param tenantKey +// */ +// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId, String tenantKey) { +// employeeDeclareService.save(saveParam, employeeId, tenantKey); +// } +// +// +// /** +// * 批量编辑 +// * +// * @param batchUpdateParam +// * @param employeeId +// * @param tenantKey +// */ +// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId, String tenantKey) { +// employeeDeclareService.batchUpdate(batchUpdateParam, employeeId, tenantKey); +// } + + /** + * 人员报送-删除 + * + * @param ids + */ + public void deleteByIds(Collection ids) { + getEmployeeDeclareService(user).deleteByIds(ids); + } + + /** + * 人员报送-刷新数据 + * + * @param refreshParam + */ + public String refresh(EmployeeDeclareRefreshParam refreshParam) { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + + Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + "-" + employeeDeclareRate.getIndex(), employeeDeclareRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getEmployeeDeclareService(user).refresh(refreshParam, Long.valueOf(user.getUID())); + employeeDeclareRate.setFinish(true); + } catch (Exception e) { + log.error("刷新数据失败:{}", e.getMessage(), e); + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } finally { + Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + "-" + employeeDeclareRate.getIndex(), employeeDeclareRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "refresh", localRunnable); + return employeeDeclareRate.getIndex(); + } + + /** + * 人员报送-获取人员报送的整体情况 + * + * @param employeeDeclareParam + * @return + */ + public EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam) { + return getEmployeeDeclareService(user).getDeclareInfo(employeeDeclareParam); + } + +// /** +// * 人员报送-全部报送 +// * +// * @param param +// * @param employeeId +// * @param tenantKey +// */ +// public String declare(EmployeeDeclareParam param, Long employeeId, String tenantKey) { +// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() +// .setIndex(UUID.randomUUID().toString()) +// .setStatus(true) +// .setFinish(false) +// .setMsg(""); +// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); +// if (!cacheResult) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156513, "全部报送失败")); +// } +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// try { +// employeeDeclareService.declare(param, employeeId, tenantKey); +// employeeDeclareRate.setFinish(true); +// } catch (SalaryRunTimeException | SalaryNullException e) { +// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); +// } catch (Exception e) { +// log.error("全部报送失败:{}", e.getMessage(), e); +// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage()); +// } finally { +// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); +// } +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable); +// return employeeDeclareRate.getIndex(); +// } +// +// /** +// * 人员报送-获取报送结果反馈 +// * +// * @param param +// * @param tenantKey +// */ +// public String getDeclareFeedback(EmployeeDeclareParam param, Long employeeId, String tenantKey) { +// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() +// .setIndex(UUID.randomUUID().toString()) +// .setStatus(true) +// .setFinish(false) +// .setMsg(""); +// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); +// if (!cacheResult) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156514, "获取报送结果反馈失败")); +// } +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// try { +// employeeDeclareService.getDeclareFeedback(param, employeeDeclareRate, employeeId, tenantKey); +// employeeDeclareRate.setFinish(true); +// } catch (SalaryRunTimeException | SalaryNullException e) { +// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); +// } catch (Exception e) { +// log.error("获取报送结果反馈失败:{}", e.getMessage(), e); +// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage()); +// } finally { +// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); +// } +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable); +// return employeeDeclareRate.getIndex(); +// } +// +// /** +// * 获取人员报送相关后端接口是否已经完成 +// * +// * @param index +// * @param tenantKey +// * @return +// */ +// public EmployeeDeclareRateDTO getRate(String index, String tenantKey) { +// return salaryCacheService.get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class); +// } +// +// /** +// * 人员报送-导出本月全部的人员 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export(EmployeeDeclareListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 人员报送-导出本月新增的人员 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export4Add(EmployeeDeclareAddListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare4Add"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export4Add(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Add", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 人员报送-导出本月信息变动的人员 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export4Update(EmployeeDeclareListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare4Update"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export4Update(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Update", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 人员报送-导出本月报送失败的人员 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export4Fail(EmployeeDeclareFailListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare4Fail"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export4Fail(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Fail", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 人员报送-导出导入模板 +// * +// * @param importParam +// * @param simpleEmployee +// * @return +// */ +// public Map exportTemplate(EmployeeDeclareImportParam importParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclareTemplate"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.exportTemplate(excelExportParam, importParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclareTemplate", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +} From 827420c2bda646274ae7e44e0947d2c2cca80031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 8 Aug 2023 19:39:53 +0800 Subject: [PATCH 007/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/GS/sql202307180103.sql | 34 -- resource/sqlupgrade/GS/sql202307180203.sql | 38 -- resource/sqlupgrade/GS/sql202307180403.sql | 31 -- .../web/TaxDeclarationApiFlowController.java | 14 + src/com/engine/salary/common/OptionDTO.java | 4 +- .../common/taxdeclare/AsyncRequestIdDTO.java | 2 +- .../entity/agency/bo/PaymentAgencyBO.java | 7 +- .../entity/agency/po/PaymentAgencyPO.java | 6 +- .../bo/EmployeeDeclareRefresh.java | 128 ++--- .../bo/EmployeeDeclareRequest.java | 142 +++++ .../dto/EmployeeDeclareRateDTO.java | 9 +- .../dto/EmployeeDeclareRefreshDTO.java | 12 +- .../param/EmployeeDeclareSaveParam.java | 96 ++++ .../po/EmployeeDeclareRecordPO.java | 56 ++ .../DeclareEmployeeFeedbackResponse.java | 35 ++ .../response/DeclareEmployeeInfoResponse.java | 23 + .../po/SalaryCheckResultDetailTempPO.java | 6 +- .../salaryacct/po/SalaryCheckResultPO.java | 6 +- .../po/SalaryCheckResultRecordPO.java | 6 +- .../taxagent/bo/TaxAgentTaxReturnBO.java | 10 +- .../dto/TaxAgentTaxReturnCheckDTO.java | 10 +- .../dto/TaxAgentTaxReturnCheckFormDTO.java | 30 +- .../dto/TaxAgentTaxReturnMainFormDTO.java | 30 +- .../param/TaxAgentTaxReturnSaveParam.java | 28 +- .../entity/taxapiflow/bo/TaxApiFlowBO.java | 219 ++++---- .../dto/CreateMessageRuleParamDTO.java | 6 +- .../TaxDeclarationApiFlowRecordListDTO.java | 24 +- ...larationApiFlowStatisticDetailListDTO.java | 6 +- ...TaxDeclarationApiFlowStatisticListDTO.java | 10 +- .../dto/TaxDeclarationApiFlowTotalDTO.java | 8 +- ...axDeclarationApiFlowWarnConfigFormDTO.java | 14 +- ...DeclarationApiFlowWarnReceiverFormDTO.java | 10 +- ...DeclarationApiFlowWarnReceiverListDTO.java | 8 +- .../TaxDeclarationBillingConfigFormDTO.java | 8 +- .../param/CreateMessageRuleParam.java | 4 +- .../TaxDeclarationApiFlowMonthQueryParam.java | 6 +- ...TaxDeclarationApiFlowRecordQueryParam.java | 10 +- ...DeclarationApiFlowWarnConfigSaveParam.java | 10 +- ...clarationApiFlowWarnReceiverSaveParam.java | 10 +- .../TaxDeclarationBillingConfigSaveParam.java | 8 +- .../TaxDeclarationApiFlowWarnReceiverPO.java | 6 +- .../dto/AbnormalEmployeeListDTO.java | 18 +- .../dto/FailEmployeeListDTO.java | 14 +- .../dto/TaxDeclarationRateDTO.java | 10 +- .../dto/TaxDeclarationTabDTO.java | 6 +- .../dto/TaxDeclareRecordFormDTO.java | 8 +- .../dto/TaxDeclareRecordListDTO.java | 28 +- .../param/AbnormalEmployeeListQueryParam.java | 8 +- .../TaxDeclarationValueListQueryParam.java | 8 +- .../param/TaxDeclareRecordParam.java | 2 +- .../po/TaxDeclarationApiConfigPO.java | 8 +- .../po/TaxDeclarationApiProfilePO.java | 6 +- .../po/TaxDeclarationValuePO.java | 6 +- .../po/TaxDeclareEmployeePO.java | 4 +- .../taxdeclaration/po/TaxDeclareRecordPO.java | 6 +- .../taxdeclaration/po/TaxReportColumnPO.java | 6 +- .../CancelDeclareFeedbackResponse.java | 4 +- .../response/CancelDeclareResponse.java | 4 +- .../response/DeclareTaxFeedbackResponse.java | 4 +- .../response/DeclareTaxResponse.java | 4 +- .../response/UpdateDeclareResponse.java | 2 +- .../dto/TaxAgreementBankFormDTO.java | 4 +- .../dto/TaxAgreementFeedbackResultDTO.java | 6 +- .../taxpayment/dto/TaxAmountFormDTO.java | 6 +- .../taxpayment/dto/TaxFeedbackResultDTO.java | 8 +- .../taxpayment/dto/TaxPayTypeFormDTO.java | 2 +- .../dto/TaxWithheldVoucherResultDTO.java | 6 +- .../param/TaxPaymentQueryParam.java | 14 +- .../taxpayment/po/TaxPaymentRequestPO.java | 6 +- .../service/EmployeeDeclareRecordService.java | 21 + .../service/EmployeeDeclareService.java | 11 +- .../TaxDeclarationApiBillingService.java | 38 +- .../EmployeeDeclareRecordServiceImpl.java | 46 ++ .../impl/EmployeeDeclareServiceImpl.java | 504 +++++++++--------- .../TaxDeclarationApiBillingServiceImpl.java | 246 ++++----- .../TaxDeclarationApiConfigServiceImpl.java | 32 +- .../TaxDeclarationApiFlowWarnServiceImpl.java | 8 +- .../engine/salary/util/SalaryEntityUtil.java | 47 ++ .../salary/web/EmployeeDeclareController.java | 127 +++-- .../web/TaxDeclarationApiFlowController.java | 119 +++++ .../wrapper/EmployeeDeclareWrapper.java | 168 +++--- .../TaxDeclarationApiFlowBillingWrapper.java | 49 +- 82 files changed, 1629 insertions(+), 1125 deletions(-) delete mode 100644 resource/sqlupgrade/GS/sql202307180103.sql delete mode 100644 resource/sqlupgrade/GS/sql202307180203.sql delete mode 100644 resource/sqlupgrade/GS/sql202307180403.sql create mode 100644 src/com/api/salary/web/TaxDeclarationApiFlowController.java create mode 100644 src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java create mode 100644 src/com/engine/salary/service/EmployeeDeclareRecordService.java create mode 100644 src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java create mode 100644 src/com/engine/salary/web/TaxDeclarationApiFlowController.java diff --git a/resource/sqlupgrade/GS/sql202307180103.sql b/resource/sqlupgrade/GS/sql202307180103.sql deleted file mode 100644 index b701b86e6..000000000 --- a/resource/sqlupgrade/GS/sql202307180103.sql +++ /dev/null @@ -1,34 +0,0 @@ -create table hrsa_tax_declare_api_profile -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - api_profile int -); -/ - -create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); -/ - -create table hrsa_tax_payment_request -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - tax_agent_id number not null, - tax_declare_record_id number, - tax_year_month date not null, - request_id varchar2(50) not null, - request_type int not null -); -/ - -create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); -/ - diff --git a/resource/sqlupgrade/GS/sql202307180203.sql b/resource/sqlupgrade/GS/sql202307180203.sql deleted file mode 100644 index 10aced290..000000000 --- a/resource/sqlupgrade/GS/sql202307180203.sql +++ /dev/null @@ -1,38 +0,0 @@ -create table hrsa_tax_declare_api_config -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - host varchar2(255), - app_key varchar2(255), - app_secret varchar2(255) -); -/ - -create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); -/ - -alter table hrsa_tax_declare_api_config modify host not null; -/ - -alter table hrsa_tax_declare_api_config modify app_key not null; -/ - -alter table hrsa_tax_declare_api_config modify app_secret not null; -/ - -alter table hrsa_tax_declare_api_config add enable_use int; -/ - -alter table hrsa_tax_declare_api_config add totality number; -/ - -alter table hrsa_tax_declare_api_config add remain number; -/ - -alter table hrsa_tax_declare_api_config add last_update_time date; -/ - diff --git a/resource/sqlupgrade/GS/sql202307180403.sql b/resource/sqlupgrade/GS/sql202307180403.sql deleted file mode 100644 index 3a72f6ecc..000000000 --- a/resource/sqlupgrade/GS/sql202307180403.sql +++ /dev/null @@ -1,31 +0,0 @@ -create table hrsa_tax_agent_tax_return -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - tax_agent_id number not null, - tax_code varchar2(50) not null, - tax_registration_number varchar2(50) not null, - department_code varchar2(50), - department_name varchar2(50), - nation varchar2(50), - province varchar2(50), - city varchar2(50), - area_code varchar2(50) not null, - password_type int not null, - real_account varchar2(50) , - pwd varchar2(50) not null, - check_status int not null, - fail_reason varchar2(255) -); -/ - -create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); -/ - -create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); -/ - diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowController.java b/src/com/api/salary/web/TaxDeclarationApiFlowController.java new file mode 100644 index 000000000..6fcdf10c5 --- /dev/null +++ b/src/com/api/salary/web/TaxDeclarationApiFlowController.java @@ -0,0 +1,14 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 智能算薪-计费 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +@Path("/bs/hrmsalary/taxdeclaration/apiflow") +public class TaxDeclarationApiFlowController extends com.engine.salary.web.TaxDeclarationApiFlowController{ + +} diff --git a/src/com/engine/salary/common/OptionDTO.java b/src/com/engine/salary/common/OptionDTO.java index 6ec60f48c..465d4ed3f 100644 --- a/src/com/engine/salary/common/OptionDTO.java +++ b/src/com/engine/salary/common/OptionDTO.java @@ -18,9 +18,9 @@ import lombok.NoArgsConstructor; @ApiModel("人员选项") public class OptionDTO { - @ApiModelProperty("人员ID") + //人员ID") private String id; - @ApiModelProperty("人员姓名") + //人员姓名") private String content; } diff --git a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java index 6f20b5f65..00cd2948f 100644 --- a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java +++ b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java @@ -13,6 +13,6 @@ import lombok.Data; @Data public class AsyncRequestIdDTO { - @ApiModelProperty("异步接口中的requestId") + //异步接口中的requestId") private String requestId; } diff --git a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java index 0fbe29e78..e3be152b6 100644 --- a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java +++ b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java @@ -7,8 +7,8 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; -import java.time.LocalDateTime; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -43,14 +43,15 @@ public class PaymentAgencyBO { } public static PaymentAgencyPO buildPaymentAgencyPO(PaymentAgencyFormDTO paymentAgencyFormDTO, Long employeeId, String tenantKey) { + Date now = new Date(); return PaymentAgencyPO.builder() .id(IdGenerator.generate()) .agencyName(paymentAgencyFormDTO.getAgencyName()) - .createTime(LocalDateTime.now()) + .createTime(now) .creator(employeeId) .tenantKey(tenantKey) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .updateTime(LocalDateTime.now()) + .updateTime(now) .remarks(paymentAgencyFormDTO.getRemarks()) .build(); } diff --git a/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java b/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java index 93045f86e..87626962b 100644 --- a/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java +++ b/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java @@ -5,7 +5,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; +import java.util.Date; @Data @Builder @@ -32,12 +32,12 @@ public class PaymentAgencyPO { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; /** * 创建人 diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index aa1b60536..a0833fb49 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -2,11 +2,14 @@ package com.engine.salary.entity.employeedeclare.bo; import com.api.formmode.page.util.Util; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.util.SalaryDateUtil; @@ -16,13 +19,11 @@ import com.engine.salary.util.valid.SalaryCardUtil; import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import lombok.Data; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; -import java.time.LocalDateTime; import java.time.YearMonth; import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; /** * @description: @@ -38,14 +39,12 @@ public class EmployeeDeclareRefresh { // 本月已有的需要报送的人员 Set employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId); // 员工的个人信息 - Map simpleUserInfoMap = dto.getSimpleUserInfos().stream() - .filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser())) - .collect(Collectors.toMap(simpleUserInfo -> simpleUserInfo.getUser().getId(), Function.identity(), (a, b) -> a)); + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(dto.getHrmEmployeeComInfos(), DataCollectionEmployee::getEmployeeId); // 薪资档案的数据(任职受雇从业类型、起始发薪日期、最后发薪日期) Map salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId); // 非系统人员的数据(任职受雇从业类型) - Map extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmployeePO::getId); - LocalDateTime now = LocalDateTime.now(); + Map extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmpPO::getId); + Date now = new Date(); // 对已有人员处理「人员状态」、「离职日期」、「任职受雇从业类型」 for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) { SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); @@ -60,17 +59,17 @@ public class EmployeeDeclareRefresh { result.getEmployeeDeclares().add(employeeDeclare); } } - if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) { - employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); - employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); - employeeDeclare.setNewEmployeeInfo(1); - } - ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); - if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { - employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); - employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); - employeeDeclare.setNewEmployeeInfo(1); - } +// if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); +// employeeDeclare.setNewEmployeeInfo(1); +// } +// ExtEmpPO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); +// if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); +// employeeDeclare.setNewEmployeeInfo(1); +// } } // 自动保存上个月报送成功的人员 for (EmployeeDeclarePO preTaxCycleEmployeeDeclare : dto.getPreTaxCycleEmployeeDeclare()) { @@ -91,37 +90,37 @@ public class EmployeeDeclareRefresh { employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); employeeDeclare.setNewEmployeeInfo(1); } - if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) { - employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); - employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); - employeeDeclare.setNewEmployeeInfo(1); - } - ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); - if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { - employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); - employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); - employeeDeclare.setNewEmployeeInfo(1); - } +// if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); +// employeeDeclare.setNewEmployeeInfo(1); +// } +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); +// if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); +// employeeDeclare.setNewEmployeeInfo(1); +// } employeeIds.add(employeeDeclare.getEmployeeId()); result.getNewEmployeeDeclares().add(employeeDeclare); } } // 薪资档案中新增的需报送的人员 - for (HrmEmployeeComInfo hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) { - if (employeeIds.contains(hrmEmployeeComInfo.getId())) { + for (DataCollectionEmployee hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) { + if (employeeIds.contains(hrmEmployeeComInfo.getEmployeeId())) { continue; } - EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); - SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getId()); + EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId); + DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId()); String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo(); - employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getId()) + employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()) .setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()) .setEmployeeName(hrmEmployeeComInfo.getUsername()) - .setJobNum(hrmEmployeeComInfo.getJob_num()) + .setJobNum(hrmEmployeeComInfo.getWorkcode()) .setCardNum(idNum) .setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()) - .setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateToLocalDate(simpleUserInfo.getBirthday())) + .setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday())) .setMobile(hrmEmployeeComInfo.getMobile()); if (StringUtils.isEmpty(idNum)) { employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); @@ -131,12 +130,12 @@ public class EmployeeDeclareRefresh { employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); } else { employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue()); - employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(idNum)); + employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum))); } // 对人员处理「人员状态」、「离职日期」 SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); if (salaryArchive != null) { - employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); +// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); employeeDeclare.setEmploymentDate(salaryArchive.getPayStartDate()); if (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { @@ -148,33 +147,34 @@ public class EmployeeDeclareRefresh { result.getNewEmployeeDeclares().add(employeeDeclare); } // 非系统人员中新增的需报送的人员 - for (ExtEmployeePO extEmployee : dto.getExtEmployees()) { - if (employeeIds.contains(extEmployee.getId())) { - continue; - } - EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); - employeeDeclare.setEmployeeId(extEmployee.getId()) - .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) - .setEmployeeName(extEmployee.getUsername()) - .setCardNum(extEmployee.getCardNum()) - .setMobile(extEmployee.getMobile()) - .setEmploymentType(extEmployee.getEmploymentType()) - .setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1)); - if (StringUtils.isEmpty(extEmployee.getCardNum())) { - employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); - employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); - } else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) { - employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); - employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); - } else { - employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue()); - employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum())); - } - employeeIds.add(employeeDeclare.getEmployeeId()); - result.getNewEmployeeDeclares().add(employeeDeclare); - } +// for (ExtEmployeePO extEmployee : dto.getExtEmployees()) { +// if (employeeIds.contains(extEmployee.getId())) { +// continue; +// } +// EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); +// employeeDeclare.setEmployeeId(extEmployee.getId()) +// .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) +// .setEmployeeName(extEmployee.getUsername()) +// .setCardNum(extEmployee.getCardNum()) +// .setMobile(extEmployee.getMobile()) +// .setEmploymentType(extEmployee.getEmploymentType()) +// .setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1)); +// if (StringUtils.isEmpty(extEmployee.getCardNum())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); +// employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); +// } else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); +// employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); +// } else { +// employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue()); +// employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum())); +// } +// employeeIds.add(employeeDeclare.getEmployeeId()); +// result.getNewEmployeeDeclares().add(employeeDeclare); +// } return result; } + private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, YearMonth taxCycle, Date now, Long employeeId) { return new EmployeeDeclarePO() .setId(IdGenerator.generate()) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java new file mode 100644 index 000000000..16b4192bc --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -0,0 +1,142 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.employeedeclare.GenderEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEnumUtil; +import lombok.Data; +import org.apache.commons.compress.utils.Lists; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @description: 个税对接(人员报送) + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/2 11:05 AM + * @version:v1.0 + */ +@Data +public class EmployeeDeclareRequest { + + /** + * 转换成请求参数 + * + * @param employeeDeclares + * @return + */ + public static List> convert2RequestParam(List employeeDeclares) { + List> employeeInfoMapList = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + Map employeeInfoMap = new HashMap<>(); + // 工号 + employeeInfoMap.put("gh", employeeDeclare.getJobNum()); + // *姓名 + employeeInfoMap.put("xm", employeeDeclare.getEmployeeName()); + // *证件类型 + CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + employeeInfoMap.put("zzlx", cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel()); + // *证件号码 + employeeInfoMap.put("zzhm", employeeDeclare.getCardNum()); + // *国籍 + employeeInfoMap.put("gj", "中国"); + // *性别 + GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class); + employeeInfoMap.put("xb", genderEnum == null ? "" : genderEnum.getDefaultLabel()); + // *出生日期 + employeeInfoMap.put("csny", employeeDeclare.getBirthday()); + // *人员状态 + EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); + employeeInfoMap.put("nsrzt", employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); + // *任职受雇类型 + EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); + employeeInfoMap.put("sfgy", employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); + // 入职年度就业情形 + employeeInfoMap.put("rzndjyqk", employeeDeclare.getEmploymentFirstYear()); + // *手机号码 + employeeInfoMap.put("lxdh", employeeDeclare.getMobile()); + // *入职受雇日期 + employeeInfoMap.put("rzsgrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate())); + // 离职日期 + employeeInfoMap.put("lzrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate())); + // 是否残疾 + SalaryOnOffEnum disability = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfcj", disability == null ? "" : disability.getDefaultLabel()); + // 残疾证号 + employeeInfoMap.put("cjzh", employeeDeclare.getDisabilityCardNo()); + // 是否扣除减除费用 + SalaryOnOffEnum deductExpenses = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfzdw", deductExpenses == null ? "是" : deductExpenses.getDefaultLabel()); + // 是否烈属 + SalaryOnOffEnum martyrDependents = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfls", martyrDependents == null ? "" : martyrDependents.getDefaultLabel()); + // 烈属证号 + employeeInfoMap.put("lszh", employeeDeclare.getMartyrDependentsCardNo()); + // 是否孤老 + SalaryOnOffEnum lonelyOld = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfgl", lonelyOld == null ? "" : lonelyOld.getDefaultLabel()); + // 个人投资总额 + employeeInfoMap.put("grgbze", ""); + // 个人投资比例 + employeeInfoMap.put("grgbbl", ""); + // 备注 + employeeInfoMap.put("bz", ""); + // 人员地区 + employeeInfoMap.put("rydq", "境内"); + // 中文名 + employeeInfoMap.put("xmzw", ""); + // 出生地: + employeeInfoMap.put("csd", ""); + // 涉税事由 + employeeInfoMap.put("sssx", ""); + // 首次入境时间 + employeeInfoMap.put("scrjsj", ""); + // 预计离境时间 + employeeInfoMap.put("yjljsj", ""); + // 其他证件类型 + employeeInfoMap.put("qtzzlx", ""); + // 其他证件号码 + employeeInfoMap.put("qtzzhm", ""); + // 户籍地址:省份、城市、区县、街道、详细地址 + employeeInfoMap.put("hjszd_sheng", ""); + employeeInfoMap.put("hjszd_shi", ""); + employeeInfoMap.put("hjszd_qx", ""); + employeeInfoMap.put("hjszd_jd", ""); + employeeInfoMap.put("hjszd_xxdz", ""); + // 居住地址:省份、城市、区县、街道、详细地址 + employeeInfoMap.put("lxdz_sheng", ""); + employeeInfoMap.put("lxdz_shi", ""); + employeeInfoMap.put("lxdz_qx", ""); + employeeInfoMap.put("lxdz_jd", ""); + employeeInfoMap.put("lxdz", ""); + // 联系地 + employeeInfoMap.put("wjrlxdz_sheng", ""); + employeeInfoMap.put("wjrlxdz_shi", ""); + employeeInfoMap.put("wjrlxdz_qx", ""); + employeeInfoMap.put("wjrlxdz_jd", ""); + employeeInfoMap.put("wjrlxdz_xxdz", ""); + // 邮箱 + employeeInfoMap.put("dzyx", ""); + // 学历 + employeeInfoMap.put("xl", ""); + // 开户银行 + employeeInfoMap.put("khyh", ""); + // 开户银行省份 + employeeInfoMap.put("khyhsfmz", ""); + // 银行账号 + employeeInfoMap.put("yhzh", ""); + // 职务 + employeeInfoMap.put("zw", ""); + // 部门编号 + employeeInfoMap.put("bmbh", ""); + employeeInfoMapList.add(employeeInfoMap); + } + return employeeInfoMapList; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java index d53dc69fb..fe1c33f95 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.employeedeclare.dto; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -25,12 +24,12 @@ public class EmployeeDeclareRateDTO implements Serializable { private static final long serialVersionUID = 6096347310269090985L; - @ApiModelProperty("缓存索引") + //缓存索引") private String index; - @ApiModelProperty("提示信息") + //提示信息") private String msg; - @ApiModelProperty("状态") + //状态") private boolean status; - @ApiModelProperty("是否已经完成") + //是否已经完成") private boolean finish; } diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java index 7d795b5a0..bc3477e99 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java @@ -3,6 +3,7 @@ package com.engine.salary.entity.employeedeclare.dto; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import lombok.Data; import lombok.experimental.Accessors; @@ -36,15 +37,12 @@ public class EmployeeDeclareRefreshDTO { private List salaryArchives; // 员工基本信息 - private List employeeInfos; - -// // 员工基本信息 -// private List hrmEmployeeComInfos; + private List hrmEmployeeComInfos; // // // 员工个人信息 // private List simpleUserInfos; -// -// // 非系统人员 -// private List extEmployees; + + // 非系统人员 + private List extEmployees; } diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java new file mode 100644 index 000000000..36cfe6bc8 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -0,0 +1,96 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.employeedeclare.GenderEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.time.LocalDate; +import java.time.YearMonth; + +/** + * @description: 人员报送(人员)保存参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/6/22 1:50 PM + * @version:v1.0 + */ +@Data +public class EmployeeDeclareSaveParam { + + //主键id") + private Long id; + + /** + * 参数错误,个税扣缴义务人id不能为空 + */ + //个税扣缴义务人id") + private Long taxAgentId; + + /** + * 参数错误,税款所属期参数格式错误 + */ + //税款所属期") + private YearMonth taxCycle; + + //员工id") + private Long employeeId; + + //员工类型") + private EmployeeTypeEnum employeeType; + + //姓名") + private String employeeName; + + //工号") + private String jobNum; + + //证件类型") + private CardTypeEnum cardType; + + //证件号码") + private String cardNum; + + //性别") + private GenderEnum gender; + + //出生日期") + private LocalDate birthday; + + //状态") + private EmploymentStatusEnum employmentStatus; + + //手机号码") + private String mobile; + + //任职受雇从业类型") + private EmploymentTypeEnum employmentType; + + //任职受雇从业日期") + private LocalDate employmentDate; + + //离职日期") + private LocalDate dismissDate; + + //是否残疾") + private SalaryOnOffEnum disability; + + //残疾证号") + private String disabilityCardNo; + + //是否孤老") + private SalaryOnOffEnum lonelyOld; + + //是否是烈属") + private SalaryOnOffEnum martyrDependents; + + //烈属证号") + private String martyrDependentsCardNo; + + //是否扣除减除费用") + private SalaryOnOffEnum deductExpenses; +} diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java new file mode 100644 index 000000000..83d5ffa7e --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java @@ -0,0 +1,56 @@ +package com.engine.salary.entity.employeedeclare.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * @description: 员工报送记录 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/11/6 16:50 + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//"hrsa_employee_declare_record") +public class EmployeeDeclareRecordPO { + + /** + * 主键id + */ + private Long id; + /** + * 个税扣缴义务人 + */ + private Long taxAgentId; + /** + * 税款所属期 + */ + private String taxCycle; + /** + * 请求的requestId + */ + private String requestId; + /** + * 租户key + */ + private String tenantKey; + /** + * 创建人id + */ + private Long creator; + /** + * 是否删除 + */ + private Integer deleteType; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新时间 + */ + private Date updateTime; +} diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java new file mode 100644 index 000000000..331090c7b --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.employeedeclare.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @description: 报送人员的反馈 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/10/27 10:41 AM + * @version:v1.0 + */ +@Data +public class DeclareEmployeeFeedbackResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("返回数据") + private DeclareEmployeeFeedbackResponseBody body; + + @Data + public static class DeclareEmployeeFeedbackResponseBody { + + @ApiModelProperty("人员数据") + private List> bsjg; + + @ApiModelProperty("requestId") + private String requestId; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java new file mode 100644 index 000000000..73216ff4b --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.employeedeclare.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 报送人员的返回数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/10/25 4:49 PM + * @version:v1.0 + */ +@Data +public class DeclareEmployeeInfoResponse { + + @ApiModelProperty("接口状态") + private SzyhResponseHead head; + + @ApiModelProperty("接口数据") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java index 08d73b41d..1f03a451d 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java @@ -6,7 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import java.time.LocalDateTime; +import java.util.Date; /** * @description: 核算结果的校验结果明细临时存储 @@ -76,10 +76,10 @@ public class SalaryCheckResultDetailTempPO { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java index f8f8da978..245f1d9c0 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java @@ -5,7 +5,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; +import java.util.Date; /** * @description: 薪资核算校验异常结果 @@ -64,10 +64,10 @@ public class SalaryCheckResultPO { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java index b57210197..9c034ff9c 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java @@ -5,7 +5,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; +import java.util.Date; /** * @description: 薪资核算校验异常结果明细 @@ -74,10 +74,10 @@ public class SalaryCheckResultRecordPO { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java index c19abcd52..559aced70 100644 --- a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -11,7 +11,7 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.util.Sm4Utils; import dm.jdbc.util.IdGenerator; -import java.time.LocalDateTime; +import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -43,6 +43,7 @@ public class TaxAgentTaxReturnBO { } public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + Date now = new Date(); return TaxAgentTaxReturnPO.builder() .taxAgentId(saveParam.getTaxAgentId()) .taxCode(saveParam.getTaxCode()) @@ -57,12 +58,13 @@ public class TaxAgentTaxReturnBO { .id(IdGenerator.generate()) .checkStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .createTime(LocalDateTime.now()) - .updateTime(LocalDateTime.now()) + .createTime(now) + .updateTime(now) .build(); } public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + Date now = new Date(); po.setTaxCode(saveParam.getTaxCode()) .setNation(saveParam.getNation()) .setCity(saveParam.getCity()) @@ -72,7 +74,7 @@ public class TaxAgentTaxReturnBO { .setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) .setTaxAgentId(saveParam.getTaxAgentId()) - .setUpdateTime(LocalDateTime.now()); + .setUpdateTime(now); } public static Map convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) { diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java index fbb47d85e..8b3a6717a 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java @@ -24,19 +24,19 @@ public class TaxAgentTaxReturnCheckDTO { * 验证状态 * @see TaxAgentTaxReturnStatusEnum */ - @ApiModelProperty("验证状态") + //验证状态") private Integer status; - @ApiModelProperty("登记序号") + //登记序号") private String taxRegistrationNumber; - @ApiModelProperty("部门编号") + //部门编号") private String departmentCode; - @ApiModelProperty("验证提示信息") + //验证提示信息") private String message; - @ApiModelProperty("详细数据") + //详细数据") private List records; public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) { diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java index 67b5a8f5e..5430733d3 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java @@ -24,51 +24,51 @@ import lombok.NoArgsConstructor; @ApiModel("税友验证信息") public class TaxAgentTaxReturnCheckFormDTO { - @ApiModelProperty("税号") + //税号") private String taxCode; - @ApiModelProperty("验证信息id") + //验证信息id") @JsonSerialize(using = ToStringSerializer.class) private Long index; - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - @ApiModelProperty("个税扣缴义务人") + //个税扣缴义务人") private String taxAgentName; - @ApiModelProperty("登记序号") + //登记序号") private String taxRegistrationNumber; - @ApiModelProperty("纳税人状态") + //纳税人状态") private String taxpayerStatus; - @ApiModelProperty("法人姓名") + //法人姓名") private String legalPersonName; - @ApiModelProperty("联系电话") + //联系电话") private String mobile; - @ApiModelProperty("生产经营地址") + //生产经营地址") private String businessAddress; - @ApiModelProperty("行业名称") + //行业名称") private String industryName; - @ApiModelProperty("主管税务机关") + //主管税务机关") private String taxAuthorities; - @ApiModelProperty("主管税务科所") + //主管税务科所") private String taxBranch; - @ApiModelProperty("是否分部门备案") + //是否分部门备案") private SalaryOnOffEnum divideFiling; - @ApiModelProperty("部门名称") + //部门名称") private String departmentName; - @ApiModelProperty("部门编码") + //部门编码") private String departmentCode; } diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java index 291f90835..dae97d778 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java @@ -24,50 +24,50 @@ import lombok.experimental.Accessors; @ApiModel("报税信息表单") public class TaxAgentTaxReturnMainFormDTO { - @ApiModelProperty("主键id") + //主键id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("名称") + //名称") private String name; - @ApiModelProperty("税号") + //税号") private String taxCode; - @ApiModelProperty("报税所属区域") + //报税所属区域") private String city; - @ApiModelProperty("省份") + //省份") private String province; - @ApiModelProperty("国家") + //国家") private String nation; - @ApiModelProperty("行政区划代码") + //行政区划代码") private String areaCode; - @ApiModelProperty("密码校验类型") + //密码校验类型") private TaxAgentTaxReturnPasswordTypeEnum passwordType; - @ApiModelProperty("个税网报密码") + //个税网报密码") private String netPassword; - @ApiModelProperty("实名账号") + //实名账号") private String account; - @ApiModelProperty("实名账号密码") + //实名账号密码") private String realNamePassword; - @ApiModelProperty("登记序号") + //登记序号") private String taxRegistrationNumber; - @ApiModelProperty("部门编码") + //部门编码") private String departmentCode; - @ApiModelProperty("报税信息验证状态") + //报税信息验证状态") private TaxAgentTaxReturnStatusEnum checkStatus; - @ApiModelProperty("失败原因") + //失败原因") private String failReason; } diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java index 23dfe7a42..a28a0b349 100644 --- a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java @@ -21,47 +21,47 @@ import lombok.NoArgsConstructor; @ApiModel("个税扣缴义务人-报税信息-保存参数") public class TaxAgentTaxReturnSaveParam { - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") private Long taxAgentId; - @ApiModelProperty("税号") + //税号") private String taxCode; - @ApiModelProperty("登记序号") + //登记序号") private String taxRegistrationNumber; - @ApiModelProperty("省级") + //省级") private String province; - @ApiModelProperty("市级") + //市级") private String city; - @ApiModelProperty("国家") + //国家") private String nation; - @ApiModelProperty("密码校验类型") + //密码校验类型") private String passwordType; - @ApiModelProperty("密码") + //密码") private String password; - @ApiModelProperty("实名账号") + //实名账号") private String account; - @ApiModelProperty("部门编码,分部门备案时填入") + //部门编码,分部门备案时填入") private String departmentCode; - @ApiModelProperty("部门名称,分部门备案时填入") + //部门名称,分部门备案时填入") private String departmentName; - @ApiModelProperty("请求类型 1.保存并验证 2.仅保存") + //请求类型 1.保存并验证 2.仅保存") private Integer requestType = 1; - @ApiModelProperty("验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码") + //验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码") @JsonIgnore private Integer type; - @ApiModelProperty("地区编码") + //地区编码") private String areaCode; public void checkParam() { diff --git a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java index 879f68bb5..44b42447c 100644 --- a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java +++ b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java @@ -1,91 +1,88 @@ -//package com.engine.salary.entity.taxapiflow.bo; -// -//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; -//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; -//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; -//import com.engine.salary.enums.sicategory.DeleteTypeEnum; -//import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; -//import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; -//import com.weaver.common.distribution.genid.IdGenerator; -//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; -//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; -//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; -//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; -//import com.weaver.hrm.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; -//import com.weaver.hrm.salary.util.SalaryDateUtil; -//import com.weaver.hrm.salary.util.SalaryEnumUtil; -//import com.weaver.hrm.salary.util.SalaryI18nUtil; -//import com.weaver.mc.api.entity.*; -//import com.weaver.mc.util.StringUtils; -//import com.weaver.teams.domain.EntityType; -// -//import java.time.LocalDate; -//import java.time.LocalDateTime; -//import java.util.*; -//import java.util.concurrent.atomic.AtomicInteger; -// -///** -// * @author chengliming -// * @date 2022-11-16 1:41 PM -// **/ -//public class TaxApiFlowBO { -// -// /** -// * 流量使用情况 -// * -// * @param wrapper 包装类 -// * @param taxAgentId -// * @param employeeId -// * @return -// */ -// public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper, -// Long taxAgentId, -// Long employeeId) { -// return TaxDeclarationApiFlowRecordPO.builder() -// .id(IdGenerator.generate()) -// .deduct(null) -// .businessType(wrapper.getBusinessType().getValue()) -// .taxMonth(wrapper.getTaxYearMonth()) -// .useTime(LocalDate.now()) -// .createTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .employeeId(employeeId) -// .taxAgentId(taxAgentId) -// .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()) -// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .tenantKey(wrapper.getTenantKey()) -// .creator(wrapper.getCurrentEmployeeId()) -// .build(); -// } -// -// public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) { -// String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId()); -// String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId()); -// String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getUsername(); -// String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getCardNum(); -// String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator()); -// String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId()); -// -// boolean isInternal = StringUtils.isNotEmpty(internalUsername); -// return TaxDeclarationApiFlowRecordListDTO.builder() -// .id(e.getId()) -// .indexNum(indexNum.getAndIncrement()) -// .createTime(SalaryDateUtil.DATE_TIME_FORMATTER.format(e.getCreateTime())) -// .taxAgentName(taxAgentName) -// .employeeName(isInternal ? internalUsername : externalUsername) -// .employeeType(isInternal ? "inside" : "external") -// .idCardNo(isInternal ? idNo : externalIdNo) -// .employeeId(e.getEmployeeId()) -// .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel()) -// .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel()) -// .creator(creator) -// .creatorId(e.getCreator()) -// .build(); -// } -// +package com.engine.salary.entity.taxapiflow.bo; + +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEnumUtil; +import dm.jdbc.util.IdGenerator; +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @author chengliming + * @date 2022-11-16 1:41 PM + **/ +public class TaxApiFlowBO { + + /** + * 流量使用情况 + * + * @param wrapper 包装类 + * @param taxAgentId + * @param employeeId + * @return + */ + public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper, + Long taxAgentId, + Long employeeId) { + Date now = new Date(); + return TaxDeclarationApiFlowRecordPO.builder() + .id(IdGenerator.generate()) + .deduct(null) + .businessType(wrapper.getBusinessType().getValue()) + .taxMonth(wrapper.getTaxYearMonth()) + .useTime(now) + .createTime(now) + .updateTime(now) + .employeeId(employeeId) + .taxAgentId(taxAgentId) + .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(wrapper.getTenantKey()) + .creator(wrapper.getCurrentEmployeeId()) + .build(); + } + + public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) { + String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId()); + String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId()); + String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getUsername(); + String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getIdNo(); + String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator()); + String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId()); + + boolean isInternal = StringUtils.isNotEmpty(internalUsername); + return TaxDeclarationApiFlowRecordListDTO.builder() + .id(e.getId()) + .indexNum(indexNum.getAndIncrement()) + .createTime(SalaryDateUtil.getFormatLocalDate(e.getCreateTime())) + .taxAgentName(taxAgentName) + .employeeName(isInternal ? internalUsername : externalUsername) + .employeeType(isInternal ? "inside" : "external") + .idCardNo(isInternal ? idNo : externalIdNo) + .employeeId(e.getEmployeeId()) + .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel()) + .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel()) + .creator(creator) + .creatorId(e.getCreator()) + .build(); + } + // public static SendMessageEntity buildSendMessageEntity(TaxDeclarationApiFlowWarnConfigPO warnConfig, List receivers, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { -// String title = SalaryI18nUtil.getI18nLabel(160389, "智能算薪流量不足提醒"); -// String desc = String.format(SalaryI18nUtil.getI18nLabel(184069, "智能算薪流量已不足%s,请及时采购续费,避免次月无法使用。"), warnConfig.getThreshold()); +// String title = SalaryI18nUtil.getI18nLabel(111, "智能算薪流量不足提醒"); +// String desc = String.format(SalaryI18nUtil.getI18nLabel(111, "智能算薪流量已不足%s,请及时采购续费,避免次月无法使用。"), warnConfig.getThreshold()); // Entity entity = new Entity() // .setId(IdGenerator.generate() + "") // .setModule(EntityType.hrmsalary.name()) @@ -120,27 +117,27 @@ // smg.setEmailInfo(emailEntity); // return smg; // } -// -// public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam, -// Long currentEmployeeId, -// String currentTenantKey) { -// saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" ")); -// saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" ")); -// return TaxDeclarationApiConfigPO.builder() -// .id(IdGenerator.generate()) -// .appKey(saveParam.getAppKey()) -// .appSecret(saveParam.getAppSecret()) -// .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) -// .createTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .creator(currentEmployeeId) -// .tenantKey(currentTenantKey) -// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .build(); -// } -// -// @Override -// public String toString() { -// return "TaxApiFlowBO{}"; -// } -//} + + public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam, + Long currentEmployeeId) { + Date now = new Date(); + saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" ")); + saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" ")); + return TaxDeclarationApiConfigPO.builder() + .id(IdGenerator.generate()) + .appKey(saveParam.getAppKey()) + .appSecret(saveParam.getAppSecret()) + .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .createTime(now) + .updateTime(now) + .creator(currentEmployeeId) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .build(); + } + + @Override + public String toString() { + return "TaxApiFlowBO{}"; + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java index 3de26dafa..527a7e2cf 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java @@ -21,15 +21,15 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("智能算税-流量提醒-创建规则参数") public class CreateMessageRuleParamDTO { - @ApiModelProperty("模块") + //模块") @JsonSerialize(using = ToStringSerializer.class) private Integer moduleId; - @ApiModelProperty("事件") + //事件") @JsonSerialize(using = ToStringSerializer.class) private Integer eventId; - @ApiModelProperty("业务") + //业务") @JsonSerialize(using = ToStringSerializer.class) private Long businessId; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java index 47281e693..5b6ef90cb 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java @@ -21,42 +21,42 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("智能算税-流量使用记录") public class TaxDeclarationApiFlowRecordListDTO { - @ApiModelProperty("id") + //id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("序号") + //序号") private Integer indexNum; - @ApiModelProperty("使用时间") + //使用时间") private String createTime; - @ApiModelProperty("个税扣缴义务人") + //个税扣缴义务人") private String taxAgentName; - @ApiModelProperty("人员") + //人员") private String employeeName; - @ApiModelProperty("人员类型") + //人员类型") private String employeeType; - @ApiModelProperty("人员id") + //人员id") @JsonSerialize(using = ToStringSerializer.class) private Long employeeId; - @ApiModelProperty("创建人id") + //创建人id") @JsonSerialize(using = ToStringSerializer.class) private Long creatorId; - @ApiModelProperty("身份证号码") + //身份证号码") private String idCardNo; - @ApiModelProperty("接口业务") + //接口业务") private String businessTypeName; - @ApiModelProperty("操作人") + //操作人") private String creator; - @ApiModelProperty("结果") + //结果") private String result; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java index 8f0897b70..9d658b6d9 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java @@ -22,7 +22,7 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("智能算税-流量统计-月度详情") public class TaxDeclarationApiFlowStatisticDetailListDTO { - @ApiModelProperty("id") + //id") @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -32,10 +32,10 @@ public class TaxDeclarationApiFlowStatisticDetailListDTO { @JsonIgnore private String taxAgentName; - @ApiModelProperty("税款所属期") + //税款所属期") private String taxMonth; - @ApiModelProperty("月使用流量数") + //月使用流量数") private Integer used; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java index f027f899d..ecfa10f57 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java @@ -21,20 +21,20 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("智能算税-流量统计") public class TaxDeclarationApiFlowStatisticListDTO { - @ApiModelProperty("id") + //id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("序号") + //序号") private Integer indexNum; - @ApiModelProperty("个税扣缴义务人") + //个税扣缴义务人") private String taxAgentName; - @ApiModelProperty("个税扣缴义务人ID") + //个税扣缴义务人ID") @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - @ApiModelProperty("已使用") + //已使用") private Integer used; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java index 139950acc..467bc6eae 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java @@ -21,18 +21,18 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("智能算税-流量统计") public class TaxDeclarationApiFlowTotalDTO { - @ApiModelProperty("总流量") + //总流量") @JsonSerialize(using = ToStringSerializer.class) private Long total; - @ApiModelProperty("剩余流量") + //剩余流量") @JsonSerialize(using = ToStringSerializer.class) private Long remain; - @ApiModelProperty("已使用流量") + //已使用流量") @JsonSerialize(using = ToStringSerializer.class) private Long used; - @ApiModelProperty("最后更新时间") + //最后更新时间") private String lastUpdateTime; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java index 7910b6dbd..0ce847aeb 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java @@ -22,28 +22,28 @@ import lombok.NoArgsConstructor; @ApiModel("智能算税-流量不足提醒-表单") public class TaxDeclarationApiFlowWarnConfigFormDTO { - @ApiModelProperty("主键id") + //主键id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("提醒开关") + //提醒开关") private Boolean enable; - @ApiModelProperty("提醒规则") + //提醒规则") private Integer threshold; - @ApiModelProperty("提醒推送方式") + //提醒推送方式") private String config; - @ApiModelProperty("业务ID") + //业务ID") @JsonSerialize(using = ToStringSerializer.class) private Long businessId; - @ApiModelProperty("模块") + //模块") @JsonSerialize(using = ToStringSerializer.class) private String moduleId; - @ApiModelProperty("事件") + //事件") @JsonSerialize(using = ToStringSerializer.class) private String eventId; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java index 2f3c38d1b..3ce0a8212 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java @@ -26,20 +26,20 @@ import java.util.List; @ApiModel("智能算税-流量不足提醒对象-表单") public class TaxDeclarationApiFlowWarnReceiverFormDTO { - @ApiModelProperty("主键id") + //主键id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("提醒对象") + //提醒对象") private List employee; - @ApiModelProperty("手机号") + //手机号") private String mobile; - @ApiModelProperty("邮箱列表") + //邮箱列表") private String email; - @ApiModelProperty("邮箱列表下拉框") + //邮箱列表下拉框") @JsonIgnore private List emailOptions; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java index d5afc26f5..c8689ef66 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java @@ -23,20 +23,20 @@ import net.minidev.json.annotate.JsonIgnore; @ApiModel("智能算税-流量提醒对象") public class TaxDeclarationApiFlowWarnReceiverListDTO { - @ApiModelProperty("id") + //id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("提醒对象") + //提醒对象") private String employeeName; @JsonIgnore @JsonSerialize(using = ToStringSerializer.class) private Long employeeId; - @ApiModelProperty("手机号") + //手机号") private String mobile; - @ApiModelProperty("邮箱") + //邮箱") private String email; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java index 1604b8e96..93502a5a6 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java @@ -22,16 +22,16 @@ import lombok.NoArgsConstructor; @ApiModel("智能算税-启用设置-表单") public class TaxDeclarationBillingConfigFormDTO { - @ApiModelProperty("主键id") + //主键id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("appKey") + //appKey") private String appKey; - @ApiModelProperty("appSecret") + //appSecret") private String appSecret; - @ApiModelProperty("智能算薪开关") + //智能算薪开关") private Boolean enable; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java index 15deaba5f..6a512da74 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java @@ -13,11 +13,11 @@ import javax.validation.constraints.NotNull; **/ @Data public class CreateMessageRuleParam { - @ApiModelProperty("业务ID") + //业务ID") @NotNull(message = "业务ID不能为空") private String businessId; - @ApiModelProperty("详细规则") + //详细规则") @NotNull(message = "详细规则不能为空") private String config; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java index 50e83b5f3..2ae0cbb43 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java @@ -24,14 +24,14 @@ import java.time.YearMonth; @ApiModel("流量月度详情查询参数") public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam { - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") @NotNull(message = "个税扣缴义务人不能为空") private Long taxAgentId; - @ApiModelProperty("税款所属期开始时间") + //税款所属期开始时间") private YearMonth startTaxMonth; - @ApiModelProperty("税款所属期结束时间") + //税款所属期结束时间") private YearMonth endTaxMonth; public Integer getStartTaxMonth() { diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java index 8a5f7be71..d0a508a08 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java @@ -23,18 +23,18 @@ import java.time.LocalDate; @ApiModel("流量月度详情查询参数") public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam { - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") private Long taxAgentId; - @ApiModelProperty("开始时间") + //开始时间") private LocalDate startDate; - @ApiModelProperty("结束时间") + //结束时间") private LocalDate endDate; - @ApiModelProperty("业务接口类型") + //业务接口类型") private Integer businessType; - @ApiModelProperty("结果") + //结果") private Integer result; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java index 482c76195..1dbf4be53 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java @@ -21,20 +21,20 @@ import javax.validation.constraints.NotNull; @AllArgsConstructor @ApiModel("流量不足提醒规则创建") public class TaxDeclarationApiFlowWarnConfigSaveParam { - @ApiModelProperty("提醒对象Id") + //提醒对象Id") private Long id; - @ApiModelProperty("提醒阈值") + //提醒阈值") @NotNull(message = "提醒规则不能为空") private Long threshold; - @ApiModelProperty("提醒开关是否打开") + //提醒开关是否打开") private Boolean enable; - @ApiModelProperty("业务ID") + //业务ID") @NotNull(message = "推送方式不能为空") private Long businessId; - @ApiModelProperty("规则") + //规则") private String config; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java index 345cc3ac7..c6b953632 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java @@ -19,18 +19,18 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("流量不足提醒对象") public class TaxDeclarationApiFlowWarnReceiverSaveParam { - @ApiModelProperty("提醒对象Id") + //提醒对象Id") private Long id; - @ApiModelProperty("提醒配置Id") + //提醒配置Id") private Long warnConfigId; - @ApiModelProperty("人员Id") + //人员Id") private Long employeeId; - @ApiModelProperty("邮箱") + //邮箱") private String email; - @ApiModelProperty("手机号") + //手机号") private String mobile; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java index afb9c15e1..843a04a81 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java @@ -20,16 +20,16 @@ import lombok.NoArgsConstructor; @ApiModel("智能算薪配置参数") public class TaxDeclarationBillingConfigSaveParam { - @ApiModelProperty("appKey") + //appKey") private String appKey; - @ApiModelProperty("appSecret") + //appSecret") private String appSecret; - @ApiModelProperty("enable") + //enable") private String enable; - @ApiModelProperty("配置ID") + //配置ID") private Long configId; } diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java index e546a8edb..5ac94d180 100644 --- a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java @@ -6,7 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; -import java.time.LocalDateTime; +import java.util.Date; /** * 流量不足提醒对象 @@ -52,12 +52,12 @@ public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; /** * 创建人 diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java index 105f6ebb8..8d497acc9 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -18,32 +18,32 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class AbnormalEmployeeListDTO { - @ApiModelProperty("主键id") + //主键id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("关联人员类型") + //关联人员类型") private Integer employeeType; - @ApiModelProperty("关联人员id") + //关联人员id") @JsonSerialize(using = ToStringSerializer.class) private Long employeeId; - @ApiModelProperty("姓名") + //姓名") private String employeeName; - @ApiModelProperty("工号") + //工号") private String jobNum; - @ApiModelProperty("证件类型") + //证件类型") private String cardType; - @ApiModelProperty("证件号码") + //证件号码") private String cardNum; - @ApiModelProperty("报送状态") + //报送状态") private DeclareStatusEnum declareStatus; - @ApiModelProperty("报送状态") + //报送状态") private String declareStatusDesc; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index 5b73b2245..40fde19f7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -17,26 +17,26 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class FailEmployeeListDTO { - @ApiModelProperty("主键id") + //主键id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("姓名") + //姓名") private String employeeName; - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - @ApiModelProperty("个税扣缴义务人名称") + //个税扣缴义务人名称") private String taxAgentName; - @ApiModelProperty("证件号码") + //证件号码") private String cardNum; - @ApiModelProperty("失败原因") + //失败原因") private String errorMsg; - @ApiModelProperty("所得项目") + //所得项目") private String incomeCategory; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java index a261ad1b0..e3a737b0c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java @@ -19,15 +19,15 @@ public class TaxDeclarationRateDTO implements Serializable { private static final long serialVersionUID = 8478996890743085394L; - @ApiModelProperty("缓存索引") + //缓存索引") private String index; - @ApiModelProperty("提示信息") + //提示信息") private String msg; - @ApiModelProperty("状态") + //状态") private boolean status; - @ApiModelProperty("是否已经完成") + //是否已经完成") private boolean finish; - @ApiModelProperty("提示信息是否自动消失") + //提示信息是否自动消失") private boolean msgPersist; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java index f8604a3da..508b83537 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java @@ -18,13 +18,13 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class TaxDeclarationTabDTO { - @ApiModelProperty("Tab页签的名称") + //Tab页签的名称") private String tabName; - @ApiModelProperty("收入所得类型") + //收入所得类型") private IncomeCategoryEnum incomeCategory; - @ApiModelProperty("个税申报表id") + //个税申报表id") @JsonSerialize(using = ToStringSerializer.class) private Long taxDeclarationId; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java index e8db3265e..4d7b82a8e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -26,15 +26,15 @@ import java.util.Map; @ApiModel("个税申报记录表单") public class TaxDeclareRecordFormDTO { - @ApiModelProperty("薪资所属月") + //薪资所属月") private YearMonth salaryMonth; - @ApiModelProperty("个税扣缴义务人范围") + //个税扣缴义务人范围") private TaxAgentRangeEnum taxAgentRange; - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") private List> taxAgentIds; - @ApiModelProperty("备注") + //备注") private String description; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java index dd494dcdc..5b8762da2 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -22,47 +22,47 @@ public class TaxDeclareRecordListDTO { @JsonSerialize(using = ToStringSerializer.class) private Long id; - @ApiModelProperty("个税扣缴义务人") + //个税扣缴义务人") @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - @ApiModelProperty("个税扣缴义务人名称") + //个税扣缴义务人名称") private String taxAgentName; - @ApiModelProperty("薪资所属月") + //薪资所属月") private String salaryMonth; - @ApiModelProperty("税款所属期") + //税款所属期") private String taxCycle; - @ApiModelProperty("申报类型") + //申报类型") private TaxDeclareTypeEnum taxDeclareType; - @ApiModelProperty("申报类型") + //申报类型") private String taxDeclareTypeDesc; - @ApiModelProperty("申报状态") + //申报状态") private TaxDeclareStatusEnum taxDeclareStatus; - @ApiModelProperty("申报状态") + //申报状态") private String taxDeclareStatusDesc; - @ApiModelProperty("已缴金额") + //已缴金额") private String taxPaidAmount; - @ApiModelProperty("操作人id") + //操作人id") @JsonSerialize(using = ToStringSerializer.class) private Long operateEmployeeId; - @ApiModelProperty("操作人名称") + //操作人名称") private String operateEmployeeName; - @ApiModelProperty("操作时间") + //操作时间") private String operateTime; - @ApiModelProperty("备注") + //备注") private String description; - @ApiModelProperty("是否展示图标") + //是否展示图标") private boolean displayIcon; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java index 3e8a7743a..dc8682958 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -17,17 +17,17 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class AbnormalEmployeeListQueryParam extends BaseQueryParam { - @ApiModelProperty("工号、姓名、身份证号码") + //工号、姓名、身份证号码") private String keyword; - @ApiModelProperty("个税申报记录id") + //个税申报记录id") private Long taxDeclareRecordId; @JsonIgnore - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") private Long taxAgentId; @JsonIgnore - @ApiModelProperty("税款所属期") + //税款所属期") private String taxCycle; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java index 1eac68efa..939ca1fc4 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -17,15 +17,15 @@ import lombok.Data; @ApiModel("个税申报表记录列表查询参数") public class TaxDeclarationValueListQueryParam extends BaseQueryParam { - @ApiModelProperty("个税申报记录id") + //个税申报记录id") private Long taxDeclareRecordId; - @ApiModelProperty("个税申报表id") + //个税申报表id") private Long taxDeclarationId; - @ApiModelProperty("收入所得项目") + //收入所得项目") private IncomeCategoryEnum incomeCategory; - @ApiModelProperty("导出excel时加密的密码") + //导出excel时加密的密码") private String sharePassword; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index de2728047..24073b49a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -13,6 +13,6 @@ import lombok.Data; @Data public class TaxDeclareRecordParam { - @ApiModelProperty("个税申报记录id") + //个税申报记录id") private Long taxDeclareRecordId; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java index 53231ebf8..5f3c1ae81 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; -import java.time.LocalDateTime; +import java.util.Date; /** * 个税申报相关api配置 @@ -61,7 +61,7 @@ public class TaxDeclarationApiConfigPO implements Serializable { /** * 流量最后更新时间 */ - private LocalDateTime lastUpdateTime; + private Date lastUpdateTime; /** * 租户key @@ -81,10 +81,10 @@ public class TaxDeclarationApiConfigPO implements Serializable { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java index d65bacb06..d726a2ca6 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java @@ -8,7 +8,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; -import java.time.LocalDateTime; +import java.util.Date; /** * 个税申报相关api配置 @@ -56,10 +56,10 @@ public class TaxDeclarationApiProfilePO implements Serializable { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index 39fc3f89c..c39e85173 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -4,7 +4,7 @@ import lombok.Data; import lombok.experimental.Accessors; import java.io.Serializable; -import java.time.LocalDateTime; +import java.util.Date; import java.util.Map; /** @@ -71,10 +71,10 @@ public class TaxDeclarationValuePO implements Serializable { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java index b692fc532..60cb134ec 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java @@ -13,9 +13,9 @@ import lombok.Data; @Data public class TaxDeclareEmployeePO { - @ApiModelProperty("人员id") + //人员id") private Long employeeId; - @ApiModelProperty("人员类型") + //人员类型") private Integer employeeType; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 59ba8eb32..5a708da50 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -4,7 +4,7 @@ import lombok.Data; import lombok.experimental.Accessors; import java.io.Serializable; -import java.time.LocalDateTime; +import java.util.Date; /** * @description: 个税申报 @@ -102,10 +102,10 @@ public class TaxDeclareRecordPO implements Serializable { * 创建时间 */ //创建时间", ignore = true) - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ //更新时间", ignore = true) - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index 43598e736..9d0d07871 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -2,7 +2,7 @@ package com.engine.salary.entity.taxdeclaration.po; import lombok.Data; -import java.time.LocalDateTime; +import java.util.Date; /** * @description: 个税申报表表头 @@ -39,7 +39,7 @@ public class TaxReportColumnPO { //name = "是否删除", ignore = true) private Integer deleteType; //name = "创建时间", ignore = true) - private LocalDateTime createTime; + private Date createTime; //name = "更新时间", ignore = true) - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java index b00a2d9d6..71e9cfd82 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java @@ -16,9 +16,9 @@ import java.util.Map; @Data public class CancelDeclareFeedbackResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口状态") + //接口状态") private Map body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java index 75956a672..743c44d59 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java @@ -15,9 +15,9 @@ import lombok.Data; @Data public class CancelDeclareResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口数据") + //接口数据") private AsyncRequestIdDTO body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java index de5292d7a..01f3ce6cf 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java @@ -16,9 +16,9 @@ import java.util.Map; @Data public class DeclareTaxFeedbackResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口状态") + //接口状态") private Map body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java index fd68013db..cb688af2a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java @@ -15,9 +15,9 @@ import lombok.Data; @Data public class DeclareTaxResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口数据") + //接口数据") private AsyncRequestIdDTO body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java index 6d37b2695..a1f58e76f 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -16,6 +16,6 @@ import lombok.Data; @ApiModel("更正申报的返回数据") public class UpdateDeclareResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java index d2cece365..59b4903ca 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java @@ -21,9 +21,9 @@ import lombok.NoArgsConstructor; public class TaxAgreementBankFormDTO { - @ApiModelProperty("开户行") + //开户行") private String bank; - @ApiModelProperty("开户账号") + //开户账号") private String bankNo; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java index f7ac03735..04bde84da 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java @@ -22,12 +22,12 @@ import lombok.experimental.Accessors; @AllArgsConstructor @ApiModel("获取三方查询反馈结果") public class TaxAgreementFeedbackResultDTO extends TaxFeedbackResultDTO { - @ApiModelProperty("实缴金额") + //实缴金额") private String payAmount; - @ApiModelProperty("滞纳金等金额") + //滞纳金等金额") private String otherAmount; - @ApiModelProperty("申报人数") + //申报人数") private String personNum; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java index b0fc09ca7..f7a268d4d 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -31,7 +31,7 @@ // @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) // } // ) -// @ApiModelProperty("个税扣缴义务人") +// //个税扣缴义务人") // private String taxAgent; // // @SalaryForm( @@ -42,7 +42,7 @@ // @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) // } // ) -// @ApiModelProperty("应缴金额") +// //应缴金额") // private String amount; // // @SalaryForm( @@ -53,6 +53,6 @@ // @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) // } // ) -// @ApiModelProperty("申报人数") +// //申报人数") // private String personNum; //} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java index 845e888a9..4ea43c7f4 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java @@ -20,15 +20,15 @@ import lombok.experimental.Accessors; @AllArgsConstructor @ApiModel("获取反馈结果") public class TaxFeedbackResultDTO { - @ApiModelProperty("请求id") + //请求id") private String requestId; - @ApiModelProperty("提示语") + //提示语") private String msg; - @ApiModelProperty("处理结果") + //处理结果") private String result; - @ApiModelProperty("是否结束轮询") + //是否结束轮询") private Boolean finish; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java index 628200104..6a5582e4e 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java @@ -20,7 +20,7 @@ import lombok.NoArgsConstructor; @ApiModel("查询缴费信息") public class TaxPayTypeFormDTO { - @ApiModelProperty("缴款方式") + //缴款方式") private String type; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java index fb6cdf770..66718e6e3 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java @@ -24,16 +24,16 @@ import java.util.List; @AllArgsConstructor @ApiModel("获取完税证明") public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO { - @ApiModelProperty("完税证明") + //完税证明") private List vouchers; @Data @AllArgsConstructor public static class Voucher { - @ApiModelProperty("名称") + //名称") private String name; - @ApiModelProperty("内容") + //内容") private String content; } } diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index dd3f86edb..ac2787246 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -20,27 +20,27 @@ import java.time.YearMonth; @ApiModel("查询企业三方信息") public class TaxPaymentQueryParam { - @ApiModelProperty("个税扣缴义务人id") + //个税扣缴义务人id") private Long taxAgentId; - @ApiModelProperty("税款所属期") + //税款所属期") private YearMonth taxYearMonth; - @ApiModelProperty("个税申报记录id") + //个税申报记录id") private Long taxDeclareRecordId; /** * TaxPaymentServiceTypeEnum */ - @ApiModelProperty("业务类型") + //业务类型") private Integer type; - @ApiModelProperty("三方协议号") + //三方协议号") private String protocolNumber; - @ApiModelProperty("应缴税额") + //应缴税额") private String taxAmount; - @ApiModelProperty("是否为反馈校验 0否 1是") + //是否为反馈校验 0否 1是") private Integer checkFeedback; } diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 614c5ee70..3ad3e8367 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; import java.io.Serializable; import java.time.LocalDate; -import java.time.LocalDateTime; +import java.util.Date; /** * 个税辅助缴款-三方缴款请求 @@ -93,11 +93,11 @@ public class TaxPaymentRequestPO implements Serializable { * 创建时间 */ //创建时间", ignore = true) - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ //更新时间", ignore = true) - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/service/EmployeeDeclareRecordService.java b/src/com/engine/salary/service/EmployeeDeclareRecordService.java new file mode 100644 index 000000000..9377c324f --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareRecordService.java @@ -0,0 +1,21 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; + +import java.time.YearMonth; + +/** + * @description: 员工报送记录 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/11/6 16:54 + * @version:v1.0 + */ +public interface EmployeeDeclareRecordService { + + EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId); + + void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId); + + void save(EmployeeDeclareRecordPO employeeDeclareRecord); +} diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index cc5590731..097e6ae3e 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -3,6 +3,7 @@ package com.engine.salary.service; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; 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.util.page.PageInfo; @@ -111,10 +112,8 @@ public interface EmployeeDeclareService{ * 保存 * * @param saveParam - * @param employeeId - * @param tenantKey */ -// void save(EmployeeDeclareSaveParam saveParam, Long employeeId); + void save(EmployeeDeclareSaveParam saveParam); /** * 批量编辑 @@ -168,15 +167,13 @@ public interface EmployeeDeclareService{ * 报送人员 * * @param param - * @param tenantKey */ -// void declare(EmployeeDeclareParam param, Long employeeId); + void declare(EmployeeDeclareParam param); /** * 获取报送人员的反馈 * * @param param - * @param tenantKey */ -// void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId); + void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate); } diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java index dec7a27be..3917b494e 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -1,12 +1,6 @@ package com.engine.salary.service; -import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; -import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; -import com.engine.salary.util.page.PageInfo; - -import java.util.List; -import java.util.Map; /** * 个税申报计费service @@ -23,21 +17,21 @@ public interface TaxDeclarationApiBillingService { */ void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); - /** - * 获取流量使用记录(分页) - * - * @param queryParam - * @return - */ - PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); - - /** - * 获取流量使用记录(不分页) - * - * @param queryParam - * @return - */ - List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); +// /** +// * 获取流量使用记录(分页) +// * +// * @param queryParam +// * @return +// */ +// PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); +// +// /** +// * 获取流量使用记录(不分页) +// * +// * @param queryParam +// * @return +// */ +// List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); /** * 导出流量使用记录 @@ -45,6 +39,6 @@ public interface TaxDeclarationApiBillingService { * @param queryParam * @param map */ - void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map); +// void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map); } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java new file mode 100644 index 000000000..9fdb54b90 --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java @@ -0,0 +1,46 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; +import com.engine.salary.service.EmployeeDeclareRecordService; + +import java.time.YearMonth; + +/** + * @description: 员工报送记录 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/11/6 16:55 + * @version:v1.0 + */ +public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService { + + @Override + public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) { +// return new LambdaQueryChainWrapper<>(baseMapper) +// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey) +// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString()) +// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId) +// .one(); + return null; + } + + @Override + public void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) { +// new LambdaUpdateChainWrapper<>(baseMapper) +// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey) +// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString()) +// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId) +// .set(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) +// .set(EmployeeDeclareRecordPO::getUpdateTime, LocalDateTime.now()) +// .update(); + } + + @Override + public void save(EmployeeDeclareRecordPO employeeDeclareRecord) { + + + } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 0b0f6ca78..3114d8ca7 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -1,42 +1,57 @@ package com.engine.salary.service.impl; +import cn.hutool.core.map.MapUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh; -import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; -import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; -import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; -import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; +import com.engine.salary.entity.employeedeclare.dto.*; import com.engine.salary.entity.employeedeclare.param.*; 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.salaryarchive.dto.SalaryArchiveDataDTO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +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.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.SalaryCycleTypeEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; -import com.engine.salary.service.EmployeeDeclareService; -import com.engine.salary.service.SalaryArchiveService; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.service.*; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.SalaryCardUtil; import com.engine.salary.util.valid.ValidUtil; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; +import weaver.general.Util; import weaver.hrm.User; import java.time.YearMonth; @@ -70,6 +85,18 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private EmployeeDeclareRecordService getEmployeeDeclareRecordService(User user) { + return ServiceUtil.getService(EmployeeDeclareRecordServiceImpl.class, user); + } + @Override public EmployeeDeclarePO getById(Long id) { return getEmployeeDeclareMapper().getById(id); @@ -77,7 +104,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla @Override public List listByIds(Collection ids) { - if (CollectionUtils.isEmpty(ids)){ + if (CollectionUtils.isEmpty(ids)) { return Collections.emptyList(); } return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(ids).build()); @@ -150,45 +177,45 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla return page; } -// @Override -// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId) { -// LocalDateTime now = LocalDateTime.now(); -// EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() -// .setTaxAgentId(saveParam.getTaxAgentId()) -// .setTaxCycle(saveParam.getTaxCycle().toString()) -// .setEmployeeName(saveParam.getEmployeeName()) -// .setJobNum(saveParam.getJobNum()) -// .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) -// .setCardNum(saveParam.getCardNum()) -// .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()) -// .setBirthday(SalaryCardUtil.judgeBirthday(saveParam.getCardNum())) -// .setEmploymentStatus(saveParam.getEmploymentStatus().getValue()) -// .setMobile(saveParam.getMobile()) -// .setEmploymentType(saveParam.getEmploymentType().getValue()) -// .setEmploymentFirstYear("") -// .setEmploymentDate(saveParam.getEmploymentDate()) -// .setDismissDate(saveParam.getDismissDate()) -// .setDisability(saveParam.getDisability().getValue()) -// .setDisabilityCardNo(saveParam.getDisabilityCardNo()) -// .setLonelyOld(saveParam.getLonelyOld().getValue()) -// .setMartyrDependents(saveParam.getMartyrDependents().getValue()) -// .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo()) -// .setDeductExpenses(saveParam.getDeductExpenses().getValue()) -// .setSuccessfullyDeclared(0) -// .setNewEmployeeInfo(0) -// .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) -// .setDeclareErrorMsg(""); -// if (Objects.isNull(saveParam.getId())) { -// employeeDeclare.setId(IdGenerator.generate()) -// .setEmployeeId(saveParam.getEmployeeId()) -// .setEmployeeType(saveParam.getEmployeeType().getValue()) -// .setTenantKey(tenantKey) -// .setCreator(employeeId) -// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .setCreateTime(now) -// .setUpdateTime(now); -// save(employeeDeclare); -// // 记录日志 + @Override + public void save(EmployeeDeclareSaveParam saveParam) { + Date now = new Date(); + EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() + .setTaxAgentId(saveParam.getTaxAgentId()) + .setTaxCycle(saveParam.getTaxCycle().toString()) + .setEmployeeName(saveParam.getEmployeeName()) + .setJobNum(saveParam.getJobNum()) + .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) + .setCardNum(saveParam.getCardNum()) + .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()) + .setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))) + .setEmploymentStatus(saveParam.getEmploymentStatus().getValue()) + .setMobile(saveParam.getMobile()) + .setEmploymentType(saveParam.getEmploymentType().getValue()) + .setEmploymentFirstYear("") + .setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate())) + .setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate())) + .setDisability(saveParam.getDisability().getValue()) + .setDisabilityCardNo(saveParam.getDisabilityCardNo()) + .setLonelyOld(saveParam.getLonelyOld().getValue()) + .setMartyrDependents(saveParam.getMartyrDependents().getValue()) + .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo()) + .setDeductExpenses(saveParam.getDeductExpenses().getValue()) + .setSuccessfullyDeclared(0) + .setNewEmployeeInfo(0) + .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .setDeclareErrorMsg(""); + if (Objects.isNull(saveParam.getId())) { + employeeDeclare.setId(IdGenerator.generate()) + .setEmployeeId(saveParam.getEmployeeId()) + .setEmployeeType(saveParam.getEmployeeType().getValue()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) user.getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + getEmployeeDeclareMapper().insertIgnoreNull(employeeDeclare); + // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); // loggerContext.setTargetName(employeeDeclare.getEmployeeName()); @@ -197,27 +224,27 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName()); // loggerContext.setNewValues(employeeDeclare); // employeeDeclareLoggerTemplate.write(loggerContext); -// } else { -// EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId(), tenantKey); -// if (Objects.isNull(originEmployeeDeclare)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除")); -// } -// if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1) -// && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName()) -// && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅")); -// } -// employeeDeclare.setId(originEmployeeDeclare.getId()) -// .setEmployeeId(originEmployeeDeclare.getEmployeeId()) -// .setEmployeeType(originEmployeeDeclare.getEmployeeType()) -// .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()) -// .setUpdateTime(now); -// // 判断本次编辑是否有修改人员信息 -// if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { -// employeeDeclare.setNewEmployeeInfo(1); -// } -// updateById(employeeDeclare); -// // 记录日志 + } else { + EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId()); + if (Objects.isNull(originEmployeeDeclare)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除")); + } + if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1) + && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName()) + && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅")); + } + employeeDeclare.setId(originEmployeeDeclare.getId()) + .setEmployeeId(originEmployeeDeclare.getEmployeeId()) + .setEmployeeType(originEmployeeDeclare.getEmployeeType()) + .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()) + .setUpdateTime(now); + // 判断本次编辑是否有修改人员信息 + if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { + employeeDeclare.setNewEmployeeInfo(1); + } + getEmployeeDeclareMapper().updateIgnoreNull(employeeDeclare); + // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); // loggerContext.setTargetName(employeeDeclare.getEmployeeName()); @@ -227,9 +254,9 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // loggerContext.setOldValues(originEmployeeDeclare); // loggerContext.setNewValues(employeeDeclare); // employeeDeclareLoggerTemplate.write(loggerContext); -// } -// } -// + } + } + // @Override // public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId) { // // 查询报送人员 @@ -376,7 +403,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla dtoList.forEach(po -> { boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(po.getEmployeeType().getValue()) == 0; DataCollectionEmployee employee = employeeInfoMap.get(po.getEmployeeId() + "-" + isExtEmp); - if(ObjectUtils.isNotEmpty(employee)){ + if (ObjectUtils.isNotEmpty(employee)) { po.setSubCompanyName(Optional.ofNullable(employee.getSubcompanyName()).orElse("")); po.setDepartmentName(Optional.ofNullable(employee.getDepartmentName()).orElse("")); } @@ -401,7 +428,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 查询本月已有的需要报送的人员 List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); // 查询上月已有的需要报送的人员(只需要正常的) - List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1,ChronoUnit.MONTHS), refreshParam.getTaxAgentId()) + List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), refreshParam.getTaxAgentId()) .stream() .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) @@ -432,7 +459,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla List salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build()); // 本月增加了哪些人员 - Set orgEmployeeIds = ((List)CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares)) + Set orgEmployeeIds = ((List) CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares)) .stream() .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) .map(EmployeeDeclarePO::getEmployeeId) @@ -446,12 +473,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // List newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey); // List newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds)); // 查询本月增加了哪些非系统人员 -// List extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId(), tenantKey); +// List extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId()); // Set extEmployeeIds = employeeDeclares.stream() // .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) // .map(EmployeeDeclarePO::getEmployeeId) // .collect(Collectors.toSet()); -// List newExtEmployees = extEmployees.stream() +// List newExtEmployees = extEmployees.stream() // .filter(e -> !extEmployeeIds.contains(e.getId())) // .collect(Collectors.toList()); @@ -462,8 +489,8 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla .setEmployeeDeclares(employeeDeclares) .setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares) .setSalaryArchives(salaryArchivePOS) - .setEmployeeInfos(employeeInfos); -// .setHrmEmployeeComInfos(newHrmEmployeeComInfos) +// .setEmployeeInfos(employeeInfos) + .setHrmEmployeeComInfos(employeeInfos); // .setSimpleUserInfos(newSimpleUserInfos) // .setExtEmployees(newExtEmployees) EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId); @@ -478,11 +505,11 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString())); // loggerContext.setOperator(Util.null2String(employeeId)); // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); // employeeDeclareLoggerTemplate.write(loggerContext); } @@ -505,171 +532,168 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla .setDeclareSuccessSize(declareSuccessSize); } -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void declare(EmployeeDeclareParam param, Long employeeId) { -// // 获取api配置信息 -// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); -// // 查询个税扣缴义务人 -// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey); -// // 查询个税扣缴义务人关联的企业信息 -// TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(param.getTaxAgentId(), tenantKey); -// if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); -// } -// // 查询需要报送的人员 -// List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); -// if (CollectionUtils.isEmpty(employeeDeclares)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156470, "当前报送人员列表暂无数据")); -// } -// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); -// if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156471, "报送中,稍后请点击【获取报送结果】更新报送状态")); -// } -// // 人员列表 -// List> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); -// // 企业信息 -// Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); -// // 税款所属期 -// requestParam.put("skssq", param.getTaxCycle().toString().replace("-", "")); -// // 人员列表 -// requestParam.put("rylb", employeeInfoMapList); -// -// String reqJson = JsonUtil.toJsonString(requestParam); -// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO; -// Map params = new HashMap<>(1); -// Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); -// String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); -// DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class); -// if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) { -// log.error("服务异常:" + res); -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); -// } -// if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { -// throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg()); -// } -// // 删除原来的人员报送记录 -// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); -// // 保存新的人员报送记录 -// LocalDateTime now = LocalDateTime.now(); -// AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody(); -// employeeDeclareRecord = new EmployeeDeclareRecordPO() -// .setId(IdGenerator.generate()) -// .setTaxAgentId(param.getTaxAgentId()) -// .setTaxCycle(param.getTaxCycle().toString()) -// .setRequestId(asyncRequestIdDTO.getRequestId()) -// .setTenantKey(tenantKey) -// .setCreator(employeeId) -// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .setCreateTime(now) -// .setUpdateTime(now); -// employeeDeclareRecordService.save(employeeDeclareRecord); -// // 记录日志 + @Override + public void declare(EmployeeDeclareParam param) { + // 获取api配置信息 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId()); + // 查询个税扣缴义务人关联的企业信息 + TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(param.getTaxAgentId()); + if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); + } + // 查询需要报送的人员 + List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156470, "当前报送人员列表暂无数据")); + } + EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156471, "报送中,稍后请点击【获取报送结果】更新报送状态")); + } + // 人员列表 + List> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); + // 企业信息 + Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); + // 税款所属期 + requestParam.put("skssq", param.getTaxCycle().toString().replace("-", "")); + // 人员列表 + requestParam.put("rylb", employeeInfoMapList); + + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class); + if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) { + log.error("服务异常:" + res); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); + } + if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg()); + } + // 删除原来的人员报送记录 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + // 保存新的人员报送记录 + Date now =new Date(); + AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody(); + employeeDeclareRecord = new EmployeeDeclareRecordPO() + .setId(IdGenerator.generate()) + .setTaxAgentId(param.getTaxAgentId()) + .setTaxCycle(param.getTaxCycle().toString()) + .setRequestId(asyncRequestIdDTO.getRequestId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long)user.getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + getEmployeeDeclareRecordService(user).save(employeeDeclareRecord); + // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); // loggerContext.setOperator(Util.null2String(employeeId)); // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送")); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156450, "全部报送")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156450, "全部报送")); // employeeDeclareLoggerTemplate.write(loggerContext); -// } -// -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId) { -// // 获取api配置信息 -// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); -// // 查询个税扣缴义务人 -// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey); -// // 查询人员报送记录 -// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); -// if (Objects.isNull(employeeDeclareRecord)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果")); -// } -// if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果")); -// } -// -// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK; -// Map requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); -// Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); -// String res = HttpUtil.getRequest(url, header, requestParam); -// DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class); -// if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) { -// log.error("服务异常:" + res); -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156449, "服务异常")); -// } -// if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { -// throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg()); -// } -// DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody(); -// Map> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "") -// + "-" + e.getOrDefault("zzlx", "") -// + "-" + e.getOrDefault("zzhm", "")); -// // 流量使用情况 -// TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = -// new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(tenantKey -// , employeeId, param.getTaxCycle().atDay(1) -// , apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); -// // 查询申报的人员列表 -// LocalDateTime now = LocalDateTime.now(); -// List needUpdateEmployeeDeclares = Lists.newArrayList(); -// List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); -// String key = employeeDeclare.getEmployeeName() -// + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel()) -// + "-" + employeeDeclare.getCardNum(); -// Map employeeInfoMap = employeeFeedbackMap.get(key); -// if (MapUtil.isEmpty(employeeInfoMap)) { -// continue; -// } -// // 报送状态 -// employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue())); -// // 失败原因 -// employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy"))); -// // 验证状态、银行卡验证状态 -// // 是否报送成功了 -// if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) { -// employeeDeclare.setSuccessfullyDeclared(1); -// } -// employeeDeclare.setUpdateTime(now); -// needUpdateEmployeeDeclares.add(employeeDeclare); -// -// // 流量使用记录 -// TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId()); -// flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue()); -// apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); -// } -// // 更新员工的报送状态 -// if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { + } + + @Override + public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate) { + // 获取api配置信息 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId()); + // 查询人员报送记录 + EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + if (Objects.isNull(employeeDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "请先报送后再获取报送结果")); + } + if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "请先报送后再获取报送结果")); + } + + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK; + ImmutableMap requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, requestParam); + DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class); + if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) { + log.error("服务异常:" + res); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); + } + if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg()); + } + DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody(); + Map> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "") + + "-" + e.getOrDefault("zzlx", "") + + "-" + e.getOrDefault("zzhm", "")); + // 流量使用情况 + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper( SalaryDateUtil.localDateToDate(param.getTaxCycle().atDay(1)), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); + // 查询申报的人员列表 + Date now = new Date(); + List needUpdateEmployeeDeclares = Lists.newArrayList(); + List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + String key = employeeDeclare.getEmployeeName() + + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel()) + + "-" + employeeDeclare.getCardNum(); + Map employeeInfoMap = employeeFeedbackMap.get(key); + if (MapUtil.isEmpty(employeeInfoMap)) { + continue; + } + // 报送状态 + employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue())); + // 失败原因 + employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy"))); + // 验证状态、银行卡验证状态 + // 是否报送成功了 + if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) { + employeeDeclare.setSuccessfullyDeclared(1); + } + employeeDeclare.setUpdateTime(now); + needUpdateEmployeeDeclares.add(employeeDeclare); + + // 流量使用记录 + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId()); + flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + } + // 更新员工的报送状态 + if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { + //todo // updateBatchById(needUpdateEmployeeDeclares); -// } -// // 删除原来的人员报送记录 -// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); -// // 记录日志 + } + // 删除原来的人员报送记录 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); // loggerContext.setOperator(Util.null2String(employeeId)); // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈")); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈")); // employeeDeclareLoggerTemplate.write(loggerContext); -// // 更新流量统计 + // 更新流量统计 + //todo // taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper); -// // 报送失败的 -// int declareFailSize = (int) needUpdateEmployeeDeclares.stream() -// .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())) -// .count(); -// employeeDeclareRate.setFinish(true); -// if (declareFailSize > 0) { -// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156472, "报送成功{0}条,报送失败{1}条") -// .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize)) -// .replace("{1}", Util.null2String(declareFailSize))); -// } else { -// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size()))); -// } -// } + // 报送失败的 + int declareFailSize = (int) needUpdateEmployeeDeclares.stream() + .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())) + .count(); + employeeDeclareRate.setFinish(true); + if (declareFailSize > 0) { + employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(156472, "报送成功{0}条,报送失败{1}条") + .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize)) + .replace("{1}", Util.null2String(declareFailSize))); + } else { + employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size()))); + } + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index da8de675c..41c63a25f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -1,51 +1,47 @@ package com.engine.salary.service.impl; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; -import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; -import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; -import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationApiBillingService; import com.engine.salary.service.TaxDeclarationApiFlowWarnService; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.page.PageInfo; import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; -import java.time.LocalDate; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * @author chengliming * @date 2022-11-11 2:57 PM **/ @Slf4j -public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBillingService { +public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService { private TaxDeclarationApiFlowRecordMapper taxDeclarationApiFlowRecordMapper; - - private TaxAgentService taxAgentService; - - private SalaryEmployeeService salaryEmployeeService; - + + public TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + public SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } // private SalaryBatchService salaryBatchService; private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService; - + // private ComInfoCache comInfoCache; // private ExtEmployeeService extEmployeeService; @@ -65,112 +61,106 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil } } - @Override - public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { - LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); - Page flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); - List records = flowRecordPOPage.getRecords(); - if (records.isEmpty()) { - return new PageInfo<>(); - } - TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); - // 转换数据 - AtomicInteger indexNum = new AtomicInteger(1); - List listDTOS = records.stream().map(e -> - TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) - ).collect(Collectors.toList()); - return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS); - } +// @Override +// public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { +// LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); +// Page flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); +// List records = flowRecordPOPage.getRecords(); +// if (records.isEmpty()) { +// return new PageInfo<>(); +// } +// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); +// // 转换数据 +// AtomicInteger indexNum = new AtomicInteger(1); +// List listDTOS = records.stream().map(e -> +// TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) +// ).collect(Collectors.toList()); +// return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS); +// } +// +// @Override +// public List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { +// LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); +// List list = queryChainWrapper.list(); +// if (list.isEmpty()) { +// return new ArrayList<>(); +// } +// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); +// // 转换数据 +// AtomicInteger indexNum = new AtomicInteger(1); +// return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); +// } +// +// private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list, String currentTenantKey) { +// Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); +// // 获取人员信息 +// List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); +// Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); +// Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); +// List extEmployeePOS = extEmployeeService.listAll(currentTenantKey); +// Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); +// // 获取个税扣缴义务人信息 +// List taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values())); +// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); +// return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); +// } +// +// private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { +// LambdaQueryChainWrapper chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper) +// .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(TaxDeclarationApiFlowRecordPO::getTenantKey) +// .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId()) +// .eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType()) +// .eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult()); +// if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) { +// chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate()) +// .le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate()); +// } +// return chainWrapper; +// } - @Override - public List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { - LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); - List list = queryChainWrapper.list(); - if (list.isEmpty()) { - return new ArrayList<>(); - } - TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); - // 转换数据 - AtomicInteger indexNum = new AtomicInteger(1); - return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); - } - - private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list, String currentTenantKey) { - Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); - // 获取人员信息 - List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); - Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); - Map empIdNoMap = salaryEmployeeService.mapByEmployeeIds(employeeTaxAgentMap.keySet()); - List extEmployeePOS = extEmployeeService.listAll(currentTenantKey); - Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); - // 获取个税扣缴义务人信息 - List taxAgentPOS = taxAgentService.listByIds(new HashSet<>(employeeTaxAgentMap.values())); - Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); - return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); - } - - private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { - LambdaQueryChainWrapper chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper) - .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(TaxDeclarationApiFlowRecordPO::getTenantKey) - .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId()) - .eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType()) - .eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult()); - if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) { - chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate()) - .le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate()); - } - return chainWrapper; - } - - @Override - public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map) { - ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); - // 表头 - List headers = exportWrapper.getHeaders(); - headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间")); - headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); - headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员")); - headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号")); - headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务")); - headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人")); - headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果")); - exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); - // 获取数据 - List dtoList = listFlowRecord(queryParam, employeeId, tenantKey); - // 组装数据 - for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { - List row = new ArrayList<>(); - row.add(dto.getCreateTime()); - row.add(dto.getTaxAgentName()); - row.add(dto.getEmployeeName()); - row.add(dto.getIdCardNo()); - row.add(dto.getBusinessTypeName()); - row.add(dto.getCreator()); - row.add(dto.getResult()); - exportWrapper.getRows().add(row); - } - // 生成表格 - buildExcelData(exportWrapper); - } - - /** - * 构建excel数据 - * - * @param wrapper - */ - private void buildExcelData(ExportWrapper wrapper) { - wrapper.getExcelSheetData().setRows(wrapper.getRows()); - wrapper.getSheetList().add(wrapper.getExcelSheetData()); - salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); - } - - @BatchExportHandler("exportFlowRecord") - public void exportFlowRecordHandler() { - BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); - log.info("接收到流量使用记录导出的结果:{}", JSONObject.toJSONString(message)); - } +// @Override +// public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map) { +// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); +// // 表头 +// List headers = exportWrapper.getHeaders(); +// headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间")); +// headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); +// headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员")); +// headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号")); +// headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务")); +// headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人")); +// headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果")); +// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); +// // 获取数据 +// List dtoList = listFlowRecord(queryParam, employeeId, tenantKey); +// // 组装数据 +// for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { +// List row = new ArrayList<>(); +// row.add(dto.getCreateTime()); +// row.add(dto.getTaxAgentName()); +// row.add(dto.getEmployeeName()); +// row.add(dto.getIdCardNo()); +// row.add(dto.getBusinessTypeName()); +// row.add(dto.getCreator()); +// row.add(dto.getResult()); +// exportWrapper.getRows().add(row); +// } +// // 生成表格 +// buildExcelData(exportWrapper); +// } +// /** +// * 构建excel数据 +// * +// * @param wrapper +// */ +// private void buildExcelData(ExportWrapper wrapper) { +// wrapper.getExcelSheetData().setRows(wrapper.getRows()); +// wrapper.getSheetList().add(wrapper.getExcelSheetData()); +// salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); +// } +// /** * 封装一些临时的集合类,便于方法复用 */ @@ -185,7 +175,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil // 获取个税扣缴义务人信息 private Map taxAgentNameMap; // 获取非系统人员 - private Map extEmployeeMap; + private Map extEmployeeMap; } @Data @@ -193,7 +183,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil private String tenantKey; private Long currentEmployeeId; // 税款所属期 - private LocalDate taxYearMonth; + private Date taxYearMonth; // api流量使用情况 private List apiFlowDetailPOList; // 当前租户的api接口配置 @@ -201,7 +191,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil // 接口类型 private EnumDeclareApiBusinessType businessType; - public ApiFlowUpdateWrapper(String tenantKey, Long currentEmployeeId, LocalDate taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { + public ApiFlowUpdateWrapper( Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { this.tenantKey = tenantKey; this.currentEmployeeId = currentEmployeeId; this.taxYearMonth = taxYearMonth; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java index f114d7330..e716e6daa 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -15,15 +15,11 @@ import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiProfileMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; /** * @author chengliming @@ -32,13 +28,16 @@ import java.util.Optional; @Slf4j public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService { - private TaxDeclareApiConfigMapper taxDeclareApiConfigMapper; - - private TaxDeclarationApiProfileMapper taxDeclarationApiProfileMapper; + private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() { + return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class); + } + private TaxDeclarationApiProfileMapper getTaxDeclarationApiProfileMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiProfileMapper.class); + } @Override public TaxDeclarationApiConfigPO getConfig(boolean needValid) { - TaxDeclarationApiConfigPO configPO = taxDeclareApiConfigMapper.getOne(); + TaxDeclarationApiConfigPO configPO = getTaxDeclareApiConfigMapper().getOne(); if (needValid) { String tips1 = SalaryI18nUtil.getI18nLabel(183786, "当前用户智能算薪尚未配置,请先前往[设置] -> [智能算薪]中配置"); String tips2 = SalaryI18nUtil.getI18nLabel(183787, "当前用户智能算薪尚未启用,请先前往[设置] -> [智能算薪]中启用该配置"); @@ -57,21 +56,21 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe @Override public void insert(TaxDeclarationApiConfigPO configPO) { - taxDeclareApiConfigMapper.insertIgnoreNull(configPO); + getTaxDeclareApiConfigMapper().insertIgnoreNull(configPO); } @Override public void update(TaxDeclarationApiConfigPO config) { - taxDeclareApiConfigMapper.updateIgnoreNull(config); + getTaxDeclareApiConfigMapper().updateIgnoreNull(config); } @Override - @Transactional(rollbackFor = Exception.class) public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { TaxDeclarationApiConfigPO config = this.getConfig(false); + Date now = new Date(); if (config != null) { config.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) - .setUpdateTime(LocalDateTime.now()); + .setUpdateTime(now); update(config); } else { config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); @@ -81,14 +80,13 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe } @Override - @Transactional(rollbackFor = Exception.class) public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) { TaxDeclarationApiConfigPO config = this.getConfig(false); if (config != null) { config.setAppKey(saveParam.getAppKey()) .setAppSecret(saveParam.getAppSecret()) .setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) - .setUpdateTime(LocalDateTime.now()); + .setUpdateTime(new Date()); update(config); } else { config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); @@ -109,7 +107,7 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe } private String getApiHost() { - List apiProfiles = taxDeclarationApiProfileMapper.listAll(); + List apiProfiles = getTaxDeclarationApiProfileMapper().listAll(); if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { return SzyhApiConstant.HOST_URL; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 12ea4afa5..75fc36ec4 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -2,30 +2,30 @@ // //import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; //import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +//import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO; +//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; //import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; //import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowWarnConfigMapper; //import com.engine.salary.service.SalaryEmployeeService; //import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +//import com.engine.salary.util.SalaryEntityUtil; //import com.weaver.common.base.entity.result.WeaResult; //import com.weaver.common.distribution.genid.IdGenerator; //import com.weaver.framework.spring.annotation.AopClass; //import com.weaver.hrm.salary.common.OptionDTO; //import com.weaver.hrm.salary.dao.TaxDeclarationApiFlowWarnReceiverMapper; -//import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentEmployeePO; //import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; //import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; -//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; //import com.weaver.hrm.salary.entity.taxapiflow.param.CreateMessageRuleParam; //import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; //import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; -//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; //import com.weaver.hrm.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; //import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; //import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; //import com.weaver.hrm.salary.service.TaxAgentService; //import com.weaver.hrm.salary.service.TaxDeclarationApiFlowStatisticService; //import com.weaver.hrm.salary.util.SalaryAssert; -//import com.weaver.hrm.salary.util.SalaryEntityUtil; //import com.weaver.hrm.salary.util.SalaryI18nUtil; //import com.weaver.mc.api.async.AsyncSystemMessageRest; //import com.weaver.mc.api.entity.*; diff --git a/src/com/engine/salary/util/SalaryEntityUtil.java b/src/com/engine/salary/util/SalaryEntityUtil.java index 3cc5fe7dd..6368dab61 100644 --- a/src/com/engine/salary/util/SalaryEntityUtil.java +++ b/src/com/engine/salary/util/SalaryEntityUtil.java @@ -358,4 +358,51 @@ public class SalaryEntityUtil { } + + public static String null2String(Object obj) { + if (Objects.isNull(obj)) { + return ""; + } + return obj.toString(); + } + + public static String null2String(Object obj, String def) { + if (Objects.isNull(obj)) { + return def; + } + return obj.toString(); + } + + public static Integer getIntValue(Object obj, Integer def) { + if (Objects.isNull(obj)) { + return def; + } + try { + return StringUtils.isEmpty(String.valueOf(obj)) ? def : Integer.valueOf(String.valueOf(obj)); + } catch (NumberFormatException e) { + return def; + } + } + + public static BigDecimal getBigDecimal(Object value, int scale) { + String valueStr = null2String(value); + if (StringUtils.isEmpty(valueStr)) { + return BigDecimal.ZERO; + } + try { + return new BigDecimal(valueStr).setScale(scale, RoundingMode.HALF_UP); + } catch (NumberFormatException e) { + return null; + } + } + + public static BigDecimal getBigDecimal(Object value, int scale, BigDecimal defValue) { + try { + return new BigDecimal(null2String(value)).setScale(scale, RoundingMode.HALF_UP); + } catch (NumberFormatException e) { + return defValue; + } + } + + } diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 6fac3b188..aaaf3cae2 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -10,7 +10,6 @@ import com.engine.salary.util.ResponseResult; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.EmployeeDeclareWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; -import oracle.jdbc.proxy.annotation.Post; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -35,8 +34,6 @@ public class EmployeeDeclareController { return ServiceUtil.getService(EmployeeDeclareWrapper.class, user); } -// private SalaryBatchService salaryBatchService; - /** * 人员报送-个税扣缴义务人列表 * @@ -71,7 +68,7 @@ public class EmployeeDeclareController { * @param queryParam 查询条件 * @return */ - @Post + @POST @Path("/list4Add") @Produces(MediaType.APPLICATION_JSON) public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) { @@ -85,7 +82,7 @@ public class EmployeeDeclareController { * @param queryParam 查询条件 * @return */ - @Post + @POST @Path("/list4Update") @Produces(MediaType.APPLICATION_JSON) public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { @@ -123,7 +120,7 @@ public class EmployeeDeclareController { // @GetMapping("/getBatchUpdateForm") // @ApiOperation("人员报送-获取批量编辑的表单") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult getBatchUpdateForm() { // WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm(); // return WeaResult.success(weaForm); @@ -131,35 +128,35 @@ public class EmployeeDeclareController { // // @GetMapping("/getSearchCondition") // @ApiOperation("人员报送-获取高级搜索条件") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult getSearchCondition() { // WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition(); // return WeaResult.success(searchCondition); // } -// -// /** -// * 人员报送-新增人员/编辑人员保存 -// * -// * @param saveParam 保存参数 -// * @return -// */ -// @PostMapping("/save") -// @ApiOperation("人员报送-新增人员/编辑人员保存") -// @WeaPermission -// public WeaResult save(@RequestBody @Validated EmployeeDeclareSaveParam saveParam) { -// employeeDeclareWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); -// return WeaResult.success(null); -// } -// + + /** + * 人员报送-新增人员/编辑人员保存 + * + * @param saveParam 保存参数 + * @return + */ + @POST + @Path("/save") + @Produces(MediaType.APPLICATION_JSON) + public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::save, saveParam); + } + // /** // * 人员报送-批量编辑 // * // * @param batchUpdateParam 批量编辑参数 // * @return // */ -// @PostMapping("/batchUpdate") +// @Path("/batchUpdate") // @ApiOperation("人员报送-批量编辑") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) { // employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); @@ -185,7 +182,7 @@ public class EmployeeDeclareController { * @param refreshParam 刷新数据的参数 * @return */ - @Post + @POST @Path("/refresh") @Produces(MediaType.APPLICATION_JSON) public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { @@ -207,34 +204,34 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam); } -// /** -// * 人员报送-全部报送 -// * -// * @param employeeDeclareParam 在线报送 -// * @return -// */ -// @PostMapping("/declare") -// @ApiOperation("人员报送-全部报送") -// @WeaPermission -// public WeaResult declare(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) { -// String rateIndex = employeeDeclareWrapper.declare(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); -// return WeaResult.success(rateIndex); -// } -// -// /** -// * 人员报送-获取报送结果反馈 -// * -// * @param employeeDeclareParam 获取反馈 -// * @return -// */ -// @PostMapping("/getDeclareFeedback") -// @ApiOperation("人员报送-获取报送结果反馈") -// @WeaPermission -// public WeaResult getDeclareFeedback(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) { -// String rateIndex = employeeDeclareWrapper.getDeclareFeedback(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); -// return WeaResult.success(rateIndex); -// } -// + /** + * 人员报送-全部报送 + * + * @param employeeDeclareParam 在线报送 + * @return + */ + @POST + @Path("/declare") + @Produces(MediaType.APPLICATION_JSON) + public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam); + } + + /** + * 人员报送-获取报送结果反馈 + * + * @param employeeDeclareParam 获取反馈 + * @return + */ + @POST + @Path("/getDeclareFeedback") + @Produces(MediaType.APPLICATION_JSON) + public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); + } + // /** // * 人员报送-后端业务逻辑是否已经完成 // * @@ -243,7 +240,7 @@ public class EmployeeDeclareController { // */ // @GetMapping("/getRate") // @ApiOperation("人员报送-后端业务逻辑是否已经完成") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult getRate(@RequestParam(value = "index") String index) { // EmployeeDeclareRateDTO rate = employeeDeclareWrapper.getRate(index, TenantContext.getCurrentTenantKey()); // return WeaResult.success(rate); @@ -255,9 +252,9 @@ public class EmployeeDeclareController { // * @param queryParam 导出参数 // * @return // */ -// @PostMapping("/export") +// @Path("/export") // @ApiOperation("人员报送-导出全部人员") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { // Map exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser()); // return WeaResult.success(exportMap); @@ -269,9 +266,9 @@ public class EmployeeDeclareController { // * @param queryParam 导出参数 // * @return // */ -// @PostMapping("/export4Add") +// @Path("/export4Add") // @ApiOperation("人员报送-导出本月新增人员") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) { // Map exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser()); // return WeaResult.success(exportMap); @@ -283,9 +280,9 @@ public class EmployeeDeclareController { // * @param queryParam 导出参数 // * @return // */ -// @PostMapping("/export4Update") +// @Path("/export4Update") // @ApiOperation("人员报送-导出本月信息变动人员") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { // Map exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser()); // return WeaResult.success(exportMap); @@ -297,9 +294,9 @@ public class EmployeeDeclareController { // * @param queryParam 导出参数 // * @return // */ -// @PostMapping("/export4Fail") +// @Path("/export4Fail") // @ApiOperation("人员报送-导出本月报送失败的人员") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) { // Map exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser()); // return WeaResult.success(exportMap); @@ -307,7 +304,7 @@ public class EmployeeDeclareController { // // @GetMapping("/getImportParam") // @ApiOperation("人员报送-获取导入参数") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult getAcctResultImportParams() { // String tenantKey = TenantContext.getCurrentTenantKey(); // Long currentEmployeeId = UserContext.getCurrentEmployeeId(); @@ -324,9 +321,9 @@ public class EmployeeDeclareController { // * @param importParam 获取导入模板 // * @return // */ -// @PostMapping("/exportTemplate") +// @Path("/exportTemplate") // @ApiOperation("人员报送-导出导入模板") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) { // Map exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser()); // return WeaResult.success(exportMap); diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java new file mode 100644 index 000000000..0a6bf2a36 --- /dev/null +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java @@ -0,0 +1,119 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.TaxDeclarationApiFlowBillingWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 智能算薪-计费 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +public class TaxDeclarationApiFlowController { + + private TaxDeclarationApiFlowBillingWrapper getTaxDeclarationApiFlowBillingWrapper(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowBillingWrapper.class, user); + } + + /** + * 计费配置保存 + * + * @param saveParam 保存参数 + * @return WeaResult 返回结果 + */ + @POST + @Path("/billing/config/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::saveConfig, saveParam); + } + + /** + * 计费配置开关 + * + * @param saveParam 保存参数 + * @return WeaResult 返回结果 + */ + @POST + @Path("/billing/config/enable") + @Produces(MediaType.APPLICATION_JSON) + public String enableConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::enableConfig, saveParam); + } + + + /** + * 查询计费配置开关状态 + * + * @return WeaResult 返回结果 + */ + @GET + @Path("/billing/config/status") + @Produces(MediaType.APPLICATION_JSON) + public String getConfigStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfigStatus); + } + + /** + * 计费配置编辑表单 + * + * @return WeaResult 返回结果 + */ + @GET + @Path("/billing/config/get") + @Produces(MediaType.APPLICATION_JSON) + public String getConfig(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfig); + } + + /** + * 接口流量使用记录 + * + * @param queryParam 查询条件 + * @return WeaResult 返回结果 + */ + @POST + @Path("/record/list") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord, queryParam); + } +// +// /** +// * 导出接口流量使用记录 +// * +// * @param queryParam 查询条件 +// * @return WeaResult 返回结果 +// */ +// @POST +// @Path("/record/export") +// @Produces(MediaType.APPLICATION_JSON) +// public String exportFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord,queryParam); +// return WeaResult.success(getTaxDeclarationApiFlowBillingWrapper.exportFlowRecord(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); +// } +} diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 608ba0892..15438a9bf 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -15,10 +15,13 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.SalaryCacheService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.impl.EmployeeDeclareServiceImpl; +import com.engine.salary.service.impl.SalaryCacheServiceImpl; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; import com.engine.salary.util.SalaryDateUtil; @@ -63,6 +66,10 @@ public class EmployeeDeclareWrapper extends Service { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalaryCacheService getSalaryCacheService(User user) { + return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); + } + /** * 人员报送的个税扣缴义务人列表 @@ -182,7 +189,7 @@ public class EmployeeDeclareWrapper extends Service { queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), queryParam.getTaxAgentId(), employeeIds); // 获取修改了哪些字段 Map> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares); - for (EmployeeDeclareListDTO employeeDeclareListDTO : (List)dtoPageInfo.getList()) { + for (EmployeeDeclareListDTO employeeDeclareListDTO : (List) dtoPageInfo.getList()) { Set updatedDataIndexSet = updatedFieldMap.get(employeeDeclareListDTO); employeeDeclareListDTO.setUpdatedDataIndexSet(updatedDataIndexSet); } @@ -378,19 +385,17 @@ public class EmployeeDeclareWrapper extends Service { // }); // return searchCondition; // } -// -// /** -// * 人员报送-新增人员/编辑人员保存 -// * -// * @param saveParam -// * @param employeeId -// * @param tenantKey -// */ -// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId, String tenantKey) { -// employeeDeclareService.save(saveParam, employeeId, tenantKey); -// } -// -// + + /** + * 人员报送-新增人员/编辑人员保存 + * + * @param saveParam + */ + public void save(EmployeeDeclareSaveParam saveParam) { + getEmployeeDeclareService(user).save(saveParam); + } + + // /** // * 批量编辑 // * @@ -399,7 +404,7 @@ public class EmployeeDeclareWrapper extends Service { // * @param tenantKey // */ // public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId, String tenantKey) { -// employeeDeclareService.batchUpdate(batchUpdateParam, employeeId, tenantKey); +// getEmployeeDeclareService(user).batchUpdate(batchUpdateParam, employeeId, tenantKey); // } /** @@ -452,79 +457,76 @@ public class EmployeeDeclareWrapper extends Service { return getEmployeeDeclareService(user).getDeclareInfo(employeeDeclareParam); } -// /** -// * 人员报送-全部报送 -// * -// * @param param -// * @param employeeId -// * @param tenantKey -// */ -// public String declare(EmployeeDeclareParam param, Long employeeId, String tenantKey) { -// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() -// .setIndex(UUID.randomUUID().toString()) -// .setStatus(true) -// .setFinish(false) -// .setMsg(""); -// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); + /** + * 人员报送-全部报送 + * + * @param param + */ + public String declare(EmployeeDeclareParam param) { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); // if (!cacheResult) { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156513, "全部报送失败")); // } -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// try { -// employeeDeclareService.declare(param, employeeId, tenantKey); -// employeeDeclareRate.setFinish(true); -// } catch (SalaryRunTimeException | SalaryNullException e) { -// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); -// } catch (Exception e) { -// log.error("全部报送失败:{}", e.getMessage(), e); -// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage()); -// } finally { -// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); -// } -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable); -// return employeeDeclareRate.getIndex(); -// } -// -// /** -// * 人员报送-获取报送结果反馈 -// * -// * @param param -// * @param tenantKey -// */ -// public String getDeclareFeedback(EmployeeDeclareParam param, Long employeeId, String tenantKey) { -// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() -// .setIndex(UUID.randomUUID().toString()) -// .setStatus(true) -// .setFinish(false) -// .setMsg(""); -// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getEmployeeDeclareService(user).declare(param); + employeeDeclareRate.setFinish(true); + } catch (SalaryRunTimeException e) { + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("全部报送失败:{}", e.getMessage(), e); + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "系统错误,请联系管理员:") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable); + return employeeDeclareRate.getIndex(); + } + + /** + * 人员报送-获取报送结果反馈 + * + * @param param + */ + public String getDeclareFeedback(EmployeeDeclareParam param) { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); // if (!cacheResult) { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156514, "获取报送结果反馈失败")); // } -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// try { -// employeeDeclareService.getDeclareFeedback(param, employeeDeclareRate, employeeId, tenantKey); -// employeeDeclareRate.setFinish(true); -// } catch (SalaryRunTimeException | SalaryNullException e) { -// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); -// } catch (Exception e) { -// log.error("获取报送结果反馈失败:{}", e.getMessage(), e); -// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage()); -// } finally { -// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate); -// } -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable); -// return employeeDeclareRate.getIndex(); -// } -// + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getEmployeeDeclareService(user).getDeclareFeedback(param, employeeDeclareRate); + employeeDeclareRate.setFinish(true); + } catch (SalaryRunTimeException e) { + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("获取报送结果反馈失败:{}", e.getMessage(), e); + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "系统错误,请联系管理员:") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable); + return employeeDeclareRate.getIndex(); + } + // /** // * 获取人员报送相关后端接口是否已经完成 // * @@ -533,7 +535,7 @@ public class EmployeeDeclareWrapper extends Service { // * @return // */ // public EmployeeDeclareRateDTO getRate(String index, String tenantKey) { -// return salaryCacheService.get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class); +// return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class); // } // // /** diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java index 01edf018d..7be89079d 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -1,13 +1,20 @@ package com.engine.salary.wrapper; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.service.TaxDeclarationApiBillingService; import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; +import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; +import weaver.hrm.User; /** * 个税申报计费 @@ -16,21 +23,22 @@ import org.springframework.stereotype.Component; * @date 2022-11-11 15:16:22 */ @Slf4j -@Component -public class TaxDeclarationApiFlowBillingWrapper { - - private TaxDeclarationApiBillingService taxDeclarationApiBillingService; - - private TaxDeclarationApiConfigService taxDeclarationApiConfigService; - -// private SalaryBatchService salaryBatchService; +public class TaxDeclarationApiFlowBillingWrapper extends Service { - public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { - taxDeclarationApiConfigService.saveConfig(saveParam); + public TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + + public TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + getTaxDeclarationApiConfigService(user).saveConfig(saveParam); } public TaxDeclarationBillingConfigFormDTO getConfig() { - TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); + TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false); if (config == null) { return TaxDeclarationBillingConfigFormDTO.builder().appKey("").appSecret("").enable(true).build(); } @@ -42,10 +50,11 @@ public class TaxDeclarationApiFlowBillingWrapper { .build(); } -// public WeaTable getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) { -// PageInfo page = taxDeclarationApiBillingService.pageFlowRecord(queryParam); -// return SalaryFormatUtil.getInstance().buildTable(TaxDeclarationApiFlowRecordListDTO.class, page); -// } + public PageInfo getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { +// PageInfo page = getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam); +// return page; + return null; + } // public Map exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) { // List dtoList = taxDeclarationApiBillingService.listFlowRecord(queryParam, employeeId, tenantKey); @@ -66,12 +75,12 @@ public class TaxDeclarationApiFlowBillingWrapper { // return map; // } - public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { - taxDeclarationApiConfigService.enableConfig(saveParam); + public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + getTaxDeclarationApiConfigService(user).enableConfig(saveParam); } - public Boolean getConfigStatus(String currentTenantKey, Long currentEmployeeId) { - TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false); + public Boolean getConfigStatus() { + TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false); return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); } } From 615813c47875a9a80d3682eb666d670db42b1c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 9 Aug 2023 18:35:09 +0800 Subject: [PATCH 008/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308080603.sql | 51 +++ resource/sqlupgrade/JC/sql202308080603.sql | 51 +++ resource/sqlupgrade/Mysql/sql202308080603.sql | 50 +++ .../sqlupgrade/Oracle/sql202308080603.sql | 50 +++ resource/sqlupgrade/PG/sql202308080603.sql | 50 +++ .../sqlupgrade/SQLServer/sql202308080603.sql | 50 +++ resource/sqlupgrade/ST/sql202308080603.sql | 51 +++ .../EmployeeDeclareBatchUpdateParam.java | 25 ++ .../employeedeclare/po/EmployeeDeclarePO.java | 1 + .../po/EmployeeDeclareRecordPO.java | 3 + .../po/TaxDeclarationApiConfigPO.java | 4 + .../EmployeeDeclareRecordMapper.java | 80 +++++ .../EmployeeDeclareRecordMapper.xml | 312 ++++++++++++++++++ .../TaxDeclareApiConfigMapper.xml | 64 +++- .../service/EmployeeDeclareService.java | 4 +- .../impl/EmployeeDeclareServiceImpl.java | 225 +++++++------ .../salary/web/EmployeeDeclareController.java | 39 +-- .../wrapper/EmployeeDeclareWrapper.java | 39 +-- 18 files changed, 996 insertions(+), 153 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202308080603.sql create mode 100644 resource/sqlupgrade/JC/sql202308080603.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308080603.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308080603.sql create mode 100644 resource/sqlupgrade/PG/sql202308080603.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308080603.sql create mode 100644 resource/sqlupgrade/ST/sql202308080603.sql create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java create mode 100644 src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java create mode 100644 src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml diff --git a/resource/sqlupgrade/DM/sql202308080603.sql b/resource/sqlupgrade/DM/sql202308080603.sql new file mode 100644 index 000000000..652e03173 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308080603.sql b/resource/sqlupgrade/JC/sql202308080603.sql new file mode 100644 index 000000000..652e03173 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308080603.sql b/resource/sqlupgrade/Mysql/sql202308080603.sql new file mode 100644 index 000000000..7e651187b --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint comment '˰۽' , + tax_cycle varchar(10) comment '˰' , + request_id varchar(100) comment 'Ӧ̵ϵͳrequestid' +) +; + +create table hrsa_employee_declare +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint comment '˰۽ID' , + tax_cycle varchar(10) comment '˰' , + employee_id bigint comment 'Աid' , + employee_type tinyint comment 'Ա' , + employee_name varchar(100) comment '' , + job_num varchar(100) comment '' , + card_type tinyint comment '֤' , + card_num varchar(100) comment '֤' , + gender varchar(100) comment 'Ա' , + birthday date comment '' , + employment_status tinyint comment 'Ա״̬' , + mobile varchar(100) comment 'ֻ' , + employment_type tinyint comment 'ְܹʹҵ' , + employment_first_year varchar(100) comment 'ְȾҵ' , + employment_date date comment 'ְܹʹҵ' , + dismiss_date date comment 'ְ' , + disability tinyint comment 'Ƿм' , + disability_card_no varchar(100) comment 'м֤' , + lonely_old tinyint comment 'Ƿ' , + martyr_dependents tinyint comment 'Ƿ' , + martyr_dependents_card_no varchar(100) comment '֤' , + deduct_expenses tinyint comment 'Ƿ۳' , + successfully_declared tinyint comment 'Ƿɹ͹' , + new_employee_info tinyint comment 'Ƿ༭' , + declare_status tinyint comment '״̬' , + declare_error_msg varchar(1000) comment 'ʧʱĴϢ' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308080603.sql b/resource/sqlupgrade/Oracle/sql202308080603.sql new file mode 100644 index 000000000..c846543ba --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + request_id varchar2(100) +) +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308080603.sql b/resource/sqlupgrade/PG/sql202308080603.sql new file mode 100644 index 000000000..f5e88b1a1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + tax_cycle varchar(10), + request_id varchar(100) +); +/ + +create table hrsa_employee_declare +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + tax_cycle varchar(10), + employee_id bigint, + employee_type smallint, + employee_name varchar(100), + job_num varchar(100), + card_type smallint, + card_num varchar(100), + gender varchar(100), + birthday date, + employment_status smallint, + mobile varchar(100), + employment_type smallint, + employment_first_year varchar(100), + employment_date date, + dismiss_date date, + disability smallint, + disability_card_no varchar(100), + lonely_old smallint, + martyr_dependents smallint, + martyr_dependents_card_no varchar(100), + deduct_expenses smallint, + successfully_declared smallint, + new_employee_info smallint, + declare_status smallint, + declare_error_msg varchar(1000) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308080603.sql b/resource/sqlupgrade/SQLServer/sql202308080603.sql new file mode 100644 index 000000000..1438be357 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint, + tax_cycle nvarchar(10), + request_id nvarchar(100) +) +GO + +create table hrsa_employee_declare +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint, + tax_cycle nvarchar(10), + employee_id bigint, + employee_type tinyint, + employee_name nvarchar(100), + job_num nvarchar(100), + card_type tinyint, + card_num nvarchar(100), + gender nvarchar(100), + birthday datetime, + employment_status tinyint, + mobile nvarchar(100), + employment_type tinyint, + employment_first_year nvarchar(100), + employment_date datetime, + dismiss_date datetime, + disability tinyint, + disability_card_no nvarchar(100), + lonely_old tinyint, + martyr_dependents tinyint, + martyr_dependents_card_no nvarchar(100), + deduct_expenses tinyint, + successfully_declared tinyint, + new_employee_info tinyint, + declare_status tinyint, + declare_error_msg nvarchar(1000) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308080603.sql b/resource/sqlupgrade/ST/sql202308080603.sql new file mode 100644 index 000000000..652e03173 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle varchar2(10), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java new file mode 100644 index 000000000..3dc154bfb --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.employeedeclare.param; + +import lombok.Data; + +import java.util.Collection; + +/** + * @description: 人员报送-批量编辑保存参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/16 3:56 PM + * @version:v1.0 + */ +@Data +public class EmployeeDeclareBatchUpdateParam extends EmployeeDeclareListQueryParam { + + //报送人员的id + private Collection ids; + + //批量编辑的项目 + private String batchUpdateItem; + + //批量编辑为 + private String itemValue; +} diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index 794a0bedd..20b531403 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -25,6 +25,7 @@ import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) +//hrsa_employee_declare public class EmployeeDeclarePO { /** diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java index 83d5ffa7e..bf715c633 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java @@ -3,6 +3,7 @@ package com.engine.salary.entity.employeedeclare.po; import lombok.Data; import lombok.experimental.Accessors; +import java.util.Collection; import java.util.Date; /** @@ -53,4 +54,6 @@ public class EmployeeDeclareRecordPO { * 更新时间 */ private Date updateTime; + + private Collection ids; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java index 5f3c1ae81..e89c94530 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java @@ -7,6 +7,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; +import java.util.Collection; import java.util.Date; /** @@ -87,4 +88,7 @@ public class TaxDeclarationApiConfigPO implements Serializable { * 更新时间 */ private Date updateTime; + + //查询条件 + Collection ids; } diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java new file mode 100644 index 000000000..9fe80ed26 --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.employeedeclare; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface EmployeeDeclareRecordMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(EmployeeDeclareRecordPO employeeDeclareRecord); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + EmployeeDeclareRecordPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param employeeDeclareRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 批量插入 + * + * @param employeeDeclareRecord + */ + void batchInsert(@Param("collection") List employeeDeclareRecord); + + /** + * 修改,修改所有字段 + * + * @param employeeDeclareRecord 修改的记录 + * @return 返回影响行数 + */ + int update(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 修改,忽略null字段 + * + * @param employeeDeclareRecord 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 删除记录 + * + * @param employeeDeclareRecord 待删除的记录 + * @return 返回影响行数 + */ + int delete(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml new file mode 100644 index 000000000..e2f16e7ac --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_agent_id + , t.tax_cycle + , t.request_id + + + + + + + + + + + + + + + INSERT INTO hrsa_employee_declare_record + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_agent_id, + + + tax_cycle, + + + request_id, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxAgentId}, + + + #{taxCycle}, + + + #{requestId}, + + + + + + + + INSERT INTO hrsa_employee_declare_record + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + tax_cycle, + request_id, + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.requestId}, + + ) + + + + + INSERT INTO hrsa_employee_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + tax_cycle, + request_id, + ) + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.taxCycle,jdbcType=VARCHAR}, + #{item.requestId,jdbcType=DOUBLE}, + from dual + + + + + + + INSERT INTO hrsa_employee_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + tax_cycle, + request_id, + ) + VALUES + ( + #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxCycle,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.requestId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + ) + + + + + + UPDATE hrsa_employee_declare_record + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_agent_id=#{taxAgentId}, + tax_cycle=#{taxCycle}, + request_id=#{requestId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare_record + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_agent_id=#{taxAgentId}, + + + tax_cycle=#{taxCycle}, + + + request_id=#{requestId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_employee_declare_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml index b6b64d359..5ae5a4680 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml @@ -11,6 +11,10 @@ + + + + @@ -26,6 +30,10 @@ , t.host , t.app_key , t.app_secret + , t.enable_use + , t.totality + , t.remain + , t.last_update_time @@ -45,8 +53,7 @@ - SELECT FROM hrsa_tax_declare_api_config t @@ -78,6 +85,18 @@ AND app_secret = #{appSecret} + + AND enable_use = #{enableUse} + + + AND totality = #{totality} + + + AND remain = #{remain} + + + AND last_update_time = #{lastUpdateTime} + AND id IN @@ -120,6 +139,18 @@ app_secret, + + enable_use, + + + totality, + + + remain, + + + last_update_time, + @@ -149,6 +180,18 @@ #{appSecret}, + + #{enableUse}, + + + #{totality}, + + + #{remain}, + + + #{lastUpdateTime}, + @@ -164,6 +207,10 @@ host=#{host}, app_key=#{appKey}, app_secret=#{appSecret}, + enable_use=#{enableUse}, + totality=#{totality}, + remain=#{remain}, + last_update_time=#{lastUpdateTime}, WHERE id = #{id} AND delete_type = 0 @@ -197,6 +244,18 @@ app_secret=#{appSecret}, + + enable_use=#{enableUse}, + + + totality=#{totality}, + + + remain=#{remain}, + + + last_update_time=#{lastUpdateTime}, + WHERE id = #{id} AND delete_type = 0 @@ -227,4 +286,5 @@ WHERE delete_type = 0 + \ No newline at end of file diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 097e6ae3e..202f28aec 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -119,10 +119,8 @@ public interface EmployeeDeclareService{ * 批量编辑 * * @param batchUpdateParam - * @param employeeId - * @param tenantKey */ -// void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId); + void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam); /** * 删除 diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 3114d8ca7..3ae25647b 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -27,9 +27,11 @@ import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.SalaryCycleTypeEnum; +import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; @@ -54,6 +56,7 @@ import org.springframework.transaction.annotation.Transactional; import weaver.general.Util; import weaver.hrm.User; +import java.time.LocalDate; import java.time.YearMonth; import java.time.temporal.ChronoUnit; import java.util.*; @@ -97,6 +100,10 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla return ServiceUtil.getService(EmployeeDeclareRecordServiceImpl.class, user); } + private TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + @Override public EmployeeDeclarePO getById(Long id) { return getEmployeeDeclareMapper().getById(id); @@ -156,7 +163,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // @Override // public List list4FailByParam(EmployeeDeclareFailListQueryParam queryParam) { // return new LambdaQueryChainWrapper<>(employeeDeclareMapper) -// .eq(EmployeeDeclarePO::getTenantKey, tenantKey) +// .eq(EmployeeDeclarePO::getTenantKey) // .eq(EmployeeDeclarePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) // .eq(EmployeeDeclarePO::getTaxAgentId, queryParam.getTaxAgentId()) // .eq(EmployeeDeclarePO::getTaxCycle, queryParam.getTaxCycle().toString()) @@ -257,109 +264,110 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } } -// @Override -// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId) { -// // 查询报送人员 -// List employeeDeclares; -// if (CollectionUtils.isNotEmpty(batchUpdateParam.getIds())) { -// employeeDeclares = listByIds(batchUpdateParam.getIds(), tenantKey); -// } else { -// employeeDeclares = listByParam(batchUpdateParam, tenantKey); -// } -// // 人员为空时,不允许批量编辑 -// if (CollectionUtils.isEmpty(employeeDeclares)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182693, "当前人员列表为空,请选择要批量编辑的人员")); -// } -// LocalDateTime now = LocalDateTime.now(); -// // 校验参数 -// if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentStatus")) { -// EmploymentStatusEnum employmentStatusEnum = null; -// for (EmploymentStatusEnum value : EmploymentStatusEnum.values()) { -// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { -// employmentStatusEnum = value; -// } -// } -// if (employmentStatusEnum == null) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); -// } -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// if (!Objects.equals(employeeDeclare.getEmploymentStatus(), employmentStatusEnum.getValue())) { -// employeeDeclare.setEmploymentStatus(employmentStatusEnum.getValue()); -// employeeDeclare.setNewEmployeeInfo(1); -// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// employeeDeclare.setDeclareErrorMsg(""); -// employeeDeclare.setUpdateTime(now); -// } -// } -// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentType")) { -// EmploymentTypeEnum employmentTypeEnum = null; -// for (EmploymentTypeEnum value : EmploymentTypeEnum.values()) { -// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { -// employmentTypeEnum = value; -// } -// } -// if (employmentTypeEnum == null) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); -// } -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// if (!Objects.equals(employeeDeclare.getEmploymentType(), employmentTypeEnum.getValue())) { -// employeeDeclare.setEmploymentType(employmentTypeEnum.getValue()); -// employeeDeclare.setNewEmployeeInfo(1); -// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// employeeDeclare.setDeclareErrorMsg(""); -// employeeDeclare.setUpdateTime(now); -// } -// } -// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentDate")) { -// if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); -// } -// LocalDate employmentDate = LocalDate.parse(batchUpdateParam.getItemValue()); -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// if (!Objects.equals(employeeDeclare.getEmploymentDate(), employmentDate)) { -// employeeDeclare.setEmploymentDate(employmentDate); -// employeeDeclare.setNewEmployeeInfo(1); -// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// employeeDeclare.setDeclareErrorMsg(""); -// employeeDeclare.setUpdateTime(now); -// } -// } -// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "dismissDate")) { -// if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); -// } -// LocalDate dismissDate = LocalDate.parse(batchUpdateParam.getItemValue()); -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// if (!Objects.equals(employeeDeclare.getDismissDate(), dismissDate)) { -// employeeDeclare.setDismissDate(dismissDate); -// employeeDeclare.setNewEmployeeInfo(1); -// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// employeeDeclare.setDeclareErrorMsg(""); -// employeeDeclare.setUpdateTime(now); -// } -// } -// } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "deductExpenses")) { -// SalaryOnOffEnum salaryOnOffEnum = null; -// for (SalaryOnOffEnum value : SalaryOnOffEnum.values()) { -// if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { -// salaryOnOffEnum = value; -// } -// } -// if (salaryOnOffEnum == null) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); -// } -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// if (!Objects.equals(employeeDeclare.getDeductExpenses(), salaryOnOffEnum.getValue())) { -// employeeDeclare.setDeductExpenses(salaryOnOffEnum.getValue()); -// employeeDeclare.setNewEmployeeInfo(1); -// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// employeeDeclare.setDeclareErrorMsg(""); -// employeeDeclare.setUpdateTime(now); -// } -// } -// } + @Override + public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam) { + // 查询报送人员 + List employeeDeclares; + if (CollectionUtils.isNotEmpty(batchUpdateParam.getIds())) { + employeeDeclares = listByIds(batchUpdateParam.getIds()); + } else { + employeeDeclares = listByParam(batchUpdateParam); + } + // 人员为空时,不允许批量编辑 + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182693, "当前人员列表为空,请选择要批量编辑的人员")); + } + Date now = new Date(); + // 校验参数 + if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentStatus")) { + EmploymentStatusEnum employmentStatusEnum = null; + for (EmploymentStatusEnum value : EmploymentStatusEnum.values()) { + if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { + employmentStatusEnum = value; + } + } + if (employmentStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getEmploymentStatus(), employmentStatusEnum.getValue())) { + employeeDeclare.setEmploymentStatus(employmentStatusEnum.getValue()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentType")) { + EmploymentTypeEnum employmentTypeEnum = null; + for (EmploymentTypeEnum value : EmploymentTypeEnum.values()) { + if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { + employmentTypeEnum = value; + } + } + if (employmentTypeEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getEmploymentType(), employmentTypeEnum.getValue())) { + employeeDeclare.setEmploymentType(employmentTypeEnum.getValue()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentDate")) { + if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + Date employmentDate = SalaryDateUtil.localDateToDate(LocalDate.parse(batchUpdateParam.getItemValue())); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getEmploymentDate(), employmentDate)) { + employeeDeclare.setEmploymentDate(employmentDate); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "dismissDate")) { + if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + Date dismissDate = SalaryDateUtil.localDateToDate(LocalDate.parse(batchUpdateParam.getItemValue())); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getDismissDate(), dismissDate)) { + employeeDeclare.setDismissDate(dismissDate); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "deductExpenses")) { + SalaryOnOffEnum salaryOnOffEnum = null; + for (SalaryOnOffEnum value : SalaryOnOffEnum.values()) { + if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { + salaryOnOffEnum = value; + } + } + if (salaryOnOffEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getDeductExpenses(), salaryOnOffEnum.getValue())) { + employeeDeclare.setDeductExpenses(salaryOnOffEnum.getValue()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } + employeeDeclares.forEach(getEmployeeDeclareMapper()::updateIgnoreNull); // updateBatchById(employeeDeclares); -// } + } @Override public void deleteByIds(Collection ids) { @@ -470,7 +478,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla .collect(Collectors.toSet()); // 查询新增加的人员信息 List employeeInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(newOrgEmployeeIds)); -// List newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey); +// List newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds); // List newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds)); // 查询本月增加了哪些非系统人员 // List extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId()); @@ -577,7 +585,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 删除原来的人员报送记录 getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); // 保存新的人员报送记录 - Date now =new Date(); + Date now = new Date(); AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody(); employeeDeclareRecord = new EmployeeDeclareRecordPO() .setId(IdGenerator.generate()) @@ -585,7 +593,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla .setTaxCycle(param.getTaxCycle().toString()) .setRequestId(asyncRequestIdDTO.getRequestId()) .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setCreator((long)user.getUID()) + .setCreator((long) user.getUID()) .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .setCreateTime(now) .setUpdateTime(now); @@ -633,7 +641,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla + "-" + e.getOrDefault("zzlx", "") + "-" + e.getOrDefault("zzhm", "")); // 流量使用情况 - TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper( SalaryDateUtil.localDateToDate(param.getTaxCycle().atDay(1)), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(SalaryDateUtil.localDateToDate(param.getTaxCycle().atDay(1)), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); // 查询申报的人员列表 Date now = new Date(); List needUpdateEmployeeDeclares = Lists.newArrayList(); @@ -667,6 +675,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 更新员工的报送状态 if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { //todo + needUpdateEmployeeDeclares.forEach(getEmployeeDeclareMapper()::updateIgnoreNull); // updateBatchById(needUpdateEmployeeDeclares); } // 删除原来的人员报送记录 @@ -682,7 +691,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // employeeDeclareLoggerTemplate.write(loggerContext); // 更新流量统计 //todo -// taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper); + getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); // 报送失败的 int declareFailSize = (int) needUpdateEmployeeDeclares.stream() .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())) diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index aaaf3cae2..e8e62dcdc 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -4,6 +4,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRateDTO; import com.engine.salary.entity.employeedeclare.dto.TaxAgentDeclareListDTO; import com.engine.salary.entity.employeedeclare.param.*; import com.engine.salary.util.ResponseResult; @@ -227,39 +228,39 @@ public class EmployeeDeclareController { @POST @Path("/getDeclareFeedback") @Produces(MediaType.APPLICATION_JSON) - public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody EmployeeDeclareParam employeeDeclareParam) { + public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); } -// /** -// * 人员报送-后端业务逻辑是否已经完成 -// * -// * @param index 进度索引 -// * @return -// */ -// @GetMapping("/getRate") -// @ApiOperation("人员报送-后端业务逻辑是否已经完成") -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult getRate(@RequestParam(value = "index") String index) { -// EmployeeDeclareRateDTO rate = employeeDeclareWrapper.getRate(index, TenantContext.getCurrentTenantKey()); -// return WeaResult.success(rate); -// } -// + /** + * 人员报送-后端业务逻辑是否已经完成 + * + * @param index 进度索引 + * @return + */ + @GET + @Path("/getRate") + @Produces(MediaType.APPLICATION_JSON) + public String getRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "index") String index) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getRate, index); + } + // /** // * 人员报送-导出全部人员 // * // * @param queryParam 导出参数 // * @return // */ +// @POST // @Path("/export") -// @ApiOperation("人员报送-导出全部人员") // @Produces(MediaType.APPLICATION_JSON) -// public WeaResult export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { +// public String export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { // Map exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser()); // return WeaResult.success(exportMap); // } -// + // /** // * 人员报送-导出本月新增人员 // * @@ -302,7 +303,7 @@ public class EmployeeDeclareController { // return WeaResult.success(exportMap); // } // -// @GetMapping("/getImportParam") +// @Path("/getImportParam") // @ApiOperation("人员报送-获取导入参数") // @Produces(MediaType.APPLICATION_JSON) // public WeaResult getAcctResultImportParams() { diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 15438a9bf..eb956d57b 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -396,16 +396,14 @@ public class EmployeeDeclareWrapper extends Service { } -// /** -// * 批量编辑 -// * -// * @param batchUpdateParam -// * @param employeeId -// * @param tenantKey -// */ -// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId, String tenantKey) { -// getEmployeeDeclareService(user).batchUpdate(batchUpdateParam, employeeId, tenantKey); -// } + /** + * 批量编辑 + * + * @param batchUpdateParam + */ + public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam) { + getEmployeeDeclareService(user).batchUpdate(batchUpdateParam); + } /** * 人员报送-删除 @@ -527,17 +525,16 @@ public class EmployeeDeclareWrapper extends Service { return employeeDeclareRate.getIndex(); } -// /** -// * 获取人员报送相关后端接口是否已经完成 -// * -// * @param index -// * @param tenantKey -// * @return -// */ -// public EmployeeDeclareRateDTO getRate(String index, String tenantKey) { -// return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class); -// } -// + /** + * 获取人员报送相关后端接口是否已经完成 + * + * @param index + * @return + */ + public EmployeeDeclareRateDTO getRate(String index) { + return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE+ index); + } + // /** // * 人员报送-导出本月全部的人员 // * From 50658012a1fbf36504dc22dc4b12cae188cc6211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 10 Aug 2023 09:33:04 +0800 Subject: [PATCH 009/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308090303.sql | 36 + resource/sqlupgrade/GS/sql202308090303.sql | 36 + resource/sqlupgrade/JC/sql202308090303.sql | 36 + resource/sqlupgrade/Mysql/sql202308090303.sql | 32 + .../sqlupgrade/Oracle/sql202308090303.sql | 31 + resource/sqlupgrade/PG/sql202308090303.sql | 31 + .../sqlupgrade/SQLServer/sql202308090303.sql | 32 + resource/sqlupgrade/ST/sql202308090303.sql | 36 + .../taxagent/TaxDeclareRecordMapper.java | 11 + .../service/TaxDeclareRecordService.java | 187 +++ .../impl/TaxDeclareRecordServiceImpl.java | 1129 +++++++++++++++++ .../salary/web/TaxDeclarationController.java | 296 +++++ .../wrapper/TaxDeclareRecordWrapper.java | 753 +++++++++++ 13 files changed, 2646 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202308090303.sql create mode 100644 resource/sqlupgrade/GS/sql202308090303.sql create mode 100644 resource/sqlupgrade/JC/sql202308090303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308090303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308090303.sql create mode 100644 resource/sqlupgrade/PG/sql202308090303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308090303.sql create mode 100644 resource/sqlupgrade/ST/sql202308090303.sql create mode 100644 src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java create mode 100644 src/com/engine/salary/service/TaxDeclareRecordService.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java create mode 100644 src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java diff --git a/resource/sqlupgrade/DM/sql202308090303.sql b/resource/sqlupgrade/DM/sql202308090303.sql new file mode 100644 index 000000000..3c9a6cee5 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month varchar2(10), + tax_cycle varchar2(10), + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/resource/sqlupgrade/GS/sql202308090303.sql b/resource/sqlupgrade/GS/sql202308090303.sql new file mode 100644 index 000000000..3c9a6cee5 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month varchar2(10), + tax_cycle varchar2(10), + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/resource/sqlupgrade/JC/sql202308090303.sql b/resource/sqlupgrade/JC/sql202308090303.sql new file mode 100644 index 000000000..3c9a6cee5 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month varchar2(10), + tax_cycle varchar2(10), + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308090303.sql b/resource/sqlupgrade/Mysql/sql202308090303.sql new file mode 100644 index 000000000..f7094b24b --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308090303.sql @@ -0,0 +1,32 @@ +create table hrsa_tax_declare_record +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint comment '˰۽id' , + salary_month varchar(10) comment 'н' , + tax_cycle varchar(10) comment '˰' , + remark varchar(1000) comment 'ע' , + request_id varchar(100) comment 'Ӧ̵ϵͳصrequestid' , + tax_declare_type tinyint comment '걨' , + tax_declare_status tinyint comment '걨״̬' +) +; + +alter table hrsa_tax_declare_record add display_update_icon tinyint +; + +alter table hrsa_tax_declare_record add tax_pay_amount varchar(255) +; + +alter table hrsa_tax_declare_record add person_num int +; +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar(1000) +; +alter table hrsa_tax_declare_record add tax_paid_amount varchar(255) +; +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar(255) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308090303.sql b/resource/sqlupgrade/Oracle/sql202308090303.sql new file mode 100644 index 000000000..e9a221fca --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308090303.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month varchar2(10), + tax_cycle varchar2(10), + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +) +/ + +alter table hrsa_tax_declare_record add display_update_icon number +/ +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255) +/ + +alter table hrsa_tax_declare_record add person_num int +/ +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000) +/ +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255) +/ +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308090303.sql b/resource/sqlupgrade/PG/sql202308090303.sql new file mode 100644 index 000000000..33f4a8aea --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308090303.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_declare_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + salary_month varchar(10), + tax_cycle varchar(10), + remark varchar(1000), + request_id varchar(100), + tax_declare_type smallint, + tax_declare_status smallint +); +/ + +alter table hrsa_tax_declare_record add display_update_icon smallint; +/ +alter table hrsa_tax_declare_record add tax_pay_amount varchar(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar(1000); +/ +alter table hrsa_tax_declare_record add tax_paid_amount varchar(255); +/ +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar(255); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308090303.sql b/resource/sqlupgrade/SQLServer/sql202308090303.sql new file mode 100644 index 000000000..e3ca10522 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308090303.sql @@ -0,0 +1,32 @@ +create table hrsa_tax_declare_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint, + salary_month nvarchar(10), + tax_cycle nvarchar(10), + remark nvarchar(1000), + request_id nvarchar(100), + tax_declare_type tinyint, + tax_declare_status tinyint +) +GO + + +alter table hrsa_tax_declare_record add display_update_icon tinyint +GO +alter table hrsa_tax_declare_record add tax_pay_amount nvarchar(255) +GO + +alter table hrsa_tax_declare_record add person_num int +GO +alter table hrsa_tax_declare_record add tax_declare_error_msg nvarchar(1000) +GO +alter table hrsa_tax_declare_record add tax_paid_amount nvarchar(255) +GO +alter table hrsa_tax_declare_record add tax_pure_paid_amount nvarchar(255) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308090303.sql b/resource/sqlupgrade/ST/sql202308090303.sql new file mode 100644 index 000000000..3c9a6cee5 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month varchar2(10), + tax_cycle varchar2(10), + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java b/src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java new file mode 100644 index 000000000..6142d2c21 --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java @@ -0,0 +1,11 @@ +package com.engine.salary.mapper.taxagent; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/2 5:46 PM + * @version:v1.0 + */ +public interface TaxDeclareRecordMapper { +} diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java new file mode 100644 index 000000000..4f64025d6 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -0,0 +1,187 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; + +import java.time.YearMonth; +import java.util.Collection; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/2 5:48 PM + * @version:v1.0 + */ +public interface TaxDeclareRecordService { + + /** + * 查询个税申报记录 + * + * @param id + * @return + */ + TaxDeclareRecordPO getById(Long id); + +// /** +// * 查询个税申报记录 +// * +// * @param ids +// * @param tenantKey +// * @return +// */ +// List listByIds(Collection ids, String tenantKey); +// +// /** +// * 查询个税申报记录 +// * +// * @param taxCycleRange +// * @param tenantKey +// * @return +// */ +// List listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey); +// +// /** +// * 根据个税扣缴义务人id、税款所属期查询个税申报记录 +// * +// * @param taxAgentIds +// * @param taxCycle +// * @param tenantKey +// * @return +// */ +// List listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey); +// +// /** +// * 根据个税扣缴义务人id、薪资所属月查询个税申报记录 +// * +// * @param salaryMonth +// * @param taxAgentIds +// * @param tenantKey +// * @return +// */ +// List listBySalaryMonthAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds, String tenantKey); +// +// /** +// * 查询个税申报记录 +// * +// * @param queryParam +// * @param tenantKey +// * @return +// */ +// Page listPageByParam(TaxDeclarationListQueryParam queryParam, Long employeeId, String tenantKey); +// +// /** +// * 生成申报表 +// * +// * @param saveParam +// * @param employeeId +// * @param tenantKey +// */ +// void save(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey); + + + /** + * 刷新数据 + * + * @param id + * @param employeeId + * @param tenantKey + */ + void refreshData(Long id, Long employeeId, String tenantKey); + + /** + * 更新个税申报表的待刷新数据的标识 + * + * @param id + * @param employeeId + * @param tenantKey + */ + void updateIcon(Long id, Integer displayIcon, Long employeeId, String tenantKey); + + /** + * 因为薪资核算结果发生变动,所以需要更新个税申报表的待刷新数据的标识 + * + * @param taxCycle + * @param taxAgentIds + * @param tenantKey + */ + void updateByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey); + + /** + * 判断是否有权限可查看个税申报表 + * + * @param taxDeclaration + * @param employeeId + * @param tenantKey + * @return + */ + boolean checkByAuthority(TaxDeclarationPO taxDeclaration, Long employeeId, String tenantKey); + + /** + * 根据id删除 + * + * @param ids + * @param tenantKey + */ + void deleteByIds(Collection ids, String tenantKey); + + /** + * 个税申报 + * + * @param id + * @param tenantKey + */ + void declare(Long id, Long employeeId, String tenantKey); + + /** + * 个税申报获取反馈 + * + * @param id + * @param tenantKey + */ + void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long employeeId, String tenantKey); + + /** + * 作废 + * + * @param id + * @param tenantKey + */ + void cancelDeclare(Long id, Long employeeId, String tenantKey); + + /** + * 获取作废反馈 + * + * @param id + * @param tenantKey + */ + void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long employeeId, String tenantKey); + + /** + * 更正申报 + * + * @param id + * @param employeeId + * @param tenantKey + */ + void updateDeclare(Long id, Long employeeId, String tenantKey); + + /** + * 税局端申报状态查询 + * + * @param id + * @param employeeId + * @param tenantKey + */ + String queryDeclareStatus(Long id, Long employeeId, String tenantKey); + + /** + * 税局端申报明细查询 + * + * @param id + * @param employeeId + * @param tenantKey + */ + String queryCompanyIncomes(Long id, Long employeeId, String tenantKey); +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java new file mode 100644 index 000000000..75c5d06b7 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -0,0 +1,1129 @@ +package com.engine.salary.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.mapper.taxagent.TaxDeclareRecordMapper; +import com.engine.salary.service.*; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.weaver.common.component.table.page.Page; +import com.weaver.common.distribution.genid.IdGenerator; +import com.weaver.common.elog.dto.LoggerContext; +import com.weaver.common.elog.util.LoggerTemplate; +import com.weaver.common.elog.util.Util; +import com.weaver.framework.util.JsonUtil; +import com.weaver.hrm.salary.common.YearMonthRange; +import com.weaver.hrm.salary.constant.SzyhApiConstant; +import com.weaver.hrm.salary.dao.TaxPaymentRequestMapper; +import com.weaver.hrm.salary.entity.datacollection.po.AddUpSituationPO; +import com.weaver.hrm.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; +import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam; +import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultValuePO; +import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.weaver.hrm.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO; +import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.weaver.hrm.salary.entity.taxdeclaration.bo.*; +import com.weaver.hrm.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; +import com.weaver.hrm.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; +import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; +import com.weaver.hrm.salary.entity.taxdeclaration.po.*; +import com.weaver.hrm.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; +import com.weaver.hrm.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; +import com.weaver.hrm.salary.entity.taxdeclaration.response.DeclareTaxResponse; +import com.weaver.hrm.salary.entity.taxdeclaration.response.UpdateDeclareResponse; +import com.weaver.hrm.salary.enums.OperateTypeEnum; +import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; +import com.weaver.hrm.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +import com.weaver.hrm.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.weaver.hrm.salary.enums.taxdeclaration.*; +import com.weaver.hrm.salary.exception.SalaryRunTimeException; +import com.weaver.hrm.salary.service.*; +import com.weaver.hrm.salary.service.factory.TaxPaymentServiceFactory; +import com.weaver.hrm.salary.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/2 5:48 PM + * @version:v1.0 + */ +@Slf4j +public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRecordService { + + + private TaxDeclareRecordMapper taxDeclareRecordMapper; + + private TaxDeclarationService taxDeclarationService; + + private TaxDeclarationValueService taxDeclarationValueService; + + private EmployeeDeclareService employeeDeclareService; + + private TaxAgentTaxReturnService taxAgentTaxReturnService; + + private TaxAgentService taxAgentService; + + private TaxDeclarationApiConfigService taxDeclarationApiConfigService; + + private AddUpSituationService addUpSituationService; + + private TaxDeclarationApiBillingService taxDeclarationApiBillingService; + @Resource(name = "taxDeclarationLoggerTemplate") + private LoggerTemplate taxDeclarationLoggerTemplate; + + private TaxDeclareEmployeeService taxDeclareEmployeeService; + + private TaxDeclareFailService taxDeclareFailService; + + private SalaryAcctRecordService salaryAcctRecordService; + + private SalaryAcctTaxAgentService salaryAcctTaxAgentService; + + private SalaryAcctEmployeeService salaryAcctEmployeeService; + + private SalaryAcctResultService salaryAcctResultValueService; + + private SalaryItemService salaryItemService; + + private SalarySobTaxReportRuleService salarySobTaxReportRuleService; + + private TaxReportColumnService taxReportColumnService; + + private SalarySobAddUpRuleService salarySobAddUpRuleService; + + private TaxPaymentServiceFactory taxPaymentServiceFactory; + + private TaxPaymentRequestMapper taxPaymentRequestMapper; + + @Override + public TaxDeclareRecordPO getById(Long id) { + return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) + .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) + .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(TaxDeclareRecordPO::getId, id) + .one(); + } +// +// @Override +// public List listByIds(Collection ids, String tenantKey) { +// return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) +// .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) +// .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(TaxDeclareRecordPO::getId, ids) +// .list(); +// } +// +// @Override +// public List listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey) { +// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); +// queryWrapper.eq(TaxDeclareRecordPO::getTenantKey, tenantKey); +// queryWrapper.eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()); +// if (Objects.nonNull(taxCycleRange.getStartMonth())) { +// queryWrapper.ge(TaxDeclareRecordPO::getTaxCycle, taxCycleRange.getStartMonth().toString()); +// } +// if (Objects.nonNull(taxCycleRange.getEndMonth())) { +// queryWrapper.le(TaxDeclareRecordPO::getTaxCycle, taxCycleRange.getEndMonth().toString()); +// } +// return taxDeclareRecordMapper.selectList(queryWrapper); +// } +// +// @Override +// public List listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey) { +// if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { +// return Collections.emptyList(); +// } +// return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) +// .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) +// .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds) +// .eq(TaxDeclareRecordPO::getTaxCycle, taxCycle.toString()) +// .list(); +// } +// +// @Override +// public List listBySalaryMonthAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds, String tenantKey) { +// if (Objects.isNull(salaryMonth) || CollectionUtils.isEmpty(taxAgentIds)) { +// return Collections.emptyList(); +// } +// return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) +// .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) +// .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds) +// .eq(TaxDeclareRecordPO::getSalaryMonth, salaryMonth.toString()) +// .list(); +// } +// +// @Override +// public Page listPageByParam(TaxDeclarationListQueryParam queryParam, Long employeeId, String tenantKey) { +// Page page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true); +// // 构建查询参数 +// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); +// queryWrapper.eq(TaxDeclareRecordPO::getTenantKey, tenantKey); +// queryWrapper.eq(TaxDeclareRecordPO::getDeleteType, 0); +// if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getFromSalaryMonth())) { +// queryWrapper.ge(TaxDeclareRecordPO::getSalaryMonth, queryParam.getFromSalaryMonth()); +// } +// if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getEndSalaryMonth())) { +// queryWrapper.le(TaxDeclareRecordPO::getSalaryMonth, queryParam.getEndSalaryMonth()); +// } +// if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { +// List taxAgents = taxAgentService.listByNameLike(queryParam.getTaxAgentName(), tenantKey); +// if (CollectionUtils.isEmpty(taxAgents)) { +// return page; +// } +// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); +// queryWrapper.in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds); +// } +// // 判断是否开启了分权 +// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); +// // 判断是否是总管理员 +// Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); +// // 可见范围内的个税扣缴义务人 +// List taxAgents = Lists.newArrayList(); +// if (openDevolution) { +// if (isChief) { +// taxAgents = taxAgentService.listAsChief(openDevolution, isChief, employeeId, tenantKey); +// } else { +// taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId, tenantKey); +// } +// if (CollectionUtils.isEmpty(taxAgents)) { +// return page; +// } +// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); +// queryWrapper.in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds); +// } +// queryWrapper.orderByDesc(TaxDeclareRecordPO::getTaxCycle); +// queryWrapper.orderByDesc(TaxDeclareRecordPO::getId); +// return taxDeclareRecordMapper.selectPage(page, queryWrapper); +// } +// +// @Override +// public void save(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey) { +// LocalDateTime now = LocalDateTime.now(); +// Set needDeleteTaxDeclareRecordIds = Sets.newHashSet(); +// List newTaxDeclareRecords = Lists.newArrayList(); +// List newTaxDeclarations = Lists.newArrayList(); +// List newTaxDeclarationValues = Lists.newArrayList(); +// List newAddUpSituations = Lists.newArrayList(); +// // 根据个税扣缴义务人范围查询个税扣缴义务人 +// List taxAgents = queryByTaxAgentRange(saveParam, employeeId, tenantKey); +// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); +// // 查询薪资所属月下的薪资核算记录,并按照权限过滤 +// YearMonthRange salaryMonthRange = new YearMonthRange() +// .setStartMonth(saveParam.getSalaryMonth()) +// .setEndMonth(saveParam.getSalaryMonth()); +// List salaryAcctRecords = salaryAcctRecordService.filterByAuthority( +// salaryAcctRecordService.listBySalaryMonth(salaryMonthRange, tenantKey), employeeId, tenantKey); +// // 查询薪资核算记录关联的个税扣缴义务人 +// List salaryAcctTaxAgents = salaryAcctTaxAgentService.listBySalaryAcctRecordIds( +// SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId), tenantKey); +// // 按照saveParam中的个税扣缴义务人范围过滤 +// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); +// salaryAcctTaxAgents = salaryAcctTaxAgents.stream() +// .filter(e -> taxAgentIds.contains(e.getTaxAgentId())) +// .collect(Collectors.toList()); +// Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getSalaryAcctRecordId); +// salaryAcctRecords = salaryAcctRecords.stream() +// .filter(e -> salaryAcctRecordIds.contains(e.getId())) +// .collect(Collectors.toList()); +// // 校验是否可以生成个税申报表 +// // 返回目前已经生成的个税申报表 +// List taxDeclareRecords = checkBeforeSave(saveParam, taxAgentNameMap, salaryAcctRecords, salaryAcctTaxAgents, employeeId, tenantKey); +// Map taxDeclareRecordMap = SalaryEntityUtil.convert2Map(taxDeclareRecords, e -> e.getTaxCycle() + "-" + e.getTaxAgentId()); +// // 查询薪资核算人员 +// List salaryAcctEmployees = salaryAcctEmployeeService.listByRecordIdsAndTaxAgentIds(salaryAcctRecordIds, taxAgentIds, tenantKey); +// // 薪资核算人员按照税款所属期聚合分类 +// Map> taxCycleKeyEmployeeMap = SalaryEntityUtil.group2Map( +// salaryAcctEmployees, SalaryAcctEmployeePO::getTaxCycle); +// for (Map.Entry> taxCycleEntry : taxCycleKeyEmployeeMap.entrySet()) { +// // 薪资核算人员按照个税扣缴义务人id聚合分类 +// Map> taxAgentIdKeyEmployeeMap = SalaryEntityUtil.group2Map( +// taxCycleEntry.getValue(), SalaryAcctEmployeePO::getTaxAgentId); +// for (Map.Entry> taxAgentIdEntry : taxAgentIdKeyEmployeeMap.entrySet()) { +// TaxDeclareRecordPO oldTaxDeclareRecord = taxDeclareRecordMap.get(taxCycleEntry.getKey() + "-" + taxAgentIdEntry.getKey()); +// // 如果已经生成了个税申报表,并且个税申报表已经申报过了,就跳过 +// if (oldTaxDeclareRecord != null) { +// if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) +// && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))) { +// continue; +// } +// needDeleteTaxDeclareRecordIds.add(oldTaxDeclareRecord.getId()); +// } +// TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO() +// .setId(IdGenerator.generate()) +// .setTaxAgentId(taxAgentIdEntry.getKey()) +// .setSalaryMonth(saveParam.getSalaryMonth().toString()) +// .setTaxCycle(taxCycleEntry.getKey()) +// .setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) +// .setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()) +// .setRemark(saveParam.getDescription()) +// .setCreator(employeeId) +// .setTenantKey(tenantKey) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// newTaxDeclareRecords.add(taxDeclareRecord); +// // 生成个税申报表 +// TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue(), employeeId, tenantKey); +// newTaxDeclarations.addAll(taxDeclarationResult.getTaxDeclarations()); +// newTaxDeclarationValues.addAll(taxDeclarationResult.getTaxDeclarationValues()); +// newAddUpSituations.addAll(taxDeclarationResult.getAddUpSituations()); +// } +// } +// +// // 删除原来生成的个税申报记录、个税申报表、个税申报表明细 +// deleteByIds(needDeleteTaxDeclareRecordIds, tenantKey); +// // 保存个税申报记录 +// if (CollectionUtils.isNotEmpty(newTaxDeclareRecords)) { +// saveBatch(newTaxDeclareRecords); +// } +// // 保存个税申报表 +// if (CollectionUtils.isNotEmpty(newTaxDeclarations)) { +// taxDeclarationService.saveBatch(newTaxDeclarations); +// } +// // 保存个税申报表明细 +// if (CollectionUtils.isNotEmpty(newTaxDeclarationValues)) { +// taxDeclarationValueService.batchSave(newTaxDeclarationValues, tenantKey); +// } +// // 保存累计情况 +// if (CollectionUtils.isNotEmpty(newAddUpSituations)) { +// Map> addUpSituationMap = SalaryEntityUtil.group2Map(newAddUpSituations, e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); +// for (Map.Entry> entry : addUpSituationMap.entrySet()) { +// addUpSituationService.deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), +// SalaryEntityUtil.properties(entry.getValue(), AddUpSituationPO::getTaxAgentId), tenantKey); +// addUpSituationService.saveBatch(entry.getValue(), tenantKey); +// } +// } +// // 记录日志 +// for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99815, "生成个税申报表")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99815, "生成个税申报表")); +// loggerContext.setNewValues(taxDeclareRecord); +// taxDeclarationLoggerTemplate.write(loggerContext); +// } +// } + + @Override + @Transactional(rollbackFor = Exception.class) + public void refreshData(Long id) { + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getById(id); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156495, "参数异常,个税申报记录不存在或已被删除")); + } + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) + && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182700, "对不起,只有未申报状态下可以刷新数据")); + } + // 查询税款所属期下的薪资核算人员 + SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = new SalaryAcctEmployeeQueryParam() + .setTaxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())) + .setTaxCycle(taxDeclareRecord.getTaxCycle()); + List salaryAcctEmployees = salaryAcctEmployeeService.listByParam(salaryAcctEmployeeQueryParam, tenantKey); + // 查询薪资核算记录 + Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); + List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds, tenantKey); + // 如果存在未归档的薪资核算记录,不允许生成个税申报表 + boolean notArchived = salaryAcctRecords.stream() + .anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); + if (notArchived) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 98875, "{0}有未归档数据,请全部归档后再申报") + .replace("{0}", taxDeclareRecord.getSalaryMonth())); + } + + TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, salaryAcctEmployees, employeeId, tenantKey); + // 更新个税申报记录 + taxDeclareRecord.setDisplayUpdateIcon(0).setUpdateTime(LocalDateTime.now()); + updateById(taxDeclareRecord); + // 删除原来的申报表,保存新生成的 + taxDeclarationService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarations())) { + taxDeclarationService.saveBatch(taxDeclarationResult.getTaxDeclarations()); + } + // 删除原来的申报表明细,保存新生成的 + taxDeclarationValueService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarationValues())) { + taxDeclarationValueService.batchSave(taxDeclarationResult.getTaxDeclarationValues(), tenantKey); + } + // 保存累计情况 + if (CollectionUtils.isNotEmpty(taxDeclarationResult.getAddUpSituations())) { + Map> addUpSituationMap = SalaryEntityUtil.group2Map(taxDeclarationResult.getAddUpSituations(), + e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); + for (Map.Entry> entry : addUpSituationMap.entrySet()) { + addUpSituationService.deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), + SalaryEntityUtil.properties(entry.getValue(), AddUpSituationPO::getTaxAgentId), tenantKey); + addUpSituationService.saveBatch(entry.getValue(), tenantKey); + } + } + } + + private TaxDeclarationResult generateReportPerRecord(TaxDeclareRecordPO taxDeclareRecord, + List salaryAcctEmployees, + Long employeeId, String tenantKey) { + LocalDateTime now = LocalDateTime.now(); + List taxDeclarations = Lists.newArrayList(); + List taxDeclarationValues = Lists.newArrayList(); + List addUpSituations = Lists.newArrayList(); + // 查询薪资项目 + List salaryItems = salaryItemService.listAll(employeeId, tenantKey); + // 查询个税申报表列 + List taxReportColumns = taxReportColumnService.listAll(tenantKey); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + // 查询薪资核算记录 + Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); + List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds, tenantKey); + Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId); + // 查询薪资核算结果 + Set salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getId); + List salaryAcctResultValues = salaryAcctResultValueService.listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds, tenantKey); + // 查询薪资账套的累计字段对应关系 + Set salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalarySobId); + List salarySobAddUpRules = salarySobAddUpRuleService.listBySalarySobIds(salarySobIds, tenantKey); + Map salarySobAddUpRuleMap = SalaryEntityUtil.convert2Map(salarySobAddUpRules, + e -> e.getSalarySobId() + "-" + e.getAddUpColumnDataIndex()); + // 查询薪资账套的个税申报表对应规则 + List salarySobTaxReportRules = salarySobTaxReportRuleService.listBySalarySobIds(salarySobIds, tenantKey); + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, e -> e.getSalarySobId() + "-" + e.getReportColumnDataIndex()); + // 薪资核算结果按照薪资核算人员id聚合分类 + Map salaryAcctResultValueMap = SalaryEntityUtil.convert2Map( + salaryAcctResultValues, SalaryAcctResultValuePO::getSalaryAcctEmployeeId); + // 薪资核算人员按照所得项目聚合分类 + Map> incomeCategoryKeyEmployeeMap = SalaryEntityUtil.group2Map( + salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); + for (Map.Entry> incomeCategoryEntry : incomeCategoryKeyEmployeeMap.entrySet()) { + List controlViewSalaryAcctRecords = incomeCategoryEntry.getValue().stream() + .map(e -> salaryAcctRecordMap.get(e.getSalaryAcctRecordId())) + .distinct() + .filter(e -> Objects.equals(e.getControlView(), 1)) + .collect(Collectors.toList()); + TaxDeclarationPO taxDeclaration = TaxDeclarationPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecord.getId()) + .incomeCategory(Util.getIntValue(incomeCategoryEntry.getKey())) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .salaryMonth(taxDeclareRecord.getSalaryMonth()) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .remark(taxDeclareRecord.getRemark()) + .controlView(CollectionUtils.isEmpty(controlViewSalaryAcctRecords) ? 0 : 1) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(tenantKey) + .build(); + taxDeclarations.add(taxDeclaration); + // 薪资核算结果 + Set salaryAcctEmployeeIdSet = SalaryEntityUtil.properties(incomeCategoryEntry.getValue(), SalaryAcctEmployeePO::getId); + List resultValues = salaryAcctEmployeeIdSet.stream() + .map(salaryAcctResultValueMap::get) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + TaxDeclareContext taxDeclareContext = new TaxDeclareContext() + .setSalaryAcctRecordMap(salaryAcctRecordMap) + .setSalaryAcctEmployees(incomeCategoryEntry.getValue()) + .setSalaryAcctResultValues(resultValues) + .setTaxDeclaration(taxDeclaration) + .setSalarySobTaxReportRuleMap(salarySobTaxReportRuleMap) + .setSalarySobAddUpRuleMap(salarySobAddUpRuleMap) + .setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())) + .setSalaryItems(salaryItems); + TaxDeclarationStrategy taxDeclarationStrategy = new TaxDeclarationCommon(); + TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext, employeeId, tenantKey); + taxDeclarationValues.addAll(generateResult.getTaxDeclarationValues()); + addUpSituations.addAll(generateResult.getAddUpSituations()); + } + return new TaxDeclarationResult() + .setTaxDeclarations(taxDeclarations) + .setTaxDeclarationValues(taxDeclarationValues) + .setAddUpSituations(addUpSituations); + } + + /** + * 校验是否可以生成个税申报表 + * + * @param saveParam + * @param taxAgentNameMap + * @param salaryAcctRecords + * @param salaryAcctTaxAgents + * @param tenantKey + */ + private List checkBeforeSave(TaxDeclarationSaveParam saveParam, + Map taxAgentNameMap, + List salaryAcctRecords, + List salaryAcctTaxAgents, + Long employeeId, String tenantKey) { + List resultList = Lists.newArrayList(); + // 如果存在未归档的薪资核算记录,不允许生成个税申报表 + boolean notArchived = salaryAcctRecords.stream() + .anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); + if (notArchived) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 98875, "{0}有未归档数据,请全部归档后再申报") + .replace("{0}", saveParam.getSalaryMonth().toString())); + } + // 查询已归档的薪资核算记录 + List archivedSalaryAcctRecords = salaryAcctRecords.stream() + .filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue())) + .collect(Collectors.toList()); + // 无已归档的薪资核算记录,不允许生成个税申报表 + if (CollectionUtils.isEmpty(archivedSalaryAcctRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177860, "{0}无可申报数据") + .replace("{0}", saveParam.getSalaryMonth().toString())); + } + // 查询已归档的薪资核算记录是否已经生成过个税申报表 + Map> taxCycleKeySalaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle); + for (Map.Entry> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) { + Set archivedTaxAgentIds = SalaryEntityUtil.properties(taxCycleEntry.getValue(), SalaryAcctTaxAgentPO::getTaxAgentId); + List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(saveParam.getSalaryMonth(), archivedTaxAgentIds, tenantKey); + TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream() + .filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) + && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) + || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))) + .findAny() + .orElse(null); + // 已经申报成功了的个税申报表的个税扣缴义务人不允许重新生成 + if (Objects.nonNull(declareSuccessTaxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成") + .replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())) + .replace("{1}", declareSuccessTaxDeclareRecord.getTaxCycle())); + } + resultList.addAll(taxDeclareRecords); + } + return resultList; + } + + /** + * 根据个税扣缴义务人范围查询个税扣缴义务人 + * + * @param saveParam + * @param employeeId + * @param tenantKey + * @return + */ + private List queryByTaxAgentRange(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey) { + List taxAgents; + if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ALL_TAX_AGENT) { + // 判断当前是否开启了分权 + Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); + // 判断是否是总管理员 + Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); + if (openDevolution && !isChief) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160523, "对不起,您不是薪酬模块的总管理员,不具备生成所有个税扣缴义务人的权限")); + } + taxAgents = taxAgentService.listAll(tenantKey); + } else if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ADMIN_TAX_AGENT) { + taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId, tenantKey); + } else { + taxAgents = taxAgentService.listByIds(saveParam.getTaxAgentIds(), tenantKey); + } + return taxAgents; + } + + @Override + public void updateIcon(Long id, Integer displayIcon, Long employeeId, String tenantKey) { + TaxDeclareRecordPO taxDeclareRecord = getById(id, tenantKey); + if (taxDeclareRecord == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误")); + } + taxDeclareRecord.setDisplayUpdateIcon(displayIcon); + taxDeclareRecord.setUpdateTime(LocalDateTime.now()); + updateById(taxDeclareRecord); + } + + @Override + public void updateByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey) { + if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + List taxDeclareRecords = listByTaxCycleAndTaxAgentIds(taxCycle, taxAgentIds, tenantKey); + if (CollectionUtils.isEmpty(taxDeclareRecords)) { + return; + } + LocalDateTime now = LocalDateTime.now(); + taxDeclareRecords.forEach(e -> e.setDisplayUpdateIcon(1).setUpdateTime(now)); + updateBatchById(taxDeclareRecords); + } + + @Override + public boolean checkByAuthority(TaxDeclarationPO taxDeclaration, Long employeeId, String tenantKey) { + // 判断是否仅本人可见 + if (Objects.equals(taxDeclaration.getControlView(), 1) && !Objects.equals(taxDeclaration.getCreator(), employeeId)) { + return false; + } + // 判断是否开启了分权 + Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); + // 判断是否是总管理员 + Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); + // 可见范围内的个税扣缴义务人 + List taxAgents = Lists.newArrayList(); + if (openDevolution) { + if (isChief) { + taxAgents = taxAgentService.listAsChief(true, true, employeeId, tenantKey); + } else { + taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId, tenantKey); + } + if (CollectionUtils.isEmpty(taxAgents)) { + return false; + } + Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); + return taxAgentIds.contains(taxDeclaration.getTaxAgentId()); + } + // 查询个税申报表 + return true; + } + + @Override + public void deleteByIds(Collection ids, String tenantKey) { + if (CollectionUtils.isEmpty(ids)) { + return; + } + List taxDeclareRecords = listByIds(ids, tenantKey); + if (CollectionUtils.isEmpty(taxDeclareRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160524, "个税申报表不存在或已被删除")); + } + List cantDeleteTaxDeclareRecords = taxDeclareRecords.stream() + .filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) + && Objects.equals(e.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))) + .collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(cantDeleteTaxDeclareRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177854, "个税申报表已经申报,无法删除")); + } + new LambdaUpdateChainWrapper<>(taxDeclareRecordMapper) + .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) + .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclareRecordPO::getId, ids) + .set(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) + .update(); + // 删除个税申报表 + taxDeclarationService.deleteByTaxDeclareRecordIds(ids, tenantKey); + // 删除个税申报表明细 + taxDeclarationValueService.deleteByTaxDeclareRecordIds(ids, tenantKey); + // 记录日志 + writeDeleteLog(taxDeclareRecords, tenantKey); + } + + private void writeDeleteLog(List taxDeclareRecords, String tenantKey) { + // 记录日志 + List taxAgents = taxAgentService.listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId), tenantKey); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), com.baomidou.mybatisplus.core.toolkit.StringUtils.EMPTY)) + .replace("{1}", taxDeclareRecord.getTaxCycle())); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); + taxDeclarationLoggerTemplate.write(loggerContext); + } + } + + @Override + public void declare(Long id, Long employeeId, String tenantKey) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160526, "目前正处于申报中,请稍后片刻再点击「申报反馈」获取结果")); + } + if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160527, "目前正处于作废申报中,请稍后片刻再点击「作废反馈」获取结果")); + } + + // 查询个税申报表 + List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(YearMonth.parse(taxDeclareRecord.getTaxCycle()), + Collections.singleton(taxDeclareRecord.getTaxAgentId()), tenantKey); + if (CollectionUtils.isEmpty(taxDeclarations)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156494, "当前无可申报的数据")); + } + AbnormalEmployeeListQueryParam queryParam = new AbnormalEmployeeListQueryParam() + .setTaxDeclareRecordId(taxDeclareRecord.getId()) + .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) + .setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 查询是否存在有未报送的人 + List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam, tenantKey); + if (CollectionUtils.isNotEmpty(notDeclareTaxDeclareEmployees)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 162125, "存在有未报送的人,请先报送相关人员后再申报个税")); + } + // 查询是否存在没有申报数据的人 + List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam, tenantKey); + if (CollectionUtils.isNotEmpty(noValueTaxDeclareEmployees)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160535, "存在没有申报数据的人,请重新核算这些人的薪资后再来申报个税")); + } + // 查询个税申报表的申报数据 + Set taxDeclarationIds = SalaryEntityUtil.properties(taxDeclarations, TaxDeclarationPO::getId); + List taxDeclarationValues = taxDeclarationValueService.listByTaxDeclarationIds(taxDeclarationIds, tenantKey); + // 查询本税款所属期内报送成功的人员 + List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(YearMonth.parse(taxDeclareRecord.getTaxCycle()), + taxDeclareRecord.getTaxAgentId(), tenantKey); + employeeDeclares = employeeDeclares.stream() + .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) + .collect(Collectors.toList()); + + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 查询个税申报表的表头 + List taxReportColumns = taxReportColumnService.listAll(tenantKey); + // 注册的企业信息-->请求参数 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + // 人员列表 + List> employeeDeclareParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); + requestParam.put("rylb", employeeDeclareParam); + // 综合所得 + Map taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); + requestParam.put("zhsd", taxDeclarationParam); + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("个税申报返回数据: {} , taxDeclareRecord: {}", res, taxDeclareRecord); + DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); + if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + } + if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); + } + // 更新个税申报记录 + taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); + taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); + taxDeclareRecord.setUpdateTime(LocalDateTime.now()); + taxDeclareRecordMapper.updateById(taxDeclareRecord); + // 删除个税申报申报失败的数据 + taxDeclareFailService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + + // 记录日志 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", taxDeclareRecord.getTaxCycle())); + loggerContext.setOperator(Util.null2String(employeeId)); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156454, "在线申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156454, "在线申报")); + taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long currentEmployeeId, String tenantKey) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, currentEmployeeId, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + if (StringUtils.isEmpty(taxDeclareRecord.getRequestId()) || !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156496, "请先点击「在线申报」后再点击「申报反馈」获取申报结果")); + } + + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX_FEEDBACK; + Map requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, requestParam); + log.info("申报反馈返回数据: {}, taxDeclareRecord: {}", res, JsonUtil.toJsonString(taxDeclareRecord)); + DeclareTaxFeedbackResponse declareTaxFeedbackResponse = JsonUtil.parseObject(res, DeclareTaxFeedbackResponse.class); + if (Objects.isNull(declareTaxFeedbackResponse) || Objects.isNull(declareTaxFeedbackResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156449, "服务异常")); + } + if (!Objects.equals(declareTaxFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareTaxFeedbackResponse.getHead().getMsg()); + } + // 申报反馈状态 + Integer declareFeedbackStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("fkztbj"), 0); + DeclareFeedBackStatusEnum declareFeedBackStatusEnum = SalaryEnumUtil.enumMatchByValue(declareFeedbackStatus, DeclareFeedBackStatusEnum.class); + if (declareFeedBackStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156509, "服务异常,接口返回数据有误")); + } + // 查询报送的人员 + List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(YearMonth.parse(taxDeclareRecord.getTaxCycle()), + taxDeclareRecord.getTaxAgentId(), tenantKey); + Map employeeInfoMap = SalaryEntityUtil.convert2Map(employeeDeclares, + e -> e.getEmployeeName() + "-" + e.getCardNum()); + // 流量统计 + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper + = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(tenantKey, currentEmployeeId + , LocalDate.parse(taxDeclareRecord.getTaxCycle() + "-01", SalaryDateUtil.DATE_FORMATTER) + , apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION); + + LocalDateTime now = LocalDateTime.now(); + List errorMsg = Lists.newArrayList(); + List taxDeclareFails = Lists.newArrayList(); + if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { + List failInfoList = JsonUtil.parseList(Util.null2String(declareTaxFeedbackResponse.getBody().getOrDefault("fknr", "")).replace("\\\"", "\""), Map.class); + for (Map map : failInfoList) { + String msg = Util.null2String(map.get("msg")); + if (StringUtils.isNotEmpty(msg)) { + errorMsg.add(msg); + } + List details = JsonUtil.parseList(map.get("details"), List.class); + for (List detail : CollectionUtils.emptyIfNull(details)) { + String employeeName = Util.null2String(detail.get(0)); + String cardNum = Util.null2String(detail.get(2)); + String incomeCategoryCode = Util.null2String(detail.get(4)); + TaxDeclareFailPO taxDeclareFailPO = new TaxDeclareFailPO() + .setId(IdGenerator.generate()) + .setTaxDeclareRecordId(taxDeclareRecord.getId()) + .setEmployeeName(employeeName) + .setCardNum(cardNum) + .setIncomeCategory(incomeCategoryCode) + .setErrorMsg(msg) + .setTenantKey(tenantKey) + .setCreator(currentEmployeeId) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + taxDeclareFails.add(taxDeclareFailPO); + // 流量使用记录 + EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); + if (Objects.isNull(employeeDeclarePO)) { + continue; + } + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + employeeInfoMap.remove(employeeName + "-" + cardNum); + } + } + taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg)); + } + // 申报状态 + Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), 0); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(declareStatus, TaxDeclareStatusEnum.class); + if (taxDeclareStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156509, "服务异常,接口返回数据有误")); + } + // 为处理异常情况,如果反馈状态为申报失败,则记录申报状态也为申报失败 + if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { + taxDeclareStatusEnum = TaxDeclareStatusEnum.DECLARE_FAIL; + } + taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + // 申报类型 + taxDeclareRecord.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); + taxDeclareRecord.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); + taxDeclareRecord.setRequestId(""); + taxDeclareRecord.setUpdateTime(LocalDateTime.now()); + BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); + BigDecimal payAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) + || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) { + // 如果是已缴纳状态,则更新已缴纳金额,判断是否需要线下退税 + if (purePaidAmount.compareTo(payAmount) > 0) { + taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()); + taxDeclarationRate.setMsg(String.format(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 183789, "应缴税额(不含滞纳金等):%s元,已缴金额(可能含滞纳金等):%s元,当前已缴款金额大于应缴纳金额,请线下前往办税大厅办理退款。"), payAmount, paidAmount)); + taxDeclarationRate.setMsgPersist(true); + } else if (purePaidAmount.compareTo(payAmount) == 0) { + taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString()); + } else { + throw new SalaryRunTimeException("缴款数据异常,请处理后重试"); + } + } else if (TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.equals(taxDeclareStatusEnum)) { + // 如果不是已缴纳状态,则减掉之前的已缴纳金额去更新应缴纳金额 + taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + } + // 更新个税申报记录 + taxDeclareRecordMapper.updateById(taxDeclareRecord); + // 如果申报失败 + if (CollectionUtils.isNotEmpty(taxDeclareFails)) { + taxDeclareFailService.saveBatch(taxDeclareFails); + } + // 更新流量使用记录 + employeeInfoMap.forEach((key, value) -> { + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), value.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + }); + taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper); + + // 记录日志 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", taxDeclareRecord.getTaxCycle())); + loggerContext.setOperator(Util.null2String(currentEmployeeId)); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156455, "申报反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156455, "申报反馈")); + taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void cancelDeclare(Long id, Long employeeId, String tenantKey) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + // 更正申报成功后不能作废 + if (Objects.equals(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182701, "更正申报后不允许作废")); + } + // 只有申报成功,无需缴款/申报成功,未缴款的状态才能作废 + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) + && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废")); + } + // 供应商信息 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 注册的企业信息-->请求参数 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + // 申报类型 + requestParam.put("sblx", "1"); + // 作废银联缴款凭证 + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(employeeId, tenantKey, apiConfig, taxDeclareRecord, requestParam); + // 是否清空所得 + requestParam.put("sfqksd", "0"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("作废申报返回数据:" + res); + DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); + if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + } + if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); + } + // 更新个税申报记录 + taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); + taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); + taxDeclareRecord.setUpdateTime(LocalDateTime.now()); + taxDeclareRecordMapper.updateById(taxDeclareRecord); + + // 记录日志 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", taxDeclareRecord.getTaxCycle())); + loggerContext.setOperator(Util.null2String(employeeId)); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156456, "申报作废")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156456, "申报作废")); + taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long employeeId, String tenantKey) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) + || StringUtils.isEmpty(taxDeclareRecord.getRequestId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156500, "请先点击「作废申报」后再来点击「申报反馈」按钮获取结果")); + } + // 供应商信息 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK; + Map requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, requestParam); + log.info("作废反馈返回数据:" + res); + CancelDeclareFeedbackResponse cancelDeclareFeedbackResponse = JsonUtil.parseObject(res, CancelDeclareFeedbackResponse.class); + if (Objects.isNull(cancelDeclareFeedbackResponse) || Objects.isNull(cancelDeclareFeedbackResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + } + if (!Objects.equals(cancelDeclareFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(cancelDeclareFeedbackResponse.getHead().getMsg()); + } + // 作废是否成功 + CancelDeclareStatusEnum cancelDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue( + SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("fkztbj"), 10), CancelDeclareStatusEnum.class); + if (cancelDeclareStatusEnum == CancelDeclareStatusEnum.CANCEL_FAIL) { + String feedbackBody = Util.null2String(cancelDeclareFeedbackResponse.getBody().get("fknr")).replace("\\", ""); + List errorMsgList = JsonUtil.parseList(feedbackBody, Map.class).stream() + .map(e -> Util.null2String(e.get("msg"))) + .collect(Collectors.toList()); + taxDeclarationRate.setStatus(false).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156508, "作废失败:") + StringUtils.join(errorMsgList, ",")); + } + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue( + SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("sbztbj"), 1), TaxDeclareStatusEnum.class); + if (taxDeclareStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156509, "服务异常,接口返回数据有误")); + } + taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + taxDeclareRecord.setRequestId(""); + taxDeclareRecord.setUpdateTime(LocalDateTime.now()); + taxDeclareRecordMapper.updateById(taxDeclareRecord); + + // 记录日志 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", taxDeclareRecord.getTaxCycle())); + loggerContext.setOperator(Util.null2String(employeeId)); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156457, "获取申报作废的反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156457, "获取申报作废的反馈")); + taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void updateDeclare(Long id, Long employeeId, String tenantKey) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + List taxDeclareStatusEnumValueList = Lists.newArrayList( + TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), + TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), + TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), + TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); + if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182702, "对不起,只有申报成功后才允许更正申报")); + } + // 供应商信息 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 注册的企业信息-->请求参数 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + // 申报类型 + requestParam.put("sblx", "1"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("更正申报请求数据:" + reqJson); + String url = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("更正申报返回数据:" + res); + UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class); + if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + } + if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg()); + } + taxDeclareRecord.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); + taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); + taxDeclareRecord.setRequestId(""); + taxDeclareRecord.setUpdateTime(LocalDateTime.now()); + updateById(taxDeclareRecord); + + // 记录日志 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", taxDeclareRecord.getTaxCycle())); + loggerContext.setOperator(Util.null2String(employeeId)); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177637, "更正申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177637, "更正申报")); + taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public String queryDeclareStatus(Long id, Long employeeId, String tenantKey) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + // 申报类型 + requestParam.put("sblx", "1"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_DECLARE_STATUS; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("税局端申报状态查询返回数据:" + res); + return res; + } + + @Override + public String queryCompanyIncomes(Long id, Long employeeId, String tenantKey) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + // 报表类型 + requestParam.put("reportType", "1"); + // 页码 + requestParam.put("pageNo", "1"); + // 每页数量 + requestParam.put("pageSize", "3000"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_COMPANY_INCOMES; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("税局端申报明细查询返回数据:" + res); + return res; + } + + private TaxDeclareRequest buildTaxDeclareRequest(Long id, Long employeeId, String tenantKey) { + // 查询供应商信息 + TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); + if (apiConfig == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量")); + } + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getById(id, tenantKey); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156495, "参数异常,个税申报记录不存在或已被删除")); + } + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = taxAgentService.getById(taxDeclareRecord.getTaxAgentId(), tenantKey); + // 查询个税扣缴义务人关联的企业信息 + TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(taxDeclareRecord.getTaxAgentId(), tenantKey); + if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); + } + // 注册的企业信息-->请求参数 + Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); + + return new TaxDeclareRequest().setTaxDeclarationApiConfig(apiConfig) + .setTaxAgent(taxAgent) + .setTaxDeclareRecord(taxDeclareRecord) + .setRequestParam(requestParam); + } +} diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 6d2332dd4..4f1d319df 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -7,6 +7,7 @@ import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; 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.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; @@ -16,9 +17,12 @@ import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationDetailWrapper; import com.engine.salary.wrapper.TaxDeclarationWrapper; +import com.engine.salary.wrapper.TaxDeclareRecordWrapper; +import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.web.bind.annotation.RequestParam; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -33,6 +37,9 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.text.ParseException; import java.time.LocalDate; +import java.util.Collection; +import java.util.List; +import java.util.Map; @Slf4j @@ -54,6 +61,11 @@ public class TaxDeclarationController { return ServiceUtil.getService(TaxDeclarationDetailWrapper.class, user); } + private TaxDeclareRecordWrapper getTaxDeclareRecordWrapper(User user) { + return ServiceUtil.getService(TaxDeclareRecordWrapper.class, user); + } + + //个税申报表列表 @POST @Path("/list") @@ -139,4 +151,288 @@ public class TaxDeclarationController { throw e; } } + + + /** + * 刷新个税申报表的待刷新标识 + * + * @param param 更新参数 + * @return + */ + @Path("/updateIcon") + @ApiOperation("刷新个税申报表的待刷新标识") + @Produces(MediaType.APPLICATION_JSON) + public String updateIcon(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclareRecordParam param) { + taxDeclareRecordWrapper.updateIcon(param.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(null); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getTaxDeclarationInfoById, taxDeclarationId); + } + + /** + * 个税申报表生成 + * + * @param ids 个税申报记录id + * @return + */ + @Path("/delete") + @ApiOperation("个税申报表生成") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult delete(@RequestBody Collection ids) { + taxDeclareRecordWrapper.delete(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(null); + } + + /** + * 个税申报表是否已经生成 + * + * @param index 进度缓存索引 + * @return + */ + @GetMapping("/getRate") + @ApiOperation("个税申报表是否已经生成") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult getRate(@RequestParam(value = "index") String index) { + TaxDeclarationRateDTO rateDTO = taxDeclareRecordWrapper.getRate(index, TenantContext.getCurrentTenantKey()); + return WeaResult.success(rateDTO); + } + + /** + * 获取个税申报记录下的个税申报表TAB + * + * @param id 个税申报记录id + * @return + */ + @GetMapping("/getTaxDeclarationTab") + @ApiOperation("获取个税申报记录下的个税申报表TAB") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> getTaxDeclarationTab(@RequestParam(value = "id") Long id) { + List taxDeclarationTab = taxDeclareRecordWrapper.getTaxDeclarationTab(id, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(taxDeclarationTab); + } + + /** + * 在线申报 + * + * @param taxDeclareRecordParam 在线申报参数 + * @return + */ + @Path("/declare") + @ApiOperation("在线申报") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult declare(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String cacheKey = taxDeclareRecordWrapper.declare(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(cacheKey); + } + + /** + * 获取在线申报反馈 + * + * @param taxDeclareRecordParam 申报反馈参数 + * @return + */ + @Path("/getDeclareFeedback") + @ApiOperation("获取在线申报反馈") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult getDeclareFeedback(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String cacheKey = taxDeclareRecordWrapper.getDeclareFeedback(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(cacheKey); + } + + /** + * 作废 + * + * @param taxDeclareRecordParam 作废参数 + * @return + */ + @Path("/cancel") + @ApiOperation("作废") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult cancel(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String cacheKey = taxDeclareRecordWrapper.cancelDeclare(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(cacheKey); + } + + /** + * 获取作废反馈 + * + * @param taxDeclareRecordParam 作废反馈参数 + * @return + */ + @Path("/getCancelFeedback") + @ApiOperation("获取作废反馈") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult getCancelFeedback(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String cacheKey = taxDeclareRecordWrapper.getCancelFeedback(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(cacheKey); + } + + /** + * 更正申报 + * + * @param taxDeclareRecordParam 更正申报参数 + * @return + */ + @Path("/updateDeclare") + @ApiOperation("更正申报") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult updateDeclare(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String cacheKey = taxDeclareRecordWrapper.updateDeclare(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(cacheKey); + } + + /** + * 税局端申报状态查询 + * + * @param taxDeclareRecordParam 查询参数 + * @return + */ + @Path("/queryDeclareStatus") + @ApiOperation("税局端申报状态查询") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult queryDeclareStatus(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String res = taxDeclareRecordWrapper.queryDeclareStatus(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(res); + } + + /** + * 税局端申报明细查询 + * + * @param taxDeclareRecordParam 查询申报明细参数 + * @return + */ + @Path("/queryCompanyIncomes") + @ApiOperation("税局端申报明细查询") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult queryCompanyIncomes(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String res = taxDeclareRecordWrapper.queryCompanyIncomes(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(res); + } + + /** + * 刷新数据 + * + * @param taxDeclareRecordParam 刷新数据参数 + * @return + */ + @Path("/refreshData") + @ApiOperation("刷新数据") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult refreshData(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { + String cacheKey = taxDeclareRecordWrapper.refreshData(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(cacheKey); + } + + /** + * 个税申报表详情列表 + * + * @param queryParam 查询条件 + * @return + */ + @Path("/detail/list") + @ApiOperation("个税申报表申报数据列表") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> listTaxDeclarationValue(@RequestBody TaxDeclarationValueListQueryParam queryParam) { + WeaTable weaTable = taxDeclareRecordWrapper.listValuePage(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(weaTable); + } + + /** + * 导出个税申报表申报数据 + * + * @param queryParam 导出参数 + * @return + */ + @Path("/detail/export") + @ApiOperation("导出个税申报表申报数据") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> exportTaxDeclaration(@RequestBody @Validated TaxDeclarationValueListQueryParam queryParam) { + Map map = taxDeclareRecordWrapper.exportTaxDeclarationValue(queryParam, UserContext.getCurrentUser()); + return WeaResult.success(map); + } + + /** + * 个税申报表申报数据-人员未报送列表 + * + * @param queryParam 查询条件 + * @return + */ + @Path("/employee/list4NotDeclare") + @ApiOperation("个税申报表申报数据-人员未报送列表") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> listEmployee4NotDeclare(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { + WeaTable weaTable = taxDeclareRecordWrapper.listEmployeePage4NotDeclare(queryParam, TenantContext.getCurrentTenantKey()); + return WeaResult.success(weaTable); + } + + /** + * 个税申报表申报数据-报送人员无申报数据列表 + * + * @param queryParam 查询条件 + * @return + */ + @Path("/employee/list4NoValue") + @ApiOperation("个税申报表申报数据-报送人员无申报数据列表") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> listEmployee4NoValue(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { + WeaTable weaTable = taxDeclareRecordWrapper.listEmployeePage4NoValue(queryParam, TenantContext.getCurrentTenantKey()); + return WeaResult.success(weaTable); + } + + /** + * 个税申报表申报数据-申报失败列表 + * + * @param queryParam 查询条件 + * @return + */ + @Path("/employee/list4Fail") + @ApiOperation("个税申报表申报数据-申报失败列表") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> listEmployee4Fail(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { + WeaTable weaTable = taxDeclareRecordWrapper.listEmployeePage4Fail(queryParam, TenantContext.getCurrentTenantKey()); + return WeaResult.success(weaTable); + } + + /** + * 个税申报表申报数据-导出人员未报送列表 + * + * @param queryParam 查询条件 + * @return + */ + @Path("/employee/export4NotDeclare") + @ApiOperation("个税申报表申报数据-导出人员未报送列表") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> exportEmployee4NotDeclare(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { + Map map = taxDeclareRecordWrapper.exportEmployee4NotDeclare(queryParam, UserContext.getCurrentUser()); + return WeaResult.success(map); + } + + /** + * 个税申报表申报数据-导出报送人员无申报数据列表 + * + * @param queryParam 查询条件 + * @return + */ + @Path("/employee/export4NoValue") + @ApiOperation("个税申报表申报数据-导出报送人员无申报数据列表") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> exportEmployee4NoValue(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { + Map map = taxDeclareRecordWrapper.exportEmployee4NoValue(queryParam, UserContext.getCurrentUser()); + return WeaResult.success(map); + } + + /** + * 个税申报表申报数据-导出申报失败列表 + * + * @param queryParam 导出参数 + * @return + */ + @Path("/employee/export4Fail") + @ApiOperation("个税申报表申报数据-导出申报失败列表") + @Produces(MediaType.APPLICATION_JSON) + public WeaResult> exportEmployee4Fail(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { + Map map = taxDeclareRecordWrapper.exportEmployee4Fail(queryParam, UserContext.getCurrentUser()); + return WeaResult.success(map); + } + } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java new file mode 100644 index 000000000..ae77b1f61 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -0,0 +1,753 @@ +package com.engine.salary.wrapper; + +import com.engine.core.impl.Service; +import com.engine.salary.service.SalaryCacheService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationExcelService; +import com.engine.salary.service.TaxDeclarationService; +import com.weaver.common.component.form.WeaForm; +import com.weaver.common.component.table.WeaTable; +import com.weaver.common.component.table.page.Page; +import com.weaver.common.component.table.permission.Permission; +import com.weaver.common.distribution.genid.IdGenerator; +import com.weaver.common.hr.util.Util; +import com.weaver.common.hrm.service.HrmCommonEmployeeService; +import com.weaver.common.threadPool.ThreadPoolUtil; +import com.weaver.common.threadPool.constant.ModulePoolEnum; +import com.weaver.common.threadPool.entity.LocalRunnable; +import com.weaver.datasecurity.interceptor.DSTenantKeyThreadVar; +import com.weaver.framework.util.JsonUtil; +import com.weaver.hrm.salary.cache.SalaryCacheKey; +import com.weaver.hrm.salary.common.excel.ExcelExportParam; +import com.weaver.hrm.salary.constant.SalaryConstant; +import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO; +import com.weaver.hrm.salary.entity.taxdeclaration.dto.*; +import com.weaver.hrm.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; +import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; +import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.weaver.hrm.salary.entity.taxdeclaration.po.*; +import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.weaver.hrm.salary.exception.SalaryNullException; +import com.weaver.hrm.salary.exception.SalaryRunTimeException; +import com.weaver.hrm.salary.service.*; +import com.weaver.hrm.salary.util.*; +import com.weaver.teams.domain.EntityType; +import com.weaver.teams.domain.user.SimpleEmployee; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.compress.utils.Lists; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.stereotype.Component; + +import java.time.YearMonth; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 9:24 AM + * @version:v1.0 + */ +@Slf4j +@Component +public class TaxDeclareRecordWrapper extends Service { + + + private TaxDeclareRecordService taxDeclareRecordService; + + private TaxAgentService taxAgentService; + + private HrmCommonEmployeeService hrmCommonEmployeeService; + + private SalaryCacheService salaryCacheService; + + private TaxDeclarationService taxDeclarationService; + + private TaxDeclarationValueService taxDeclarationValueService; + + private TaxDeclarationExcelService taxDeclarationExcelService; + + private TaxDeclareEmployeeService taxDeclareEmployeeService; + + private TaxDeclareFailService taxDeclareFailService; + + /** + * 个税申报记录列表 + * + * @param queryParam + * @param employeeId + * @param tenantKey + * @return + */ + public WeaTable listPage(TaxDeclarationListQueryParam queryParam, Long employeeId, String tenantKey) { + Page page = taxDeclareRecordService.listPageByParam(queryParam, employeeId, tenantKey); + Page dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); + if (CollectionUtils.isNotEmpty(page.getRecords())) { + // 查询个税扣缴义务人 + Set taxAgentIds = SalaryEntityUtil.properties(page.getRecords(), TaxDeclareRecordPO::getTaxAgentId); + List taxAgents = taxAgentService.listByIds(taxAgentIds, tenantKey); + // 查询人员姓名 + List employeeIds = SalaryEntityUtil.properties(page.getRecords(), TaxDeclareRecordPO::getCreator, Collectors.toList()); + List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIds, tenantKey); + + List dtoList = Lists.newArrayList(); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + Map simpleEmployeeNameMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId, SimpleEmployee::getName); + for (TaxDeclareRecordPO taxDeclareRecord : page.getRecords()) { + TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); + TaxDeclareRecordListDTO taxDeclareRecordListDTO = new TaxDeclareRecordListDTO() + .setId(taxDeclareRecord.getId()) + .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) + .setTaxAgentName(taxAgentNameMap.get(taxDeclareRecord.getTaxAgentId())) + .setSalaryMonth(taxDeclareRecord.getSalaryMonth()) + .setTaxCycle(taxDeclareRecord.getTaxCycle()) + .setTaxDeclareType(taxDeclareTypeEnum) + .setTaxDeclareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel())) + .setTaxDeclareStatus(taxDeclareStatusEnum) + .setTaxDeclareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel())) + .setTaxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPaidAmount())) + .setOperateEmployeeId(taxDeclareRecord.getCreator()) + .setOperateEmployeeName(simpleEmployeeNameMap.get(taxDeclareRecord.getCreator())) + .setOperateTime(SalaryDateUtil.getFormatLocalDateTime(taxDeclareRecord.getCreateTime())) + .setDescription(taxDeclareRecord.getRemark()) + .setDisplayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)); + dtoList.add(taxDeclareRecordListDTO); + } + dtoPage.setRecords(dtoList); + } + // 转换成前端所需的数据格式 + WeaTable weaTable = SalaryFormatUtil.getInstance() + .buildTable(TaxDeclareRecordListDTO.class, dtoPage); + for (int i = 0; i < dtoPage.getRecords().size(); i++) { + TaxDeclareRecordListDTO dto = dtoPage.getRecords().get(i); + List permissions = weaTable.getOperatesPermission().get(i); + for (int j = 0; j < permissions.size(); j++) { + Permission permission = permissions.get(j); + if (j == 1 && (dto.getTaxDeclareStatus() != TaxDeclareStatusEnum.NOT_DECLARE || dto.getTaxDeclareType() != TaxDeclareTypeEnum.NORMAL_DECLARE)) { + permission.setVisible(false); + permission.setDisabled(false); + } + } + } + return weaTable; + } + + /** + * 个税申报表明细列表 + * + * @param queryParam 列表查询条件 + * @param tenantKey 租户key + * @return + */ + public WeaTable listValuePage(TaxDeclarationValueListQueryParam queryParam, Long employeeId, String tenantKey) { + // 查询个税申报表 + TaxDeclarationPO taxDeclaration = taxDeclarationService.getById(queryParam.getTaxDeclarationId(), tenantKey); + // 判断是否有权限查看 + boolean canSee = taxDeclareRecordService.checkByAuthority(taxDeclaration, employeeId, tenantKey); + if (!canSee) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看")); + } + String pageUid = "taxDeclarationValueList"; + SalaryPageUtil.handlePageSize(pageUid, queryParam); + // 查询个税申报表详情 + Page page = taxDeclarationValueService.listPageByTaxDeclarationIds( + new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true), Collections.singleton(queryParam.getTaxDeclarationId()), tenantKey); + TaxDeclarationValueListDTO taxDeclarationValueListDTO = taxDeclarationValueService.convert2List(taxDeclaration, page.getRecords(), tenantKey); + Page> dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); + dtoPage.setRecords(taxDeclarationValueListDTO.getData()); + // 转成前端所需的格式 + WeaTable> weaTable = new WeaTable<>(); + weaTable.setColumns(taxDeclarationValueListDTO.getColumns()); + weaTable.setPage(dtoPage); + weaTable.setModule(SalaryConstant.MODULE); + weaTable.setPageUid(pageUid); + return weaTable; + } + + /** + * 未报送的人员列表 + * + * @param queryParam + * @param tenantKey + * @return + */ + public WeaTable listEmployeePage4NotDeclare(AbnormalEmployeeListQueryParam queryParam, String tenantKey) { + String pageUid = "abnormalEmployeeList4NoDeclare"; + SalaryPageUtil.handlePageSize(pageUid, queryParam); + WeaTable weaTable = listEmployeePage("NotDeclare", queryParam, tenantKey); + weaTable.setPageUid(pageUid); + return weaTable; + } + + /** + * 没有申报数据的人员列表 + * + * @param queryParam + * @param tenantKey + * @return + */ + public WeaTable listEmployeePage4NoValue(AbnormalEmployeeListQueryParam queryParam, String tenantKey) { + String pageUid = "abnormalEmployeeList4NoValue"; + SalaryPageUtil.handlePageSize(pageUid, queryParam); + WeaTable weaTable = listEmployeePage("NoValue", queryParam, tenantKey); + weaTable.setPageUid(pageUid); + return weaTable; + } + + /** + * 申报失败的人员列表 + * + * @param queryParam + * @param tenantKey + * @return + */ + public WeaTable listEmployeePage4Fail(AbnormalEmployeeListQueryParam queryParam, String tenantKey) { + String pageUid = "failEmployeeList"; + SalaryPageUtil.handlePageSize(pageUid, queryParam); + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId(), tenantKey); + // 查询申报失败的数据 + Page page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true); + page = taxDeclareFailService.listPageByTaxDeclareRecordIds(page, Collections.singleton(taxDeclareRecord.getId()), tenantKey); + // 转换成dto + Page dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); + dtoPage.setRecords(taxDeclareFailService.convert2FailEmployeeList(taxDeclareRecord, page.getRecords(), tenantKey)); + // 转成前端所需的格式 + return SalaryFormatUtil.getInstance().buildTable(FailEmployeeListDTO.class, dtoPage); + } + + private WeaTable listEmployeePage(String key, AbnormalEmployeeListQueryParam queryParam, String tenantKey) { + WeaTable weaTable; + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId(), tenantKey); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + if (StringUtils.isEmpty(queryParam.getKeyword())) { + // 查询个税申报记录的人员 + Page page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true); + if (StringUtils.equals("NotDeclare", key)) { + page = taxDeclareEmployeeService.listPage4NotDeclareByParam(queryParam, tenantKey); + } else if (StringUtils.equals("NoValue", key)) { + page = taxDeclareEmployeeService.listPage4NoValueByParam(queryParam, tenantKey); + } + Page dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); + dtoPage.setRecords(taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, page.getRecords(), tenantKey)); + // 转换成前端所需的格式 + weaTable = SalaryFormatUtil.getInstance().buildTable(AbnormalEmployeeListDTO.class, dtoPage); + } else { + // 查询条件中包含"keyword"时,不好通过SQL分页,所以在内存中分页 + List taxDeclareEmployees = Collections.emptyList(); + if (StringUtils.equals("NotDeclare", key)) { + taxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam, tenantKey); + } else if (StringUtils.equals("NoValue", key)) { + taxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam, tenantKey); + } + List dtos = taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees, tenantKey) + .stream() + .filter(e -> StringUtils.contains(e.getEmployeeName(), queryParam.getKeyword()) + || StringUtils.contains(e.getJobNum(), queryParam.getKeyword()) + || StringUtils.contains(e.getCardNum(), queryParam.getKeyword())) + .collect(Collectors.toList()); + Page dtoPage = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), dtos.size(), true); + dtoPage.setRecords(SalaryPageUtil.subList((int) dtoPage.getCurrent(), (int) dtoPage.getSize(), dtos)); + // 转换成前端所需的格式 + weaTable = SalaryFormatUtil.getInstance().buildTable(AbnormalEmployeeListDTO.class, dtoPage); + } + return weaTable; + } + + /** + * 获取个税申报记录的表单 + * + * @param id + * @param tenantKey + * @return + */ + public WeaForm getForm(Long id, Long employeeId, String tenantKey) { + TaxDeclareRecordFormDTO formDTO = new TaxDeclareRecordFormDTO(); + formDTO.setTaxAgentRange(TaxAgentRangeEnum.SELECT_TAX_AGENT); + // 判断当前是否开启了分权 + Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); + Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); + // 转换成前端所需的数据格式 + WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclareRecordFormDTO.class, formDTO); + weaForm.getItems().forEach((k, v) -> { + if (StringUtils.equals("salaryMonth", k)) { + Map otherParams = new HashMap<>(); + otherParams.put("type", "month"); + v.setOtherParams(otherParams); + } + // 未开启分权,没有"作为管理员的个税扣缴义务人" + if (!openDevolution && StringUtils.equals("taxAgentRange", k)) { + v.getOptions().remove(1); + } + // 开启分权,但不是总管理员,没有"所有个税扣缴义务人" + if (openDevolution && !isChief && StringUtils.equals("taxAgentRange", k)) { + v.getOptions().remove(0); + } + }); + return weaForm; + } + + /** + * 获取个税申报记录下的个税申报表TAB + * + * @param id + * @param tenantKey + * @return + */ + public List getTaxDeclarationTab(Long id, Long employeeId, String tenantKey) { + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id, tenantKey); + // 查询个税申报记录下的个税申报表 + List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(YearMonth.parse(taxDeclareRecord.getTaxCycle()), + Collections.singleton(taxDeclareRecord.getTaxAgentId()), tenantKey); + taxDeclarations = taxDeclarations.stream() + .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), employeeId)) + .collect(Collectors.toList()); + Map taxDeclarationMap = SalaryEntityUtil.convert2Map(taxDeclarations, TaxDeclarationPO::getIncomeCategory); + List tabs = Lists.newArrayList(); + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + TaxDeclarationPO taxDeclaration = taxDeclarationMap.get(incomeCategoryEnum.getValue()); + if (taxDeclaration != null) { + TaxDeclarationTabDTO taxDeclarationTabDTO = new TaxDeclarationTabDTO() + .setTabName(SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())) + .setIncomeCategory(incomeCategoryEnum) + .setTaxDeclarationId(taxDeclaration.getId()); + tabs.add(taxDeclarationTabDTO); + } + } + return tabs; + } + + /** + * 查询个税申报表的基本信息 + * + * @param id 个税申报表id + * @param tenantKey 租户key + * @return + */ + public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id, String tenantKey) { + // 查询个税申报表 + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id, tenantKey); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); + } + AbnormalEmployeeListQueryParam queryParam = new AbnormalEmployeeListQueryParam() + .setTaxDeclareRecordId(taxDeclareRecord.getId()) + .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) + .setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 查询是否存在有未报送的人 + List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam, tenantKey); + // 查询是否存在没有申报数据的人 + List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam, tenantKey); + // 查询是否存在申报失败的人 + List taxDeclareFails = taxDeclareFailService.listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + // 查询个税扣缴义务人 + TaxAgentPO taxAgentPO = taxAgentService.getById(taxDeclareRecord.getTaxAgentId(), tenantKey); + TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); + return new TaxDeclarationInfoDTO() + .setSalaryMonth(taxDeclareRecord.getSalaryMonth()) + .setTaxCycle(taxDeclareRecord.getTaxCycle()) + .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) + .setTaxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")) + .setDeclareType(taxDeclareTypeEnum) + .setDeclareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel())) + .setDeclareStatus(taxDeclareStatusEnum) + .setDeclareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel())) + .setDeclareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) + .setDisplayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)) + .setDeclareFailSize(taxDeclareFails.size()) + .setAbnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size()) + .setTaxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPaidAmount())); + } + + /** + * 保存 + * + * @param saveParam 保存参数 + * @param employeeId 人员id + * @param tenantKey 租户key + */ + public String save(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey) { + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true) + .setIndex(Util.null2String(IdGenerator.generate())) + .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95836, "生成申报表")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + DSTenantKeyThreadVar.tenantKey.set(tenantKey); + taxDeclareRecordService.save(saveParam, employeeId, tenantKey); + taxDeclarationRate.setStatus(true).setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("个税申报表生成报错:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187276, "个税申报表生成报错:") + e.getMessage()); + } finally { + DSTenantKeyThreadVar.tenantKey.remove(); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "saveTaxDeclaration", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 更新个税申报表的待刷新数据的标识 + * + * @param id + * @param employeeId + * @param tenantKey + */ + public void updateIcon(Long id, Long employeeId, String tenantKey) { + taxDeclareRecordService.updateIcon(id, NumberUtils.INTEGER_ZERO, employeeId, tenantKey); + } + + /** + * 删除个税申报表 + * + * @param ids + * @param employeeId + * @param tenantKey + */ + public void delete(Collection ids, Long employeeId, String tenantKey) { + taxDeclareRecordService.deleteByIds(ids, tenantKey); + } + + /** + * 获取个税申报表是否已经生成 + * + * @param index + * @param tenantKey + * @return + */ + public TaxDeclarationRateDTO getRate(String index, String tenantKey) { + return salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION, index, TaxDeclarationRateDTO.class); + } + + /** + * 申报 + * + * @param id + * @param tenantKey + */ + public String declare(Long id, Long employeeId, String tenantKey) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156454, "在线申报")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + DSTenantKeyThreadVar.tenantKey.set(tenantKey); + taxDeclareRecordService.declare(id, employeeId, tenantKey); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException | SalaryNullException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("在线申报失败:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187274, "在线申报失败:") + e.getMessage()); + } finally { + DSTenantKeyThreadVar.tenantKey.remove(); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 获取申报反馈 + * + * @param id + * @param tenantKey + */ + public String getDeclareFeedback(Long id, Long employeeId, String tenantKey) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182680, "获取申报反馈")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + taxDeclareRecordService.getDeclareFeedback(id, taxDeclarationRate, employeeId, tenantKey); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException | SalaryNullException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("获取申报反馈失败:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187255, "获取申报反馈失败:") + e.getMessage()); + } finally { + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 作废 + * + * @param id + * @param tenantKey + */ + public String cancelDeclare(Long id, Long employeeId, String tenantKey) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 158842, "作废申报")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + taxDeclareRecordService.cancelDeclare(id, employeeId, tenantKey); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException | SalaryNullException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("作废申报失败:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187272, "作废申报失败:") + e.getMessage()); + } finally { + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "cancel", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 获取作废反馈 + * + * @param id + * @param tenantKey + */ + public String getCancelFeedback(Long id, Long employeeId, String tenantKey) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182681, "获取作废申报反馈")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + taxDeclareRecordService.getCancelFeedback(id, taxDeclarationRate, employeeId, tenantKey); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException | SalaryNullException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("获取作废反馈结果失败:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187270, "获取作废反馈结果失败:") + e.getMessage()); + } finally { + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getCancelFeedback", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 更正申报 + * + * @param id + * @param employeeId + * @param tenantKey + * @return + */ + public String updateDeclare(Long id, Long employeeId, String tenantKey) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177637, "更正申报")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + taxDeclareRecordService.updateDeclare(id, employeeId, tenantKey); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException | SalaryNullException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("更正申报失败:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187269, "更正申报失败:") + e.getMessage()); + } finally { + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "updateDeclare", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 税局端申报状态查询 + * + * @param id + * @param employeeId + * @param tenantKey + * @return + */ + public String queryDeclareStatus(Long id, Long employeeId, String tenantKey) { + return taxDeclareRecordService.queryDeclareStatus(id, employeeId, tenantKey); + } + + /** + * 税局端申报明细查询 + * + * @param id + * @param employeeId + * @param tenantKey + * @return + */ + public String queryCompanyIncomes(Long id, Long employeeId, String tenantKey) { + return taxDeclareRecordService.queryCompanyIncomes(id, employeeId, tenantKey); + } + + /** + * 刷新数据 + * + * @param id + * @param employeeId + * @param tenantKey + * @return + */ + public String refreshData(Long id, Long employeeId, String tenantKey) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + DSTenantKeyThreadVar.tenantKey.set(tenantKey); + taxDeclareRecordService.refreshData(id, employeeId, tenantKey); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException | SalaryNullException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("刷新数据失败:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187268, "刷新数据失败:") + e.getMessage()); + } finally { + DSTenantKeyThreadVar.tenantKey.remove(); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "refreshData", localRunnable); + return taxDeclarationRate.getIndex(); + } + + private void checkBefore(Long id) { + TaxDeclarationRateDTO taxDeclarationRate = salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION, Util.null2String(id), TaxDeclarationRateDTO.class); + if (taxDeclarationRate != null && !taxDeclarationRate.isFinish()) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182691, "当前正处于「{0}」中,请稍后再试").replace("{0}", taxDeclarationRate.getMsg())); + } + } + + /** + * 导出个税申报明细列表 + * + * @param queryParam + * @param simpleEmployee + * @return + */ + public Map exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam, SimpleEmployee simpleEmployee) { + ExcelExportParam excelExportParam = new ExcelExportParam() + .setBiz(String.valueOf(IdGenerator.generate())) + .setModule(EntityType.hrmsalary.name()) + .setFunction("exportTaxDeclarationValue"); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + taxDeclarationExcelService.exportTaxDeclarationValue(excelExportParam, queryParam, simpleEmployee); + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportTaxDeclarationValue", localRunnable); + return JsonUtil.parseMap(excelExportParam, Object.class); + } + + /** + * 导出未报送的人员列表 + * + * @param queryParam + * @param simpleEmployee + * @return + */ + public Map exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { + ExcelExportParam excelExportParam = new ExcelExportParam() + .setBiz(String.valueOf(IdGenerator.generate())) + .setModule(EntityType.hrmsalary.name()) + .setFunction("exportEmployee4NotDeclare"); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + taxDeclarationExcelService.exportEmployee4NotDeclare(excelExportParam, queryParam, simpleEmployee); + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NotDeclare", localRunnable); + return JsonUtil.parseMap(excelExportParam, Object.class); + } + + /** + * 导出没有申报数据的人员列表 + * + * @param queryParam + * @param simpleEmployee + * @return + */ + public Map exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { + ExcelExportParam excelExportParam = new ExcelExportParam() + .setBiz(String.valueOf(IdGenerator.generate())) + .setModule(EntityType.hrmsalary.name()) + .setFunction("exportEmployee4NoValue"); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + taxDeclarationExcelService.exportEmployee4NoValue(excelExportParam, queryParam, simpleEmployee); + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NoValue", localRunnable); + return JsonUtil.parseMap(excelExportParam, Object.class); + } + + /** + * 导出申报失败的人员列表 + * + * @param queryParam + * @param simpleEmployee + * @return + */ + public Map exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { + ExcelExportParam excelExportParam = new ExcelExportParam() + .setBiz(String.valueOf(IdGenerator.generate())) + .setModule(EntityType.hrmsalary.name()) + .setFunction("exportEmployee4Fail"); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + taxDeclarationExcelService.exportEmployee4Fail(excelExportParam, queryParam, simpleEmployee); + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4Fail", localRunnable); + return JsonUtil.parseMap(excelExportParam, Object.class); + } +} From dc638971657e304f0ba1040baee39e49a5fd6323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 11 Aug 2023 14:20:14 +0800 Subject: [PATCH 010/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308090303.sql | 4 +- resource/sqlupgrade/GS/sql202308090303.sql | 4 +- resource/sqlupgrade/JC/sql202308090303.sql | 4 +- resource/sqlupgrade/Mysql/sql202308090303.sql | 4 +- .../sqlupgrade/Oracle/sql202308090303.sql | 4 +- resource/sqlupgrade/PG/sql202308090303.sql | 4 +- .../sqlupgrade/SQLServer/sql202308090303.sql | 4 +- resource/sqlupgrade/ST/sql202308090303.sql | 4 +- .../engine/salary/common/YearMonthRange.java | 28 + .../param/SalaryAcctEmployeeQueryParam.java | 9 +- .../salaryacct/po/SalaryAcctEmployeePO.java | 5 + .../salaryacct/po/SalaryAcctTaxAgentPO.java | 75 ++ .../bo/TaxDeclareEmployeeBO.java | 174 +++-- .../dto/TaxDeclarationInfoDTO.java | 48 +- .../dto/TaxDeclareRecordListDTO.java | 7 +- .../param/AbnormalEmployeeListQueryParam.java | 5 +- .../param/TaxDeclarationListQueryParam.java | 8 +- .../taxdeclaration/po/TaxDeclarationPO.java | 6 + .../taxdeclaration/po/TaxDeclareRecordPO.java | 42 +- .../salaryacct/SalaryAcctRecordMapper.java | 9 + .../salaryacct/SalaryAcctRecordMapper.xml | 25 +- .../taxagent/TaxDeclareRecordMapper.java | 11 - .../TaxDeclarationDetailMapper.java | 10 + .../TaxDeclareRecordMapper.java | 79 ++ .../taxdeclaration/TaxDeclareRecordMapper.xml | 536 ++++++++++++++ .../engine/salary/service/ExtEmpService.java | 2 + .../salary/service/SalaryAcctCalcService.java | 31 - .../service/SalaryAcctRecordService.java | 10 + .../salary/service/TaxDeclarationService.java | 9 + .../service/TaxDeclarationValueService.java | 71 ++ .../service/TaxDeclareEmployeeService.java | 60 ++ .../salary/service/TaxDeclareFailService.java | 51 ++ .../service/TaxDeclareRecordService.java | 152 ++-- .../service/TaxReportColumnService.java | 31 + .../factory/SalaryCalcRunServiceFactory.java | 2 +- .../factory/TaxPaymentServiceFactory.java | 2 +- .../service/impl/ExtEmpServiceImpl.java | 12 + .../impl/SalaryAcctRecordServiceImpl.java | 9 + .../service/impl/SalaryItemServiceImpl.java | 2 +- .../impl/TaxDeclarationServiceImpl.java | 28 +- .../impl/TaxDeclarationValueServiceImpl.java | 173 +++++ .../impl/TaxDeclareEmployeeServiceImpl.java | 101 +++ .../impl/TaxDeclareFailServiceImpl.java | 97 +++ .../impl/TaxDeclareRecordServiceImpl.java | 677 +++++++++--------- .../impl/TaxReportColumnServiceImpl.java | 40 ++ .../salary/web/TaxDeclarationController.java | 2 +- .../wrapper/TaxDeclareRecordWrapper.java | 648 ++++++++--------- 47 files changed, 2325 insertions(+), 994 deletions(-) create mode 100644 src/com/engine/salary/common/YearMonthRange.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java delete mode 100644 src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml delete mode 100644 src/com/engine/salary/service/SalaryAcctCalcService.java create mode 100644 src/com/engine/salary/service/TaxDeclarationValueService.java create mode 100644 src/com/engine/salary/service/TaxDeclareEmployeeService.java create mode 100644 src/com/engine/salary/service/TaxDeclareFailService.java create mode 100644 src/com/engine/salary/service/TaxReportColumnService.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java diff --git a/resource/sqlupgrade/DM/sql202308090303.sql b/resource/sqlupgrade/DM/sql202308090303.sql index 3c9a6cee5..0a9e21cc4 100644 --- a/resource/sqlupgrade/DM/sql202308090303.sql +++ b/resource/sqlupgrade/DM/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - salary_month varchar2(10), - tax_cycle varchar2(10), + salary_month date, + tax_cycle date, remark varchar2(1000), request_id varchar2(100), tax_declare_type number, diff --git a/resource/sqlupgrade/GS/sql202308090303.sql b/resource/sqlupgrade/GS/sql202308090303.sql index 3c9a6cee5..0a9e21cc4 100644 --- a/resource/sqlupgrade/GS/sql202308090303.sql +++ b/resource/sqlupgrade/GS/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - salary_month varchar2(10), - tax_cycle varchar2(10), + salary_month date, + tax_cycle date, remark varchar2(1000), request_id varchar2(100), tax_declare_type number, diff --git a/resource/sqlupgrade/JC/sql202308090303.sql b/resource/sqlupgrade/JC/sql202308090303.sql index 3c9a6cee5..0a9e21cc4 100644 --- a/resource/sqlupgrade/JC/sql202308090303.sql +++ b/resource/sqlupgrade/JC/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - salary_month varchar2(10), - tax_cycle varchar2(10), + salary_month date, + tax_cycle date, remark varchar2(1000), request_id varchar2(100), tax_declare_type number, diff --git a/resource/sqlupgrade/Mysql/sql202308090303.sql b/resource/sqlupgrade/Mysql/sql202308090303.sql index f7094b24b..4e6351529 100644 --- a/resource/sqlupgrade/Mysql/sql202308090303.sql +++ b/resource/sqlupgrade/Mysql/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0 comment 'Ƿɾ' , tenant_key varchar(10) comment '⻧KEY' , tax_agent_id bigint comment '˰۽id' , - salary_month varchar(10) comment 'н' , - tax_cycle varchar(10) comment '˰' , + salary_month datetime comment 'н' , + tax_cycle datetime comment '˰' , remark varchar(1000) comment 'ע' , request_id varchar(100) comment 'Ӧ̵ϵͳصrequestid' , tax_declare_type tinyint comment '걨' , diff --git a/resource/sqlupgrade/Oracle/sql202308090303.sql b/resource/sqlupgrade/Oracle/sql202308090303.sql index e9a221fca..7ce46cb95 100644 --- a/resource/sqlupgrade/Oracle/sql202308090303.sql +++ b/resource/sqlupgrade/Oracle/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - salary_month varchar2(10), - tax_cycle varchar2(10), + salary_month date, + tax_cycle date, remark varchar2(1000), request_id varchar2(100), tax_declare_type number, diff --git a/resource/sqlupgrade/PG/sql202308090303.sql b/resource/sqlupgrade/PG/sql202308090303.sql index 33f4a8aea..511123b31 100644 --- a/resource/sqlupgrade/PG/sql202308090303.sql +++ b/resource/sqlupgrade/PG/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0, tenant_key varchar(10), tax_agent_id bigint, - salary_month varchar(10), - tax_cycle varchar(10), + salary_month timestamp, + tax_cycle timestamp, remark varchar(1000), request_id varchar(100), tax_declare_type smallint, diff --git a/resource/sqlupgrade/SQLServer/sql202308090303.sql b/resource/sqlupgrade/SQLServer/sql202308090303.sql index e3ca10522..6757c6ad9 100644 --- a/resource/sqlupgrade/SQLServer/sql202308090303.sql +++ b/resource/sqlupgrade/SQLServer/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0, tenant_key nvarchar(10), tax_agent_id bigint, - salary_month nvarchar(10), - tax_cycle nvarchar(10), + salary_month datetime, + tax_cycle datetime, remark nvarchar(1000), request_id nvarchar(100), tax_declare_type tinyint, diff --git a/resource/sqlupgrade/ST/sql202308090303.sql b/resource/sqlupgrade/ST/sql202308090303.sql index 3c9a6cee5..0a9e21cc4 100644 --- a/resource/sqlupgrade/ST/sql202308090303.sql +++ b/resource/sqlupgrade/ST/sql202308090303.sql @@ -7,8 +7,8 @@ create table hrsa_tax_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - salary_month varchar2(10), - tax_cycle varchar2(10), + salary_month date, + tax_cycle date, remark varchar2(1000), request_id varchar2(100), tax_declare_type number, diff --git a/src/com/engine/salary/common/YearMonthRange.java b/src/com/engine/salary/common/YearMonthRange.java new file mode 100644 index 000000000..e5d7e82d9 --- /dev/null +++ b/src/com/engine/salary/common/YearMonthRange.java @@ -0,0 +1,28 @@ +package com.engine.salary.common; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * @description: 月份范围 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/22 1:53 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class YearMonthRange { + + //开始月份 + @JsonSerialize(using = ToStringSerializer.class) + private Date startMonth; + + //开始月份 + @JsonSerialize(using = ToStringSerializer.class) + private Date endMonth; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java index cfe97aae9..7ec1aea5e 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java @@ -7,6 +7,7 @@ import com.engine.salary.util.valid.DataCheck; import lombok.*; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -31,8 +32,14 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { //人员姓名") private String employeeName; + /** + * 税款所属期 + */ + private Date taxCycle; + //个税扣缴义务人") private Long taxAgentId; + private List taxAgentIds; //分部 private List subcompanyIds; @@ -48,8 +55,8 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { * 状态 * @see SalaryEmployeeStatusEnum */ - private SalaryEmployeeStatusEnum status; + //状态(多选) private List statuses; diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index 7d6c82f58..3e7e00b35 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -69,6 +69,11 @@ public class SalaryAcctEmployeePO { @SalaryFormulaVar(defaultLabel = "薪资所属月", labelId = 86321, dataType = "string") private Date salaryMonth; + /** + * 税款所属期 + */ + private Date taxCycle; + /** * 租户key */ diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java new file mode 100644 index 000000000..945482916 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java @@ -0,0 +1,75 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * @description: 薪资核算记录对应的个税扣缴义务人 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/7/29 9:40 + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +// "hrsa_acct_tax_agent") +public class SalaryAcctTaxAgentPO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资核算记录的id + */ + private Long salaryAcctRecordId; + + /** + * 收入所得项目 + */ + private Integer incomeCategory; + + /** + * 个税扣缴义务人的id + */ + private Long taxAgentId; + + /** + * 薪资所属月 + */ + private Date salaryMonth; + + /** + * 税款所属期 + */ + private Date taxCycle; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java index 0f1b6e5a6..22156a38c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -1,88 +1,86 @@ -//package com.engine.salary.entity.taxdeclaration.bo; -// -//import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; -//import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; -//import com.google.common.collect.Lists; -//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; -//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; -//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; -//import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; -//import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; -//import com.weaver.hrm.salary.util.SalaryEntityUtil; -//import com.weaver.hrm.salary.util.SalaryEnumUtil; -//import com.weaver.hrm.salary.util.SalaryI18nUtil; -//import com.weaver.teams.domain.hr.SimpleUserInfo; -//import com.weaver.teams.domain.user.SimpleEmployee; -//import org.apache.commons.collections4.CollectionUtils; -// -//import java.util.Collections; -//import java.util.List; -//import java.util.Map; -//import java.util.Objects; -//import java.util.function.Function; -//import java.util.stream.Collectors; -// -///** -// * @description: 个税申报明细表中的人员 -// * @author: xiajun -// * @modified By: xiajun -// * @date: Created in 2022/11/10 4:20 PM -// * @version:v1.0 -// */ -//public class TaxDeclareEmployeeBO { -// -// public static List convert2AbnormalEmployee(List taxDeclareEmployees, -// List employeeDeclares, -// List simpleEmployees, -// List simpleUserInfos, -// List extEmployees) { -// if (CollectionUtils.isEmpty(taxDeclareEmployees)) { -// return Collections.emptyList(); -// } -// List abnormalEmployeeList = Lists.newArrayList(); -// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); -// Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); -// Map simpleUserInfoMap = simpleUserInfos.stream() -// .filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser())) -// .collect(Collectors.toMap(simpleUserInfo -> simpleUserInfo.getUser().getId(), Function.identity(), (a, b) -> a)); -// Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId); -// for (TaxDeclareEmployeePO taxDeclareEmployee : taxDeclareEmployees) { -// AbnormalEmployeeListDTO abnormalEmployeeListDTO = new AbnormalEmployeeListDTO() -// .setId(taxDeclareEmployee.getEmployeeId()) -// .setEmployeeId(taxDeclareEmployee.getEmployeeId()) -// .setEmployeeType(taxDeclareEmployee.getEmployeeType()); -// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclareEmployee.getEmployeeId()); -// if (employeeDeclare != null) { -// DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class); -// abnormalEmployeeListDTO -// .setEmployeeName(employeeDeclare.getEmployeeName()) -// .setJobNum(employeeDeclare.getJobNum()) -// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) -// .setCardNum(employeeDeclare.getCardNum()) -// .setDeclareStatus(declareStatusEnum) -// .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); -// } else if (Objects.equals(taxDeclareEmployee.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { -// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclareEmployee.getEmployeeId()); -// SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(taxDeclareEmployee.getEmployeeId()); -// abnormalEmployeeListDTO -// .setEmployeeName(simpleEmployee.getUsername()) -// .setJobNum(simpleEmployee.getJobNum()) -// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) -// .setCardNum(simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()) -// .setDeclareStatus(null) -// .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); -// } else { -// ExtEmployeePO extEmployee = extEmployeePOMap.get(taxDeclareEmployee.getEmployeeId()); -// abnormalEmployeeListDTO -// .setEmployeeName(extEmployee.getUsername()) -// .setJobNum("") -// .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) -// .setCardNum(extEmployee.getCardNum()) -// .setDeclareStatus(null) -// .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); -// } -// abnormalEmployeeList.add(abnormalEmployeeListDTO); -// } -// return abnormalEmployeeList; -// } -//} +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @description: 个税申报明细表中的人员 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 4:20 PM + * @version:v1.0 + */ +public class TaxDeclareEmployeeBO { + + public static List convert2AbnormalEmployee(List taxDeclareEmployees, + List employeeDeclares, + List simpleEmployees, + List simpleUserInfos, + List extEmployees) { + if (CollectionUtils.isEmpty(taxDeclareEmployees)) { + return Collections.emptyList(); + } + List abnormalEmployeeList = Lists.newArrayList(); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + Map simpleUserInfoMap = simpleUserInfos.stream() + .collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity(), (a, b) -> a)); + Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmpPO::getId); + for (TaxDeclareEmployeePO taxDeclareEmployee : taxDeclareEmployees) { + AbnormalEmployeeListDTO abnormalEmployeeListDTO = new AbnormalEmployeeListDTO() + .setId(taxDeclareEmployee.getEmployeeId()) + .setEmployeeId(taxDeclareEmployee.getEmployeeId()) + .setEmployeeType(taxDeclareEmployee.getEmployeeType()); + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclareEmployee.getEmployeeId()); + if (employeeDeclare != null) { + DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class); + abnormalEmployeeListDTO + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) + .setCardNum(employeeDeclare.getCardNum()) + .setDeclareStatus(declareStatusEnum) + .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); + } else if (Objects.equals(taxDeclareEmployee.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclareEmployee.getEmployeeId()); + DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(taxDeclareEmployee.getEmployeeId()); + abnormalEmployeeListDTO + .setEmployeeName(simpleEmployee.getUsername()) + .setJobNum(simpleEmployee.getWorkcode()) + .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) + .setCardNum(simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()) + .setDeclareStatus(null) + .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); + } else { + ExtEmpPO extEmployee = extEmployeePOMap.get(taxDeclareEmployee.getEmployeeId()); + abnormalEmployeeListDTO + .setEmployeeName(extEmployee.getUsername()) + .setJobNum("") + .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) + .setCardNum(extEmployee.getIdNo()) + .setDeclareStatus(null) + .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "报送人员列表中无此人员")); + } + abnormalEmployeeList.add(abnormalEmployeeListDTO); + } + return abnormalEmployeeList; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java index 11900c619..acb55f5b7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java @@ -1,13 +1,16 @@ package com.engine.salary.entity.taxdeclaration.dto; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; /** * @description: 个税申报表信息 @@ -22,13 +25,46 @@ import java.time.YearMonth; @AllArgsConstructor public class TaxDeclarationInfoDTO { - //薪资所属月") - @JsonSerialize(using = ToStringSerializer.class) - private YearMonth salaryMonth; - //个税扣缴义务人id") + @ApiModelProperty("薪资所属月") + @JsonSerialize(using = ToStringSerializer.class) + private Date salaryMonth; + + @ApiModelProperty("税款所属期") + @JsonSerialize(using = ToStringSerializer.class) + private Date taxCycle; + + @ApiModelProperty("个税扣缴义务人id") + @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - //个税扣缴义务人名称") + @ApiModelProperty("个税扣缴义务人名称") private String taxAgentName; + + @ApiModelProperty("申报类型") + private TaxDeclareTypeEnum declareType; + + @ApiModelProperty("申报类型描述") + private String declareTypeDesc; + + @ApiModelProperty("申报状态") + private TaxDeclareStatusEnum declareStatus; + + @ApiModelProperty("申报状态描述") + private String declareStatusDesc; + + @ApiModelProperty("申报失败的错误信息") + private String declareErrorMsg; + + @ApiModelProperty("是否展示图标") + private boolean displayIcon; + + @ApiModelProperty("申报失败的人数") + private Integer declareFailSize; + + @ApiModelProperty("校验异常的人数") + private Integer abnormalSize; + + @ApiModelProperty("已缴金额") + private String taxPaidAmount; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java index 5b8762da2..2e952ba37 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -4,10 +4,11 @@ import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; +import java.util.Date; + /** * @description: 个税申报记录列表 * @author: xiajun @@ -30,10 +31,10 @@ public class TaxDeclareRecordListDTO { private String taxAgentName; //薪资所属月") - private String salaryMonth; + private Date salaryMonth; //税款所属期") - private String taxCycle; + private Date taxCycle; //申报类型") private TaxDeclareTypeEnum taxDeclareType; diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java index dc8682958..09b322559 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -2,10 +2,11 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.common.BaseQueryParam; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; +import java.util.Date; + /** * @description: 个税申报-异常数据-未报送人员列表 * @author: xiajun @@ -29,5 +30,5 @@ public class AbnormalEmployeeListQueryParam extends BaseQueryParam { @JsonIgnore //税款所属期") - private String taxCycle; + private Date taxCycle; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java index 521fadd56..16ed00006 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java @@ -1,7 +1,10 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.common.BaseQueryParam; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; import java.time.YearMonth; @@ -28,4 +31,7 @@ public class TaxDeclarationListQueryParam extends BaseQueryParam { private String fromSalaryMonthStr; private String endSalaryMonthStr; + + //个税扣缴义务人菜单") + private String taxAgentName; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java index 8319f9e4d..67acbc304 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java @@ -82,6 +82,12 @@ public class TaxDeclarationPO { */ private Date updateTime; + + /** + * 查看控制 + */ + private Integer controlView; + //税款所属期 LocalDateRange salaryMonths; diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 5a708da50..0a257bf4a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -1,9 +1,13 @@ package com.engine.salary.entity.taxdeclaration.po; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; +import java.util.Collection; import java.util.Date; /** @@ -15,6 +19,9 @@ import java.util.Date; */ @Data @Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor //hrsa_tax_declare_record") //个税申报记录") public class TaxDeclareRecordPO implements Serializable { @@ -23,89 +30,82 @@ public class TaxDeclareRecordPO implements Serializable { /** * 主键id */ - //主键id") private Long id; /** * 个税扣缴义务人id */ - //个税扣缴义务人") private Long taxAgentId; /** * 薪资所属月 */ - //薪资所属月") - private String salaryMonth; + private Date salaryMonth; /** * 税款所属期 */ - //税款所属期") - private String taxCycle; + private Date taxCycle; /** * 申报类型 */ - //申报类型") private Integer taxDeclareType; /** * 申报状态 */ - //申报状态") private Integer taxDeclareStatus; /** * 申报失败的错误信息 */ - //申报失败的错误信息") private String taxDeclareErrorMsg; /** * 请求的requestId */ - //请求的requestId") private String requestId; /** * 备注 */ - //备注") private String remark; - //应缴金额") + //应缴金额 private String taxPayAmount; - //实缴总额") + //实缴总额 private String taxPaidAmount; - //实缴税额(不含滞纳金等)") + //实缴税额(不含滞纳金等) private String taxPurePaidAmount; - //申报人数") + //申报人数 private Integer personNum; /** * 个税申报表的待刷新数据的标识 */ - //个税申报表的待刷新数据的标识") private Integer displayUpdateIcon; /** * 租户key */ - //租户key", ignore = true) private String tenantKey; /** * 创建人id */ - //创建人id", ignore = true) private Long creator; /** * 是否删除 */ - //是否删除", ignore = true) private Integer deleteType; /** * 创建时间 */ - //创建时间", ignore = true) private Date createTime; /** * 更新时间 */ - //更新时间", ignore = true) private Date updateTime; + + + private Collection ids; + private Collection taxAgentIds; + private Date startDate; + private Date endDate; + private Date salaryMonthStartDate; + private Date salaryMonthEndDate; } diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java index 4b560b7c2..0863b5358 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java @@ -2,6 +2,7 @@ package com.engine.salary.mapper.salaryacct; import com.engine.salary.common.LocalDateRange; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -78,4 +79,12 @@ public interface SalaryAcctRecordMapper { void updateLockSalaryItemIds(SalaryAcctRecordPO salaryAcctRecord); List getBackCalcRecordByIds(@Param("collection") Set salaryAcctIds); + + + /** + * 获取核算记录和扣缴义务人对应关系 + * @param salaryAcctIds + * @return + */ + List listAcctTaxAgent(Collection salaryAcctIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml index 4266b9277..b1abf055d 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml @@ -15,7 +15,8 @@ - + @@ -148,7 +149,7 @@ FROM hrsa_salary_acct_record t where delete_type = 0 - AND back_calc_status = 1 + AND back_calc_status = 1 AND id IN @@ -422,4 +423,24 @@ WHERE id = #{id} AND delete_type = 0 + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java b/src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java deleted file mode 100644 index 6142d2c21..000000000 --- a/src/com/engine/salary/mapper/taxagent/TaxDeclareRecordMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.engine.salary.mapper.taxagent; - -/** - * @description: 个税申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/2 5:46 PM - * @version:v1.0 - */ -public interface TaxDeclareRecordMapper { -} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java index cbe931b93..3ee8b562a 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java @@ -1,8 +1,10 @@ package com.engine.salary.mapper.taxdeclaration; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationEmployeeDTO; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -70,4 +72,12 @@ public interface TaxDeclarationDetailMapper { List listAll(); int batchUpdate(@Param("collection") List taxDeclarationDetailPos); + + List listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + List listPage4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); + + List list4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.java new file mode 100644 index 000000000..e8cedfc93 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.java @@ -0,0 +1,79 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareRecordMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclareRecordPO taxDeclareRecord); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclareRecordPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 批量插入 + * + * @param taxDeclareRecord + */ + void batchInsert(@Param("collection") List taxDeclareRecord); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareRecord 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 修改,忽略null字段 + * + * @param taxDeclareRecord 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 删除记录 + * + * @param taxDeclareRecord 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml new file mode 100644 index 000000000..e3d62fdcc --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -0,0 +1,536 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_agent_id + , t.salary_month + , t.tax_cycle + , t.remark + , t.request_id + , t.tax_declare_type + , t.tax_declare_status + , t.display_update_icon + , t.tax_pay_amount + , t.person_num + , t.tax_declare_error_msg + , t.tax_paid_amount + , t.tax_pure_paid_amount + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_record + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_agent_id, + + + salary_month, + + + tax_cycle, + + + remark, + + + request_id, + + + tax_declare_type, + + + tax_declare_status, + + + display_update_icon, + + + tax_pay_amount, + + + person_num, + + + tax_declare_error_msg, + + + tax_paid_amount, + + + tax_pure_paid_amount, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxAgentId}, + + + #{salaryMonth}, + + + #{taxCycle}, + + + #{remark}, + + + #{requestId}, + + + #{taxDeclareType}, + + + #{taxDeclareStatus}, + + + #{displayUpdateIcon}, + + + #{taxPayAmount}, + + + #{personNum}, + + + #{taxDeclareErrorMsg}, + + + #{taxPaidAmount}, + + + #{taxPurePaidAmount}, + + + + + + + + INSERT INTO hrsa_tax_declare_record + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + salary_month, + tax_cycle, + remark, + request_id, + tax_declare_type, + tax_declare_status, + display_update_icon, + tax_pay_amount, + person_num, + tax_declare_error_msg, + tax_paid_amount, + tax_pure_paid_amount, + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.salaryMonth}, + #{item.taxCycle}, + #{item.remark}, + #{item.requestId}, + #{item.taxDeclareType}, + #{item.taxDeclareStatus}, + #{item.displayUpdateIcon}, + #{item.taxPayAmount}, + #{item.personNum}, + #{item.taxDeclareErrorMsg}, + #{item.taxPaidAmount}, + #{item.taxPurePaidAmount}, + + ) + + + + + INSERT INTO hrsa_tax_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + salary_month, + tax_cycle, + remark, + request_id, + tax_declare_type, + tax_declare_status, + display_update_icon, + tax_pay_amount, + person_num, + tax_declare_error_msg, + tax_paid_amount, + tax_pure_paid_amount, + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.salaryMonth,jdbcType=DATE}, + #{item.taxCycle,jdbcType=DATE}, + #{item.remark,jdbcType=VARCHAR}, + #{item.requestId,jdbcType=DOUBLE}, + #{item.taxDeclareType,jdbcType=INTEGER}, + #{item.taxDeclareStatus,jdbcType=INTEGER}, + #{item.displayUpdateIcon,jdbcType=INTEGER}, + #{item.taxPayAmount,jdbcType=VARCHAR}, + #{item.personNum,jdbcType=INTEGER}, + #{item.taxDeclareErrorMsg,jdbcType=VARCHAR}, + #{item.taxPaidAmount,jdbcType=VARCHAR}, + #{item.taxPurePaidAmount,jdbcType=VARCHAR}, + from dual + + + + + + + INSERT INTO hrsa_tax_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + salary_month, + tax_cycle, + remark, + request_id, + tax_declare_type, + tax_declare_status, + display_update_icon, + tax_pay_amount, + person_num, + tax_declare_error_msg, + tax_paid_amount, + tax_pure_paid_amount, + ) + VALUES + ( + #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.salaryMonth,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxCycle,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.remark,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.requestId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxDeclareType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxDeclareStatus,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.displayUpdateIcon,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxPayAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.personNum,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxDeclareErrorMsg,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxPaidAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxPurePaidAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + ) + + + + + + UPDATE hrsa_tax_declare_record + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_agent_id=#{taxAgentId}, + salary_month=#{salaryMonth}, + tax_cycle=#{taxCycle}, + remark=#{remark}, + request_id=#{requestId}, + tax_declare_type=#{taxDeclareType}, + tax_declare_status=#{taxDeclareStatus}, + display_update_icon=#{displayUpdateIcon}, + tax_pay_amount=#{taxPayAmount}, + person_num=#{personNum}, + tax_declare_error_msg=#{taxDeclareErrorMsg}, + tax_paid_amount=#{taxPaidAmount}, + tax_pure_paid_amount=#{taxPurePaidAmount}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_record + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_agent_id=#{taxAgentId}, + + + salary_month=#{salaryMonth}, + + + tax_cycle=#{taxCycle}, + + + remark=#{remark}, + + + request_id=#{requestId}, + + + tax_declare_type=#{taxDeclareType}, + + + tax_declare_status=#{taxDeclareStatus}, + + + display_update_icon=#{displayUpdateIcon}, + + + tax_pay_amount=#{taxPayAmount}, + + + person_num=#{personNum}, + + + tax_declare_error_msg=#{taxDeclareErrorMsg}, + + + tax_paid_amount=#{taxPaidAmount}, + + + tax_pure_paid_amount=#{taxPurePaidAmount}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index d6f3b2d7d..b3a897798 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -22,6 +22,8 @@ public interface ExtEmpService { void delete(Collection ids); + List getExtEmpByIds(List ids); + DataCollectionEmployee getEmployeeById(Long id); /** diff --git a/src/com/engine/salary/service/SalaryAcctCalcService.java b/src/com/engine/salary/service/SalaryAcctCalcService.java deleted file mode 100644 index 842622b3c..000000000 --- a/src/com/engine/salary/service/SalaryAcctCalcService.java +++ /dev/null @@ -1,31 +0,0 @@ -//package com.engine.salary.service; -// -//import com.engine.salary.entity.datacollection.DataCollectionEmployee; -// -//import java.util.Collection; -// -///** -// * @description: 薪资核算 -// * @author: xiajun -// * @modified By: xiajun -// * @date: Created in 8/22/22 3:15 PM -// * @version:v1.0 -// */ -//public interface SalaryAcctCalcService { -// -// /** -// * 按薪资核算记录id进行核算 -// * -// * @param salaryAcctRecordId -// * @param simpleEmployee -// */ -// void calcByRecordId(Long salaryAcctRecordId, DataCollectionEmployee simpleEmployee) throws Exception; -// -// /** -// * 按薪资核算人员id进行核算 -// * -// * @param salaryAcctEmployeeIds -// * @param simpleEmployee -// */ -// void calcByEmployeeIds(Long salaryAcctRecordId, Collection salaryAcctEmployeeIds, DataCollectionEmployee simpleEmployee) throws Exception; -//} diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 1ba3419bf..4e7c8eb2e 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -5,6 +5,7 @@ import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; 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.dto.SalarySobCycleDTO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.util.page.PageInfo; @@ -207,4 +208,13 @@ public interface SalaryAcctRecordService { List listSome(SalaryAcctRecordPO po); + + /** + * 根据薪资核算记录id查询关联的个税扣缴义务人 + * + * @param salaryAcctRecordIds + * @return + */ + List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + } diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 7537c1c06..4e7d0e3ce 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -50,4 +50,13 @@ public interface TaxDeclarationService { * @param taxDeclarationId */ void withDrawTaxDeclaration(Long taxDeclarationId); + + /** + * 删除个税申报表 + * + * @param taxDeclareRecordIds + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + void saveBatch(List taxDeclarations); } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java new file mode 100644 index 000000000..1eedf2b59 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -0,0 +1,71 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.util.page.PageInfo; + +import java.util.Collection; +import java.util.List; + +/** + * @description: 个税申报表明细 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/28/22 9:41 AM + * @version:v1.0 + */ +public interface TaxDeclarationValueService { + + /** + * 查询个税申报表明细 + * + * @param page + * @param taxDeclarationIds + * @return + */ + PageInfo listPageByTaxDeclarationIds( Collection taxDeclarationIds); + + /** + * 查询个税申报表明细 + * + * @param taxDeclarationIds + * @param tenantKey + * @return + */ + List listByTaxDeclarationIds(Collection taxDeclarationIds); + + /** + * 查询个税申报表明细 + * + * @param taxDeclarationIds + * @param tenantKey + * @return + */ + List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds); + + /** + * 个税申报表明细列表 + * + * @param taxDeclarationValues + * @param tenantKey + * @return + */ + TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues); + + /** + * 批量保存 + * + * @param taxDeclarationValues + * @param tenantKey + */ + void batchSave(List taxDeclarationValues); + + /** + * 删除个税申报表明细 + * + * @param taxDeclareRecordIds + * @param tenantKey + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); +} diff --git a/src/com/engine/salary/service/TaxDeclareEmployeeService.java b/src/com/engine/salary/service/TaxDeclareEmployeeService.java new file mode 100644 index 000000000..7b29555cb --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareEmployeeService.java @@ -0,0 +1,60 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.util.page.PageInfo; + +import java.util.List; + +/** + * @description: 个税申报表明细中的人员 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 4:10 PM + * @version:v1.0 + */ +public interface TaxDeclareEmployeeService { + + /** + * 查询个税申报表明细中未报送成功的人员 + * + * @param queryParam + * @return + */ + PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 查询个税申报表明细中未报送成功的人员 + * + * @param queryParam + * @return + */ + List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 查询已报送但是没有申报数据的人员 + * + * @param queryParam + * @return + */ + PageInfo listPage4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 查询已报送但是没有申报数据的人员 + * + * @param queryParam + * @return + */ + List list4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 转换成数据异常人员dto + * + * @param taxDeclareRecord + * @param taxDeclareEmployees + * @return + */ + List convert2AbnormalEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareEmployees); +} diff --git a/src/com/engine/salary/service/TaxDeclareFailService.java b/src/com/engine/salary/service/TaxDeclareFailService.java new file mode 100644 index 000000000..25b649933 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareFailService.java @@ -0,0 +1,51 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.util.page.PageInfo; + +import java.util.Collection; +import java.util.List; + +/** + * @description: 个税申报失败数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/30 1:31 PM + * @version:v1.0 + */ +public interface TaxDeclareFailService { + + /** + * 根据个税申报记录id查询申报失败数据(分页) + * + * @param taxDeclareRecordIds + * @return + */ + PageInfo listPageByTaxDeclareRecordIds( Collection taxDeclareRecordIds); + + /** + * 根据个税申报记录id查询申报失败数据 + * + * @param taxDeclareRecordIds + * @return + */ + List listByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + /** + * 根据个税申报记录id删除申报失败数据 + * + * @param taxDeclareRecordIds + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + /** + * 转换成申报失败数据dto + * + * @param taxDeclareRecord + * @param taxDeclareFails + * @return + */ + List convert2FailEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareFails); +} diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 4f64025d6..4fdfb64aa 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -1,11 +1,16 @@ 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.TaxDeclarationListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.util.page.PageInfo; -import java.time.YearMonth; import java.util.Collection; +import java.util.Date; +import java.util.List; /** * @description: 个税申报 @@ -24,164 +29,139 @@ public interface TaxDeclareRecordService { */ TaxDeclareRecordPO getById(Long id); -// /** -// * 查询个税申报记录 -// * -// * @param ids -// * @param tenantKey -// * @return -// */ -// List listByIds(Collection ids, String tenantKey); -// -// /** -// * 查询个税申报记录 -// * -// * @param taxCycleRange -// * @param tenantKey -// * @return -// */ -// List listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey); -// -// /** -// * 根据个税扣缴义务人id、税款所属期查询个税申报记录 -// * -// * @param taxAgentIds -// * @param taxCycle -// * @param tenantKey -// * @return -// */ -// List listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey); -// -// /** -// * 根据个税扣缴义务人id、薪资所属月查询个税申报记录 -// * -// * @param salaryMonth -// * @param taxAgentIds -// * @param tenantKey -// * @return -// */ -// List listBySalaryMonthAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds, String tenantKey); -// -// /** -// * 查询个税申报记录 -// * -// * @param queryParam -// * @param tenantKey -// * @return -// */ -// Page listPageByParam(TaxDeclarationListQueryParam queryParam, Long employeeId, String tenantKey); -// -// /** -// * 生成申报表 -// * -// * @param saveParam -// * @param employeeId -// * @param tenantKey -// */ -// void save(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey); + /** + * 查询个税申报记录 + * + * @param ids + * @return + */ + List listByIds(Collection ids); + + /** + * 查询个税申报记录 + * + * @param taxCycleRange + * @return + */ + List listByTaxCycleRange(YearMonthRange taxCycleRange); + + /** + * 根据个税扣缴义务人id、税款所属期查询个税申报记录 + * + * @param taxAgentIds + * @param taxCycle + * @return + */ + List listByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds); + + /** + * 根据个税扣缴义务人id、薪资所属月查询个税申报记录 + * + * @param salaryMonth + * @param taxAgentIds + * @return + */ + List listBySalaryMonthAndTaxAgentIds(Date salaryMonth, Collection taxAgentIds); + + /** + * 查询个税申报记录 + * + * @param queryParam + * @return + */ + PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam); + + /** + * 生成申报表 + * + * @param saveParam + */ + void save(TaxDeclarationSaveParam saveParam); /** * 刷新数据 * * @param id - * @param employeeId - * @param tenantKey */ - void refreshData(Long id, Long employeeId, String tenantKey); + void refreshData(Long id); /** * 更新个税申报表的待刷新数据的标识 * * @param id - * @param employeeId - * @param tenantKey */ - void updateIcon(Long id, Integer displayIcon, Long employeeId, String tenantKey); + void updateIcon(Long id, Integer displayIcon); /** * 因为薪资核算结果发生变动,所以需要更新个税申报表的待刷新数据的标识 * * @param taxCycle * @param taxAgentIds - * @param tenantKey */ - void updateByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey); + void updateByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds); /** * 判断是否有权限可查看个税申报表 * * @param taxDeclaration - * @param employeeId - * @param tenantKey * @return */ - boolean checkByAuthority(TaxDeclarationPO taxDeclaration, Long employeeId, String tenantKey); + boolean checkByAuthority(TaxDeclarationPO taxDeclaration); /** * 根据id删除 * * @param ids - * @param tenantKey */ - void deleteByIds(Collection ids, String tenantKey); + void deleteByIds(Collection ids); /** * 个税申报 * * @param id - * @param tenantKey */ - void declare(Long id, Long employeeId, String tenantKey); + void declare(Long id); /** * 个税申报获取反馈 * * @param id - * @param tenantKey */ - void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long employeeId, String tenantKey); + void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate); /** * 作废 * * @param id - * @param tenantKey */ - void cancelDeclare(Long id, Long employeeId, String tenantKey); + void cancelDeclare(Long id); /** * 获取作废反馈 * * @param id - * @param tenantKey */ - void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long employeeId, String tenantKey); + void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate); /** * 更正申报 * * @param id - * @param employeeId - * @param tenantKey */ - void updateDeclare(Long id, Long employeeId, String tenantKey); + void updateDeclare(Long id); /** * 税局端申报状态查询 * * @param id - * @param employeeId - * @param tenantKey */ - String queryDeclareStatus(Long id, Long employeeId, String tenantKey); + String queryDeclareStatus(Long id); /** * 税局端申报明细查询 * * @param id - * @param employeeId - * @param tenantKey */ - String queryCompanyIncomes(Long id, Long employeeId, String tenantKey); + String queryCompanyIncomes(Long id); } diff --git a/src/com/engine/salary/service/TaxReportColumnService.java b/src/com/engine/salary/service/TaxReportColumnService.java new file mode 100644 index 000000000..28ba37b8b --- /dev/null +++ b/src/com/engine/salary/service/TaxReportColumnService.java @@ -0,0 +1,31 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; + +import java.util.List; + +/** + * @description: 个税申报表表头 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/5 6:36 PM + * @version:v1.0 + */ +public interface TaxReportColumnService { + + /** + * 查询所有所得项目的个税申报表表头 + * + * @return + */ + List listAll(); + + /** + * 根据所得项目查询个税申报表表头 + * + * @param incomeCategory + * @return + */ + List listByIncomeCategory(IncomeCategoryEnum incomeCategory); +} diff --git a/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java index f1ca117ab..938452813 100644 --- a/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java +++ b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java @@ -22,7 +22,7 @@ // // private final Map serviceMap = new ConcurrentHashMap<>(); // -// @Autowired +// // public SalaryCalcRunServiceFactory(Map map) { // for (Map.Entry entry : map.entrySet()) { // serviceMap.put(entry.getValue().getCalcType(), entry.getValue()); diff --git a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java index dde22b970..d8587a395 100644 --- a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java +++ b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java @@ -16,7 +16,7 @@ //public class TaxPaymentServiceFactory { // private final Map serviceMap = new ConcurrentHashMap<>(); // -// @Autowired +// // public TaxPaymentServiceFactory(Map map) { // for (Map.Entry entry : map.entrySet()) { // serviceMap.putIfAbsent(entry.getValue().getServiceType(), entry.getValue()); diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 8de9513ee..755b9e32f 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -109,6 +109,18 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } } + @Override + public List getExtEmpByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(); + } + List extEmpPOS = new ArrayList<>(); + List> partition = Lists.partition(ids, 500); + partition.forEach(list -> extEmpPOS.addAll(getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(list).build()))); + return extEmpPOS; + + } + @Override public DataCollectionEmployee getEmployeeById(Long id) { ExtEmpPO po = getExternalEmployeeMapper().getById(id); diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 459873c3e..35fcdab05 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -11,6 +11,7 @@ import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; 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.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; @@ -806,4 +807,12 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe public List listSome(SalaryAcctRecordPO po) { return getSalaryAcctRecordMapper().listSome(po); } + + @Override + public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { + if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { + return Collections.emptyList(); + } + return getSalaryAcctRecordMapper().listAcctTaxAgent(salaryAcctRecordIds); + } } diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index d2c0999f3..29d4ee4e2 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -71,7 +71,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService private SysSalaryItemBiz sysSalaryItemBiz = new SysSalaryItemBiz(); -// @Autowired +// // private LoggerTemplate salaryItemLoggerTemplate; @Override diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 6f66a9b54..38fb5b51d 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -318,7 +318,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration @Override public void withDrawTaxDeclaration(Long taxDeclarationId) { TaxDeclarationPO po = getTaxDeclarationMapper().getById(taxDeclarationId); - if(Objects.isNull(po)){ + if (Objects.isNull(po)) { throw new SalaryRunTimeException("个税申报表不存在"); } // 获取当前个税扣缴义务人下的薪资账套 @@ -331,8 +331,30 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration // 删除个税申报表 getTaxDeclarationMapper().deleteByIdZj(po.getId()); // 修改薪资核算记录状态为已归档 - if(CollectionUtils.isNotEmpty(salaryAcctRecordIds)){ - getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds,SalaryAcctRecordStatusEnum.ARCHIVED); + if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) { + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); + } + } + + @Override + public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { + return; + } + getTaxDeclarationMapper().deleteByIds(taxDeclareRecordIds); +// new LambdaUpdateChainWrapper<>(baseMapper) +// .eq(TaxDeclarationPO::getTenantKey, tenantKey) +// .eq(TaxDeclarationPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(TaxDeclarationPO::getTaxDeclareRecordId, taxDeclareRecordIds) +// .set(TaxDeclarationPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) +// .set(TaxDeclarationPO::getUpdateTime, LocalDateTime.now()) +// .update(); + } + + @Override + public void saveBatch(List taxDeclarations) { + if (CollectionUtils.isNotEmpty(taxDeclarations)) { + getTaxDeclarationMapper().batchInsert(taxDeclarations); } } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java new file mode 100644 index 000000000..292a84204 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -0,0 +1,173 @@ +package com.engine.salary.service.impl; + +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.ExtEmpService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxDeclarationValueService; +import com.engine.salary.util.page.PageInfo; +import com.google.common.collect.Lists; +import com.weaver.common.component.table.column.WeaTableColumn; +import com.weaver.common.hrm.service.HrmCommonEmployeeService; +import com.weaver.framework.util.JsonUtil; +import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; +import com.weaver.hrm.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; +import com.weaver.hrm.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; +import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +import com.weaver.hrm.salary.service.*; +import com.weaver.hrm.salary.util.SalaryEntityUtil; +import com.weaver.hrm.salary.util.SalaryEnumUtil; +import com.weaver.hrm.salary.util.SalaryPageUtil; +import com.weaver.teams.domain.hr.SimpleUserInfo; +import com.weaver.teams.domain.user.SimpleEmployee; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; + +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.util.*; +import java.util.stream.Collectors; + +import static com.engine.salary.entity.siaccount.param.DSTenantKeyThreadVar.tenantKey; + +/** + * @description: 个税申报表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/28/22 9:41 AM + * @version:v1.0 + */ +@Slf4j +public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclarationValueService { + + + private DataSecurityService dataSecurityService; + + private HrmCommonEmployeeService hrmCommonEmployeeService; + + private SalaryEmployeeService salaryEmployeeService; + + private ExtEmpService extEmployeeService; + + private EmployeeDeclareService employeeDeclareService; + +// private TaxReportColumnService taxReportColumnService; + + @Override + public PageInfo listPageByTaxDeclarationIds( Collection taxDeclarationIds) { + if (page == null) { + return page; + } + page = new LambdaQueryChainWrapper<>(baseMapper) + .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) + .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclarationValuePO::getTaxDeclarationId, taxDeclarationIds) + .page(page); + page.setRecords(decryptBatch(page.getRecords(), tenantKey)); + return page; + } + + @Override + public List listByTaxDeclarationIds(Collection taxDeclarationIds) { + List taxDeclarationValues = new LambdaQueryChainWrapper<>(baseMapper) + .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) + .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclarationValuePO::getTaxDeclarationId, taxDeclarationIds) + .list(); + return decryptBatch(taxDeclarationValues); + } + + @Override + public List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds) { + return new LambdaQueryChainWrapper<>(baseMapper) + .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) + .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclarationValuePO::getTaxDeclarationId, taxDeclarationIds) + .list(); + } + + @Override + public TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues) { + // 查询个税申报表表头 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = taxReportColumnService.listByIncomeCategory(incomeCategoryEnum, tenantKey); + // 人员id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 查询报送的人员 + List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentIdAndEmployeeIds( + YearMonth.parse(taxDeclaration.getTaxCycle()), taxDeclaration.getTaxAgentId(), employeeIds, tenantKey); + // 查询人员信息 + List simpleEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .distinct() + .collect(Collectors.toList()); + List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(simpleEmployeeIds, tenantKey); + // 查询人员薪资(身份证号码等) + List simpleUserInfos = salaryEmployeeService.listByEmployeeIds(simpleEmployeeIds, tenantKey); + // 查询外部人员 + Set extEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .collect(Collectors.toSet()); + List extEmployees = extEmployeeService.listByIdsWithDeleted(extEmployeeIds, tenantKey); + + // 列表表头 + List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); + // 列表数据 + List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, + employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees); + + return new TaxDeclarationValueListDTO().setColumns(weaTableColumns).setData(data); + } + + @Override + public void batchSave(List taxDeclarationValues) { + if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { + // 加密 + taxDeclarationValues.forEach(taxDeclarationValue -> + taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues = dataSecurityService.encryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); + // 分批保存 + int batchSize = SalaryPageUtil.getBatchSize(); + List> partition = Lists.partition(taxDeclarationValues, batchSize); + for (List subTaxDeclarationValues : partition) { + baseMapper.batchInsert(subTaxDeclarationValues); + } + } + } + + @Override + public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { + return; + } + new LambdaUpdateChainWrapper<>(baseMapper) + .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) + .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclarationValuePO::getTaxDeclareRecordId, taxDeclareRecordIds) + .set(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.PHYSICAL_DELETED.getValue()) + .set(TaxDeclarationValuePO::getUpdateTime, LocalDateTime.now()) + .update(); + } + + private List decryptBatch(List taxDeclarationValues) { + if (CollectionUtils.isEmpty(taxDeclarationValues)) { + return Collections.emptyList(); + } + // 解密 + taxDeclarationValues = dataSecurityService.decryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); + taxDeclarationValues.forEach(salaryAcctResultValue -> { + salaryAcctResultValue.setResultValue(JsonUtil.parseMap(salaryAcctResultValue.getResultValueJson(), String.class)); + }); + return taxDeclarationValues; + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java new file mode 100644 index 000000000..88de031b4 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java @@ -0,0 +1,101 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclareEmployeeBO; +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; +import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.ExtEmpService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxDeclareEmployeeService; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @description: 个税申报表明细中的人员 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/10 4:12 PM + * @version:v1.0 + */ +public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclareEmployeeService { + + + // private TaxDeclarationValueMapper taxDeclarationValueMapper; + private TaxDeclarationDetailMapper taxDeclarationValueMapper; + + private SalaryEmployeeService hrmCommonEmployeeService; + + private SalaryEmployeeService salaryEmployeeService; + + private ExtEmpService extEmployeeService; + + private EmployeeDeclareService employeeDeclareService; + + @Override + public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + List list = taxDeclarationValueMapper.listPage4NotDeclareByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, TaxDeclareEmployeePO.class); + } + + @Override + public List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + return taxDeclarationValueMapper.list4NotDeclareByParam(queryParam); + } + + @Override + public PageInfo listPage4NoValueByParam(AbnormalEmployeeListQueryParam queryParam) { + List list = taxDeclarationValueMapper.listPage4NoValueByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, TaxDeclareEmployeePO.class); + } + + @Override + public List list4NoValueByParam(AbnormalEmployeeListQueryParam queryParam) { + return taxDeclarationValueMapper.list4NoValueByParam(queryParam); + } + + @Override + public List convert2AbnormalEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareEmployees) { + if (CollectionUtils.isEmpty(taxDeclareEmployees)) { + return Collections.emptyList(); + } + // 人员id + Set employeeIds = SalaryEntityUtil.properties(taxDeclareEmployees, TaxDeclareEmployeePO::getEmployeeId); + // 查询报送的人员 + List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentIdAndEmployeeIds( + SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), taxDeclareRecord.getTaxAgentId(), employeeIds); + // 查询人员信息 + List simpleEmployeeIds = taxDeclareEmployees.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(TaxDeclareEmployeePO::getEmployeeId) + .distinct() + .collect(Collectors.toList()); + List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(simpleEmployeeIds); + // 查询人员薪资(身份证号码等) + List simpleUserInfos = salaryEmployeeService.listByIds(simpleEmployeeIds); + // 查询外部人员 + List extEmployeeIds = taxDeclareEmployees.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) + .map(TaxDeclareEmployeePO::getEmployeeId) + .collect(Collectors.toList()); + List extEmployees = extEmployeeService.getExtEmpByIds(extEmployeeIds); + + return TaxDeclareEmployeeBO.convert2AbnormalEmployee(taxDeclareEmployees, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java new file mode 100644 index 000000000..58fefe59f --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java @@ -0,0 +1,97 @@ +package com.engine.salary.service.impl; + +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclareFailService; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.weaver.common.component.table.page.Page; +import com.weaver.hrm.salary.dao.TaxDeclareFailMapper; +import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +import org.apache.commons.collections4.CollectionUtils; + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static com.engine.salary.entity.siaccount.param.DSTenantKeyThreadVar.tenantKey; + +/** + * @description: 个税申报失败数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/30 1:32 PM + * @version:v1.0 + */ +public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFailService { + + private TaxDeclareFailMapper taxDeclareFailMapper; + private TaxAgentService taxAgentService; + + @Override + public PageInfo listPageByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + return new LambdaQueryChainWrapper<>(taxDeclareFailMapper) + .eq(TaxDeclareFailPO::getTenantKey, tenantKey) + .eq(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclareFailPO::getTaxDeclareRecordId, taxDeclareRecordIds) + .page(page); + } + + @Override + public List listByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + return new LambdaQueryChainWrapper<>(taxDeclareFailMapper) + .eq(TaxDeclareFailPO::getTenantKey, tenantKey) + .eq(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclareFailPO::getTaxDeclareRecordId, taxDeclareRecordIds) + .list(); + } + + @Override + public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + new LambdaUpdateChainWrapper<>(taxDeclareFailMapper) + .eq(TaxDeclareFailPO::getTenantKey, tenantKey) + .eq(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .in(TaxDeclareFailPO::getTaxDeclareRecordId, taxDeclareRecordIds) + .set(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.PHYSICAL_DELETED.getValue()) + .set(TaxDeclareFailPO::getUpdateTime, LocalDateTime.now()) + .update(); + } + + @Override + public List convert2FailEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareFails) { + if (CollectionUtils.isEmpty(taxDeclareFails)) { + return Collections.emptyList(); + } + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = taxAgentService.getById(taxDeclareRecord.getTaxAgentId()); + Map incomeCategoryEnumMap = Maps.newHashMap(); + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + incomeCategoryEnumMap.put(incomeCategoryEnum.getCode(), incomeCategoryEnum); + } + + List dtos = Lists.newArrayList(); + for (TaxDeclareFailPO taxDeclareFail : taxDeclareFails) { + IncomeCategoryEnum incomeCategoryEnum = incomeCategoryEnumMap.get(taxDeclareFail.getIncomeCategory()); + FailEmployeeListDTO dto = new FailEmployeeListDTO() + .setId(taxDeclareFail.getId()) + .setEmployeeName(taxDeclareFail.getEmployeeName()) + .setTaxAgentName(taxAgent.getName()) + .setCardNum(taxDeclareFail.getCardNum()) + .setErrorMsg(taxDeclareFail.getErrorMsg()) + .setIncomeCategory(incomeCategoryEnum == null ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + dtos.add(dto); + } + return dtos; + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 75c5d06b7..8e3771445 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1,46 +1,52 @@ package com.engine.salary.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; -import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.engine.core.impl.Service; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; -import com.engine.salary.mapper.taxagent.TaxDeclareRecordMapper; +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationResult; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclareRequest; +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.po.*; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.service.*; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.weaver.common.component.table.page.Page; -import com.weaver.common.distribution.genid.IdGenerator; import com.weaver.common.elog.dto.LoggerContext; -import com.weaver.common.elog.util.LoggerTemplate; import com.weaver.common.elog.util.Util; import com.weaver.framework.util.JsonUtil; -import com.weaver.hrm.salary.common.YearMonthRange; import com.weaver.hrm.salary.constant.SzyhApiConstant; import com.weaver.hrm.salary.dao.TaxPaymentRequestMapper; -import com.weaver.hrm.salary.entity.datacollection.po.AddUpSituationPO; import com.weaver.hrm.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; -import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; -import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam; -import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; -import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultValuePO; -import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; -import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; import com.weaver.hrm.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; -import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO; import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.weaver.hrm.salary.entity.taxdeclaration.bo.*; import com.weaver.hrm.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; -import com.weaver.hrm.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; -import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.weaver.hrm.salary.entity.taxdeclaration.po.*; import com.weaver.hrm.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; import com.weaver.hrm.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; @@ -48,20 +54,17 @@ import com.weaver.hrm.salary.entity.taxdeclaration.response.DeclareTaxResponse; import com.weaver.hrm.salary.entity.taxdeclaration.response.UpdateDeclareResponse; import com.weaver.hrm.salary.enums.OperateTypeEnum; import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; -import com.weaver.hrm.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; -import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; import com.weaver.hrm.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.weaver.hrm.salary.enums.taxdeclaration.*; -import com.weaver.hrm.salary.exception.SalaryRunTimeException; import com.weaver.hrm.salary.service.*; import com.weaver.hrm.salary.service.factory.TaxPaymentServiceFactory; import com.weaver.hrm.salary.util.*; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; @@ -69,6 +72,8 @@ import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; +import static com.engine.salary.entity.siaccount.param.DSTenantKeyThreadVar.tenantKey; + /** * @description: 个税申报 * @author: xiajun @@ -79,173 +84,145 @@ import java.util.stream.Collectors; @Slf4j public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRecordService { - + private TaxDeclareRecordMapper taxDeclareRecordMapper; - + private TaxDeclarationService taxDeclarationService; - + private TaxDeclarationValueService taxDeclarationValueService; - + private EmployeeDeclareService employeeDeclareService; - + private TaxAgentTaxReturnService taxAgentTaxReturnService; - + private TaxAgentService taxAgentService; - + private TaxDeclarationApiConfigService taxDeclarationApiConfigService; - + private AddUpSituationService addUpSituationService; - + private TaxDeclarationApiBillingService taxDeclarationApiBillingService; - @Resource(name = "taxDeclarationLoggerTemplate") - private LoggerTemplate taxDeclarationLoggerTemplate; - + private TaxDeclareEmployeeService taxDeclareEmployeeService; - + private TaxDeclareFailService taxDeclareFailService; - + private SalaryAcctRecordService salaryAcctRecordService; - + private SalaryAcctTaxAgentService salaryAcctTaxAgentService; - + private SalaryAcctEmployeeService salaryAcctEmployeeService; - + private SalaryAcctResultService salaryAcctResultValueService; - + private SalaryItemService salaryItemService; - + private SalarySobTaxReportRuleService salarySobTaxReportRuleService; - + private TaxReportColumnService taxReportColumnService; - + private SalarySobAddUpRuleService salarySobAddUpRuleService; - + private TaxPaymentServiceFactory taxPaymentServiceFactory; - + private TaxPaymentRequestMapper taxPaymentRequestMapper; @Override public TaxDeclareRecordPO getById(Long id) { - return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) - .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) - .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(TaxDeclareRecordPO::getId, id) - .one(); + return taxDeclareRecordMapper.getById(id); } -// -// @Override -// public List listByIds(Collection ids, String tenantKey) { -// return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) -// .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) -// .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .in(TaxDeclareRecordPO::getId, ids) -// .list(); -// } -// -// @Override -// public List listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey) { -// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); -// queryWrapper.eq(TaxDeclareRecordPO::getTenantKey, tenantKey); -// queryWrapper.eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()); -// if (Objects.nonNull(taxCycleRange.getStartMonth())) { -// queryWrapper.ge(TaxDeclareRecordPO::getTaxCycle, taxCycleRange.getStartMonth().toString()); -// } -// if (Objects.nonNull(taxCycleRange.getEndMonth())) { -// queryWrapper.le(TaxDeclareRecordPO::getTaxCycle, taxCycleRange.getEndMonth().toString()); -// } -// return taxDeclareRecordMapper.selectList(queryWrapper); -// } -// -// @Override -// public List listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey) { -// if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { -// return Collections.emptyList(); -// } -// return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) -// .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) -// .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds) -// .eq(TaxDeclareRecordPO::getTaxCycle, taxCycle.toString()) -// .list(); -// } -// -// @Override -// public List listBySalaryMonthAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds, String tenantKey) { -// if (Objects.isNull(salaryMonth) || CollectionUtils.isEmpty(taxAgentIds)) { -// return Collections.emptyList(); -// } -// return new LambdaQueryChainWrapper<>(taxDeclareRecordMapper) -// .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) -// .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds) -// .eq(TaxDeclareRecordPO::getSalaryMonth, salaryMonth.toString()) -// .list(); -// } -// -// @Override -// public Page listPageByParam(TaxDeclarationListQueryParam queryParam, Long employeeId, String tenantKey) { -// Page page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true); -// // 构建查询参数 -// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); -// queryWrapper.eq(TaxDeclareRecordPO::getTenantKey, tenantKey); -// queryWrapper.eq(TaxDeclareRecordPO::getDeleteType, 0); -// if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getFromSalaryMonth())) { -// queryWrapper.ge(TaxDeclareRecordPO::getSalaryMonth, queryParam.getFromSalaryMonth()); -// } -// if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getEndSalaryMonth())) { -// queryWrapper.le(TaxDeclareRecordPO::getSalaryMonth, queryParam.getEndSalaryMonth()); -// } -// if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { -// List taxAgents = taxAgentService.listByNameLike(queryParam.getTaxAgentName(), tenantKey); -// if (CollectionUtils.isEmpty(taxAgents)) { -// return page; -// } -// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); -// queryWrapper.in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds); -// } -// // 判断是否开启了分权 -// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); -// // 判断是否是总管理员 -// Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); -// // 可见范围内的个税扣缴义务人 -// List taxAgents = Lists.newArrayList(); -// if (openDevolution) { -// if (isChief) { -// taxAgents = taxAgentService.listAsChief(openDevolution, isChief, employeeId, tenantKey); -// } else { -// taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId, tenantKey); -// } -// if (CollectionUtils.isEmpty(taxAgents)) { -// return page; -// } -// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); -// queryWrapper.in(TaxDeclareRecordPO::getTaxAgentId, taxAgentIds); -// } -// queryWrapper.orderByDesc(TaxDeclareRecordPO::getTaxCycle); -// queryWrapper.orderByDesc(TaxDeclareRecordPO::getId); -// return taxDeclareRecordMapper.selectPage(page, queryWrapper); -// } -// -// @Override -// public void save(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey) { -// LocalDateTime now = LocalDateTime.now(); + + @Override + public List listByIds(Collection ids) { + return taxDeclareRecordMapper.listSome(TaxDeclareRecordPO.builder().ids(ids).build()); + } + + @Override + public List listByTaxCycleRange(YearMonthRange taxCycleRange) { + TaxDeclareRecordPO build = TaxDeclareRecordPO.builder().build(); + if (Objects.nonNull(taxCycleRange.getStartMonth())) { + build.setStartDate(taxCycleRange.getStartMonth()); + } + if (Objects.nonNull(taxCycleRange.getEndMonth())) { + build.setEndDate(taxCycleRange.getEndMonth()); + } + return taxDeclareRecordMapper.listSome(build); + } + + @Override + public List listByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds) { + if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { + return Collections.emptyList(); + } + return taxDeclareRecordMapper.listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).taxCycle(taxCycle).build()); + } + + @Override + public List listBySalaryMonthAndTaxAgentIds(Date salaryMonth, Collection taxAgentIds) { + if (Objects.isNull(salaryMonth) || CollectionUtils.isEmpty(taxAgentIds)) { + return Collections.emptyList(); + } + return taxDeclareRecordMapper.listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).salaryMonth(salaryMonth).build()); + } + + @Override + public PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam) { + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareRecordPO.class); + // 构建查询参数 + TaxDeclareRecordPO build = TaxDeclareRecordPO.builder().build(); + if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getFromSalaryMonth())) { + build.setSalaryMonthStartDate(SalaryDateUtil.localDateToDate(queryParam.getFromSalaryMonth().atDay(1))); + } + if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getEndSalaryMonth())) { + build.setSalaryMonthEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atDay(1))); + } + List taxAgentIds = new ArrayList<>(); + if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { + List taxAgents = taxAgentService.list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build()); + if (CollectionUtils.isEmpty(taxAgents)) { + return pageInfo; + } + taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); + } + // 判断是否开启了分权 + Boolean openDevolution = taxAgentService.isOpenDevolution(); + // 判断是否是总管理员 + Boolean isChief = taxAgentService.isChief((long) user.getUID()); + // 可见范围内的个税扣缴义务人 + Collection taxAgents = Lists.newArrayList(); + if (openDevolution && !isChief) { + taxAgents = taxAgentService.listAllTaxAgentsAsAdmin((long) user.getUID()); + if (CollectionUtils.isEmpty(taxAgents)) { + return pageInfo; + } + List taxAgentDevolution = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); + taxAgentIds = taxAgentIds.stream().filter(taxAgentDevolution::contains).collect(Collectors.toList()); + } + build.setTaxAgentIds(taxAgentIds); + List taxDeclareRecordPOS = taxDeclareRecordMapper.listSome(build); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + taxDeclareRecordPOS, TaxDeclareRecordPO.class); + } + + @Override + public void save(TaxDeclarationSaveParam saveParam) { +// Date now = new Date(); // Set needDeleteTaxDeclareRecordIds = Sets.newHashSet(); // List newTaxDeclareRecords = Lists.newArrayList(); // List newTaxDeclarations = Lists.newArrayList(); // List newTaxDeclarationValues = Lists.newArrayList(); -// List newAddUpSituations = Lists.newArrayList(); +// List newAddUpSituations = Lists.newArrayList(); // // 根据个税扣缴义务人范围查询个税扣缴义务人 -// List taxAgents = queryByTaxAgentRange(saveParam, employeeId, tenantKey); +// List taxAgents = queryByTaxAgentRange(saveParam); // Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); // // 查询薪资所属月下的薪资核算记录,并按照权限过滤 -// YearMonthRange salaryMonthRange = new YearMonthRange() -// .setStartMonth(saveParam.getSalaryMonth()) -// .setEndMonth(saveParam.getSalaryMonth()); -// List salaryAcctRecords = salaryAcctRecordService.filterByAuthority( -// salaryAcctRecordService.listBySalaryMonth(salaryMonthRange, tenantKey), employeeId, tenantKey); +// LocalDateRange salaryMonthRange = new LocalDateRange() +// .setFromDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))) +// .setEndDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); +// List salaryAcctRecords = salaryAcctRecordService.listBySalaryMonth(salaryMonthRange); // // 查询薪资核算记录关联的个税扣缴义务人 -// List salaryAcctTaxAgents = salaryAcctTaxAgentService.listBySalaryAcctRecordIds( -// SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId), tenantKey); +// List salaryAcctTaxAgents = salaryAcctRecordService.listBySalaryAcctRecordIds( +// SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId)); // // 按照saveParam中的个税扣缴义务人范围过滤 // Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); // salaryAcctTaxAgents = salaryAcctTaxAgents.stream() @@ -257,14 +234,14 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // .collect(Collectors.toList()); // // 校验是否可以生成个税申报表 // // 返回目前已经生成的个税申报表 -// List taxDeclareRecords = checkBeforeSave(saveParam, taxAgentNameMap, salaryAcctRecords, salaryAcctTaxAgents, employeeId, tenantKey); +// List taxDeclareRecords = checkBeforeSave(saveParam, taxAgentNameMap, salaryAcctRecords, salaryAcctTaxAgents); // Map taxDeclareRecordMap = SalaryEntityUtil.convert2Map(taxDeclareRecords, e -> e.getTaxCycle() + "-" + e.getTaxAgentId()); // // 查询薪资核算人员 -// List salaryAcctEmployees = salaryAcctEmployeeService.listByRecordIdsAndTaxAgentIds(salaryAcctRecordIds, taxAgentIds, tenantKey); +// List salaryAcctEmployees = salaryAcctEmployeeService.listByRecordIdsAndEmpIdAndTaxAgentId(salaryAcctRecordIds, null, taxAgents.get(0).getId()); // // 薪资核算人员按照税款所属期聚合分类 -// Map> taxCycleKeyEmployeeMap = SalaryEntityUtil.group2Map( +// Map> taxCycleKeyEmployeeMap = SalaryEntityUtil.group2Map( // salaryAcctEmployees, SalaryAcctEmployeePO::getTaxCycle); -// for (Map.Entry> taxCycleEntry : taxCycleKeyEmployeeMap.entrySet()) { +// for (Map.Entry> taxCycleEntry : taxCycleKeyEmployeeMap.entrySet()) { // // 薪资核算人员按照个税扣缴义务人id聚合分类 // Map> taxAgentIdKeyEmployeeMap = SalaryEntityUtil.group2Map( // taxCycleEntry.getValue(), SalaryAcctEmployeePO::getTaxAgentId); @@ -281,19 +258,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO() // .setId(IdGenerator.generate()) // .setTaxAgentId(taxAgentIdEntry.getKey()) -// .setSalaryMonth(saveParam.getSalaryMonth().toString()) +// .setSalaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))) // .setTaxCycle(taxCycleEntry.getKey()) // .setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) // .setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()) // .setRemark(saveParam.getDescription()) -// .setCreator(employeeId) -// .setTenantKey(tenantKey) +// .setCreator((long)user.getUID()) +// .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) // .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) // .setCreateTime(now) // .setUpdateTime(now); // newTaxDeclareRecords.add(taxDeclareRecord); // // 生成个税申报表 -// TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue(), employeeId, tenantKey); +// TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue()); // newTaxDeclarations.addAll(taxDeclarationResult.getTaxDeclarations()); // newTaxDeclarationValues.addAll(taxDeclarationResult.getTaxDeclarationValues()); // newAddUpSituations.addAll(taxDeclarationResult.getAddUpSituations()); @@ -301,7 +278,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // } // // // 删除原来生成的个税申报记录、个税申报表、个税申报表明细 -// deleteByIds(needDeleteTaxDeclareRecordIds, tenantKey); +// deleteByIds(needDeleteTaxDeclareRecordIds); // // 保存个税申报记录 // if (CollectionUtils.isNotEmpty(newTaxDeclareRecords)) { // saveBatch(newTaxDeclareRecords); @@ -312,32 +289,32 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // } // // 保存个税申报表明细 // if (CollectionUtils.isNotEmpty(newTaxDeclarationValues)) { -// taxDeclarationValueService.batchSave(newTaxDeclarationValues, tenantKey); +// taxDeclarationValueService.batchSave(newTaxDeclarationValues); // } // // 保存累计情况 // if (CollectionUtils.isNotEmpty(newAddUpSituations)) { // Map> addUpSituationMap = SalaryEntityUtil.group2Map(newAddUpSituations, e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); // for (Map.Entry> entry : addUpSituationMap.entrySet()) { // addUpSituationService.deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), -// SalaryEntityUtil.properties(entry.getValue(), AddUpSituationPO::getTaxAgentId), tenantKey); -// addUpSituationService.saveBatch(entry.getValue(), tenantKey); +// SalaryEntityUtil.properties(entry.getValue(), AddUpSituationPO::getTaxAgentId)); +// addUpSituationService.saveBatch(entry.getValue()); // } // } // // 记录日志 // for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") // .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) // .replace("{1}", taxDeclareRecord.getTaxCycle())); // loggerContext.setOperator(Util.null2String(employeeId)); // loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99815, "生成个税申报表")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99815, "生成个税申报表")); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(99815, "生成个税申报表")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(99815, "生成个税申报表")); // loggerContext.setNewValues(taxDeclareRecord); // taxDeclarationLoggerTemplate.write(loggerContext); // } -// } + } @Override @Transactional(rollbackFor = Exception.class) @@ -345,80 +322,79 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = getById(id); if (Objects.isNull(taxDeclareRecord)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156495, "参数异常,个税申报记录不存在或已被删除")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); } if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182700, "对不起,只有未申报状态下可以刷新数据")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182700, "对不起,只有未申报状态下可以刷新数据")); } // 查询税款所属期下的薪资核算人员 - SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = new SalaryAcctEmployeeQueryParam() - .setTaxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())) - .setTaxCycle(taxDeclareRecord.getTaxCycle()); - List salaryAcctEmployees = salaryAcctEmployeeService.listByParam(salaryAcctEmployeeQueryParam, tenantKey); + SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder() + .taxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .build(); + List salaryAcctEmployees = salaryAcctEmployeeService.listByParam(salaryAcctEmployeeQueryParam); // 查询薪资核算记录 Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); - List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds, tenantKey); + List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds); // 如果存在未归档的薪资核算记录,不允许生成个税申报表 boolean notArchived = salaryAcctRecords.stream() .anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 98875, "{0}有未归档数据,请全部归档后再申报") - .replace("{0}", taxDeclareRecord.getSalaryMonth())); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报") + .replace("{0}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getSalaryMonth()))); } - TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, salaryAcctEmployees, employeeId, tenantKey); + TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, salaryAcctEmployees); // 更新个税申报记录 - taxDeclareRecord.setDisplayUpdateIcon(0).setUpdateTime(LocalDateTime.now()); - updateById(taxDeclareRecord); + taxDeclareRecord.setDisplayUpdateIcon(0).setUpdateTime(new Date()); + taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); // 删除原来的申报表,保存新生成的 - taxDeclarationService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + taxDeclarationService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarations())) { taxDeclarationService.saveBatch(taxDeclarationResult.getTaxDeclarations()); } // 删除原来的申报表明细,保存新生成的 - taxDeclarationValueService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + taxDeclarationValueService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarationValues())) { - taxDeclarationValueService.batchSave(taxDeclarationResult.getTaxDeclarationValues(), tenantKey); + taxDeclarationValueService.batchSave(taxDeclarationResult.getTaxDeclarationValues()); } // 保存累计情况 if (CollectionUtils.isNotEmpty(taxDeclarationResult.getAddUpSituations())) { - Map> addUpSituationMap = SalaryEntityUtil.group2Map(taxDeclarationResult.getAddUpSituations(), + Map> addUpSituationMap = SalaryEntityUtil.group2Map(taxDeclarationResult.getAddUpSituations(), e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); - for (Map.Entry> entry : addUpSituationMap.entrySet()) { + for (Map.Entry> entry : addUpSituationMap.entrySet()) { addUpSituationService.deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), - SalaryEntityUtil.properties(entry.getValue(), AddUpSituationPO::getTaxAgentId), tenantKey); - addUpSituationService.saveBatch(entry.getValue(), tenantKey); + SalaryEntityUtil.properties(entry.getValue(), AddUpSituation::getTaxAgentId)); + addUpSituationService.batchSave(entry.getValue()); } } } - private TaxDeclarationResult generateReportPerRecord(TaxDeclareRecordPO taxDeclareRecord, - List salaryAcctEmployees, - Long employeeId, String tenantKey) { + private TaxDeclarationResult generateReportPerRecord(TaxDeclareRecordPO taxDeclareRecord, List salaryAcctEmployees) { LocalDateTime now = LocalDateTime.now(); List taxDeclarations = Lists.newArrayList(); List taxDeclarationValues = Lists.newArrayList(); - List addUpSituations = Lists.newArrayList(); + List addUpSituations = Lists.newArrayList(); // 查询薪资项目 - List salaryItems = salaryItemService.listAll(employeeId, tenantKey); + List salaryItems = salaryItemService.listAll(); // 查询个税申报表列 - List taxReportColumns = taxReportColumnService.listAll(tenantKey); + List taxReportColumns = taxReportColumnService.listAll(); Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); // 查询薪资核算记录 Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); - List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds, tenantKey); + List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds); Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId); // 查询薪资核算结果 Set salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getId); - List salaryAcctResultValues = salaryAcctResultValueService.listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds, tenantKey); + List salaryAcctResultValues = salaryAcctResultValueService.listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); // 查询薪资账套的累计字段对应关系 Set salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalarySobId); - List salarySobAddUpRules = salarySobAddUpRuleService.listBySalarySobIds(salarySobIds, tenantKey); + List salarySobAddUpRules = salarySobAddUpRuleService.listBySalarySobIds(salarySobIds); Map salarySobAddUpRuleMap = SalaryEntityUtil.convert2Map(salarySobAddUpRules, e -> e.getSalarySobId() + "-" + e.getAddUpColumnDataIndex()); // 查询薪资账套的个税申报表对应规则 - List salarySobTaxReportRules = salarySobTaxReportRuleService.listBySalarySobIds(salarySobIds, tenantKey); + List salarySobTaxReportRules = salarySobTaxReportRuleService.listBySalarySobIds(salarySobIds); Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, e -> e.getSalarySobId() + "-" + e.getReportColumnDataIndex()); // 薪资核算结果按照薪资核算人员id聚合分类 Map salaryAcctResultValueMap = SalaryEntityUtil.convert2Map( @@ -464,7 +440,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())) .setSalaryItems(salaryItems); TaxDeclarationStrategy taxDeclarationStrategy = new TaxDeclarationCommon(); - TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext, employeeId, tenantKey); + TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext); taxDeclarationValues.addAll(generateResult.getTaxDeclarationValues()); addUpSituations.addAll(generateResult.getAddUpSituations()); } @@ -481,19 +457,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe * @param taxAgentNameMap * @param salaryAcctRecords * @param salaryAcctTaxAgents - * @param tenantKey */ private List checkBeforeSave(TaxDeclarationSaveParam saveParam, Map taxAgentNameMap, List salaryAcctRecords, - List salaryAcctTaxAgents, - Long employeeId, String tenantKey) { + List salaryAcctTaxAgents) { List resultList = Lists.newArrayList(); // 如果存在未归档的薪资核算记录,不允许生成个税申报表 boolean notArchived = salaryAcctRecords.stream() .anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 98875, "{0}有未归档数据,请全部归档后再申报") + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报") .replace("{0}", saveParam.getSalaryMonth().toString())); } // 查询已归档的薪资核算记录 @@ -502,14 +476,14 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .collect(Collectors.toList()); // 无已归档的薪资核算记录,不允许生成个税申报表 if (CollectionUtils.isEmpty(archivedSalaryAcctRecords)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177860, "{0}无可申报数据") + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177860, "{0}无可申报数据") .replace("{0}", saveParam.getSalaryMonth().toString())); } // 查询已归档的薪资核算记录是否已经生成过个税申报表 - Map> taxCycleKeySalaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle); - for (Map.Entry> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) { + Map> taxCycleKeySalaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle); + for (Map.Entry> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) { Set archivedTaxAgentIds = SalaryEntityUtil.properties(taxCycleEntry.getValue(), SalaryAcctTaxAgentPO::getTaxAgentId); - List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(saveParam.getSalaryMonth(), archivedTaxAgentIds, tenantKey); + List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)), archivedTaxAgentIds); TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream() .filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) @@ -518,9 +492,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .orElse(null); // 已经申报成功了的个税申报表的个税扣缴义务人不允许重新生成 if (Objects.nonNull(declareSuccessTaxDeclareRecord)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成") + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成") .replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())) - .replace("{1}", declareSuccessTaxDeclareRecord.getTaxCycle())); + .replace("{1}", SalaryDateUtil.getFormatYearMonth(declareSuccessTaxDeclareRecord.getTaxCycle()))); } resultList.addAll(taxDeclareRecords); } @@ -531,88 +505,88 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe * 根据个税扣缴义务人范围查询个税扣缴义务人 * * @param saveParam - * @param employeeId - * @param tenantKey * @return */ - private List queryByTaxAgentRange(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey) { - List taxAgents; - if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ALL_TAX_AGENT) { - // 判断当前是否开启了分权 - Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); - // 判断是否是总管理员 - Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); - if (openDevolution && !isChief) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160523, "对不起,您不是薪酬模块的总管理员,不具备生成所有个税扣缴义务人的权限")); - } - taxAgents = taxAgentService.listAll(tenantKey); - } else if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ADMIN_TAX_AGENT) { - taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId, tenantKey); - } else { - taxAgents = taxAgentService.listByIds(saveParam.getTaxAgentIds(), tenantKey); - } - return taxAgents; - } +// private List queryByTaxAgentRange(TaxDeclarationSaveParam saveParam) { +// List taxAgents; +// if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ALL_TAX_AGENT) { +// // 判断当前是否开启了分权 +// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); +// // 判断是否是总管理员 +// Boolean isChief = taxAgentService.isChief(employeeId); +// if (openDevolution && !isChief) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160523, "对不起,您不是薪酬模块的总管理员,不具备生成所有个税扣缴义务人的权限")); +// } +// taxAgents = taxAgentService.listAll(tenantKey); +// } else if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ADMIN_TAX_AGENT) { +// taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId); +// } else { +// taxAgents = taxAgentService.listByIds(saveParam.getTaxAgentIds()); +// } +// return taxAgents; +// } @Override - public void updateIcon(Long id, Integer displayIcon, Long employeeId, String tenantKey) { - TaxDeclareRecordPO taxDeclareRecord = getById(id, tenantKey); + public void updateIcon(Long id, Integer displayIcon) { + TaxDeclareRecordPO taxDeclareRecord = getById(id); if (taxDeclareRecord == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); } taxDeclareRecord.setDisplayUpdateIcon(displayIcon); - taxDeclareRecord.setUpdateTime(LocalDateTime.now()); - updateById(taxDeclareRecord); + taxDeclareRecord.setUpdateTime(new Date()); + taxDeclareRecordMapper.update(taxDeclareRecord); } @Override - public void updateByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds, String tenantKey) { + public void updateByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds) { if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); } - List taxDeclareRecords = listByTaxCycleAndTaxAgentIds(taxCycle, taxAgentIds, tenantKey); + List taxDeclareRecords = listByTaxCycleAndTaxAgentIds(taxCycle, taxAgentIds); if (CollectionUtils.isEmpty(taxDeclareRecords)) { return; } - LocalDateTime now = LocalDateTime.now(); - taxDeclareRecords.forEach(e -> e.setDisplayUpdateIcon(1).setUpdateTime(now)); - updateBatchById(taxDeclareRecords); + Date now = new Date(); + taxDeclareRecords.forEach(e -> { + e.setDisplayUpdateIcon(1).setUpdateTime(now); + taxDeclareRecordMapper.update(e); + }); } @Override - public boolean checkByAuthority(TaxDeclarationPO taxDeclaration, Long employeeId, String tenantKey) { - // 判断是否仅本人可见 - if (Objects.equals(taxDeclaration.getControlView(), 1) && !Objects.equals(taxDeclaration.getCreator(), employeeId)) { - return false; - } - // 判断是否开启了分权 - Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); - // 判断是否是总管理员 - Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); - // 可见范围内的个税扣缴义务人 - List taxAgents = Lists.newArrayList(); - if (openDevolution) { - if (isChief) { - taxAgents = taxAgentService.listAsChief(true, true, employeeId, tenantKey); - } else { - taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId, tenantKey); - } - if (CollectionUtils.isEmpty(taxAgents)) { - return false; - } - Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); - return taxAgentIds.contains(taxDeclaration.getTaxAgentId()); - } + public boolean checkByAuthority(TaxDeclarationPO taxDeclaration) { +// // 判断是否仅本人可见 +// if (Objects.equals(taxDeclaration.getControlView(), 1) && !Objects.equals(taxDeclaration.getCreator(), employeeId)) { +// return false; +// } +// // 判断是否开启了分权 +// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); +// // 判断是否是总管理员 +// Boolean isChief = taxAgentService.isChief(employeeId); +// // 可见范围内的个税扣缴义务人 +// List taxAgents = Lists.newArrayList(); +// if (openDevolution) { +// if (isChief) { +// taxAgents = taxAgentService.listAsChief(true, true); +// } else { +// taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId); +// } +// if (CollectionUtils.isEmpty(taxAgents)) { +// return false; +// } +// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); +// return taxAgentIds.contains(taxDeclaration.getTaxAgentId()); +// } // 查询个税申报表 return true; } @Override - public void deleteByIds(Collection ids, String tenantKey) { + public void deleteByIds(Collection ids) { if (CollectionUtils.isEmpty(ids)) { return; } - List taxDeclareRecords = listByIds(ids, tenantKey); + List taxDeclareRecords = listByIds(ids); if (CollectionUtils.isEmpty(taxDeclareRecords)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160524, "个税申报表不存在或已被删除")); } @@ -623,74 +597,68 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (CollectionUtils.isNotEmpty(cantDeleteTaxDeclareRecords)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177854, "个税申报表已经申报,无法删除")); } - new LambdaUpdateChainWrapper<>(taxDeclareRecordMapper) - .eq(TaxDeclareRecordPO::getTenantKey, tenantKey) - .eq(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclareRecordPO::getId, ids) - .set(TaxDeclareRecordPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) - .update(); + taxDeclareRecordMapper.deleteByIds(ids); // 删除个税申报表 - taxDeclarationService.deleteByTaxDeclareRecordIds(ids, tenantKey); + taxDeclarationService.deleteByTaxDeclareRecordIds(ids); // 删除个税申报表明细 - taxDeclarationValueService.deleteByTaxDeclareRecordIds(ids, tenantKey); + taxDeclarationValueService.deleteByTaxDeclareRecordIds(ids); // 记录日志 - writeDeleteLog(taxDeclareRecords, tenantKey); +// writeDeleteLog(taxDeclareRecords); } - private void writeDeleteLog(List taxDeclareRecords, String tenantKey) { - // 记录日志 - List taxAgents = taxAgentService.listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId), tenantKey); - Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); - for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), com.baomidou.mybatisplus.core.toolkit.StringUtils.EMPTY)) - .replace("{1}", taxDeclareRecord.getTaxCycle())); - loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); - taxDeclarationLoggerTemplate.write(loggerContext); - } - } +// private void writeDeleteLog(List taxDeclareRecords) { +// // 记录日志 +// List taxAgents = taxAgentService.listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); +// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); +// for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), com.baomidou.mybatisplus.core.toolkit.StringUtils.EMPTY)) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); +// taxDeclarationLoggerTemplate.write(loggerContext); +// } +// } @Override - public void declare(Long id, Long employeeId, String tenantKey) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + public void declare(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160526, "目前正处于申报中,请稍后片刻再点击「申报反馈」获取结果")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160526, "目前正处于申报中,请稍后片刻再点击「申报反馈」获取结果")); } if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160527, "目前正处于作废申报中,请稍后片刻再点击「作废反馈」获取结果")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160527, "目前正处于作废申报中,请稍后片刻再点击「作废反馈」获取结果")); } // 查询个税申报表 - List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(YearMonth.parse(taxDeclareRecord.getTaxCycle()), - Collections.singleton(taxDeclareRecord.getTaxAgentId()), tenantKey); + List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); if (CollectionUtils.isEmpty(taxDeclarations)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156494, "当前无可申报的数据")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据")); } AbnormalEmployeeListQueryParam queryParam = new AbnormalEmployeeListQueryParam() .setTaxDeclareRecordId(taxDeclareRecord.getId()) .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) .setTaxCycle(taxDeclareRecord.getTaxCycle()); // 查询是否存在有未报送的人 - List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam, tenantKey); + List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam); if (CollectionUtils.isNotEmpty(notDeclareTaxDeclareEmployees)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 162125, "存在有未报送的人,请先报送相关人员后再申报个税")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(162125, "存在有未报送的人,请先报送相关人员后再申报个税")); } // 查询是否存在没有申报数据的人 - List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam, tenantKey); + List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam); if (CollectionUtils.isNotEmpty(noValueTaxDeclareEmployees)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160535, "存在没有申报数据的人,请重新核算这些人的薪资后再来申报个税")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160535, "存在没有申报数据的人,请重新核算这些人的薪资后再来申报个税")); } // 查询个税申报表的申报数据 Set taxDeclarationIds = SalaryEntityUtil.properties(taxDeclarations, TaxDeclarationPO::getId); - List taxDeclarationValues = taxDeclarationValueService.listByTaxDeclarationIds(taxDeclarationIds, tenantKey); + List taxDeclarationValues = taxDeclarationValueService.listByTaxDeclarationIds(taxDeclarationIds); // 查询本税款所属期内报送成功的人员 List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(YearMonth.parse(taxDeclareRecord.getTaxCycle()), - taxDeclareRecord.getTaxAgentId(), tenantKey); + taxDeclareRecord.getTaxAgentId()); employeeDeclares = employeeDeclares.stream() .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) .collect(Collectors.toList()); @@ -716,7 +684,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe log.info("个税申报返回数据: {} , taxDeclareRecord: {}", res, taxDeclareRecord); DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); } if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); @@ -727,26 +695,25 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setUpdateTime(LocalDateTime.now()); taxDeclareRecordMapper.updateById(taxDeclareRecord); // 删除个税申报申报失败的数据 - taxDeclareFailService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + taxDeclareFailService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") .replace("{0}", taxAgent.getName()) .replace("{1}", taxDeclareRecord.getTaxCycle())); loggerContext.setOperator(Util.null2String(employeeId)); loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156454, "在线申报")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156454, "在线申报")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); taxDeclarationLoggerTemplate.write(loggerContext); } @Override - @Transactional(rollbackFor = Exception.class) - public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long currentEmployeeId, String tenantKey) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, currentEmployeeId, tenantKey); + public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long currentEmployeeId) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, currentEmployeeId); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); if (StringUtils.isEmpty(taxDeclareRecord.getRequestId()) || !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156496, "请先点击「在线申报」后再点击「申报反馈」获取申报结果")); @@ -773,7 +740,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } // 查询报送的人员 List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(YearMonth.parse(taxDeclareRecord.getTaxCycle()), - taxDeclareRecord.getTaxAgentId(), tenantKey); + taxDeclareRecord.getTaxAgentId()); Map employeeInfoMap = SalaryEntityUtil.convert2Map(employeeDeclares, e -> e.getEmployeeName() + "-" + e.getCardNum()); // 流量统计 @@ -887,17 +854,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - public void cancelDeclare(Long id, Long employeeId, String tenantKey) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + public void cancelDeclare(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); // 更正申报成功后不能作废 if (Objects.equals(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182701, "更正申报后不允许作废")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182701, "更正申报后不允许作废")); } // 只有申报成功,无需缴款/申报成功,未缴款的状态才能作废 if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废")); } // 供应商信息 TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); @@ -908,7 +875,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 申报类型 requestParam.put("sblx", "1"); // 作废银联缴款凭证 - taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(employeeId, tenantKey, apiConfig, taxDeclareRecord, requestParam); + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(employeeId, apiConfig, taxDeclareRecord, requestParam); // 是否清空所得 requestParam.put("sfqksd", "0"); // 请求 @@ -920,7 +887,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe log.info("作废申报返回数据:" + res); DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); } if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); @@ -935,23 +902,23 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") .replace("{0}", taxAgent.getName()) .replace("{1}", taxDeclareRecord.getTaxCycle())); loggerContext.setOperator(Util.null2String(employeeId)); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156456, "申报作废")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156456, "申报作废")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); taxDeclarationLoggerTemplate.write(loggerContext); } @Override - public void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long employeeId, String tenantKey) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + public void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(taxDeclareRecord.getRequestId())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156500, "请先点击「作废申报」后再来点击「申报反馈」按钮获取结果")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156500, "请先点击「作废申报」后再来点击「申报反馈」按钮获取结果")); } // 供应商信息 TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); @@ -962,7 +929,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe log.info("作废反馈返回数据:" + res); CancelDeclareFeedbackResponse cancelDeclareFeedbackResponse = JsonUtil.parseObject(res, CancelDeclareFeedbackResponse.class); if (Objects.isNull(cancelDeclareFeedbackResponse) || Objects.isNull(cancelDeclareFeedbackResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); } if (!Objects.equals(cancelDeclareFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(cancelDeclareFeedbackResponse.getHead().getMsg()); @@ -975,12 +942,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List errorMsgList = JsonUtil.parseList(feedbackBody, Map.class).stream() .map(e -> Util.null2String(e.get("msg"))) .collect(Collectors.toList()); - taxDeclarationRate.setStatus(false).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156508, "作废失败:") + StringUtils.join(errorMsgList, ",")); + taxDeclarationRate.setStatus(false).setMsg(SalaryI18nUtil.getI18nLabel(156508, "作废失败:") + StringUtils.join(errorMsgList, ",")); } TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue( SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("sbztbj"), 1), TaxDeclareStatusEnum.class); if (taxDeclareStatusEnum == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156509, "服务异常,接口返回数据有误")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); taxDeclareRecord.setRequestId(""); @@ -991,19 +958,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") .replace("{0}", taxAgent.getName()) .replace("{1}", taxDeclareRecord.getTaxCycle())); loggerContext.setOperator(Util.null2String(employeeId)); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156457, "获取申报作废的反馈")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156457, "获取申报作废的反馈")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); taxDeclarationLoggerTemplate.write(loggerContext); } @Override - public void updateDeclare(Long id, Long employeeId, String tenantKey) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + public void updateDeclare(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); List taxDeclareStatusEnumValueList = Lists.newArrayList( TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), @@ -1011,7 +978,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182702, "对不起,只有申报成功后才允许更正申报")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "对不起,只有申报成功后才允许更正申报")); } // 供应商信息 TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); @@ -1031,7 +998,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe log.info("更正申报返回数据:" + res); UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class); if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); } if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg()); @@ -1046,19 +1013,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") .replace("{0}", taxAgent.getName()) .replace("{1}", taxDeclareRecord.getTaxCycle())); loggerContext.setOperator(Util.null2String(employeeId)); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177637, "更正申报")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177637, "更正申报")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); taxDeclarationLoggerTemplate.write(loggerContext); } @Override - public String queryDeclareStatus(Long id, Long employeeId, String tenantKey) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + public String queryDeclareStatus(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); Map requestParam = taxDeclareRequest.getRequestParam(); @@ -1077,8 +1044,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - public String queryCompanyIncomes(Long id, Long employeeId, String tenantKey) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, employeeId, tenantKey); + public String queryCompanyIncomes(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); Map requestParam = taxDeclareRequest.getRequestParam(); @@ -1100,23 +1067,23 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return res; } - private TaxDeclareRequest buildTaxDeclareRequest(Long id, Long employeeId, String tenantKey) { + private TaxDeclareRequest buildTaxDeclareRequest(Long id) { // 查询供应商信息 - TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true); + TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(true); if (apiConfig == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量")); } // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = getById(id, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = getById(id); if (Objects.isNull(taxDeclareRecord)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156495, "参数异常,个税申报记录不存在或已被删除")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); } // 查询个税扣缴义务人 - TaxAgentPO taxAgent = taxAgentService.getById(taxDeclareRecord.getTaxAgentId(), tenantKey); + TaxAgentPO taxAgent = taxAgentService.getById(taxDeclareRecord.getTaxAgentId()); // 查询个税扣缴义务人关联的企业信息 - TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(taxDeclareRecord.getTaxAgentId(), tenantKey); + TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(taxDeclareRecord.getTaxAgentId()); if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); } // 注册的企业信息-->请求参数 Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); diff --git a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java new file mode 100644 index 000000000..4cc852653 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -0,0 +1,40 @@ +package com.engine.salary.service.impl; + +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.service.TaxReportColumnService; +import com.weaver.hrm.salary.constant.SalaryConstant; +import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; + +import java.util.List; + +/** + * @description: 个税申报表表头 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/5 6:36 PM + * @version:v1.0 + */ +public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { + + @Override + public List listAll() { + return new LambdaQueryChainWrapper<>(baseMapper) + .eq(TaxReportColumnPO::getTenantKey, SalaryConstant.DEFAULT_TENANT_KEY) + .eq(TaxReportColumnPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .orderByAsc(TaxReportColumnPO::getId) + .list(); + } + + @Override + public List listByIncomeCategory(IncomeCategoryEnum incomeCategory) { + return new LambdaQueryChainWrapper<>(baseMapper) + .eq(TaxReportColumnPO::getTenantKey, SalaryConstant.DEFAULT_TENANT_KEY) + .eq(TaxReportColumnPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(TaxReportColumnPO::getIncomeCategory, incomeCategory.getValue()) + .orderByAsc(TaxReportColumnPO::getId) + .list(); + } +} diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 4f1d319df..838b498a5 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -166,7 +166,7 @@ public class TaxDeclarationController { taxDeclareRecordWrapper.updateIcon(param.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); return WeaResult.success(null); User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getTaxDeclarationInfoById, taxDeclarationId); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateIcon, taxDeclarationId); } /** diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index ae77b1f61..39f67ef2e 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -1,50 +1,38 @@ package com.engine.salary.wrapper; import com.engine.core.impl.Service; -import com.engine.salary.service.SalaryCacheService; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.TaxDeclarationExcelService; -import com.engine.salary.service.TaxDeclarationService; -import com.weaver.common.component.form.WeaForm; -import com.weaver.common.component.table.WeaTable; -import com.weaver.common.component.table.page.Page; -import com.weaver.common.component.table.permission.Permission; -import com.weaver.common.distribution.genid.IdGenerator; -import com.weaver.common.hr.util.Util; -import com.weaver.common.hrm.service.HrmCommonEmployeeService; -import com.weaver.common.threadPool.ThreadPoolUtil; -import com.weaver.common.threadPool.constant.ModulePoolEnum; -import com.weaver.common.threadPool.entity.LocalRunnable; -import com.weaver.datasecurity.interceptor.DSTenantKeyThreadVar; -import com.weaver.framework.util.JsonUtil; -import com.weaver.hrm.salary.cache.SalaryCacheKey; -import com.weaver.hrm.salary.common.excel.ExcelExportParam; -import com.weaver.hrm.salary.constant.SalaryConstant; -import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentPO; -import com.weaver.hrm.salary.entity.taxdeclaration.dto.*; -import com.weaver.hrm.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; -import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; -import com.weaver.hrm.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; -import com.weaver.hrm.salary.entity.taxdeclaration.po.*; -import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxAgentRangeEnum; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareStatusEnum; -import com.weaver.hrm.salary.enums.taxdeclaration.TaxDeclareTypeEnum; -import com.weaver.hrm.salary.exception.SalaryNullException; -import com.weaver.hrm.salary.exception.SalaryRunTimeException; -import com.weaver.hrm.salary.service.*; -import com.weaver.hrm.salary.util.*; -import com.weaver.teams.domain.EntityType; -import com.weaver.teams.domain.user.SimpleEmployee; +import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.dto.*; +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.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.weaver.util.threadPool.ThreadPoolUtil; +import com.weaver.util.threadPool.constant.ModulePoolEnum; +import com.weaver.util.threadPool.entity.LocalRunnable; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.stereotype.Component; +import weaver.general.Util; -import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; @@ -59,48 +47,48 @@ import java.util.stream.Collectors; @Component public class TaxDeclareRecordWrapper extends Service { - + private TaxDeclareRecordService taxDeclareRecordService; - + private TaxAgentService taxAgentService; - - private HrmCommonEmployeeService hrmCommonEmployeeService; - + + private SalaryEmployeeService hrmCommonEmployeeService; + private SalaryCacheService salaryCacheService; - + private TaxDeclarationService taxDeclarationService; - + private TaxDeclarationValueService taxDeclarationValueService; - + private TaxDeclarationExcelService taxDeclarationExcelService; - + private TaxDeclareEmployeeService taxDeclareEmployeeService; - + private TaxDeclareFailService taxDeclareFailService; /** * 个税申报记录列表 * * @param queryParam - * @param employeeId - * @param tenantKey * @return */ - public WeaTable listPage(TaxDeclarationListQueryParam queryParam, Long employeeId, String tenantKey) { - Page page = taxDeclareRecordService.listPageByParam(queryParam, employeeId, tenantKey); - Page dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); - if (CollectionUtils.isNotEmpty(page.getRecords())) { + public PageInfo listPage(TaxDeclarationListQueryParam queryParam) { + PageInfo page = taxDeclareRecordService.listPageByParam(queryParam); + List list = page.getList(); + + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareRecordListDTO.class); + if (CollectionUtils.isNotEmpty(list)) { // 查询个税扣缴义务人 - Set taxAgentIds = SalaryEntityUtil.properties(page.getRecords(), TaxDeclareRecordPO::getTaxAgentId); - List taxAgents = taxAgentService.listByIds(taxAgentIds, tenantKey); + Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclareRecordPO::getTaxAgentId); + List taxAgents = taxAgentService.listByIds(taxAgentIds); // 查询人员姓名 - List employeeIds = SalaryEntityUtil.properties(page.getRecords(), TaxDeclareRecordPO::getCreator, Collectors.toList()); - List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIds, tenantKey); + List employeeIds = SalaryEntityUtil.properties(list, TaxDeclareRecordPO::getCreator, Collectors.toList()); + List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIds); List dtoList = Lists.newArrayList(); Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); - Map simpleEmployeeNameMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId, SimpleEmployee::getName); - for (TaxDeclareRecordPO taxDeclareRecord : page.getRecords()) { + Map simpleEmployeeNameMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + for (TaxDeclareRecordPO taxDeclareRecord : list) { TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); TaxDeclareRecordListDTO taxDeclareRecordListDTO = new TaxDeclareRecordListDTO() @@ -121,195 +109,152 @@ public class TaxDeclareRecordWrapper extends Service { .setDisplayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)); dtoList.add(taxDeclareRecordListDTO); } - dtoPage.setRecords(dtoList); + dtoPage.setList(dtoList); } - // 转换成前端所需的数据格式 - WeaTable weaTable = SalaryFormatUtil.getInstance() - .buildTable(TaxDeclareRecordListDTO.class, dtoPage); - for (int i = 0; i < dtoPage.getRecords().size(); i++) { - TaxDeclareRecordListDTO dto = dtoPage.getRecords().get(i); - List permissions = weaTable.getOperatesPermission().get(i); - for (int j = 0; j < permissions.size(); j++) { - Permission permission = permissions.get(j); - if (j == 1 && (dto.getTaxDeclareStatus() != TaxDeclareStatusEnum.NOT_DECLARE || dto.getTaxDeclareType() != TaxDeclareTypeEnum.NORMAL_DECLARE)) { - permission.setVisible(false); - permission.setDisabled(false); - } - } - } - return weaTable; + return dtoPage; } /** * 个税申报表明细列表 * * @param queryParam 列表查询条件 - * @param tenantKey 租户key * @return */ - public WeaTable listValuePage(TaxDeclarationValueListQueryParam queryParam, Long employeeId, String tenantKey) { + public PageInfo listValuePage(TaxDeclarationValueListQueryParam queryParam) { // 查询个税申报表 - TaxDeclarationPO taxDeclaration = taxDeclarationService.getById(queryParam.getTaxDeclarationId(), tenantKey); + TaxDeclarationPO taxDeclaration = taxDeclarationService.getById(queryParam.getTaxDeclarationId()); // 判断是否有权限查看 - boolean canSee = taxDeclareRecordService.checkByAuthority(taxDeclaration, employeeId, tenantKey); + boolean canSee = taxDeclareRecordService.checkByAuthority(taxDeclaration); if (!canSee) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看")); } - String pageUid = "taxDeclarationValueList"; - SalaryPageUtil.handlePageSize(pageUid, queryParam); // 查询个税申报表详情 - Page page = taxDeclarationValueService.listPageByTaxDeclarationIds( - new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true), Collections.singleton(queryParam.getTaxDeclarationId()), tenantKey); - TaxDeclarationValueListDTO taxDeclarationValueListDTO = taxDeclarationValueService.convert2List(taxDeclaration, page.getRecords(), tenantKey); - Page> dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); - dtoPage.setRecords(taxDeclarationValueListDTO.getData()); - // 转成前端所需的格式 - WeaTable> weaTable = new WeaTable<>(); - weaTable.setColumns(taxDeclarationValueListDTO.getColumns()); - weaTable.setPage(dtoPage); - weaTable.setModule(SalaryConstant.MODULE); - weaTable.setPageUid(pageUid); - return weaTable; + PageInfo page = taxDeclarationValueService.listPageByTaxDeclarationIds(Collections.singleton(queryParam.getTaxDeclarationId())); + TaxDeclarationValueListDTO taxDeclarationValueListDTO = taxDeclarationValueService.convert2List(taxDeclaration, page.getList()); + PageInfo> dtoPage = new PageInfo(); + dtoPage.setList(taxDeclarationValueListDTO.getData()); + return dtoPage; } /** * 未报送的人员列表 * * @param queryParam - * @param tenantKey * @return */ - public WeaTable listEmployeePage4NotDeclare(AbnormalEmployeeListQueryParam queryParam, String tenantKey) { - String pageUid = "abnormalEmployeeList4NoDeclare"; - SalaryPageUtil.handlePageSize(pageUid, queryParam); - WeaTable weaTable = listEmployeePage("NotDeclare", queryParam, tenantKey); - weaTable.setPageUid(pageUid); - return weaTable; + public PageInfo listEmployeePage4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { + return listEmployeePage("NotDeclare", queryParam); } /** * 没有申报数据的人员列表 * * @param queryParam - * @param tenantKey * @return */ - public WeaTable listEmployeePage4NoValue(AbnormalEmployeeListQueryParam queryParam, String tenantKey) { - String pageUid = "abnormalEmployeeList4NoValue"; - SalaryPageUtil.handlePageSize(pageUid, queryParam); - WeaTable weaTable = listEmployeePage("NoValue", queryParam, tenantKey); - weaTable.setPageUid(pageUid); - return weaTable; + public PageInfo listEmployeePage4NoValue(AbnormalEmployeeListQueryParam queryParam) { + return listEmployeePage("NoValue", queryParam); } /** * 申报失败的人员列表 * * @param queryParam - * @param tenantKey * @return */ - public WeaTable listEmployeePage4Fail(AbnormalEmployeeListQueryParam queryParam, String tenantKey) { - String pageUid = "failEmployeeList"; - SalaryPageUtil.handlePageSize(pageUid, queryParam); + public PageInfo listEmployeePage4Fail(AbnormalEmployeeListQueryParam queryParam) { // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId(), tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId()); // 查询申报失败的数据 - Page page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true); - page = taxDeclareFailService.listPageByTaxDeclareRecordIds(page, Collections.singleton(taxDeclareRecord.getId()), tenantKey); + PageInfo taxDeclareFailPOPageInfo = taxDeclareFailService.listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + List list = taxDeclareFailPOPageInfo.getList(); // 转换成dto - Page dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); - dtoPage.setRecords(taxDeclareFailService.convert2FailEmployeeList(taxDeclareRecord, page.getRecords(), tenantKey)); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), FailEmployeeListDTO.class); + dtoPage.setList(taxDeclareFailService.convert2FailEmployeeList(taxDeclareRecord, list)); // 转成前端所需的格式 - return SalaryFormatUtil.getInstance().buildTable(FailEmployeeListDTO.class, dtoPage); + return dtoPage; } - private WeaTable listEmployeePage(String key, AbnormalEmployeeListQueryParam queryParam, String tenantKey) { - WeaTable weaTable; + private PageInfo listEmployeePage(String key, AbnormalEmployeeListQueryParam queryParam) { // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId(), tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId()); queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); if (StringUtils.isEmpty(queryParam.getKeyword())) { // 查询个税申报记录的人员 - Page page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true); + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareEmployeePO.class); if (StringUtils.equals("NotDeclare", key)) { - page = taxDeclareEmployeeService.listPage4NotDeclareByParam(queryParam, tenantKey); + page = taxDeclareEmployeeService.listPage4NotDeclareByParam(queryParam); } else if (StringUtils.equals("NoValue", key)) { - page = taxDeclareEmployeeService.listPage4NoValueByParam(queryParam, tenantKey); + page = taxDeclareEmployeeService.listPage4NoValueByParam(queryParam); } - Page dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); - dtoPage.setRecords(taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, page.getRecords(), tenantKey)); - // 转换成前端所需的格式 - weaTable = SalaryFormatUtil.getInstance().buildTable(AbnormalEmployeeListDTO.class, dtoPage); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AbnormalEmployeeListDTO.class); + dtoPage.setList(taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, page.getList())); + return dtoPage; } else { // 查询条件中包含"keyword"时,不好通过SQL分页,所以在内存中分页 List taxDeclareEmployees = Collections.emptyList(); if (StringUtils.equals("NotDeclare", key)) { - taxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam, tenantKey); + taxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam); } else if (StringUtils.equals("NoValue", key)) { - taxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam, tenantKey); + taxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam); } - List dtos = taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees, tenantKey) + List dtos = taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees) .stream() .filter(e -> StringUtils.contains(e.getEmployeeName(), queryParam.getKeyword()) || StringUtils.contains(e.getJobNum(), queryParam.getKeyword()) || StringUtils.contains(e.getCardNum(), queryParam.getKeyword())) .collect(Collectors.toList()); - Page dtoPage = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), dtos.size(), true); - dtoPage.setRecords(SalaryPageUtil.subList((int) dtoPage.getCurrent(), (int) dtoPage.getSize(), dtos)); - // 转换成前端所需的格式 - weaTable = SalaryFormatUtil.getInstance().buildTable(AbnormalEmployeeListDTO.class, dtoPage); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtos, AbnormalEmployeeListDTO.class); + return dtoPage; } - return weaTable; } - /** - * 获取个税申报记录的表单 - * - * @param id - * @param tenantKey - * @return - */ - public WeaForm getForm(Long id, Long employeeId, String tenantKey) { - TaxDeclareRecordFormDTO formDTO = new TaxDeclareRecordFormDTO(); - formDTO.setTaxAgentRange(TaxAgentRangeEnum.SELECT_TAX_AGENT); - // 判断当前是否开启了分权 - Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); - Boolean isChief = taxAgentService.isChief(employeeId, tenantKey); - // 转换成前端所需的数据格式 - WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclareRecordFormDTO.class, formDTO); - weaForm.getItems().forEach((k, v) -> { - if (StringUtils.equals("salaryMonth", k)) { - Map otherParams = new HashMap<>(); - otherParams.put("type", "month"); - v.setOtherParams(otherParams); - } - // 未开启分权,没有"作为管理员的个税扣缴义务人" - if (!openDevolution && StringUtils.equals("taxAgentRange", k)) { - v.getOptions().remove(1); - } - // 开启分权,但不是总管理员,没有"所有个税扣缴义务人" - if (openDevolution && !isChief && StringUtils.equals("taxAgentRange", k)) { - v.getOptions().remove(0); - } - }); - return weaForm; - } +// /** +// * 获取个税申报记录的表单 +// * +// * @param id +// * @param tenantKey +// * @return +// */ +// public WeaForm getForm(Long id) { +// TaxDeclareRecordFormDTO formDTO = new TaxDeclareRecordFormDTO(); +// formDTO.setTaxAgentRange(TaxAgentRangeEnum.SELECT_TAX_AGENT); +// // 判断当前是否开启了分权 +// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); +// Boolean isChief = taxAgentService.isChief(employeeId); +// // 转换成前端所需的数据格式 +// WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclareRecordFormDTO.class, formDTO); +// weaForm.getItems().forEach((k, v) -> { +// if (StringUtils.equals("salaryMonth", k)) { +// Map otherParams = new HashMap<>(); +// otherParams.put("type", "month"); +// v.setOtherParams(otherParams); +// } +// // 未开启分权,没有"作为管理员的个税扣缴义务人" +// if (!openDevolution && StringUtils.equals("taxAgentRange", k)) { +// v.getOptions().remove(1); +// } +// // 开启分权,但不是总管理员,没有"所有个税扣缴义务人" +// if (openDevolution && !isChief && StringUtils.equals("taxAgentRange", k)) { +// v.getOptions().remove(0); +// } +// }); +// return weaForm; +// } /** * 获取个税申报记录下的个税申报表TAB * * @param id - * @param tenantKey * @return */ - public List getTaxDeclarationTab(Long id, Long employeeId, String tenantKey) { + public List getTaxDeclarationTab(Long id, Long employeeId) { // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id); // 查询个税申报记录下的个税申报表 - List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(YearMonth.parse(taxDeclareRecord.getTaxCycle()), - Collections.singleton(taxDeclareRecord.getTaxAgentId()), tenantKey); + List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), + Collections.singleton(taxDeclareRecord.getTaxAgentId())); taxDeclarations = taxDeclarations.stream() .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), employeeId)) .collect(Collectors.toList()); @@ -332,12 +277,11 @@ public class TaxDeclareRecordWrapper extends Service { * 查询个税申报表的基本信息 * * @param id 个税申报表id - * @param tenantKey 租户key * @return */ - public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id, String tenantKey) { + public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { // 查询个税申报表 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id, tenantKey); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id); if (Objects.isNull(taxDeclareRecord)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); } @@ -346,58 +290,55 @@ public class TaxDeclareRecordWrapper extends Service { .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) .setTaxCycle(taxDeclareRecord.getTaxCycle()); // 查询是否存在有未报送的人 - List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam, tenantKey); + List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam); // 查询是否存在没有申报数据的人 - List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam, tenantKey); + List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam); // 查询是否存在申报失败的人 - List taxDeclareFails = taxDeclareFailService.listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId()), tenantKey); + List taxDeclareFails = taxDeclareFailService.listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 查询个税扣缴义务人 - TaxAgentPO taxAgentPO = taxAgentService.getById(taxDeclareRecord.getTaxAgentId(), tenantKey); + TaxAgentPO taxAgentPO = taxAgentService.getById(taxDeclareRecord.getTaxAgentId()); TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); - return new TaxDeclarationInfoDTO() - .setSalaryMonth(taxDeclareRecord.getSalaryMonth()) - .setTaxCycle(taxDeclareRecord.getTaxCycle()) - .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) - .setTaxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")) - .setDeclareType(taxDeclareTypeEnum) - .setDeclareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel())) - .setDeclareStatus(taxDeclareStatusEnum) - .setDeclareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel())) - .setDeclareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) - .setDisplayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)) - .setDeclareFailSize(taxDeclareFails.size()) - .setAbnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size()) - .setTaxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPaidAmount())); + return TaxDeclarationInfoDTO.builder() + .salaryMonth(taxDeclareRecord.getSalaryMonth()) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")) + .declareType(taxDeclareTypeEnum) + .declareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel())) + .declareStatus(taxDeclareStatusEnum) + .declareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel())) + .declareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) + .displayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)) + .declareFailSize(taxDeclareFails.size()) + .abnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size()) + .taxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPaidAmount())) + .build(); } /** * 保存 * - * @param saveParam 保存参数 - * @param employeeId 人员id - * @param tenantKey 租户key + * @param saveParam 保存参数 */ - public String save(TaxDeclarationSaveParam saveParam, Long employeeId, String tenantKey) { + public String save(TaxDeclarationSaveParam saveParam) { TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true) .setIndex(Util.null2String(IdGenerator.generate())) - .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95836, "生成申报表")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + .setMsg(SalaryI18nUtil.getI18nLabel(95836, "生成申报表")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - DSTenantKeyThreadVar.tenantKey.set(tenantKey); - taxDeclareRecordService.save(saveParam, employeeId, tenantKey); + taxDeclareRecordService.save(saveParam); taxDeclarationRate.setStatus(true).setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } catch (Exception e) { log.error("个税申报表生成报错:{}", e.getMessage(), e); - taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187276, "个税申报表生成报错:") + e.getMessage()); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187276, "个税申报表生成报错:") + e.getMessage()); } finally { - DSTenantKeyThreadVar.tenantKey.remove(); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -409,61 +350,53 @@ public class TaxDeclareRecordWrapper extends Service { * 更新个税申报表的待刷新数据的标识 * * @param id - * @param employeeId - * @param tenantKey */ - public void updateIcon(Long id, Long employeeId, String tenantKey) { - taxDeclareRecordService.updateIcon(id, NumberUtils.INTEGER_ZERO, employeeId, tenantKey); + public void updateIcon(Long id) { + taxDeclareRecordService.updateIcon(id, NumberUtils.INTEGER_ZERO); } /** * 删除个税申报表 * * @param ids - * @param employeeId - * @param tenantKey */ - public void delete(Collection ids, Long employeeId, String tenantKey) { - taxDeclareRecordService.deleteByIds(ids, tenantKey); + public void delete(Collection ids) { + taxDeclareRecordService.deleteByIds(ids); } /** * 获取个税申报表是否已经生成 * * @param index - * @param tenantKey * @return */ - public TaxDeclarationRateDTO getRate(String index, String tenantKey) { - return salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION, index, TaxDeclarationRateDTO.class); + public TaxDeclarationRateDTO getRate(String index) { + return salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION + index); } /** * 申报 * * @param id - * @param tenantKey */ - public String declare(Long id, Long employeeId, String tenantKey) { + public String declare(Long id) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) - .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156454, "在线申报")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + .setMsg(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - DSTenantKeyThreadVar.tenantKey.set(tenantKey); - taxDeclareRecordService.declare(id, employeeId, tenantKey); + taxDeclareRecordService.declare(id); taxDeclarationRate.setFinish(true); - } catch (SalaryRunTimeException | SalaryNullException e) { + } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } catch (Exception e) { log.error("在线申报失败:{}", e.getMessage(), e); - taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187274, "在线申报失败:") + e.getMessage()); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187274, "在线申报失败:") + e.getMessage()); } finally { - DSTenantKeyThreadVar.tenantKey.remove(); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -475,26 +408,25 @@ public class TaxDeclareRecordWrapper extends Service { * 获取申报反馈 * * @param id - * @param tenantKey */ - public String getDeclareFeedback(Long id, Long employeeId, String tenantKey) { + public String getDeclareFeedback(Long id, Long employeeId) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) - .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182680, "获取申报反馈")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + .setMsg(SalaryI18nUtil.getI18nLabel(182680, "获取申报反馈")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.getDeclareFeedback(id, taxDeclarationRate, employeeId, tenantKey); + taxDeclareRecordService.getDeclareFeedback(id, taxDeclarationRate); taxDeclarationRate.setFinish(true); - } catch (SalaryRunTimeException | SalaryNullException e) { + } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } catch (Exception e) { log.error("获取申报反馈失败:{}", e.getMessage(), e); - taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187255, "获取申报反馈失败:") + e.getMessage()); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187255, "获取申报反馈失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -506,26 +438,25 @@ public class TaxDeclareRecordWrapper extends Service { * 作废 * * @param id - * @param tenantKey */ - public String cancelDeclare(Long id, Long employeeId, String tenantKey) { + public String cancelDeclare(Long id, Long employeeId) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) - .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 158842, "作废申报")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + .setMsg(SalaryI18nUtil.getI18nLabel(158842, "作废申报")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.cancelDeclare(id, employeeId, tenantKey); + taxDeclareRecordService.cancelDeclare(id); taxDeclarationRate.setFinish(true); - } catch (SalaryRunTimeException | SalaryNullException e) { + } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } catch (Exception e) { log.error("作废申报失败:{}", e.getMessage(), e); - taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187272, "作废申报失败:") + e.getMessage()); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187272, "作废申报失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -537,26 +468,25 @@ public class TaxDeclareRecordWrapper extends Service { * 获取作废反馈 * * @param id - * @param tenantKey */ - public String getCancelFeedback(Long id, Long employeeId, String tenantKey) { + public String getCancelFeedback(Long id, Long employeeId) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) - .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 182681, "获取作废申报反馈")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + .setMsg(SalaryI18nUtil.getI18nLabel(182681, "获取作废申报反馈")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.getCancelFeedback(id, taxDeclarationRate, employeeId, tenantKey); + taxDeclareRecordService.getCancelFeedback(id, taxDeclarationRate); taxDeclarationRate.setFinish(true); - } catch (SalaryRunTimeException | SalaryNullException e) { + } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } catch (Exception e) { log.error("获取作废反馈结果失败:{}", e.getMessage(), e); - taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187270, "获取作废反馈结果失败:") + e.getMessage()); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187270, "获取作废反馈结果失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -569,27 +499,26 @@ public class TaxDeclareRecordWrapper extends Service { * * @param id * @param employeeId - * @param tenantKey * @return */ - public String updateDeclare(Long id, Long employeeId, String tenantKey) { + public String updateDeclare(Long id, Long employeeId) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) - .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177637, "更正申报")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + .setMsg(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.updateDeclare(id, employeeId, tenantKey); + taxDeclareRecordService.updateDeclare(id); taxDeclarationRate.setFinish(true); - } catch (SalaryRunTimeException | SalaryNullException e) { + } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } catch (Exception e) { log.error("更正申报失败:{}", e.getMessage(), e); - taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187269, "更正申报失败:") + e.getMessage()); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187269, "更正申报失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -601,54 +530,46 @@ public class TaxDeclareRecordWrapper extends Service { * 税局端申报状态查询 * * @param id - * @param employeeId - * @param tenantKey * @return */ - public String queryDeclareStatus(Long id, Long employeeId, String tenantKey) { - return taxDeclareRecordService.queryDeclareStatus(id, employeeId, tenantKey); + public String queryDeclareStatus(Long id) { + return taxDeclareRecordService.queryDeclareStatus(id); } /** * 税局端申报明细查询 * * @param id - * @param employeeId - * @param tenantKey * @return */ - public String queryCompanyIncomes(Long id, Long employeeId, String tenantKey) { - return taxDeclareRecordService.queryCompanyIncomes(id, employeeId, tenantKey); + public String queryCompanyIncomes(Long id) { + return taxDeclareRecordService.queryCompanyIncomes(id); } /** * 刷新数据 * * @param id - * @param employeeId - * @param tenantKey * @return */ - public String refreshData(Long id, Long employeeId, String tenantKey) { + public String refreshData(Long id) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) - .setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + .setMsg(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - DSTenantKeyThreadVar.tenantKey.set(tenantKey); - taxDeclareRecordService.refreshData(id, employeeId, tenantKey); + taxDeclareRecordService.refreshData(id); taxDeclarationRate.setFinish(true); - } catch (SalaryRunTimeException | SalaryNullException e) { + } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } catch (Exception e) { log.error("刷新数据失败:{}", e.getMessage(), e); - taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187268, "刷新数据失败:") + e.getMessage()); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187268, "刷新数据失败:") + e.getMessage()); } finally { - DSTenantKeyThreadVar.tenantKey.remove(); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION, taxDeclarationRate.getIndex(), taxDeclarationRate); + salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -657,97 +578,96 @@ public class TaxDeclareRecordWrapper extends Service { } private void checkBefore(Long id) { - TaxDeclarationRateDTO taxDeclarationRate = salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION, Util.null2String(id), TaxDeclarationRateDTO.class); + TaxDeclarationRateDTO taxDeclarationRate = salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION + Util.null2String(id)); if (taxDeclarationRate != null && !taxDeclarationRate.isFinish()) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182691, "当前正处于「{0}」中,请稍后再试").replace("{0}", taxDeclarationRate.getMsg())); } } - /** - * 导出个税申报明细列表 - * - * @param queryParam - * @param simpleEmployee - * @return - */ - public Map exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam, SimpleEmployee simpleEmployee) { - ExcelExportParam excelExportParam = new ExcelExportParam() - .setBiz(String.valueOf(IdGenerator.generate())) - .setModule(EntityType.hrmsalary.name()) - .setFunction("exportTaxDeclarationValue"); - LocalRunnable localRunnable = new LocalRunnable() { - @Override - public void execute() { - taxDeclarationExcelService.exportTaxDeclarationValue(excelExportParam, queryParam, simpleEmployee); - } - }; - ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportTaxDeclarationValue", localRunnable); - return JsonUtil.parseMap(excelExportParam, Object.class); - } - - /** - * 导出未报送的人员列表 - * - * @param queryParam - * @param simpleEmployee - * @return - */ - public Map exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { - ExcelExportParam excelExportParam = new ExcelExportParam() - .setBiz(String.valueOf(IdGenerator.generate())) - .setModule(EntityType.hrmsalary.name()) - .setFunction("exportEmployee4NotDeclare"); - LocalRunnable localRunnable = new LocalRunnable() { - @Override - public void execute() { - taxDeclarationExcelService.exportEmployee4NotDeclare(excelExportParam, queryParam, simpleEmployee); - } - }; - ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NotDeclare", localRunnable); - return JsonUtil.parseMap(excelExportParam, Object.class); - } - - /** - * 导出没有申报数据的人员列表 - * - * @param queryParam - * @param simpleEmployee - * @return - */ - public Map exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { - ExcelExportParam excelExportParam = new ExcelExportParam() - .setBiz(String.valueOf(IdGenerator.generate())) - .setModule(EntityType.hrmsalary.name()) - .setFunction("exportEmployee4NoValue"); - LocalRunnable localRunnable = new LocalRunnable() { - @Override - public void execute() { - taxDeclarationExcelService.exportEmployee4NoValue(excelExportParam, queryParam, simpleEmployee); - } - }; - ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NoValue", localRunnable); - return JsonUtil.parseMap(excelExportParam, Object.class); - } - - /** - * 导出申报失败的人员列表 - * - * @param queryParam - * @param simpleEmployee - * @return - */ - public Map exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { - ExcelExportParam excelExportParam = new ExcelExportParam() - .setBiz(String.valueOf(IdGenerator.generate())) - .setModule(EntityType.hrmsalary.name()) - .setFunction("exportEmployee4Fail"); - LocalRunnable localRunnable = new LocalRunnable() { - @Override - public void execute() { - taxDeclarationExcelService.exportEmployee4Fail(excelExportParam, queryParam, simpleEmployee); - } - }; - ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4Fail", localRunnable); - return JsonUtil.parseMap(excelExportParam, Object.class); - } +// /** +// * 导出个税申报明细列表 +// * +// * @param queryParam +// * @return +// */ +// public Map exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportTaxDeclarationValue"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// taxDeclarationExcelService.exportTaxDeclarationValue(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportTaxDeclarationValue", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 导出未报送的人员列表 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployee4NotDeclare"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// taxDeclarationExcelService.exportEmployee4NotDeclare(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NotDeclare", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 导出没有申报数据的人员列表 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployee4NoValue"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// taxDeclarationExcelService.exportEmployee4NoValue(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NoValue", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 导出申报失败的人员列表 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployee4Fail"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// taxDeclarationExcelService.exportEmployee4Fail(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4Fail", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } } From b1817142b0dec813214466f9bd63a56c59373edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 14 Aug 2023 20:07:29 +0800 Subject: [PATCH 011/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308100803.sql | 15 + resource/sqlupgrade/DM/sql202308110103.sql | 39 ++ resource/sqlupgrade/DM/sql202308110203.sql | 18 + resource/sqlupgrade/DM/sql202308110303.sql | 18 + resource/sqlupgrade/DM/sql202308140203.sql | 16 + resource/sqlupgrade/GS/sql202308100803.sql | 15 + resource/sqlupgrade/GS/sql202308110103.sql | 39 ++ resource/sqlupgrade/GS/sql202308110203.sql | 18 + resource/sqlupgrade/GS/sql202308110303.sql | 18 + resource/sqlupgrade/GS/sql202308140203.sql | 16 + resource/sqlupgrade/JC/sql202308100803.sql | 15 + resource/sqlupgrade/JC/sql202308110103.sql | 39 ++ resource/sqlupgrade/JC/sql202308110203.sql | 18 + resource/sqlupgrade/JC/sql202308110303.sql | 18 + resource/sqlupgrade/JC/sql202308140203.sql | 16 + resource/sqlupgrade/Mysql/sql202308100803.sql | 14 + resource/sqlupgrade/Mysql/sql202308110103.sql | 38 ++ resource/sqlupgrade/Mysql/sql202308110203.sql | 16 + resource/sqlupgrade/Mysql/sql202308110303.sql | 16 + resource/sqlupgrade/Mysql/sql202308140203.sql | 15 + .../sqlupgrade/Oracle/sql202308100803.sql | 14 + .../sqlupgrade/Oracle/sql202308110103.sql | 38 ++ .../sqlupgrade/Oracle/sql202308110203.sql | 17 + .../sqlupgrade/Oracle/sql202308110303.sql | 13 + .../sqlupgrade/Oracle/sql202308140203.sql | 15 + resource/sqlupgrade/PG/sql202308100803.sql | 14 + resource/sqlupgrade/PG/sql202308110103.sql | 38 ++ resource/sqlupgrade/PG/sql202308110203.sql | 17 + resource/sqlupgrade/PG/sql202308110303.sql | 15 + resource/sqlupgrade/PG/sql202308140203.sql | 15 + .../sqlupgrade/SQLServer/sql202308100803.sql | 14 + .../sqlupgrade/SQLServer/sql202308110103.sql | 38 ++ .../sqlupgrade/SQLServer/sql202308110203.sql | 17 + .../sqlupgrade/SQLServer/sql202308110303.sql | 14 + .../sqlupgrade/SQLServer/sql202308140203.sql | 15 + resource/sqlupgrade/ST/sql202308100803.sql | 15 + resource/sqlupgrade/ST/sql202308110103.sql | 39 ++ resource/sqlupgrade/ST/sql202308110203.sql | 18 + resource/sqlupgrade/ST/sql202308110303.sql | 18 + resource/sqlupgrade/ST/sql202308140203.sql | 16 + .../bo/EmployeeDeclareRefresh.java | 7 +- .../dto/EmployeeDeclareListDTO.java | 16 + .../dto/EmployeeDeclareRefreshDTO.java | 4 +- .../EmployeeDeclareAddListQueryParam.java | 13 +- .../EmployeeDeclareFailListQueryParam.java | 6 +- .../param/EmployeeDeclareListQueryParam.java | 10 +- .../param/EmployeeDeclareParam.java | 4 +- .../param/EmployeeDeclareRefreshParam.java | 4 +- .../param/EmployeeDeclareSaveParam.java | 5 +- .../employeedeclare/po/EmployeeDeclarePO.java | 2 +- .../salaryacct/po/SalaryAcctEmployeePO.java | 6 + .../salaryacct/po/SalaryAcctRecordPO.java | 5 + .../po/SalaryAcctResultValuePO.java | 100 +++++ .../salarysob/dto/SalarySobAddUpRuleDTO.java | 48 +++ .../dto/SalarySobTaxReportRuleDTO.java | 48 +++ .../param/SalarySobAddUpRuleSaveParam.java | 42 ++ .../SalarySobTaxReportRuleSaveParam.java | 42 ++ .../salarysob/po/SalarySobAddUpRulePO.java | 41 ++ .../po/SalarySobTaxReportRulePO.java | 40 ++ .../bo/TaxDeclarationCommon.java | 334 +++++++-------- .../bo/TaxDeclarationRequest.java | 329 ++++++++------- .../bo/TaxDeclarationStrategy.java | 40 +- .../bo/TaxDeclarationValueList.java | 229 +++++----- .../taxdeclaration/bo/TaxDeclareContext.java | 120 +++--- .../param/TaxDeclarationListQueryParam.java | 6 +- .../taxdeclaration/po/TaxDeclarationPO.java | 18 +- .../po/TaxDeclarationValuePO.java | 11 + .../taxdeclaration/po/TaxDeclareFailPO.java | 7 + .../taxdeclaration/po/TaxReportColumnPO.java | 2 + .../taxpayment/dto/TaxAmountFormDTO.java | 88 ++-- .../enums/salarysob/IncomeCategoryEnum.java | 52 ++- .../TaxDeclarationValueMapper.java | 81 ++++ .../TaxDeclarationValueMapper.xml | 365 ++++++++++++++++ .../taxdeclaration/TaxDeclareFailMapper.java | 84 ++++ .../taxdeclaration/TaxDeclareFailMapper.xml | 365 ++++++++++++++++ .../taxdeclaration/TaxReportColumnMapper.java | 80 ++++ .../taxdeclaration/TaxReportColumnMapper.xml | 396 ++++++++++++++++++ .../service/EmployeeDeclareRecordService.java | 6 +- .../service/EmployeeDeclareService.java | 6 +- .../service/SalaryAcctTaxAgentService.java | 56 +++ .../service/SalarySobAddUpRuleService.java | 48 +++ .../SalarySobTaxReportRuleService.java | 48 +++ .../service/TaxDeclarationValueService.java | 9 +- .../salary/service/TaxDeclareFailService.java | 5 +- .../salary/service/TaxPaymentService.java | 80 ++++ .../TaxAgentTaxReturnCheckServiceFactory.java | 24 +- .../factory/TaxPaymentServiceFactory.java | 64 ++- .../EmployeeDeclareRecordServiceImpl.java | 6 +- .../impl/EmployeeDeclareServiceImpl.java | 34 +- .../impl/TaxAgentTaxReturnServiceImpl.java | 9 +- .../TaxDeclarationApiBillingServiceImpl.java | 2 - .../impl/TaxDeclarationServiceImpl.java | 4 +- .../impl/TaxDeclarationValueServiceImpl.java | 142 +++---- .../impl/TaxDeclareEmployeeServiceImpl.java | 2 +- .../impl/TaxDeclareFailServiceImpl.java | 39 +- .../impl/TaxDeclareRecordServiceImpl.java | 302 +++++++------ .../impl/TaxReportColumnServiceImpl.java | 23 +- .../impl/TaxReturnCheckMainServiceImpl.java | 5 +- .../engine/salary/util/SalaryEntityUtil.java | 8 + .../salary/web/TaxDeclarationController.java | 258 ++++++------ .../wrapper/EmployeeDeclareWrapper.java | 5 +- .../wrapper/TaxAgentTaxReturnWrapper.java | 38 +- .../salary/wrapper/TaxDeclarationWrapper.java | 5 +- .../wrapper/TaxDeclareRecordWrapper.java | 20 +- 104 files changed, 3927 insertions(+), 1188 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202308100803.sql create mode 100644 resource/sqlupgrade/DM/sql202308110103.sql create mode 100644 resource/sqlupgrade/DM/sql202308110203.sql create mode 100644 resource/sqlupgrade/DM/sql202308110303.sql create mode 100644 resource/sqlupgrade/DM/sql202308140203.sql create mode 100644 resource/sqlupgrade/GS/sql202308100803.sql create mode 100644 resource/sqlupgrade/GS/sql202308110103.sql create mode 100644 resource/sqlupgrade/GS/sql202308110203.sql create mode 100644 resource/sqlupgrade/GS/sql202308110303.sql create mode 100644 resource/sqlupgrade/GS/sql202308140203.sql create mode 100644 resource/sqlupgrade/JC/sql202308100803.sql create mode 100644 resource/sqlupgrade/JC/sql202308110103.sql create mode 100644 resource/sqlupgrade/JC/sql202308110203.sql create mode 100644 resource/sqlupgrade/JC/sql202308110303.sql create mode 100644 resource/sqlupgrade/JC/sql202308140203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308100803.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308110103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308110203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308110303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308140203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308100803.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308110103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308110203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308110303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308140203.sql create mode 100644 resource/sqlupgrade/PG/sql202308100803.sql create mode 100644 resource/sqlupgrade/PG/sql202308110103.sql create mode 100644 resource/sqlupgrade/PG/sql202308110203.sql create mode 100644 resource/sqlupgrade/PG/sql202308110303.sql create mode 100644 resource/sqlupgrade/PG/sql202308140203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308100803.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308110103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308110203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308110303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308140203.sql create mode 100644 resource/sqlupgrade/ST/sql202308100803.sql create mode 100644 resource/sqlupgrade/ST/sql202308110103.sql create mode 100644 resource/sqlupgrade/ST/sql202308110203.sql create mode 100644 resource/sqlupgrade/ST/sql202308110303.sql create mode 100644 resource/sqlupgrade/ST/sql202308140203.sql create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultValuePO.java create mode 100644 src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java create mode 100644 src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java create mode 100644 src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java create mode 100644 src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java create mode 100644 src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java create mode 100644 src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml create mode 100644 src/com/engine/salary/service/SalaryAcctTaxAgentService.java create mode 100644 src/com/engine/salary/service/SalarySobAddUpRuleService.java create mode 100644 src/com/engine/salary/service/SalarySobTaxReportRuleService.java create mode 100644 src/com/engine/salary/service/TaxPaymentService.java diff --git a/resource/sqlupgrade/DM/sql202308100803.sql b/resource/sqlupgrade/DM/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202308110103.sql b/resource/sqlupgrade/DM/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/DM/sql202308110203.sql b/resource/sqlupgrade/DM/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/DM/sql202308110303.sql b/resource/sqlupgrade/DM/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/DM/sql202308140203.sql b/resource/sqlupgrade/DM/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308100803.sql b/resource/sqlupgrade/GS/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308110103.sql b/resource/sqlupgrade/GS/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/GS/sql202308110203.sql b/resource/sqlupgrade/GS/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/GS/sql202308110303.sql b/resource/sqlupgrade/GS/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/GS/sql202308140203.sql b/resource/sqlupgrade/GS/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308100803.sql b/resource/sqlupgrade/JC/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308110103.sql b/resource/sqlupgrade/JC/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/JC/sql202308110203.sql b/resource/sqlupgrade/JC/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/JC/sql202308110303.sql b/resource/sqlupgrade/JC/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/JC/sql202308140203.sql b/resource/sqlupgrade/JC/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308100803.sql b/resource/sqlupgrade/Mysql/sql202308100803.sql new file mode 100644 index 000000000..438670759 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_declare_record_id bigint comment '˰걨¼id' , + employee_name varchar(100) comment '' , + card_num varchar(100) comment '֤' , + error_msg varchar(1000) comment 'ʧԭ' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308110103.sql b/resource/sqlupgrade/Mysql/sql202308110103.sql new file mode 100644 index 000000000..296d921a2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_report_type varchar(100) comment '' , + income_category varchar(100) comment 'Ŀ' , + report_column_name varchar(100) comment '' , + report_column_data_index varchar(100) comment '' +) +; + +create table hrsa_sob_tax_report_rule +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + salary_sob_id bigint comment 'н׵id' , + income_category varchar(100) comment 'Ŀ' , + report_column_data_index varchar(100) comment '˰걨' , + salary_item_id bigint comment 'нĿid' +) +; + +alter table hrsa_tax_report_column add data_type varchar(100) +; + +alter table hrsa_tax_report_column add request_param_key varchar(100) +; + +alter table hrsa_tax_report_column add report_column_label varchar(100) +; diff --git a/resource/sqlupgrade/Mysql/sql202308110203.sql b/resource/sqlupgrade/Mysql/sql202308110203.sql new file mode 100644 index 000000000..35182319d --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308110203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_declare_record_id bigint comment '˰걨¼id' , + employee_name varchar(100) comment '' , + card_num varchar(100) comment '֤' , + error_msg varchar(1000) comment 'ʧԭ' +) +; +alter table hrsa_tax_declare_fail add income_category varchar(100) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308110303.sql b/resource/sqlupgrade/Mysql/sql202308110303.sql new file mode 100644 index 000000000..eaa08d8ae --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308110303.sql @@ -0,0 +1,16 @@ +alter table hrsa_tax_declaration add control_view int +; + +alter table hrsa_tax_declaration add tax_declare_record_id bigint +; + +alter table hrsa_salary_acct_emp add income_category varchar(100) +; + +alter table hrsa_salary_acct_record add control_view int +; + +update hrsa_salary_acct_record set control_view = 0 where control_view is null +; +update hrsa_tax_declaration set control_view = 0 where control_view is null +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308140203.sql b/resource/sqlupgrade/Mysql/sql202308140203.sql new file mode 100644 index 000000000..b78034d4f --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_declare_record_id bigint comment '˰걨¼id' , + tax_declaration_id bigint comment '˰걨id' , + employee_type tinyint comment 'Ա' , + employee_id bigint comment 'Աid' , + result_value_json text comment '˰걨ϸֵ' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308100803.sql b/resource/sqlupgrade/Oracle/sql202308100803.sql new file mode 100644 index 000000000..e30e9aa15 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308110103.sql b/resource/sqlupgrade/Oracle/sql202308110103.sql new file mode 100644 index 000000000..ee096466d --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +) +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +) +/ + +alter table hrsa_tax_report_column add data_type varchar2(100) +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100) +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308110203.sql b/resource/sqlupgrade/Oracle/sql202308110203.sql new file mode 100644 index 000000000..751860966 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308110203.sql @@ -0,0 +1,17 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +) +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308110303.sql b/resource/sqlupgrade/Oracle/sql202308110303.sql new file mode 100644 index 000000000..31f781391 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308110303.sql @@ -0,0 +1,13 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number +/ +alter table hrsa_tax_declaration add control_view int +/ +alter table hrsa_salary_acct_emp add income_category varchar2(100) +/ +alter table hrsa_salary_acct_record add control_view int +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null +/ +update hrsa_tax_declaration set control_view = 0 where control_view is null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308140203.sql b/resource/sqlupgrade/Oracle/sql202308140203.sql new file mode 100644 index 000000000..a04ffa126 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308100803.sql b/resource/sqlupgrade/PG/sql202308100803.sql new file mode 100644 index 000000000..b8e97e081 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_declare_record_id bigint, + employee_name varchar(100), + card_num varchar(100), + error_msg varchar(1000) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308110103.sql b/resource/sqlupgrade/PG/sql202308110103.sql new file mode 100644 index 000000000..fda879e38 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_report_type varchar(100), + income_category varchar(100), + report_column_name varchar(100), + report_column_data_index varchar(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + salary_sob_id bigint, + income_category varchar(100), + report_column_data_index varchar(100), + salary_item_id bigint +); +/ + +alter table hrsa_tax_report_column add data_type varchar(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar(100); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308110203.sql b/resource/sqlupgrade/PG/sql202308110203.sql new file mode 100644 index 000000000..c7335d809 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308110203.sql @@ -0,0 +1,17 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_declare_record_id bigint, + employee_name varchar(100), + card_num varchar(100), + error_msg varchar(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar(100); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308110303.sql b/resource/sqlupgrade/PG/sql202308110303.sql new file mode 100644 index 000000000..e1bc1a983 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308110303.sql @@ -0,0 +1,15 @@ +alter table hrsa_tax_declaration add control_view int; +/ +alter table hrsa_tax_declaration add tax_declare_record_id bigint; +/ +alter table hrsa_salary_acct_emp add income_category varchar(100); +/ +alter table hrsa_salary_acct_record add control_view int; +/ + + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308140203.sql b/resource/sqlupgrade/PG/sql202308140203.sql new file mode 100644 index 000000000..54373d885 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_declare_record_id bigint, + tax_declaration_id bigint, + employee_type smallint, + employee_id bigint, + result_value_json text +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308100803.sql b/resource/sqlupgrade/SQLServer/sql202308100803.sql new file mode 100644 index 000000000..2c58c6a3e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_declare_record_id bigint, + employee_name nvarchar(100), + card_num nvarchar(100), + error_msg nvarchar(1000) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308110103.sql b/resource/sqlupgrade/SQLServer/sql202308110103.sql new file mode 100644 index 000000000..d9d79670c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_report_type nvarchar(100), + income_category nvarchar(100), + report_column_name nvarchar(100), + report_column_data_index nvarchar(100) +) +GO + +create table hrsa_sob_tax_report_rule +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + salary_sob_id bigint, + income_category nvarchar(100), + report_column_data_index nvarchar(100), + salary_item_id bigint +) +GO + +alter table hrsa_tax_report_column add data_type nvarchar(100) +GO + +alter table hrsa_tax_report_column add request_param_key nvarchar(100) +GO + +alter table hrsa_tax_report_column add report_column_label nvarchar(100) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308110203.sql b/resource/sqlupgrade/SQLServer/sql202308110203.sql new file mode 100644 index 000000000..d11b4913b --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308110203.sql @@ -0,0 +1,17 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_declare_record_id bigint, + employee_name nvarchar(100), + card_num nvarchar(100), + error_msg nvarchar(1000) +) +GO + +alter table hrsa_tax_declare_fail add income_category nvarchar(100) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308110303.sql b/resource/sqlupgrade/SQLServer/sql202308110303.sql new file mode 100644 index 000000000..54a64f52e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308110303.sql @@ -0,0 +1,14 @@ +alter table hrsa_tax_declaration add control_view int +GO +alter table hrsa_tax_declaration add tax_declare_record_id bigint +GO +alter table hrsa_salary_acct_emp add income_category nvarchar(100) +GO +alter table hrsa_salary_acct_record add control_view int +GO + + +update hrsa_salary_acct_record set control_view = 0 where control_view is null +GO +update hrsa_tax_declaration set control_view = 0 where control_view is null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308140203.sql b/resource/sqlupgrade/SQLServer/sql202308140203.sql new file mode 100644 index 000000000..a4b55a654 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_declare_record_id bigint, + tax_declaration_id bigint, + employee_type tinyint, + employee_id bigint, + result_value_json ntext +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308100803.sql b/resource/sqlupgrade/ST/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202308110103.sql b/resource/sqlupgrade/ST/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/ST/sql202308110203.sql b/resource/sqlupgrade/ST/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/ST/sql202308110303.sql b/resource/sqlupgrade/ST/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/ST/sql202308140203.sql b/resource/sqlupgrade/ST/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index a0833fb49..f12575e8c 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -22,7 +22,6 @@ import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; -import java.time.YearMonth; import java.util.*; /** @@ -77,7 +76,7 @@ public class EmployeeDeclareRefresh { EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO(); BeanUtils.copyProperties(preTaxCycleEmployeeDeclare, employeeDeclare); employeeDeclare.setId(IdGenerator.generate()) - .setTaxCycle(dto.getTaxCycle().toString()) + .setTaxCycle(dto.getTaxCycle()) .setNewEmployeeInfo(0) .setCreateTime(now) .setUpdateTime(now); @@ -175,11 +174,11 @@ public class EmployeeDeclareRefresh { return result; } - private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, YearMonth taxCycle, Date now, Long employeeId) { + private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, Date taxCycle, Date now, Long employeeId) { return new EmployeeDeclarePO() .setId(IdGenerator.generate()) .setTaxAgentId(taxAgentId) - .setTaxCycle(taxCycle.toString()) + .setTaxCycle(taxCycle) .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) .setGender(GenderEnum.MALE.getValue()) .setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue()) diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java index 94d8ea0c8..339e7a51f 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.employeedeclare.dto; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import lombok.AllArgsConstructor; @@ -39,59 +40,73 @@ public class EmployeeDeclareListDTO { // 姓名 @SalaryTableColumn(text = "姓名", width = "10%", column = "employeeName") + @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName") private String employeeName; // 分部 @SalaryTableColumn(text = "分部", width = "10%", column = "subCompanyName") + @TableTitle(title = "分部", dataIndex = "subCompanyName", key = "subCompanyName") private String subCompanyName; // 部门 @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") private String departmentName; // 个税扣缴义务人 @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") private String taxAgentName; // 工号 @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") private String jobNum; // 证件类型 @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") + @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") private String cardType; // 证件号码 @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") private String cardNum; // 性别 @SalaryTableColumn(text = "性别", width = "10%", column = "gender") + @TableTitle(title = "性别", dataIndex = "gender", key = "gender") private String gender; // 出生日期 @SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday") + @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") private String birthday; // 人员状态 @SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus") + @TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus") private String employmentStatus; // 手机号码 @SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile") + @TableTitle(title = "手机号码", dataIndex = "mobile", key = "mobile") private String mobile; // 任职受雇从业类型 @SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType") + @TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType") private String employmentType; // 任职受雇从业日期 @SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate") + @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") private String employmentDate; // 离职日期 @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") + @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") private String dismissDate; // 申报状态 @@ -99,6 +114,7 @@ public class EmployeeDeclareListDTO { // 申报状态 @SalaryTableColumn(text = "申报状态", width = "10%", column = "declareStatusDesc") + @TableTitle(title = "申报状态", dataIndex = "declareStatusDesc", key = "declareStatusDesc") private String declareStatusDesc; // 申报失败原因 diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java index bc3477e99..eedeee37f 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java @@ -8,7 +8,7 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import lombok.Data; import lombok.experimental.Accessors; -import java.time.YearMonth; +import java.util.Date; import java.util.List; /** @@ -25,7 +25,7 @@ public class EmployeeDeclareRefreshDTO { private Long taxAgentId; // 税款所属期 - private YearMonth taxCycle; + private Date taxCycle; // 已有的报送人员 private List employeeDeclares; diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java index d3ba6e893..7a5a37f8c 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java @@ -6,6 +6,7 @@ import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; import com.engine.salary.util.valid.DataCheck; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -14,8 +15,8 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDate; -import java.time.YearMonth; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -42,9 +43,10 @@ public class EmployeeDeclareAddListQueryParam extends BaseQueryParam { /** * 参数错误,税款所属期参数格式错误 */ - @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") // 税款所属期 - private YearMonth taxCycle; + @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; // 报送状态 private DeclareStatusEnum declareStatus; @@ -88,9 +90,10 @@ public class EmployeeDeclareAddListQueryParam extends BaseQueryParam { // 是否扣除减除费用 private SalaryOnOffEnum deductExpenses; - @JsonIgnore // 税款所属期(上月) - private String preTaxCycle; + @JsonIgnore + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date preTaxCycle; @ApiModelProperty private List customColumns; diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java index 960f3b1a3..7719bdba1 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java @@ -2,13 +2,14 @@ package com.engine.salary.entity.employeedeclare.param; import com.engine.salary.common.BaseQueryParam; import com.engine.salary.util.valid.DataCheck; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; import java.util.Collection; +import java.util.Date; /** * @description: 报送人员失败查询参数 @@ -38,5 +39,6 @@ public class EmployeeDeclareFailListQueryParam extends BaseQueryParam { * 税款所属期 */ @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") - private YearMonth taxCycle; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; } diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java index b3f8ec99e..09eae8d9f 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java @@ -6,14 +6,15 @@ import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; import com.engine.salary.util.valid.DataCheck; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDate; -import java.time.YearMonth; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -33,12 +34,13 @@ public class EmployeeDeclareListQueryParam extends BaseQueryParam { private Collection ids; // 个税扣缴义务人id - @DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空") + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") private Long taxAgentId; // 税款所属期 - @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") - private YearMonth taxCycle; + @DataCheck(require = true, message = "参数错误,税款所属期参数格式错误") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; // 报送状态 private DeclareStatusEnum declareStatus; diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java index 8a92df28d..48d4e6478 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java @@ -6,7 +6,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; /** * @description: 人员报送 @@ -31,5 +31,5 @@ public class EmployeeDeclareParam { * 税款所属期 */ @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") - private YearMonth taxCycle; + private Date taxCycle; } diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java index 0b94104c7..b4fca003e 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java @@ -6,7 +6,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; /** * @description: 刷新报送人员 @@ -31,5 +31,5 @@ public class EmployeeDeclareRefreshParam { * 税款所属期 */ @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") - private YearMonth taxCycle; + private Date taxCycle; } diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java index 36cfe6bc8..1fef4f070 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -8,9 +8,8 @@ import com.engine.salary.enums.employeedeclare.GenderEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import lombok.Data; -import javax.validation.constraints.NotNull; import java.time.LocalDate; -import java.time.YearMonth; +import java.util.Date; /** * @description: 人员报送(人员)保存参数 @@ -35,7 +34,7 @@ public class EmployeeDeclareSaveParam { * 参数错误,税款所属期参数格式错误 */ //税款所属期") - private YearMonth taxCycle; + private Date taxCycle; //员工id") private Long employeeId; diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index 20b531403..0f2e3d4c8 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -41,7 +41,7 @@ public class EmployeeDeclarePO { /** * 税款所属期 */ - private String taxCycle; + private Date taxCycle; /** * 人员id diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index 3e7e00b35..4cab0c6ec 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -74,6 +74,12 @@ public class SalaryAcctEmployeePO { */ private Date taxCycle; + /** + * 所得项目 + */ + private String incomeCategory; + + /** * 租户key */ diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java index 9587048ee..56a527116 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java @@ -83,6 +83,11 @@ public class SalaryAcctRecordPO { */ private String description; + /** + * 控制查看 + */ + private Integer controlView; + /** * 租户key */ diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultValuePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultValuePO.java new file mode 100644 index 000000000..19444573f --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultValuePO.java @@ -0,0 +1,100 @@ +//package com.engine.salary.entity.salaryacct.po; +// +//import com.baomidou.mybatisplus.annotation.TableField; +//import com.baomidou.mybatisplus.annotation.TableName; +//import com.weaver.hrm.salary.annotation.DecryptField; +//import com.weaver.hrm.salary.annotation.EncryptField; +//import com.weaver.hrm.salary.annotation.SecurityConfig; +//import com.weaver.hrm.salary.handle.SalaryJsonTypeHandler; +//import lombok.Data; +//import lombok.experimental.Accessors; +// +//import java.time.LocalDateTime; +//import java.util.Map; +//import java.util.Set; +// +///** +// * @description: 薪资核算结果 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 8/19/22 4:50 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//@TableName(value = "hrsa_acct_result_value", autoResultMap = true) +//public class SalaryAcctResultValuePO { +// +// /** +// * 主键id +// */ +// private Long id; +// +// /** +// * 薪资核算记录id +// */ +// private Long salaryAcctRecordId; +// +// /** +// * 薪资核算人员id +// */ +// private Long SalaryAcctEmployeeId; +// +// /** +// * 薪资核算结果 +// */ +// @TableField(exist = false) +// private Map resultValue; +// +// /** +// * 回算前的薪资核算 +// */ +// @TableField(exist = false) +// private Map originResultValue; +// +// /** +// * 薪资核算结果(只在加密解密中使用) +// */ +// @EncryptField +// @DecryptField +// @SecurityConfig(tableName = "hrsa_acct_result_value", filedName = "result_value_json", dataTableName = "hrsa_acct_result_encdata") +// private String resultValueJson; +// +// /** +// * 回算前的薪资核算(只在加密解密中使用) +// */ +// @DecryptField +// @SecurityConfig(tableName = "hrsa_acct_result_value", filedName = "origin_result_value_json", dataTableName = "hrsa_acct_result_encdata") +// private String originResultValueJson; +// +// /** +// * 锁定的薪资项目 +// */ +// @TableField(typeHandler = SalaryJsonTypeHandler.class) +// private Set lockSalaryItemIds; +// +// /** +// * 租户key +// */ +// private String tenantKey; +// +// /** +// * 创建人id +// */ +// private Long creator; +// +// /** +// * 是否删除 +// */ +// private Integer deleteType; +// +// /** +// * 创建时间 +// */ +// private LocalDateTime createTime; +// +// /** +// * 更新时间 +// */ +// private LocalDateTime updateTime; +//} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java new file mode 100644 index 000000000..c5874501e --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.salarysob.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @description: 薪资账套的累计字段对应关系 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/1/4 10:43 AM + * @version:v1.0 + */ +@Data +public class SalarySobAddUpRuleDTO { + + //所得项目的id") + private String incomeCategoryId; + + //所得项目的名称") + private String incomeCategoryName; + + //往期累计情况的字段对应关系") + private List addUpRules; + + @Data + public static class AddUpRuleDTO { + + //所得项目的id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //往期累计情况的字段名称") + private String addUpColumnName; + + //往期累计情况的字段索引") + private String addUpColumnDataIndex; + + //往期累计情况的字段和薪资项目的对应关系") + private List> salaryItem; + + //对应关系是否可以编辑") + private boolean canEdit; + } +} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java new file mode 100644 index 000000000..342265e28 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.salarysob.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @description: 薪资账套的个税申报表规则 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/7 4:29 PM + * @version:v1.0 + */ +@Data +public class SalarySobTaxReportRuleDTO { + + //所得项目的id + private String incomeCategoryId; + + //所得项目的名称 + private String incomeCategoryName; + + //个税申报表的对应关系 + private List taxReportRules; + + @Data + public static class TaxReportRuleDTO { + + //所得项目的id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //个税申报表字段 + private String reportColumnName; + + //个税申报表索引 + private String reportColumnDataIndex; + + //个税申报表字段和薪资项目的对应关系 + private List> salaryItem; + + //对应关系是否可以编辑 + private boolean canEdit; + } +} diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java new file mode 100644 index 000000000..231fa0c61 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.salarysob.param; + +import lombok.Data; + +import java.util.List; + +/** + * @description: 薪资账套的累计字段对应保存参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/1/4 10:11 AM + * @version:v1.0 + */ +@Data +public class SalarySobAddUpRuleSaveParam { + + //薪资账套的id") + private Long salarySobId; + + //往期累计情况的对应关系") + private List incomeCategoryParams; + + @Data + public static class AddUpRuleIncomeCategoryParam { + + //所得项目") + private String incomeCategory; + + //往期累计情况的对应关系") + private List addUpRuleParams; + } + + @Data + public static class AddUpRuleParam { + + //薪资项目的id") + private Long salaryItemId; + + //往期累计情况的字段索引") + private String addUpColumnDataIndex; + } +} diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java new file mode 100644 index 000000000..5c7046538 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.salarysob.param; + +import lombok.Data; + +import java.util.List; + +/** + * @description: 薪资账套的个税申报表规则 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/29 5:20 PM + * @version:v1.0 + */ +@Data +public class SalarySobTaxReportRuleSaveParam { + + //薪资账套的id + private Long salarySobId; + + //不同所得项目的个税申报表的对应关系 + private List incomeCategoryParams; + + @Data + public static class TaxReportRuleIncomeCategoryParam { + + //所得项目 + private String incomeCategory; + + //个税申报表的对应关系 + private List taxReportRuleParams; + } + + @Data + public static class TaxReportRuleParam { + + //个税申报表的列索引 + private String reportColumnDataIndex; + + //薪资项目的id + private Long salaryItemId; + } +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java new file mode 100644 index 000000000..7417857d4 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java @@ -0,0 +1,41 @@ +package com.engine.salary.entity.salarysob.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * @description: 薪资账套的累计字段对应关系 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/1/4 10:03 AM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//"hrsa_sob_add_up_rule") +public class SalarySobAddUpRulePO { + + //主键id") + private Long id; + //薪资账套id") + private Long salarySobId; + //收入所得项目") + private String incomeCategory; + //薪资项目id") + private Long salaryItemId; + //往期累计情况的字段索引") + private String addUpColumnDataIndex; + //租户key", ignore = true) + private String tenantKey; + //创建人id", ignore = true) + private Long creator; + //是否删除", ignore = true) + private Integer deleteType; + //创建时间", ignore = true) + private Date createTime; + //更新时间", ignore = true) + private Date updateTime; +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java new file mode 100644 index 000000000..339e8e012 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.salarysob.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * @description: 薪资账套的个税申报表规则 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/28 5:48 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +//hrsa_sob_tax_report_rule +public class SalarySobTaxReportRulePO { + + //主键id + private Long id; + //薪资账套id + private Long salarySobId; + //收入所得项目 + private String incomeCategory; + //个税申报表对应字段 + private String reportColumnDataIndex; + //薪资项目id + private Long salaryItemId; + //租户key", ignore = true) + private String tenantKey; + //创建人id", ignore = true) + private Long creator; + //是否删除", ignore = true) + private Integer deleteType; + //创建时间", ignore = true) + private Date createTime; + //更新时间", ignore = true) + private Date updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index cbd849012..b9eda1e21 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -1,167 +1,173 @@ -//package com.engine.salary.entity.taxdeclaration.bo; -// -//import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; -//import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; -//import com.engine.salary.util.SalaryEntityUtil; -//import com.google.common.collect.Lists; -//import com.google.common.collect.Maps; -//import com.weaver.common.distribution.genid.IdGenerator; -//import com.weaver.common.elog.util.Util; -//import com.weaver.hrm.salary.annotation.SalaryFormulaVar; -//import com.weaver.hrm.salary.entity.datacollection.po.AddUpSituationPO; -//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; -//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultValuePO; -//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; -//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; -//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; -//import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; -//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; -// -//import java.lang.reflect.Field; -//import java.math.BigDecimal; -//import java.time.LocalDateTime; -//import java.time.YearMonth; -//import java.util.List; -//import java.util.Map; -//import java.util.Objects; -// -///** -// * @description: 通用:一般劳务报酬所得、全年一次性奖金 -// * @author: xiajun -// * @modified By: xiajun -// * @date: Created in 2022/12/2 3:16 PM -// * @version:v1.0 -// */ -//public class TaxDeclarationCommon implements TaxDeclarationStrategy { -// -// @Override -// public TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey) { -// LocalDateTime now = LocalDateTime.now(); -// // 薪资核算结果按照薪资核算人员id聚合分类 -// Map salaryAcctResultValueMap = SalaryEntityUtil.convert2Map( -// taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); -// // 薪资核算人员按照人员id聚合分类 -// Map> employeeIdKeyMap = SalaryEntityUtil.group2Map( -// taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); -// -// List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); -// for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { -// // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 -// SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); -// for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { -// SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); -// SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); -// if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { -// lastSalaryAcctEmployee = salaryAcctEmployee; -// } -// } -// Map valueMap = Maps.newHashMap(); -// for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) { -// SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() -// .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); -// SalaryAcctResultValuePO salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); -// String defaultValue = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0" : ""; -// String value = defaultValue; -// if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { -// value = salaryAcctResultValue.getResultValue().getOrDefault(Util.null2String(salarySobTaxReportRule.getSalaryItemId()), defaultValue); -// } -// valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); -// } -// TaxDeclarationValuePO taxDeclarationValue = new TaxDeclarationValuePO() -// .setId(IdGenerator.generate()) -// .setTaxDeclareRecordId(taxDeclareContext.getTaxDeclaration().getTaxDeclareRecordId()) -// .setTaxDeclarationId(taxDeclareContext.getTaxDeclaration().getId()) -// .setEmployeeType(employeeIdEntry.getValue().get(0).getEmployeeType()) -// .setEmployeeId(employeeIdEntry.getKey()) -// .setResultValue(valueMap) -// .setTenantKey(tenantKey) -// .setCreator(employeeId) -// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .setCreateTime(now) -// .setUpdateTime(now); -// taxDeclarationValues.add(taxDeclarationValue); -// } -// // 生成累计数据 -// List addUpSituations = generateAddUpSituation(taxDeclareContext, salaryAcctResultValueMap, employeeIdKeyMap); -// return new TaxDeclarationGenerateResult() -// .setTaxDeclarationValues(taxDeclarationValues) -// .setAddUpSituations(addUpSituations); -// } -// -// /** -// * 生成往期累计数据 -// * -// * @param taxDeclareContext -// * @param salaryAcctResultValueMap -// * @param employeeIdKeyMap -// * @return -// */ -// private List generateAddUpSituation(TaxDeclareContext taxDeclareContext, -// Map salaryAcctResultValueMap, -// Map> employeeIdKeyMap) { -// List addUpSituations = Lists.newArrayList(); -// // 只有「工资工资薪金」、「保险营销员佣金收入」、「证券经纪人佣金收入」、「其他连续劳务报酬所得」需要累计计税 -// TaxDeclarationPO taxDeclaration = taxDeclareContext.getTaxDeclaration(); -// if (!Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) -// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN.getValue()) -// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER.getValue()) -// && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR.getValue())) { -// return addUpSituations; -// } -// for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { -// // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 -// SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); -// for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { -// SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); -// SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); -// if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { -// lastSalaryAcctEmployee = salaryAcctEmployee; -// } -// } -// SalaryAcctResultValuePO salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); -// Map valueMap = Maps.newHashMap(); -// for (Field declaredField : AddUpSituationPO.class.getDeclaredFields()) { -// if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { -// continue; -// } -// SalarySobAddUpRulePO salarySobAddUpRule = taxDeclareContext.getSalarySobAddUpRuleMap() -// .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + declaredField.getName()); -// String value = BigDecimal.ZERO.toPlainString(); -// if (Objects.nonNull(salarySobAddUpRule) && Objects.nonNull(salaryAcctResultValue)) { -// value = salaryAcctResultValue.getResultValue() -// .getOrDefault(Util.null2String(salarySobAddUpRule.getSalaryItemId()), BigDecimal.ZERO.toPlainString()); -// } -// valueMap.put(declaredField.getName(), value); -// } -// AddUpSituationPO addUpSituation = AddUpSituationPO.builder() -// .id(IdGenerator.generate()) -// .employeeId(lastSalaryAcctEmployee.getEmployeeId()) +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +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.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +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.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.util.SalaryEntityUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; + +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * @description: 通用:一般劳务报酬所得、全年一次性奖金 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/2 3:16 PM + * @version:v1.0 + */ +public class TaxDeclarationCommon implements TaxDeclarationStrategy { + + @Override + public TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId) { + Date now = new Date(); + // 薪资核算结果按照薪资核算人员id聚合分类 + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map( + taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); + // 薪资核算人员按照人员id聚合分类 + Map> employeeIdKeyMap = SalaryEntityUtil.group2Map( + taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); + + List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); + for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { + // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 + SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); + for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { + SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); + SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); + if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { + lastSalaryAcctEmployee = salaryAcctEmployee; + } + } + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) { + SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + String defaultValue = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0" : ""; + String value = defaultValue; + if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { + value = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); + } + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareContext.getTaxDeclaration().getTaxDeclareRecordId()) + .taxDeclarationId(taxDeclareContext.getTaxDeclaration().getId()) + .employeeType(employeeIdEntry.getValue().get(0).getEmployeeType()) + .employeeId(employeeIdEntry.getKey()) + .resultValue(valueMap) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(employeeId) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + taxDeclarationValues.add(taxDeclarationValue); + } + // 生成累计数据 + List addUpSituations = generateAddUpSituation(taxDeclareContext, salaryAcctResultValueMap, employeeIdKeyMap); + return new TaxDeclarationGenerateResult() + .setTaxDeclarationValues(taxDeclarationValues) + .setAddUpSituations(addUpSituations); + } + + /** + * 生成往期累计数据 + * + * @param taxDeclareContext + * @param salaryAcctResultValueMap + * @param employeeIdKeyMap + * @return + */ + private List generateAddUpSituation(TaxDeclareContext taxDeclareContext, + Map> salaryAcctResultValueMap, + Map> employeeIdKeyMap) { + List addUpSituations = Lists.newArrayList(); + // 只有「工资工资薪金」、「保险营销员佣金收入」、「证券经纪人佣金收入」、「其他连续劳务报酬所得」需要累计计税 + TaxDeclarationPO taxDeclaration = taxDeclareContext.getTaxDeclaration(); + if (!Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) + && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN.getValue()) + && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER.getValue()) + && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR.getValue())) { + return addUpSituations; + } + for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { + // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 + SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); + for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { + SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); + SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); + if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { + lastSalaryAcctEmployee = salaryAcctEmployee; + } + } + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + Map valueMap = Maps.newHashMap(); + for (Field declaredField : AddUpSituation.class.getDeclaredFields()) { + if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { + continue; + } + SalarySobAddUpRulePO salarySobAddUpRule = taxDeclareContext.getSalarySobAddUpRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + declaredField.getName()); + String value = BigDecimal.ZERO.toPlainString(); + if (Objects.nonNull(salarySobAddUpRule) && Objects.nonNull(salaryAcctResultValue)) { + value = salaryAcctResultValue.stream() + .filter(e -> e.getSalaryItemId().equals(salarySobAddUpRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + valueMap.put(declaredField.getName(), value); + } + AddUpSituation addUpSituation = AddUpSituation.builder() + .id(IdGenerator.generate()) + .employeeId(lastSalaryAcctEmployee.getEmployeeId()) // .employeeType(lastSalaryAcctEmployee.getEmployeeType()) -// .taxAgentId(lastSalaryAcctEmployee.getTaxAgentId()) -// .taxYearMonth(YearMonth.parse(taxDeclaration.getTaxCycle()).atDay(1)) -// .year(YearMonth.parse(taxDeclaration.getTaxCycle()).getYear()) -// .addUpIncome(valueMap.get("addUpIncome")) -// .addUpSocialSecurityTotal(valueMap.get("addUpSocialSecurityTotal")) -// .addUpAccumulationFundTotal(valueMap.get("addUpAccumulationFundTotal")) -// .addUpEnterpriseAndOther(valueMap.get("addUpEnterpriseAndOther")) -// .addUpSubtraction(valueMap.get("addUpSubtraction")) -// .addUpOtherDeduction(valueMap.get("addUpOtherDeduction")) -// .addUpTaxExemptIncome(valueMap.get("addUpTaxExemptIncome")) -// .addUpAllowedDonation(valueMap.get("addUpAllowedDonation")) -// .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) + .taxAgentId(lastSalaryAcctEmployee.getTaxAgentId()) + .taxYearMonth(taxDeclaration.getTaxCycle()) + .year(taxDeclaration.getTaxCycle().getYear()) + .addUpIncome(valueMap.get("addUpIncome")) + .addUpSocialSecurityTotal(valueMap.get("addUpSocialSecurityTotal")) + .addUpAccumulationFundTotal(valueMap.get("addUpAccumulationFundTotal")) + .addUpEnterpriseAndOther(valueMap.get("addUpEnterpriseAndOther")) + .addUpSubtraction(valueMap.get("addUpSubtraction")) + .addUpOtherDeduction(valueMap.get("addUpOtherDeduction")) + .addUpTaxExemptIncome(valueMap.get("addUpTaxExemptIncome")) + .addUpAllowedDonation(valueMap.get("addUpAllowedDonation")) + .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) // .addUpTaxableIncome(valueMap.get("addUpTaxableIncome")) // .modifier(taxDeclaration.getCreator()) -// .creator(taxDeclaration.getCreator()) -// .createTime(taxDeclaration.getCreateTime()) -// .updateTime(taxDeclaration.getUpdateTime()) -// .tenantKey(taxDeclaration.getTenantKey()) -// .deleteType(taxDeclaration.getDeleteType()) -// .build(); -// addUpSituations.add(addUpSituation); -// } -// return addUpSituations; -// } -//} + .creator(taxDeclaration.getCreator()) + .createTime(taxDeclaration.getCreateTime()) + .updateTime(taxDeclaration.getUpdateTime()) + .tenantKey(taxDeclaration.getTenantKey()) + .deleteType(taxDeclaration.getDeleteType()) + .build(); + addUpSituations.add(addUpSituation); + } + return addUpSituations; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 45de69cf4..0f7386203 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -1,165 +1,164 @@ -//package com.engine.salary.entity.taxdeclaration.bo; -// -//import com.engine.salary.report.enums.IncomeCategoryEnum; -//import com.google.common.collect.Lists; -//import com.google.common.collect.Maps; -//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; -//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; -//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; -//import com.weaver.hrm.salary.util.SalaryEntityUtil; -//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.*; -// -///** -// * @description: 个税申报 -// * @author: xiajun -// * @modified By: xiajun -// * @date: Created in 2022/11/2 11:18 AM -// * @version:v1.0 -// */ -//public class TaxDeclarationRequest { -// -// public static Map convert2RequestParam(List taxReportColumns, -// List taxDeclarations, -// List taxDeclarationValues, -// List employeeDeclares) { -// Map> objRequestParam = Maps.newHashMap(); -// Map>> listRequestParam = Maps.newHashMap(); -// Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); -// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); -// Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); -// for (TaxDeclarationPO taxDeclaration : taxDeclarations) { -// List values = taxDeclarationValueMap.get(taxDeclaration.getId()); -// for (TaxDeclarationValuePO taxDeclarationValue : values) { -// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); -// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); -// if (employeeDeclare == null || incomeCategoryEnum == null) { -// continue; -// } -// List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); -// Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); -// if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) { -// Map paramMap = objRequestParam.computeIfAbsent("zcgzxj", k -> { -// Map param = new HashMap<>(); -// // 正常工资薪金列表 -// param.put("zcgzxjlb", Lists.newArrayList()); -// // 正常工资薪金是否需要专项 -// param.put("zcgzxjsfxyzx", 0); -// // 正常工资薪金是否传入专项累计 -// param.put("zcgzxjsfcrlj", 1); -// return param; -// }); -// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zcgzxjlb", K -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { -// // 全年一次性奖金收入 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("qnycxjjsslb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_RETIRE) { -// // 内退一次性补偿金 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("ntycxbcjlb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_DISMISS) { -// // 解除劳动合同一次性补偿金 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE) { -// // 个人股权激励收入 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("grgqjl", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.ANNUITY_RECEIPT) { -// // 处理"是否一次性领取"(接口只能传0和1但是接口的错误返回信息告知只能填写是和否,所以需要转一下) -// String sfycxlq = Util.null2String(employeeRequestParam.get("sfycxlq")); -// employeeRequestParam.put("sfycxlq", Objects.equals("是", sfycxlq) ? "1" : "0"); -// // 年金领取 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("qynj", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_LABOR) { -// // 一般劳务报酬所得 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN) { -// // 保险营销员佣金收入 -// Map paramMap = objRequestParam.computeIfAbsent("bxyxy", k -> { -// Map param = new HashMap<>(); -// param.put("bxyxylwbclb", Lists.newArrayList()); -// return param; -// }); -// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("bxyxylwbclb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER) { -// // 证券经纪人佣金收入 -// Map paramMap = objRequestParam.computeIfAbsent("zqjjr", k -> { -// Map param = new HashMap<>(); -// param.put("zqjjrsdlb", Lists.newArrayList()); -// return param; -// }); -// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zqjjrsdlb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) { -// // 其他连续劳务报酬所得 -// Map paramMap = objRequestParam.computeIfAbsent("qtlxlwbc", k -> { -// Map param = new HashMap<>(); -// param.put("qtlxlwbclb", Lists.newArrayList()); -// return param; -// }); -// List> employeeRequestParams = (List>) paramMap.computeIfAbsent("qtlxlwbclb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR) { -// // 其他非连续劳务报酬所得 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("qtflxlwbc", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR) { -// // 稿酬所得 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("gcsdlb", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { -// // 特许权使用费所得 -// List> employeeRequestParams = listRequestParam.computeIfAbsent("txq", k -> Lists.newArrayList()); -// employeeRequestParams.add(employeeRequestParam); -// } -// } -// } -// -// Map requestParam = Maps.newHashMap(); -// requestParam.putAll(objRequestParam); -// requestParam.putAll(listRequestParam); -// return requestParam; -// } -// -// private static Map convert2RequestParam(IncomeCategoryEnum incomeCategoryEnum, -// List taxReportColumns, -// TaxDeclarationValuePO taxDeclarationValue, -// EmployeeDeclarePO employeeDeclare) { -// if (CollectionUtils.isEmpty(taxReportColumns)) { -// return Collections.emptyMap(); -// } -// Map 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) { -// String value = taxDeclarationValue.getResultValue().getOrDefault(taxReportColumn.getReportColumnDataIndex(), StringUtils.EMPTY); -// if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { -// value = Util.getBigDecimalValue(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex()), BigDecimal.ZERO).toPlainString(); -// } else if (Objects.equals(taxReportColumn.getDataType(), "integer")) { -// value = Util.getBigDecimalValue(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex()), BigDecimal.ZERO).setScale(0, RoundingMode.HALF_UP).toPlainString(); -// } -// requestParam.put(taxReportColumn.getRequestParamKey(), value); -// } -// return requestParam; -// } -//} +package com.engine.salary.entity.taxdeclaration.bo; + +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.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.report.enums.IncomeCategoryEnum; +import com.engine.salary.util.SalaryEntityUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; + +import java.math.RoundingMode; +import java.util.*; + +/** + * @description: 个税申报 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/2 11:18 AM + * @version:v1.0 + */ +public class TaxDeclarationRequest { + + public static Map convert2RequestParam(List taxReportColumns, + List taxDeclarations, + List taxDeclarationValues, + List employeeDeclares) { + Map> objRequestParam = Maps.newHashMap(); + Map>> listRequestParam = Maps.newHashMap(); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + for (TaxDeclarationPO taxDeclaration : taxDeclarations) { + List values = taxDeclarationValueMap.get(taxDeclaration.getId()); + for (TaxDeclarationValuePO taxDeclarationValue : values) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); + if (employeeDeclare == null || incomeCategoryEnum == null) { + continue; + } + List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); + Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); + if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) { + Map paramMap = objRequestParam.computeIfAbsent("zcgzxj", k -> { + Map param = new HashMap<>(); + // 正常工资薪金列表 + param.put("zcgzxjlb", Lists.newArrayList()); + // 正常工资薪金是否需要专项 + param.put("zcgzxjsfxyzx", 0); + // 正常工资薪金是否传入专项累计 + param.put("zcgzxjsfcrlj", 1); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zcgzxjlb", K -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { + // 全年一次性奖金收入 + List> employeeRequestParams = listRequestParam.computeIfAbsent("qnycxjjsslb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_RETIRE) { + // 内退一次性补偿金 + List> employeeRequestParams = listRequestParam.computeIfAbsent("ntycxbcjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_DISMISS) { + // 解除劳动合同一次性补偿金 + List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE) { + // 个人股权激励收入 + List> employeeRequestParams = listRequestParam.computeIfAbsent("grgqjl", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.ANNUITY_RECEIPT) { + // 处理"是否一次性领取"(接口只能传0和1但是接口的错误返回信息告知只能填写是和否,所以需要转一下) + String sfycxlq = Util.null2String(employeeRequestParam.get("sfycxlq")); + employeeRequestParam.put("sfycxlq", Objects.equals("是", sfycxlq) ? "1" : "0"); + // 年金领取 + List> employeeRequestParams = listRequestParam.computeIfAbsent("qynj", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_LABOR) { + // 一般劳务报酬所得 + List> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN) { + // 保险营销员佣金收入 + Map paramMap = objRequestParam.computeIfAbsent("bxyxy", k -> { + Map param = new HashMap<>(); + param.put("bxyxylwbclb", Lists.newArrayList()); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("bxyxylwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER) { + // 证券经纪人佣金收入 + Map paramMap = objRequestParam.computeIfAbsent("zqjjr", k -> { + Map param = new HashMap<>(); + param.put("zqjjrsdlb", Lists.newArrayList()); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zqjjrsdlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) { + // 其他连续劳务报酬所得 + Map paramMap = objRequestParam.computeIfAbsent("qtlxlwbc", k -> { + Map param = new HashMap<>(); + param.put("qtlxlwbclb", Lists.newArrayList()); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("qtlxlwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR) { + // 其他非连续劳务报酬所得 + List> employeeRequestParams = listRequestParam.computeIfAbsent("qtflxlwbc", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR) { + // 稿酬所得 + List> employeeRequestParams = listRequestParam.computeIfAbsent("gcsdlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { + // 特许权使用费所得 + List> employeeRequestParams = listRequestParam.computeIfAbsent("txq", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + } + } + + Map requestParam = Maps.newHashMap(); + requestParam.putAll(objRequestParam); + requestParam.putAll(listRequestParam); + return requestParam; + } + + private static Map convert2RequestParam(IncomeCategoryEnum incomeCategoryEnum, + List taxReportColumns, + TaxDeclarationValuePO taxDeclarationValue, + EmployeeDeclarePO employeeDeclare) { + if (CollectionUtils.isEmpty(taxReportColumns)) { + return Collections.emptyMap(); + } + Map 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) { + String value = taxDeclarationValue.getResultValue().getOrDefault(taxReportColumn.getReportColumnDataIndex(), StringUtils.EMPTY); + if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { + value = SalaryEntityUtil.string2BigDecimalDefault0(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())).toPlainString(); + } else if (Objects.equals(taxReportColumn.getDataType(), "integer")) { + value = SalaryEntityUtil.string2BigDecimalDefault0(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())).setScale(0, RoundingMode.HALF_UP).toPlainString(); + } + requestParam.put(taxReportColumn.getRequestParamKey(), value); + } + return requestParam; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java index 09fed43d0..f743ee91c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java @@ -1,21 +1,19 @@ -//package com.engine.salary.entity.taxdeclaration.bo; -// -///** -// * @description: 生成个税申报表 -// * @author: xiajun -// * @modified By: xiajun -// * @date: Created in 2022/12/1 4:47 PM -// * @version:v1.0 -// */ -//public interface TaxDeclarationStrategy { -// -// /** -// * 生成个税申报表 -// * -// * @param taxDeclareContext -// * @param employeeId -// * @param tenantKey -// * @return -// */ -// TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId, String tenantKey); -//} +package com.engine.salary.entity.taxdeclaration.bo; + +/** + * @description: 生成个税申报表 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/1 4:47 PM + * @version:v1.0 + */ +public interface TaxDeclarationStrategy { + + /** + * 生成个税申报表 + * + * @param taxDeclareContext + * @return + */ + TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId); +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index dcb4fe6e8..fa0392444 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -1,115 +1,114 @@ -//package com.engine.salary.entity.taxdeclaration.bo; -// -//import com.google.common.collect.Lists; -//import com.google.common.collect.Maps; -//import com.weaver.common.component.table.column.WeaTableColumn; -//import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; -//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; -//import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; -//import com.weaver.hrm.salary.enums.employeedeclare.CardTypeEnum; -//import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; -//import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; -//import com.weaver.hrm.salary.util.SalaryEntityUtil; -//import com.weaver.hrm.salary.util.SalaryI18nUtil; -//import com.weaver.teams.domain.hr.SimpleUserInfo; -//import com.weaver.teams.domain.user.SimpleEmployee; -//import lombok.Data; -//import org.apache.commons.collections4.CollectionUtils; -// -//import java.util.Collections; -//import java.util.List; -//import java.util.Map; -//import java.util.Objects; -// -///** -// * @description: 个税申报表详情 -// * @author: xiajun -// * @modified By: xiajun -// * @date: 2022/3/14 18:31 -// * @version:v1.0 -// */ -//@Data -//public class TaxDeclarationValueList { -// -// /** -// * 个税申报表的表头 -// * -// * @param taxReportColumns -// * @return -// */ -// public static List buildTableColumns(List taxReportColumns) { -// List weaTableColumns = Lists.newArrayList(); -// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum", "120")); -// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username", "120")); -// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(105139, "证件类型"), "cardType", "120")); -// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86318, "证件号码"), "cardNum", "150")); -// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(102786, "所得项目"), "incomeCategory", "120")); -// for (TaxReportColumnPO taxReportColumn : taxReportColumns) { -// weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(taxReportColumn.getReportColumnLabel(), taxReportColumn.getReportColumnName()), taxReportColumn.getReportColumnDataIndex(), "120")); -// } -// return weaTableColumns; -// } -// -// /** -// * 个税申报表的数据 -// * -// * @param taxReportColumns -// * @param taxDeclarationValues -// * @param simpleEmployees -// * @param simpleUserInfos -// * @param extEmployees -// * @return -// */ -// public static List> buildTableData(IncomeCategoryEnum incomeCategoryEnum, -// List taxReportColumns, -// List taxDeclarationValues, -// List employeeDeclares, -// List simpleEmployees, -// List simpleUserInfos, -// List extEmployees) { -// if (CollectionUtils.isEmpty(simpleEmployees)) { -// return Collections.emptyList(); -// } -// List> tableDataList = Lists.newArrayList(); -// // 员工基本信息按照人员id聚合分类 -// Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); -// // 员工报送信息按照人员id聚合分类 -// Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); -// // 员工个人信息按照人员id聚合分类 -// Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, e -> e.getUser().getId()); -// // 非系统员工按照人员id聚合分类 -// Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId); -// for (TaxDeclarationValuePO taxDeclarationValue : taxDeclarationValues) { -// Map dataMap = Maps.newHashMap(); -// dataMap.put("id", taxDeclarationValue.getId().toString()); -// dataMap.put("employeeId", taxDeclarationValue.getEmployeeId() + ""); -// dataMap.put("incomeCategory", incomeCategoryEnum.getDefaultLabel()); -// for (TaxReportColumnPO taxReportColumn : taxReportColumns) { -// dataMap.put(taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); -// } -// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); -// if (employeeDeclare != null) { -// dataMap.put("jobNum", employeeDeclare.getJobNum()); -// dataMap.put("username", employeeDeclare.getEmployeeName()); -// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); -// dataMap.put("cardNum", employeeDeclare.getCardNum()); -// } else if (Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { -// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); -// SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(taxDeclarationValue.getEmployeeId()); -// dataMap.put("jobNum", simpleEmployee.getJobNum()); -// dataMap.put("username", simpleEmployee.getUsername()); -// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); -// dataMap.put("cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); -// } else { -// ExtEmployeePO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); -// dataMap.put("jobNum", ""); -// dataMap.put("username", extEmployee.getUsername()); -// dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); -// dataMap.put("cardNum", extEmployee.getCardNum()); -// } -// tableDataList.add(dataMap); -// } -// return tableDataList; -// } -//} +package com.engine.salary.entity.taxdeclaration.bo; + +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.Data; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * @description: 个税申报表详情 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/3/14 18:31 + * @version:v1.0 + */ +@Data +public class TaxDeclarationValueList { + + /** + * 个税申报表的表头 + * + * @param taxReportColumns + * @return + */ + public static List buildTableColumns(List taxReportColumns) { + List weaTableColumns = Lists.newArrayList(); + weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum", "120")); + weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username", "120")); + weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(105139, "证件类型"), "cardType", "120")); + weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86318, "证件号码"), "cardNum", "150")); + weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(102786, "所得项目"), "incomeCategory", "120")); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(taxReportColumn.getReportColumnLabel(), taxReportColumn.getReportColumnName()), taxReportColumn.getReportColumnDataIndex(), "120")); + } + return weaTableColumns; + } + + /** + * 个税申报表的数据 + * + * @param taxReportColumns + * @param taxDeclarationValues + * @param simpleEmployees + * @param simpleUserInfos + * @param extEmployees + * @return + */ + public static List> buildTableData(IncomeCategoryEnum incomeCategoryEnum, + List taxReportColumns, + List taxDeclarationValues, + List employeeDeclares, + List simpleEmployees, + List simpleUserInfos, + List extEmployees) { + if (CollectionUtils.isEmpty(simpleEmployees)) { + return Collections.emptyList(); + } + List> tableDataList = Lists.newArrayList(); + // 员工基本信息按照人员id聚合分类 + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + // 员工报送信息按照人员id聚合分类 + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + // 员工个人信息按照人员id聚合分类 + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, e -> e.getEmployeeId()); + // 非系统员工按照人员id聚合分类 + Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmpPO::getId); + for (TaxDeclarationValuePO taxDeclarationValue : taxDeclarationValues) { + Map dataMap = Maps.newHashMap(); + dataMap.put("id", taxDeclarationValue.getId().toString()); + dataMap.put("employeeId", taxDeclarationValue.getEmployeeId() + ""); + dataMap.put("incomeCategory", incomeCategoryEnum.getDefaultLabel()); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + dataMap.put(taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); + } + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + if (employeeDeclare != null) { + dataMap.put("jobNum", employeeDeclare.getJobNum()); + dataMap.put("username", employeeDeclare.getEmployeeName()); + dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put("cardNum", employeeDeclare.getCardNum()); + } else if (Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); + DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(taxDeclarationValue.getEmployeeId()); + dataMap.put("jobNum", simpleEmployee.getWorkcode()); + dataMap.put("username", simpleEmployee.getUsername()); + dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put("cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); + } else { + ExtEmpPO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); + dataMap.put("jobNum", ""); + dataMap.put("username", extEmployee.getUsername()); + dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put("cardNum", extEmployee.getIdNo()); + } + tableDataList.add(dataMap); + } + return tableDataList; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java index 991166356..fb4a0e49d 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java @@ -1,60 +1,60 @@ -//package com.engine.salary.entity.taxdeclaration.bo; -// -//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.salaryitem.po.SalaryItemPO; -//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -//import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; -//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; -//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; -//import lombok.Data; -//import lombok.experimental.Accessors; -// -//import java.util.List; -//import java.util.Map; -// -///** -// * @description: 生成个税申报表所需的数据 -// * @author: xiajun -// * @modified By: xiajun -// * @date: Created in 2022/12/2 2:29 PM -// * @version:v1.0 -// */ -//@Data -//@Accessors(chain = true) -//public class TaxDeclareContext { -// -// /** -// * 薪资核算记录 -// */ -// private Map salaryAcctRecordMap; -// /** -// * 薪资核算人员 -// */ -// private List salaryAcctEmployees; -// /** -// * 薪资核算结果 -// */ -// private List salaryAcctResultValues; -// /** -// * 个税申报表 -// */ -// private TaxDeclarationPO taxDeclaration; -// /** -// * 个税申报表字段 -// */ -// private List taxReportColumns; -// /** -// * 薪资账套的个税申报表规则。key:薪资账套id-个税申报表字段索引、value:薪资账套的个税申报表规则 -// */ -// private Map salarySobTaxReportRuleMap; -// /** -// * 薪资账套的累计字段对应关系。key:薪资账套id-往期累计情况的字段索引、value:薪资账套的累计字段对应关系 -// */ -// private Map salarySobAddUpRuleMap; -// /** -// * 薪资项目 -// */ -// private List salaryItems; -//} +package com.engine.salary.entity.taxdeclaration.bo; + +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.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Map; + +/** + * @description: 生成个税申报表所需的数据 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/2 2:29 PM + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class TaxDeclareContext { + + /** + * 薪资核算记录 + */ + private Map salaryAcctRecordMap; + /** + * 薪资核算人员 + */ + private List salaryAcctEmployees; + /** + * 薪资核算结果 + */ + private List salaryAcctResultValues; + /** + * 个税申报表 + */ + private TaxDeclarationPO taxDeclaration; + /** + * 个税申报表字段 + */ + private List taxReportColumns; + /** + * 薪资账套的个税申报表规则。key:薪资账套id-个税申报表字段索引、value:薪资账套的个税申报表规则 + */ + private Map salarySobTaxReportRuleMap; + /** + * 薪资账套的累计字段对应关系。key:薪资账套id-往期累计情况的字段索引、value:薪资账套的累计字段对应关系 + */ + private Map salarySobAddUpRuleMap; + /** + * 薪资项目 + */ + private List salaryItems; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java index 16ed00006..c08de0b62 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java @@ -6,7 +6,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; /** * 个税申报记录查询条件 @@ -23,10 +23,10 @@ import java.time.YearMonth; public class TaxDeclarationListQueryParam extends BaseQueryParam { //薪资所属月范围起点 - private YearMonth fromSalaryMonth; + private Date fromSalaryMonth; //薪资所属月范围终点 - private YearMonth endSalaryMonth; + private Date endSalaryMonth; private String fromSalaryMonthStr; diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java index 67acbc304..682f1a87b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java @@ -30,6 +30,18 @@ public class TaxDeclarationPO { */ private Long id; + /** + * 个税申报记录id + */ + private Long taxDeclareRecordId; + + /** + * 薪资类型 + * + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + /** * 薪资所属月 */ @@ -45,12 +57,6 @@ public class TaxDeclarationPO { */ private Long taxAgentId; - /** - * 薪资类型 - * - * @see IncomeCategoryEnum - */ - private Integer incomeCategory; /** * 备注 diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index c39e85173..12d4d0844 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -1,9 +1,13 @@ package com.engine.salary.entity.taxdeclaration.po; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; +import java.util.Collection; import java.util.Date; import java.util.Map; @@ -16,6 +20,9 @@ import java.util.Map; */ @Data @Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor //hrsa_tax_declaration_value") public class TaxDeclarationValuePO implements Serializable { /** @@ -77,4 +84,8 @@ public class TaxDeclarationValuePO implements Serializable { * 更新时间 */ private Date updateTime; + + private Collection ids; + private Collection taxDeclarationIds; + } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java index 1c1127159..82aecf953 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java @@ -1,10 +1,12 @@ package com.engine.salary.entity.taxdeclaration.po; import com.engine.salary.report.enums.IncomeCategoryEnum; +import lombok.Builder; import lombok.Data; import lombok.experimental.Accessors; import java.io.Serializable; +import java.util.Collection; import java.util.Date; /** @@ -16,6 +18,7 @@ import java.util.Date; */ @Data @Accessors(chain = true) +@Builder //hrsa_tax_declare_fail") public class TaxDeclareFailPO implements Serializable { @@ -54,4 +57,8 @@ public class TaxDeclareFailPO implements Serializable { //更新时间", ignore = true) private Date updateTime; + + private Collection ids; + private Collection taxDeclareRecordIds; + } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index 9d0d07871..ad84be201 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.po; +import lombok.Builder; import lombok.Data; import java.util.Date; @@ -12,6 +13,7 @@ import java.util.Date; * @version:v1.0 */ @Data +@Builder //name = "个税申报表表头") //hrsa_tax_report_column") public class TaxReportColumnPO { diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java index f7a268d4d..9da6b4793 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -1,58 +1,30 @@ -//package com.engine.salary.entity.taxpayment.dto; -// -//import com.weaver.common.component.form.item.WeaFormItemType; -//import com.weaver.hrm.salary.annotation.SalaryForm; -//import com.weaver.hrm.salary.annotation.SalaryFormItem; -//import io.swagger.annotations.ApiModel; -//import io.swagger.annotations.ApiModelProperty; -//import lombok.AllArgsConstructor; -//import lombok.Builder; -//import lombok.Data; -//import lombok.NoArgsConstructor; -// -///** -// * 查询缴费信息 -// * -// * @author chengliming -// * @date 2022-12-27 13:25:42 -// */ -//@Data -//@Builder -//@NoArgsConstructor -//@AllArgsConstructor -//@ApiModel("查询缴费信息") -//public class TaxAmountFormDTO { -// -// @SalaryForm( -// label = "个税扣缴义务人", -// labelId = 86184, -// labelSpan = 8, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) -// } -// ) -// //个税扣缴义务人") -// private String taxAgent; -// -// @SalaryForm( -// label = "应缴金额", -// labelId = 175126, -// labelSpan = 8, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) -// } -// ) -// //应缴金额") -// private String amount; -// -// @SalaryForm( -// label = "申报人数", -// labelId = 175128, -// labelSpan = 8, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true) -// } -// ) -// //申报人数") -// private String personNum; -//} +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 查询缴费信息 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询缴费信息") +public class TaxAmountFormDTO { + + //个税扣缴义务人") + private String taxAgent; + + //应缴金额") + private String amount; + + //申报人数") + private String personNum; +} diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 6fc084f52..72d52afb0 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,7 +1,12 @@ package com.engine.salary.enums.salarysob; import com.engine.salary.enums.BaseEnum; +import com.google.common.collect.Lists; +import org.apache.commons.collections4.CollectionUtils; +import java.util.Collection; +import java.util.Collections; +import java.util.List; import java.util.Objects; /** @@ -14,24 +19,33 @@ import java.util.Objects; **/ public enum IncomeCategoryEnum implements BaseEnum { - WAGES_AND_SALARIES(1, "正常工资薪金所得", 98656), - - REMUNERATION_FOR_LABOR(4, "劳务报酬所得", 105218), - - // 暂时注释掉,后续会开放 - ONETIME_ANNUAL_BONUS(2,"全年一次性奖金收入", 0) -// -// OTHER(11, "其他所得", 0), + WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487), + REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488), + ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489), + COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", 181936), + COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", 181937), + INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", 181938), + ANNUITY_RECEIPT(110, "0110", "年金领取", 181939), + INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", 181940), + INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", 181942), + REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", 181943), + REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", 175330), + REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", 181944), + ROYALTIES(600, "0600", "特许权使用费所得", 181945), ; + private int value; + private String code; + private String defaultLabel; private int labelId; - IncomeCategoryEnum(int value, String defaultLabel, int labelId) { + IncomeCategoryEnum(int value, String code, String defaultLabel, int labelId) { this.value = value; + this.code = code; this.defaultLabel = defaultLabel; this.labelId = labelId; } @@ -41,6 +55,10 @@ public enum IncomeCategoryEnum implements BaseEnum { return value; } + public String getCode() { + return code; + } + @Override public Integer getLabelId() { return labelId; @@ -51,6 +69,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return defaultLabel; } + public static IncomeCategoryEnum parseByValue(Integer value) { for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { if (Objects.equals(incomeCategoryEnum.getValue(), value)) { @@ -59,4 +78,19 @@ public enum IncomeCategoryEnum implements BaseEnum { } return null; } + public static List parseByValue(Collection values) { + if (CollectionUtils.isEmpty(values)) { + return Collections.emptyList(); + } + List incomeCategoryEnums = Lists.newArrayListWithExpectedSize(values.size()); + for (Integer value : values) { + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + if (Objects.equals(incomeCategoryEnum.getValue(), value)) { + incomeCategoryEnums.add(incomeCategoryEnum); + } + } + } + return incomeCategoryEnums; + } + } diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java new file mode 100644 index 000000000..985cf7459 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java @@ -0,0 +1,81 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclarationValueMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclarationValuePO taxDeclarationValue); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationValuePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclarationValue 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 批量插入 + * + * @param taxDeclarationValue + */ + void batchInsert(@Param("collection") List taxDeclarationValue); + + /** + * 修改,修改所有字段 + * + * @param taxDeclarationValue 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 修改,忽略null字段 + * + * @param taxDeclarationValue 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 删除记录 + * + * @param taxDeclarationValue 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBytaxDeclareRecordIds(Collection taxDeclareRecordIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml new file mode 100644 index 000000000..f42226d71 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_declare_record_id + , t.tax_declaration_id + , t.employee_type + , t.employee_id + , t.result_value_json + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declaration_value + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_declare_record_id, + + + tax_declaration_id, + + + employee_type, + + + employee_id, + + + result_value_json, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxDeclareRecordId}, + + + #{taxDeclarationId}, + + + #{employeeType}, + + + #{employeeId}, + + + #{resultValueJson}, + + + + + + + + INSERT INTO hrsa_tax_declaration_value + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + tax_declaration_id, + employee_type, + employee_id, + result_value_json, + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.taxDeclarationId}, + #{item.employeeType}, + #{item.employeeId}, + #{item.resultValueJson}, + + ) + + + + + INSERT INTO hrsa_tax_declaration_value ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + tax_declaration_id, + employee_type, + employee_id, + result_value_json, + ) + + + select + #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxDeclarationId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.employeeType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.employeeId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.resultValueJson,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + from dual + + + + + + + INSERT INTO hrsa_tax_declaration_value ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + tax_declaration_id, + employee_type, + employee_id, + result_value_json, + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.taxDeclarationId}, + #{item.employeeType}, + #{item.employeeId}, + #{item.resultValueJson}, + ) + + + + + + UPDATE hrsa_tax_declaration_value + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_declare_record_id=#{taxDeclareRecordId}, + tax_declaration_id=#{taxDeclarationId}, + employee_type=#{employeeType}, + employee_id=#{employeeId}, + result_value_json=#{resultValueJson}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration_value + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + tax_declaration_id=#{taxDeclarationId}, + + + employee_type=#{employeeType}, + + + employee_id=#{employeeId}, + + + result_value_json=#{resultValueJson}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration_value + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declaration_value + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_tax_declaration_value + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_declare_record_id IN + + #{taxDeclareRecordId} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.java new file mode 100644 index 000000000..74e39e44e --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.java @@ -0,0 +1,84 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareFailMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclareFailPO taxDeclareFail); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclareFailPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareFail 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclareFailPO taxDeclareFail); + + /** + * 批量插入 + * + * @param taxDeclareFail + */ + void batchInsert(@Param("collection") List taxDeclareFail); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareFail 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclareFailPO taxDeclareFail); + + /** + * 修改,忽略null字段 + * + * @param taxDeclareFail 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclareFailPO taxDeclareFail); + + /** + * 删除记录 + * + * @param taxDeclareFail 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclareFailPO taxDeclareFail); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + /** + * 根据申报记录id删除 + * @param taxDeclareRecordIds + */ + void deleteBytaxDeclareRecordIds(@Param("taxDeclareRecordIds")Collection taxDeclareRecordIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml new file mode 100644 index 000000000..4ffd5b4e0 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_declare_record_id + , t.employee_name + , t.card_num + , t.error_msg + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_fail + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_declare_record_id, + + + employee_name, + + + card_num, + + + error_msg, + + + income_category, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxDeclareRecordId}, + + + #{employeeName}, + + + #{cardNum}, + + + #{errorMsg}, + + + #{incomeCategory}, + + + + + + + + INSERT INTO hrsa_tax_declare_fail + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + employee_name, + card_num, + error_msg, + income_category, + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.employeeName}, + #{item.cardNum}, + #{item.errorMsg}, + #{item.incomeCategory}, + + ) + + + + + INSERT INTO hrsa_tax_declare_fail ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + employee_name, + card_num, + error_msg, + income_category, + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE}, + #{item.employeeName,jdbcType=VARCHAR}, + #{item.cardNum,jdbcType=VARCHAR}, + #{item.errorMsg,jdbcType=VARCHAR}, + #{item.incomeCategory,jdbcType=VARCHAR}, + from dual + + + + + + + INSERT INTO hrsa_tax_declare_fail ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + employee_name, + card_num, + error_msg, + income_category, + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.employeeName}, + #{item.cardNum}, + #{item.errorMsg}, + #{item.incomeCategory}, + ) + + + + + + UPDATE hrsa_tax_declare_fail + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_declare_record_id=#{taxDeclareRecordId}, + employee_name=#{employeeName}, + card_num=#{cardNum}, + error_msg=#{errorMsg}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_fail + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + employee_name=#{employeeName}, + + + card_num=#{cardNum}, + + + error_msg=#{errorMsg}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_fail + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_fail + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_tax_declare_fail + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_declare_record_id IN + + #{taxDeclareRecordId} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java new file mode 100644 index 000000000..df8f8738a --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxReportColumnMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxReportColumnPO taxReportColumn); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxReportColumnPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxReportColumn 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxReportColumnPO taxReportColumn); + + /** + * 批量插入 + * + * @param taxReportColumn + */ + void batchInsert(@Param("collection") List taxReportColumn); + + /** + * 修改,修改所有字段 + * + * @param taxReportColumn 修改的记录 + * @return 返回影响行数 + */ + int update(TaxReportColumnPO taxReportColumn); + + /** + * 修改,忽略null字段 + * + * @param taxReportColumn 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxReportColumnPO taxReportColumn); + + /** + * 删除记录 + * + * @param taxReportColumn 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxReportColumnPO taxReportColumn); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml new file mode 100644 index 000000000..025135981 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml @@ -0,0 +1,396 @@ + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_report_type + , t.income_category + , t.report_column_name + , t.report_column_data_index + , t.data_type + , t.request_param_key + , t.report_column_label + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_report_column + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_report_type, + + + income_category, + + + report_column_name, + + + report_column_data_index, + + + data_type, + + + request_param_key, + + + report_column_label, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxReportType}, + + + #{incomeCategory}, + + + #{reportColumnName}, + + + #{reportColumnDataIndex}, + + + #{dataType}, + + + #{requestParamKey}, + + + #{reportColumnLabel}, + + + + + + + + INSERT INTO hrsa_tax_report_column + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_report_type, + income_category, + report_column_name, + report_column_data_index, + data_type, + request_param_key, + report_column_label + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxReportType}, + #{item.incomeCategory}, + #{item.reportColumnName}, + #{item.reportColumnDataIndex}, + #{item.dataType}, + #{item.requestParamKey}, + #{item.reportColumnLabel} + + ) + + + + + INSERT INTO hrsa_tax_report_column ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_report_type, + income_category, + report_column_name, + report_column_data_index, + data_type, + request_param_key, + report_column_label + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxReportType,jdbcType=INTEGER}, + #{item.incomeCategory,jdbcType=INTEGER}, + #{item.reportColumnName,jdbcType=VARCHAR}, + #{item.reportColumnDataIndex,jdbcType=VARCHAR}, + #{item.dataType,jdbcType=VARCHAR}, + #{item.requestParamKey,jdbcType=VARCHAR}, + #{item.reportColumnLabel,jdbcType=INTEGER} + from dual + + + + + + + INSERT INTO hrsa_tax_report_column ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_report_type, + income_category, + report_column_name, + report_column_data_index, + data_type, + request_param_key, + report_column_label + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxReportType}, + #{item.incomeCategory}, + #{item.reportColumnName}, + #{item.reportColumnDataIndex}, + #{item.dataType}, + #{item.requestParamKey}, + #{item.reportColumnLabel} + ) + + + + + UPDATE hrsa_tax_report_column + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_report_type=#{taxReportType}, + income_category=#{incomeCategory}, + report_column_name=#{reportColumnName}, + report_column_data_index=#{reportColumnDataIndex}, + data_type=#{dataType}, + request_param_key=#{requestParamKey}, + report_column_label=#{reportColumnLabel}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_report_column + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_report_type=#{taxReportType}, + + + income_category=#{incomeCategory}, + + + report_column_name=#{reportColumnName}, + + + report_column_data_index=#{reportColumnDataIndex}, + + + data_type=#{dataType}, + + + request_param_key=#{requestParamKey}, + + + report_column_label=#{reportColumnLabel}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_report_column + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_report_column + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/EmployeeDeclareRecordService.java b/src/com/engine/salary/service/EmployeeDeclareRecordService.java index 9377c324f..d18e73395 100644 --- a/src/com/engine/salary/service/EmployeeDeclareRecordService.java +++ b/src/com/engine/salary/service/EmployeeDeclareRecordService.java @@ -2,7 +2,7 @@ package com.engine.salary.service; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; -import java.time.YearMonth; +import java.util.Date; /** * @description: 员工报送记录 @@ -13,9 +13,9 @@ import java.time.YearMonth; */ public interface EmployeeDeclareRecordService { - EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId); + EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); - void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId); + void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); void save(EmployeeDeclareRecordPO employeeDeclareRecord); } diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 202f28aec..8dbdbb57b 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -8,8 +8,8 @@ import com.engine.salary.entity.employeedeclare.param.*; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.util.page.PageInfo; -import java.time.YearMonth; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -44,7 +44,7 @@ public interface EmployeeDeclareService{ * @param taxAgentId * @return */ - List listByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId); + List listByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); /** * 查询人员报送信息 @@ -54,7 +54,7 @@ public interface EmployeeDeclareService{ * @param employeeIds * @return */ - List listByTaxCycleAndTaxAgentIdAndEmployeeIds(YearMonth taxCycle, Long taxAgentId, + List listByTaxCycleAndTaxAgentIdAndEmployeeIds(Date taxCycle, Long taxAgentId, Collection employeeIds); /** diff --git a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java new file mode 100644 index 000000000..c0121633e --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java @@ -0,0 +1,56 @@ +package com.engine.salary.service; + +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; + +import java.util.Collection; +import java.util.List; + +/** + * @description: 薪资核算记录对应的个税扣缴义务人 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/7/29 9:45 + * @version:v1.0 + */ +public interface SalaryAcctTaxAgentService { + + /** + * 根据薪资核算记录id查询关联的个税扣缴义务人 + * + * @param salaryAcctRecordIds + * @return + */ + List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + + /** + * 根据税款所属期范围查询 + * + * @param taxCycleRange + * @return + */ + List listByTaxCycleRange(YearMonthRange taxCycleRange); + + /** + * 根据薪资核算人员初始化 + * + * @param salaryAcctEmployees + * @return + */ + List initBySalaryAcctEmployees(List salaryAcctEmployees); + + /** + * 批量保存 + * + * @param salaryAcctTaxAgents + */ + void batchSave(List salaryAcctTaxAgents); + + /** + * 根据薪资核算记录id删除关联的个税扣缴义务人 + * + * @param salaryAcctRecordIds + */ + void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds); +} diff --git a/src/com/engine/salary/service/SalarySobAddUpRuleService.java b/src/com/engine/salary/service/SalarySobAddUpRuleService.java new file mode 100644 index 000000000..7c4e240b4 --- /dev/null +++ b/src/com/engine/salary/service/SalarySobAddUpRuleService.java @@ -0,0 +1,48 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.dto.SalarySobAddUpRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobAddUpRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; + +import java.util.Collection; +import java.util.List; + +/** + * @description: 薪资账套的累计字段对应 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/1/4 10:08 AM + * @version:v1.0 + */ +public interface SalarySobAddUpRuleService { + + /** + * 根据薪资账套id查询薪资账套的累计字段对应关系 + * + * @param salarySobIds + * @return + */ + List listBySalarySobIds(Collection salarySobIds); + + /** + * 根据薪资账套id查询薪资账套的累计字段对应关系 + * + * @param salarySobId + * @return + */ + List listSalarySobAddUpRuleDTO(Long salarySobId); + + /** + * 保存 + * + * @param saveParam + */ + void saveByParam(SalarySobAddUpRuleSaveParam saveParam); + + /** + * 根据薪资账套id删除 + * + * @param salarySobIds + */ + void deleteBySalarySobIds(Collection salarySobIds); +} diff --git a/src/com/engine/salary/service/SalarySobTaxReportRuleService.java b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java new file mode 100644 index 000000000..4c75a31f7 --- /dev/null +++ b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java @@ -0,0 +1,48 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; + +import java.util.Collection; +import java.util.List; + +/** + * @description: 薪资账套的个税申报表规则 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/29 5:19 PM + * @version:v1.0 + */ +public interface SalarySobTaxReportRuleService { + + /** + * 根据薪资账套id查询薪资账套的个税申报表规则 + * + * @param salarySobIds + * @return + */ + List listBySalarySobIds(Collection salarySobIds); + + /** + * 根据薪资账套id查询薪资账套的个税申报表规则 + * + * @param salarySobId + * @return + */ + List getSalarySobTaxReportRuleDTO(Long salarySobId); + + /** + * 保存 + * + * @param saveParam + */ + void saveByParam(SalarySobTaxReportRuleSaveParam saveParam); + + /** + * 按薪资账套id删除 + * + * @param salarySobIds + */ + void deleteBySalarySobIds(Collection salarySobIds); +} diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 1eedf2b59..41cc2182b 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -1,6 +1,7 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; import com.engine.salary.util.page.PageInfo; @@ -20,17 +21,15 @@ public interface TaxDeclarationValueService { /** * 查询个税申报表明细 * - * @param page * @param taxDeclarationIds * @return */ - PageInfo listPageByTaxDeclarationIds( Collection taxDeclarationIds); + PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam,Collection taxDeclarationIds); /** * 查询个税申报表明细 * * @param taxDeclarationIds - * @param tenantKey * @return */ List listByTaxDeclarationIds(Collection taxDeclarationIds); @@ -39,7 +38,6 @@ public interface TaxDeclarationValueService { * 查询个税申报表明细 * * @param taxDeclarationIds - * @param tenantKey * @return */ List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds); @@ -48,7 +46,6 @@ public interface TaxDeclarationValueService { * 个税申报表明细列表 * * @param taxDeclarationValues - * @param tenantKey * @return */ TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues); @@ -57,7 +54,6 @@ public interface TaxDeclarationValueService { * 批量保存 * * @param taxDeclarationValues - * @param tenantKey */ void batchSave(List taxDeclarationValues); @@ -65,7 +61,6 @@ public interface TaxDeclarationValueService { * 删除个税申报表明细 * * @param taxDeclareRecordIds - * @param tenantKey */ void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); } diff --git a/src/com/engine/salary/service/TaxDeclareFailService.java b/src/com/engine/salary/service/TaxDeclareFailService.java index 25b649933..a5b540dc4 100644 --- a/src/com/engine/salary/service/TaxDeclareFailService.java +++ b/src/com/engine/salary/service/TaxDeclareFailService.java @@ -3,7 +3,6 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; -import com.engine.salary.util.page.PageInfo; import java.util.Collection; import java.util.List; @@ -23,7 +22,7 @@ public interface TaxDeclareFailService { * @param taxDeclareRecordIds * @return */ - PageInfo listPageByTaxDeclareRecordIds( Collection taxDeclareRecordIds); + List listPageByTaxDeclareRecordIds( Collection taxDeclareRecordIds); /** * 根据个税申报记录id查询申报失败数据 @@ -48,4 +47,6 @@ public interface TaxDeclareFailService { * @return */ List convert2FailEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareFails); + + void saveBatch(List taxDeclareFails); } diff --git a/src/com/engine/salary/service/TaxPaymentService.java b/src/com/engine/salary/service/TaxPaymentService.java new file mode 100644 index 000000000..72c740132 --- /dev/null +++ b/src/com/engine/salary/service/TaxPaymentService.java @@ -0,0 +1,80 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; + +import java.util.Map; + +/** + * 个税辅助缴款 + * + * @author chengliming + * @date 2022-12-06 17:27:59 + **/ +public interface TaxPaymentService { + /** + * 查询外部接口(异步接口) + * + * @param param + * @return + */ + String getRequestId(TaxPaymentQueryParam param); + + /** + * 获取反馈查询结果 + * + * @param param + * @return + */ + TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param); + + /** + * 获取业务类型 + * + * @return + */ + Integer getServiceType(); + + /** + * 查询应缴金额 + * + * @param param + * @return + */ + TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param); + + /** + * 作废缴费凭证 + * + * @param apiConfig + * @param taxDeclareRecord + * @param requestParam + */ + void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam); + + /** + * 获取完税证明 + * + * @param param + * @return + */ + TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param); + + /** + * 刷新缴款状态(主要针对线下缴款场景) + * + * @param param + */ + void syncWithholdingFeedback(TaxPaymentQueryParam param); + + /** + * 作废缴款凭证 + * + * @param param + */ + void cancelWithholdingVoucher(TaxPaymentQueryParam param); +} diff --git a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java index 769c58ba2..a807422bf 100644 --- a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java +++ b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java @@ -1,30 +1,34 @@ package com.engine.salary.service.factory; import com.engine.common.util.ServiceUtil; -import com.engine.core.impl.Service; import com.engine.salary.service.TaxAgentTaxReturnCheckService; import com.engine.salary.service.impl.AbstractTaxAgentTaxReturnCheckService; import com.engine.salary.service.impl.TaxReturnCheckDepartmentServiceImpl; import com.engine.salary.service.impl.TaxReturnCheckMainServiceImpl; import com.engine.salary.service.impl.TaxReturnCheckRegistrationServiceImpl; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; +import weaver.hrm.User; /** * @author chengliming * @date 2022-09-09 2:09 PM **/ -public class TaxAgentTaxReturnCheckServiceFactory extends Service { - private final Map serviceMap = new ConcurrentHashMap<>(); +public class TaxAgentTaxReturnCheckServiceFactory { + // private final Map serviceMap = new ConcurrentHashMap<>(); +// +// public TaxAgentTaxReturnCheckServiceFactory(Map map) { +// for (Map.Entry entry : map.entrySet()) { +// serviceMap.putIfAbsent(entry.getValue().getCheckType(), entry.getValue()); +// } +// } - public TaxAgentTaxReturnCheckServiceFactory(Map map) { - for (Map.Entry entry : map.entrySet()) { - serviceMap.putIfAbsent(entry.getValue().getCheckType(), entry.getValue()); - } + private User user; + + public TaxAgentTaxReturnCheckServiceFactory(User user) { + this.user = user; } + public TaxAgentTaxReturnCheckService get(Integer type) { // TaxAgentTaxReturnCheckService service = serviceMap.get(type); // if (service == null) { diff --git a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java index d8587a395..bae9778b7 100644 --- a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java +++ b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java @@ -1,33 +1,31 @@ -//package com.engine.salary.service.factory; -// -//import com.weaver.hrm.salary.exception.SalaryRunTimeException; -//import com.weaver.hrm.salary.service.TaxPaymentService; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//import java.util.Map; -//import java.util.concurrent.ConcurrentHashMap; -// -///** -// * @author chengliming -// * @date 2022-12-08 19:05:16 -// **/ -// -//public class TaxPaymentServiceFactory { -// private final Map serviceMap = new ConcurrentHashMap<>(); -// -// -// public TaxPaymentServiceFactory(Map map) { -// for (Map.Entry entry : map.entrySet()) { -// serviceMap.putIfAbsent(entry.getValue().getServiceType(), entry.getValue()); -// } -// } -// -// public TaxPaymentService get(Integer type) { -// TaxPaymentService service = serviceMap.get(type); -// if (service == null) { -// throw new SalaryRunTimeException("TaxPaymentService is null"); -// } -// return service; -// } -//} +package com.engine.salary.service.factory; + +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.service.TaxPaymentService; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author chengliming + * @date 2022-12-08 19:05:16 + **/ + +public class TaxPaymentServiceFactory { + private final Map serviceMap = new ConcurrentHashMap<>(); + + + public TaxPaymentServiceFactory(Map map) { + for (Map.Entry entry : map.entrySet()) { + serviceMap.putIfAbsent(entry.getValue().getServiceType(), entry.getValue()); + } + } + + public TaxPaymentService get(Integer type) { + TaxPaymentService service = serviceMap.get(type); + if (service == null) { + throw new SalaryRunTimeException("TaxPaymentService is null"); + } + return service; + } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java index 9fdb54b90..9a4f14760 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java @@ -4,7 +4,7 @@ import com.engine.core.impl.Service; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; import com.engine.salary.service.EmployeeDeclareRecordService; -import java.time.YearMonth; +import java.util.Date; /** * @description: 员工报送记录 @@ -16,7 +16,7 @@ import java.time.YearMonth; public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService { @Override - public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) { + public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { // return new LambdaQueryChainWrapper<>(baseMapper) // .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey) // .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) @@ -27,7 +27,7 @@ public class EmployeeDeclareRecordServiceImpl extends Service implements Employe } @Override - public void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) { + public void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { // new LambdaUpdateChainWrapper<>(baseMapper) // .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey) // .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 3ae25647b..b68952c24 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -57,8 +57,6 @@ import weaver.general.Util; import weaver.hrm.User; import java.time.LocalDate; -import java.time.YearMonth; -import java.time.temporal.ChronoUnit; import java.util.*; import java.util.stream.Collectors; @@ -118,20 +116,20 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } @Override - public List listByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) { + public List listByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() - .taxCycle(taxCycle.toString()) + .taxCycle(taxCycle) .taxAgentId(taxAgentId) .build()); } @Override - public List listByTaxCycleAndTaxAgentIdAndEmployeeIds(YearMonth taxCycle, Long taxAgentId, Collection employeeIds) { + public List listByTaxCycleAndTaxAgentIdAndEmployeeIds(Date taxCycle, Long taxAgentId, Collection employeeIds) { if (CollectionUtils.isEmpty(employeeIds)) { return Collections.emptyList(); } return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() - .taxCycle(taxCycle.toString()) + .taxCycle(taxCycle) .taxAgentId(taxAgentId) .employeeIds(employeeIds) .build()); @@ -145,7 +143,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla @Override public List list4AddByParam(EmployeeDeclareAddListQueryParam queryParam) { - queryParam.setPreTaxCycle(queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS).toString()); + queryParam.setPreTaxCycle(SalaryDateUtil.plusMonths(queryParam.getTaxCycle(),-1)); return getEmployeeDeclareMapper().list4AddByParam(queryParam); } @@ -176,7 +174,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla ValidUtil.doValidator(queryParam); List list = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() .taxAgentId(queryParam.getTaxAgentId()) - .taxCycle(queryParam.getTaxCycle().toString()) + .taxCycle(queryParam.getTaxCycle()) .declareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()) .build()); PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), @@ -189,7 +187,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla Date now = new Date(); EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() .setTaxAgentId(saveParam.getTaxAgentId()) - .setTaxCycle(saveParam.getTaxCycle().toString()) + .setTaxCycle(saveParam.getTaxCycle()) .setEmployeeName(saveParam.getEmployeeName()) .setJobNum(saveParam.getJobNum()) .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) @@ -436,7 +434,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 查询本月已有的需要报送的人员 List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); // 查询上月已有的需要报送的人员(只需要正常的) - List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), refreshParam.getTaxAgentId()) + List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()) .stream() .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) @@ -444,24 +442,22 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId()); // 根据税款所属期计算出薪资周期 - YearMonth salaryCycle; - YearMonth taxCycle = refreshParam.getTaxCycle(); + Date salaryCycle; + Date taxCycle = refreshParam.getTaxCycle(); // TODO:先临时写死本月!!!!需先完成个税扣缴义务人的改造 // SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryEnumUtil.enumMatchByValue(taxAgent.getTaxCycleType(), SalaryCycleTypeEnum.class); SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryCycleTypeEnum.THIS_MONTH; if (salaryCycleTypeEnum == SalaryCycleTypeEnum.BEFORE_LAST_MONTH) { - salaryCycle = taxCycle.plus(2, ChronoUnit.MONTHS); + salaryCycle = SalaryDateUtil.plusMonths(taxCycle, 2); } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.LAST_MONTH) { - salaryCycle = taxCycle.plus(1, ChronoUnit.MONTHS); - } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.THIS_MONTH) { - salaryCycle = taxCycle; + salaryCycle = SalaryDateUtil.plusMonths(taxCycle, 1); } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.NEXT_MONTH) { - salaryCycle = taxCycle.plus(-1, ChronoUnit.MONTHS); + salaryCycle = SalaryDateUtil.plusMonths(taxCycle, -1); } else { salaryCycle = taxCycle; } // 查询薪资档案的发薪人员 - LocalDateRange salaryCycleRange = LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryCycle.atDay(1))).endDate(SalaryDateUtil.localDateToDate(salaryCycle.atEndOfMonth())).build(); + LocalDateRange salaryCycleRange = LocalDateRange.builder().fromDate(salaryCycle).endDate(SalaryDateUtil.localDateToDate(SalaryDateUtil.localDate2YearMonth(salaryCycle).atEndOfMonth())).build(); List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salaryCycleRange, Collections.emptyList(), refreshParam.getTaxAgentId()); List employeeIds = salaryArchiveDataDTOS.stream().map(SalaryArchiveDataDTO::getEmployeeId).collect(Collectors.toList()); List salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build()); @@ -641,7 +637,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla + "-" + e.getOrDefault("zzlx", "") + "-" + e.getOrDefault("zzhm", "")); // 流量使用情况 - TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(SalaryDateUtil.localDateToDate(param.getTaxCycle().atDay(1)), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(param.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); // 查询申报的人员列表 Date now = new Date(); List needUpdateEmployeeDeclares = Lists.newArrayList(); diff --git a/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java index 6efad07ac..7b36f358d 100644 --- a/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java @@ -1,6 +1,5 @@ package com.engine.salary.service.impl; -import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; @@ -9,7 +8,6 @@ import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; import com.engine.salary.service.TaxAgentTaxReturnService; import com.engine.salary.service.factory.TaxAgentTaxReturnCheckServiceFactory; import com.engine.salary.util.db.MapperProxyFactory; -import weaver.hrm.User; import java.util.Collection; import java.util.List; @@ -18,14 +16,11 @@ import java.util.List; * @author chengliming * @date 2022-09-02 9:27 AM **/ -public class TaxAgentTaxReturnServiceImpl extends Service implements TaxAgentTaxReturnService { +public class TaxAgentTaxReturnServiceImpl extends Service implements TaxAgentTaxReturnService { private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); } - private TaxAgentTaxReturnCheckServiceFactory getTaxAgentTaxReturnCheckServiceFactory(User user) { - return ServiceUtil.getService(TaxAgentTaxReturnCheckServiceFactory.class, user); - } @Override public TaxAgentTaxReturnPO getByTaxAgentId(Long taxAgentId) { return getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); @@ -33,7 +28,7 @@ public class TaxAgentTaxReturnServiceImpl extends Service implements TaxAgentTa @Override public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { - return getTaxAgentTaxReturnCheckServiceFactory(user).get(saveParam.getType()).verify(saveParam); + return new TaxAgentTaxReturnCheckServiceFactory(user).get(saveParam.getType()).verify(saveParam); } @Override diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index 41c63a25f..6c76e9bf4 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -192,8 +192,6 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax private EnumDeclareApiBusinessType businessType; public ApiFlowUpdateWrapper( Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { - this.tenantKey = tenantKey; - this.currentEmployeeId = currentEmployeeId; this.taxYearMonth = taxYearMonth; this.apiFlowDetailPOList = new ArrayList<>(); this.apiConfig = apiConfig; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 38fb5b51d..42ac51716 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -101,10 +101,10 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration TaxDeclarationPO po = TaxDeclarationPO.builder().build(); LocalDateRange localDateRange = new LocalDateRange(); if (Objects.nonNull(queryParam.getFromSalaryMonth())) { - localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getFromSalaryMonth().atDay(1))); + localDateRange.setFromDate(queryParam.getFromSalaryMonth()); } if (Objects.nonNull(queryParam.getEndSalaryMonth())) { - localDateRange.setEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atEndOfMonth())); + localDateRange.setEndDate(SalaryDateUtil.localDateToDate(SalaryDateUtil.localDate2YearMonth(queryParam.getEndSalaryMonth()).atEndOfMonth())); } po.setSalaryMonths(localDateRange); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 292a84204..9dbf8ea30 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -1,43 +1,31 @@ package com.engine.salary.service.impl; -import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; -import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; -import com.engine.salary.service.EmployeeDeclareService; -import com.engine.salary.service.ExtEmpService; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxDeclarationValueService; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.page.PageInfo; -import com.google.common.collect.Lists; -import com.weaver.common.component.table.column.WeaTableColumn; -import com.weaver.common.hrm.service.HrmCommonEmployeeService; -import com.weaver.framework.util.JsonUtil; -import com.weaver.hrm.salary.entity.employeedeclare.po.EmployeeDeclarePO; -import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO; -import com.weaver.hrm.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; -import com.weaver.hrm.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; -import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.weaver.hrm.salary.entity.taxdeclaration.po.TaxReportColumnPO; -import com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum; -import com.weaver.hrm.salary.enums.salarysob.IncomeCategoryEnum; -import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; -import com.weaver.hrm.salary.service.*; -import com.weaver.hrm.salary.util.SalaryEntityUtil; -import com.weaver.hrm.salary.util.SalaryEnumUtil; -import com.weaver.hrm.salary.util.SalaryPageUtil; -import com.weaver.teams.domain.hr.SimpleUserInfo; -import com.weaver.teams.domain.user.SimpleEmployee; +import com.engine.salary.util.page.SalaryPageUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import java.time.LocalDateTime; -import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; -import static com.engine.salary.entity.siaccount.param.DSTenantKeyThreadVar.tenantKey; - /** * @description: 个税申报表 * @author: xiajun @@ -48,77 +36,58 @@ import static com.engine.salary.entity.siaccount.param.DSTenantKeyThreadVar.tena @Slf4j public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclarationValueService { - - private DataSecurityService dataSecurityService; - - private HrmCommonEmployeeService hrmCommonEmployeeService; - + private TaxDeclarationValueMapper taxDeclarationValueMapper; +// private DataSecurityService dataSecurityService; + private SalaryEmployeeService salaryEmployeeService; - + private ExtEmpService extEmployeeService; - + private EmployeeDeclareService employeeDeclareService; - -// private TaxReportColumnService taxReportColumnService; + + private TaxReportColumnService taxReportColumnService; @Override - public PageInfo listPageByTaxDeclarationIds( Collection taxDeclarationIds) { - if (page == null) { - return page; - } - page = new LambdaQueryChainWrapper<>(baseMapper) - .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) - .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclarationValuePO::getTaxDeclarationId, taxDeclarationIds) - .page(page); - page.setRecords(decryptBatch(page.getRecords(), tenantKey)); - return page; + public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds) { + List taxDeclarationValuePOS = taxDeclarationValueMapper.listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationValuePOS, TaxDeclarationValuePO.class); } @Override public List listByTaxDeclarationIds(Collection taxDeclarationIds) { - List taxDeclarationValues = new LambdaQueryChainWrapper<>(baseMapper) - .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) - .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclarationValuePO::getTaxDeclarationId, taxDeclarationIds) - .list(); + List taxDeclarationValues = taxDeclarationValueMapper.listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); return decryptBatch(taxDeclarationValues); } @Override public List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds) { - return new LambdaQueryChainWrapper<>(baseMapper) - .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) - .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclarationValuePO::getTaxDeclarationId, taxDeclarationIds) - .list(); + return taxDeclarationValueMapper.listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); } @Override public TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues) { // 查询个税申报表表头 IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - List taxReportColumns = taxReportColumnService.listByIncomeCategory(incomeCategoryEnum, tenantKey); + List taxReportColumns = taxReportColumnService.listByIncomeCategory(incomeCategoryEnum); // 人员id Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); // 查询报送的人员 - List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentIdAndEmployeeIds( - YearMonth.parse(taxDeclaration.getTaxCycle()), taxDeclaration.getTaxAgentId(), employeeIds, tenantKey); + List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); // 查询人员信息 List simpleEmployeeIds = taxDeclarationValues.stream() .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) .map(TaxDeclarationValuePO::getEmployeeId) .distinct() .collect(Collectors.toList()); - List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(simpleEmployeeIds, tenantKey); + List simpleEmployees = salaryEmployeeService.getEmployeeByIds(simpleEmployeeIds); // 查询人员薪资(身份证号码等) - List simpleUserInfos = salaryEmployeeService.listByEmployeeIds(simpleEmployeeIds, tenantKey); + List simpleUserInfos = salaryEmployeeService.getEmployeeByIds(simpleEmployeeIds); // 查询外部人员 - Set extEmployeeIds = taxDeclarationValues.stream() + List extEmployeeIds = taxDeclarationValues.stream() .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) .map(TaxDeclarationValuePO::getEmployeeId) - .collect(Collectors.toSet()); - List extEmployees = extEmployeeService.listByIdsWithDeleted(extEmployeeIds, tenantKey); + .collect(Collectors.toList()); + List extEmployees = extEmployeeService.getExtEmpByIds(extEmployeeIds); // 列表表头 List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); @@ -132,16 +101,17 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar @Override public void batchSave(List taxDeclarationValues) { if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { - // 加密 - taxDeclarationValues.forEach(taxDeclarationValue -> - taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); - taxDeclarationValues = dataSecurityService.encryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); - // 分批保存 - int batchSize = SalaryPageUtil.getBatchSize(); - List> partition = Lists.partition(taxDeclarationValues, batchSize); - for (List subTaxDeclarationValues : partition) { - baseMapper.batchInsert(subTaxDeclarationValues); - } + throw new RuntimeException("todo"); +// // 加密 +// taxDeclarationValues.forEach(taxDeclarationValue -> +// taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); +// taxDeclarationValues = dataSecurityService.encryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); +// // 分批保存 +// int batchSize = SalaryPageUtil.getBatchSize(); +// List> partition = Lists.partition(taxDeclarationValues, batchSize); +// for (List subTaxDeclarationValues : partition) { +// baseMapper.batchInsert(subTaxDeclarationValues); +// } } } @@ -150,24 +120,18 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { return; } - new LambdaUpdateChainWrapper<>(baseMapper) - .eq(TaxDeclarationValuePO::getTenantKey, tenantKey) - .eq(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclarationValuePO::getTaxDeclareRecordId, taxDeclareRecordIds) - .set(TaxDeclarationValuePO::getDeleteType, DeleteTypeEnum.PHYSICAL_DELETED.getValue()) - .set(TaxDeclarationValuePO::getUpdateTime, LocalDateTime.now()) - .update(); + taxDeclarationValueMapper.deleteBytaxDeclareRecordIds(taxDeclareRecordIds); } private List decryptBatch(List taxDeclarationValues) { if (CollectionUtils.isEmpty(taxDeclarationValues)) { return Collections.emptyList(); } - // 解密 - taxDeclarationValues = dataSecurityService.decryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); - taxDeclarationValues.forEach(salaryAcctResultValue -> { - salaryAcctResultValue.setResultValue(JsonUtil.parseMap(salaryAcctResultValue.getResultValueJson(), String.class)); - }); +// // 解密 +// taxDeclarationValues = dataSecurityService.decryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); +// taxDeclarationValues.forEach(salaryAcctResultValue -> { +// salaryAcctResultValue.setResultValue(JsonUtil.parseMap(salaryAcctResultValue.getResultValueJson(), String.class)); +// }); return taxDeclarationValues; } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java index 88de031b4..9c58579b5 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java @@ -79,7 +79,7 @@ public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclare Set employeeIds = SalaryEntityUtil.properties(taxDeclareEmployees, TaxDeclareEmployeePO::getEmployeeId); // 查询报送的人员 List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentIdAndEmployeeIds( - SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), taxDeclareRecord.getTaxAgentId(), employeeIds); + taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId(), employeeIds); // 查询人员信息 List simpleEmployeeIds = taxDeclareEmployees.stream() .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) diff --git a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java index 58fefe59f..4324c74e7 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java @@ -1,32 +1,24 @@ package com.engine.salary.service.impl; -import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; -import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.engine.core.impl.Service; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareFailMapper; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclareFailService; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.page.PageInfo; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.weaver.common.component.table.page.Page; -import com.weaver.hrm.salary.dao.TaxDeclareFailMapper; -import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; import org.apache.commons.collections4.CollectionUtils; -import java.time.LocalDateTime; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; -import static com.engine.salary.entity.siaccount.param.DSTenantKeyThreadVar.tenantKey; - /** * @description: 个税申报失败数据 * @author: xiajun @@ -40,32 +32,18 @@ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFail private TaxAgentService taxAgentService; @Override - public PageInfo listPageByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { - return new LambdaQueryChainWrapper<>(taxDeclareFailMapper) - .eq(TaxDeclareFailPO::getTenantKey, tenantKey) - .eq(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclareFailPO::getTaxDeclareRecordId, taxDeclareRecordIds) - .page(page); + public List listPageByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + return taxDeclareFailMapper.listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); } @Override public List listByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { - return new LambdaQueryChainWrapper<>(taxDeclareFailMapper) - .eq(TaxDeclareFailPO::getTenantKey, tenantKey) - .eq(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclareFailPO::getTaxDeclareRecordId, taxDeclareRecordIds) - .list(); + return taxDeclareFailMapper.listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); } @Override public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { - new LambdaUpdateChainWrapper<>(taxDeclareFailMapper) - .eq(TaxDeclareFailPO::getTenantKey, tenantKey) - .eq(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .in(TaxDeclareFailPO::getTaxDeclareRecordId, taxDeclareRecordIds) - .set(TaxDeclareFailPO::getDeleteType, DeleteTypeEnum.PHYSICAL_DELETED.getValue()) - .set(TaxDeclareFailPO::getUpdateTime, LocalDateTime.now()) - .update(); + taxDeclareFailMapper.deleteBytaxDeclareRecordIds(taxDeclareRecordIds); } @Override @@ -94,4 +72,11 @@ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFail } return dtos; } + + @Override + public void saveBatch(List taxDeclareFails) { + if (CollectionUtils.isNotEmpty(taxDeclareFails)) { + taxDeclareFailMapper.batchInsert(taxDeclareFails); + } + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 8e3771445..65e236f94 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -2,78 +2,61 @@ package com.engine.salary.service.impl; import com.engine.core.impl.Service; import com.engine.salary.common.YearMonthRange; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam; 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.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationResult; -import com.engine.salary.entity.taxdeclaration.bo.TaxDeclareRequest; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +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.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; +import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; +import com.engine.salary.entity.taxdeclaration.response.DeclareTaxResponse; +import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; -import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; -import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; -import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +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.service.*; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.service.factory.TaxPaymentServiceFactory; +import com.engine.salary.util.*; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import com.weaver.common.elog.dto.LoggerContext; -import com.weaver.common.elog.util.Util; -import com.weaver.framework.util.JsonUtil; -import com.weaver.hrm.salary.constant.SzyhApiConstant; -import com.weaver.hrm.salary.dao.TaxPaymentRequestMapper; -import com.weaver.hrm.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; -import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultValuePO; -import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAddUpRulePO; -import com.weaver.hrm.salary.entity.salarysob.po.SalarySobTaxReportRulePO; -import com.weaver.hrm.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; -import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentTaxReturnPO; -import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; -import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; -import com.weaver.hrm.salary.entity.taxdeclaration.bo.*; -import com.weaver.hrm.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; -import com.weaver.hrm.salary.entity.taxdeclaration.po.*; -import com.weaver.hrm.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; -import com.weaver.hrm.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; -import com.weaver.hrm.salary.entity.taxdeclaration.response.DeclareTaxResponse; -import com.weaver.hrm.salary.entity.taxdeclaration.response.UpdateDeclareResponse; -import com.weaver.hrm.salary.enums.OperateTypeEnum; -import com.weaver.hrm.salary.enums.employeedeclare.DeclareStatusEnum; -import com.weaver.hrm.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; -import com.weaver.hrm.salary.enums.taxdeclaration.*; -import com.weaver.hrm.salary.service.*; -import com.weaver.hrm.salary.service.factory.TaxPaymentServiceFactory; -import com.weaver.hrm.salary.util.*; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; +import weaver.general.Util; import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; -import static com.engine.salary.entity.siaccount.param.DSTenantKeyThreadVar.tenantKey; - /** * @description: 个税申报 * @author: xiajun @@ -125,7 +108,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe private TaxPaymentServiceFactory taxPaymentServiceFactory; - private TaxPaymentRequestMapper taxPaymentRequestMapper; +// private TaxPaymentRequestMapper taxPaymentRequestMapper; @Override public TaxDeclareRecordPO getById(Long id) { @@ -171,10 +154,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 构建查询参数 TaxDeclareRecordPO build = TaxDeclareRecordPO.builder().build(); if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getFromSalaryMonth())) { - build.setSalaryMonthStartDate(SalaryDateUtil.localDateToDate(queryParam.getFromSalaryMonth().atDay(1))); + build.setSalaryMonthStartDate(queryParam.getFromSalaryMonth()); } if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getEndSalaryMonth())) { - build.setSalaryMonthEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atDay(1))); + build.setSalaryMonthEndDate(queryParam.getEndSalaryMonth()); } List taxAgentIds = new ArrayList<>(); if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { @@ -372,7 +355,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } private TaxDeclarationResult generateReportPerRecord(TaxDeclareRecordPO taxDeclareRecord, List salaryAcctEmployees) { - LocalDateTime now = LocalDateTime.now(); + Date now = new Date(); List taxDeclarations = Lists.newArrayList(); List taxDeclarationValues = Lists.newArrayList(); List addUpSituations = Lists.newArrayList(); @@ -387,7 +370,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId); // 查询薪资核算结果 Set salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getId); - List salaryAcctResultValues = salaryAcctResultValueService.listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); + List salaryAcctResultValues = salaryAcctResultValueService.listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); // 查询薪资账套的累计字段对应关系 Set salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalarySobId); List salarySobAddUpRules = salarySobAddUpRuleService.listBySalarySobIds(salarySobIds); @@ -397,8 +380,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List salarySobTaxReportRules = salarySobTaxReportRuleService.listBySalarySobIds(salarySobIds); Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, e -> e.getSalarySobId() + "-" + e.getReportColumnDataIndex()); // 薪资核算结果按照薪资核算人员id聚合分类 - Map salaryAcctResultValueMap = SalaryEntityUtil.convert2Map( - salaryAcctResultValues, SalaryAcctResultValuePO::getSalaryAcctEmployeeId); + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map( + salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); // 薪资核算人员按照所得项目聚合分类 Map> incomeCategoryKeyEmployeeMap = SalaryEntityUtil.group2Map( salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); @@ -415,32 +398,32 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .taxAgentId(taxDeclareRecord.getTaxAgentId()) .salaryMonth(taxDeclareRecord.getSalaryMonth()) .taxCycle(taxDeclareRecord.getTaxCycle()) - .remark(taxDeclareRecord.getRemark()) + .description(taxDeclareRecord.getRemark()) .controlView(CollectionUtils.isEmpty(controlViewSalaryAcctRecords) ? 0 : 1) - .creator(employeeId) + .creator((long) user.getUID()) .createTime(now) .updateTime(now) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .tenantKey(tenantKey) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); taxDeclarations.add(taxDeclaration); // 薪资核算结果 Set salaryAcctEmployeeIdSet = SalaryEntityUtil.properties(incomeCategoryEntry.getValue(), SalaryAcctEmployeePO::getId); - List resultValues = salaryAcctEmployeeIdSet.stream() + List> resultValues = salaryAcctEmployeeIdSet.stream() .map(salaryAcctResultValueMap::get) .filter(Objects::nonNull) .collect(Collectors.toList()); TaxDeclareContext taxDeclareContext = new TaxDeclareContext() .setSalaryAcctRecordMap(salaryAcctRecordMap) .setSalaryAcctEmployees(incomeCategoryEntry.getValue()) - .setSalaryAcctResultValues(resultValues) + .setSalaryAcctResultValues(salaryAcctResultValues) .setTaxDeclaration(taxDeclaration) .setSalarySobTaxReportRuleMap(salarySobTaxReportRuleMap) .setSalarySobAddUpRuleMap(salarySobAddUpRuleMap) .setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())) .setSalaryItems(salaryItems); TaxDeclarationStrategy taxDeclarationStrategy = new TaxDeclarationCommon(); - TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext); + TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext, (long) user.getUID()); taxDeclarationValues.addAll(generateResult.getTaxDeclarationValues()); addUpSituations.addAll(generateResult.getAddUpSituations()); } @@ -501,12 +484,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return resultList; } - /** - * 根据个税扣缴义务人范围查询个税扣缴义务人 - * - * @param saveParam - * @return - */ + // /** +// * 根据个税扣缴义务人范围查询个税扣缴义务人 +// * +// * @param saveParam +// * @return +// */ // private List queryByTaxAgentRange(TaxDeclarationSaveParam saveParam) { // List taxAgents; // if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ALL_TAX_AGENT) { @@ -525,7 +508,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // } // return taxAgents; // } - @Override public void updateIcon(Long id, Integer displayIcon) { TaxDeclareRecordPO taxDeclareRecord = getById(id); @@ -657,7 +639,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Set taxDeclarationIds = SalaryEntityUtil.properties(taxDeclarations, TaxDeclarationPO::getId); List taxDeclarationValues = taxDeclarationValueService.listByTaxDeclarationIds(taxDeclarationIds); // 查询本税款所属期内报送成功的人员 - List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(YearMonth.parse(taxDeclareRecord.getTaxCycle()), + List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); employeeDeclares = employeeDeclares.stream() .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) @@ -665,11 +647,11 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); // 查询个税申报表的表头 - List taxReportColumns = taxReportColumnService.listAll(tenantKey); + List taxReportColumns = taxReportColumnService.listAll(); // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); // 人员列表 List> employeeDeclareParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); requestParam.put("rylb", employeeDeclareParam); @@ -692,42 +674,42 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 更新个税申报记录 taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); - taxDeclareRecord.setUpdateTime(LocalDateTime.now()); - taxDeclareRecordMapper.updateById(taxDeclareRecord); + taxDeclareRecord.setUpdateTime(new Date()); + taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); // 删除个税申报申报失败的数据 taxDeclareFailService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", taxDeclareRecord.getTaxCycle())); - loggerContext.setOperator(Util.null2String(employeeId)); - loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); - taxDeclarationLoggerTemplate.write(loggerContext); +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); +// taxDeclarationLoggerTemplate.write(loggerContext); } @Override - public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate, Long currentEmployeeId) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id, currentEmployeeId); + public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); if (StringUtils.isEmpty(taxDeclareRecord.getRequestId()) || !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156496, "请先点击「在线申报」后再点击「申报反馈」获取申报结果")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156496, "请先点击「在线申报」后再点击「申报反馈」获取申报结果")); } TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX_FEEDBACK; - Map requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); + ImmutableMap requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, requestParam); log.info("申报反馈返回数据: {}, taxDeclareRecord: {}", res, JsonUtil.toJsonString(taxDeclareRecord)); DeclareTaxFeedbackResponse declareTaxFeedbackResponse = JsonUtil.parseObject(res, DeclareTaxFeedbackResponse.class); if (Objects.isNull(declareTaxFeedbackResponse) || Objects.isNull(declareTaxFeedbackResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156449, "服务异常")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); } if (!Objects.equals(declareTaxFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(declareTaxFeedbackResponse.getHead().getMsg()); @@ -736,20 +718,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Integer declareFeedbackStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("fkztbj"), 0); DeclareFeedBackStatusEnum declareFeedBackStatusEnum = SalaryEnumUtil.enumMatchByValue(declareFeedbackStatus, DeclareFeedBackStatusEnum.class); if (declareFeedBackStatusEnum == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156509, "服务异常,接口返回数据有误")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } // 查询报送的人员 - List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(YearMonth.parse(taxDeclareRecord.getTaxCycle()), + List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId( + taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); Map employeeInfoMap = SalaryEntityUtil.convert2Map(employeeDeclares, e -> e.getEmployeeName() + "-" + e.getCardNum()); // 流量统计 TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper - = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(tenantKey, currentEmployeeId - , LocalDate.parse(taxDeclareRecord.getTaxCycle() + "-01", SalaryDateUtil.DATE_FORMATTER) - , apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION); + = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(taxDeclareRecord.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION); - LocalDateTime now = LocalDateTime.now(); + Date now = new Date(); List errorMsg = Lists.newArrayList(); List taxDeclareFails = Lists.newArrayList(); if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { @@ -760,22 +741,23 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe errorMsg.add(msg); } List details = JsonUtil.parseList(map.get("details"), List.class); - for (List detail : CollectionUtils.emptyIfNull(details)) { + for (List detail : details) { String employeeName = Util.null2String(detail.get(0)); String cardNum = Util.null2String(detail.get(2)); String incomeCategoryCode = Util.null2String(detail.get(4)); - TaxDeclareFailPO taxDeclareFailPO = new TaxDeclareFailPO() - .setId(IdGenerator.generate()) - .setTaxDeclareRecordId(taxDeclareRecord.getId()) - .setEmployeeName(employeeName) - .setCardNum(cardNum) - .setIncomeCategory(incomeCategoryCode) - .setErrorMsg(msg) - .setTenantKey(tenantKey) - .setCreator(currentEmployeeId) - .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .setCreateTime(now) - .setUpdateTime(now); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecord.getId()) + .employeeName(employeeName) + .cardNum(cardNum) + .incomeCategory(incomeCategoryCode) + .errorMsg(msg) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); taxDeclareFails.add(taxDeclareFailPO); // 流量使用记录 EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); @@ -794,7 +776,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), 0); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(declareStatus, TaxDeclareStatusEnum.class); if (taxDeclareStatusEnum == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156509, "服务异常,接口返回数据有误")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } // 为处理异常情况,如果反馈状态为申报失败,则记录申报状态也为申报失败 if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { @@ -805,7 +787,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); taxDeclareRecord.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); taxDeclareRecord.setRequestId(""); - taxDeclareRecord.setUpdateTime(LocalDateTime.now()); + taxDeclareRecord.setUpdateTime(new Date()); BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); BigDecimal payAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) @@ -814,7 +796,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (purePaidAmount.compareTo(payAmount) > 0) { taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()); - taxDeclarationRate.setMsg(String.format(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 183789, "应缴税额(不含滞纳金等):%s元,已缴金额(可能含滞纳金等):%s元,当前已缴款金额大于应缴纳金额,请线下前往办税大厅办理退款。"), payAmount, paidAmount)); + taxDeclarationRate.setMsg(String.format(SalaryI18nUtil.getI18nLabel(183789, "应缴税额(不含滞纳金等):%s元,已缴金额(可能含滞纳金等):%s元,当前已缴款金额大于应缴纳金额,请线下前往办税大厅办理退款。"), payAmount, paidAmount)); taxDeclarationRate.setMsgPersist(true); } else if (purePaidAmount.compareTo(payAmount) == 0) { taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString()); @@ -826,7 +808,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); } // 更新个税申报记录 - taxDeclareRecordMapper.updateById(taxDeclareRecord); + taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); // 如果申报失败 if (CollectionUtils.isNotEmpty(taxDeclareFails)) { taxDeclareFailService.saveBatch(taxDeclareFails); @@ -840,17 +822,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper); // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", taxDeclareRecord.getTaxCycle())); - loggerContext.setOperator(Util.null2String(currentEmployeeId)); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156455, "申报反馈")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 156455, "申报反馈")); - taxDeclarationLoggerTemplate.write(loggerContext); +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(currentEmployeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156455, "申报反馈")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156455, "申报反馈")); +// taxDeclarationLoggerTemplate.write(loggerContext); } @Override @@ -871,11 +853,11 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); // 申报类型 requestParam.put("sblx", "1"); // 作废银联缴款凭证 - taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(employeeId, apiConfig, taxDeclareRecord, requestParam); + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); // 是否清空所得 requestParam.put("sfqksd", "0"); // 请求 @@ -895,21 +877,21 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 更新个税申报记录 taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); - taxDeclareRecord.setUpdateTime(LocalDateTime.now()); - taxDeclareRecordMapper.updateById(taxDeclareRecord); + taxDeclareRecord.setUpdateTime(new Date()); + taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); - // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", taxDeclareRecord.getTaxCycle())); - loggerContext.setOperator(Util.null2String(employeeId)); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); - taxDeclarationLoggerTemplate.write(loggerContext); +// // 记录日志 +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); +// taxDeclarationLoggerTemplate.write(loggerContext); } @Override @@ -923,7 +905,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 供应商信息 TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK; - Map requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); + ImmutableMap requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, requestParam); log.info("作废反馈返回数据:" + res); @@ -951,21 +933,21 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); taxDeclareRecord.setRequestId(""); - taxDeclareRecord.setUpdateTime(LocalDateTime.now()); - taxDeclareRecordMapper.updateById(taxDeclareRecord); + taxDeclareRecord.setUpdateTime(new Date()); + taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", taxDeclareRecord.getTaxCycle())); - loggerContext.setOperator(Util.null2String(employeeId)); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); - taxDeclarationLoggerTemplate.write(loggerContext); +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); +// taxDeclarationLoggerTemplate.write(loggerContext); } @Override @@ -985,7 +967,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); // 申报类型 requestParam.put("sblx", "1"); // 请求 @@ -1006,21 +988,21 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); taxDeclareRecord.setRequestId(""); - taxDeclareRecord.setUpdateTime(LocalDateTime.now()); - updateById(taxDeclareRecord); + taxDeclareRecord.setUpdateTime(new Date()); + taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", taxDeclareRecord.getTaxCycle())); - loggerContext.setOperator(Util.null2String(employeeId)); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); - taxDeclarationLoggerTemplate.write(loggerContext); +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); +// taxDeclarationLoggerTemplate.write(loggerContext); } @Override @@ -1030,7 +1012,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); // 申报类型 requestParam.put("sblx", "1"); // 请求 @@ -1050,7 +1032,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", taxDeclareRecord.getTaxCycle().replace("-", "")); + requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); // 报表类型 requestParam.put("reportType", "1"); // 页码 diff --git a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java index 4cc852653..667f2fbd1 100644 --- a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -1,12 +1,11 @@ package com.engine.salary.service.impl; -import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.engine.core.impl.Service; import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.taxdeclaration.TaxReportColumnMapper; import com.engine.salary.service.TaxReportColumnService; -import com.weaver.hrm.salary.constant.SalaryConstant; -import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.util.db.MapperProxyFactory; import java.util.List; @@ -19,22 +18,18 @@ import java.util.List; */ public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { + private TaxReportColumnMapper getTaxReportColumnMapper() { + return MapperProxyFactory.getProxy(TaxReportColumnMapper.class); + } + + @Override public List listAll() { - return new LambdaQueryChainWrapper<>(baseMapper) - .eq(TaxReportColumnPO::getTenantKey, SalaryConstant.DEFAULT_TENANT_KEY) - .eq(TaxReportColumnPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .orderByAsc(TaxReportColumnPO::getId) - .list(); + return getTaxReportColumnMapper().listAll(); } @Override public List listByIncomeCategory(IncomeCategoryEnum incomeCategory) { - return new LambdaQueryChainWrapper<>(baseMapper) - .eq(TaxReportColumnPO::getTenantKey, SalaryConstant.DEFAULT_TENANT_KEY) - .eq(TaxReportColumnPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(TaxReportColumnPO::getIncomeCategory, incomeCategory.getValue()) - .orderByAsc(TaxReportColumnPO::getId) - .list(); + return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().incomeCategory(incomeCategory.getValue().toString()).build()); } } diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java index 9ab875746..0d304779c 100644 --- a/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java @@ -41,7 +41,7 @@ public class TaxReturnCheckMainServiceImpl extends AbstractTaxAgentTaxReturnChec return new TaxAgentTaxReturnCheckDTO().setStatus(po.getCheckStatus()).setMessage(po.getFailReason()); } } catch (Exception e) { - log.error("TaxReturnCheckMainServiceImpl.saveOrUpdate() ----------- error :{}", e.getMessage()); + log.error("保存异常", e); } // 调用神州云合API CompanyRegisterInfoResponse response = getCompanyRegisterInfoResponse(apiConfig, po, saveParam); @@ -78,8 +78,7 @@ public class TaxReturnCheckMainServiceImpl extends AbstractTaxAgentTaxReturnChec TaxAgentTaxReturnBO.convertParam2Po4Update(apiConfig, po, saveParam); getTaxAgentTaxReturnMapper().updateByTaxAgentId(po); } else { - po = TaxAgentTaxReturnBO.convertParam2Po4Insert(apiConfig, saveParam) - .setCreator((long) user.getUID()).setTenantKey(""); + po = TaxAgentTaxReturnBO.convertParam2Po4Insert(apiConfig, saveParam).setCreator((long) user.getUID()).setTenantKey(""); getTaxAgentTaxReturnMapper().insertIgnoreNull(po); } return po; diff --git a/src/com/engine/salary/util/SalaryEntityUtil.java b/src/com/engine/salary/util/SalaryEntityUtil.java index 6368dab61..d0d97905e 100644 --- a/src/com/engine/salary/util/SalaryEntityUtil.java +++ b/src/com/engine/salary/util/SalaryEntityUtil.java @@ -2,6 +2,7 @@ package com.engine.salary.util; import com.alibaba.fastjson.JSON; import com.engine.salary.enums.SalaryRoundingModeEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.apache.commons.collections.CollectionUtils; @@ -405,4 +406,11 @@ public class SalaryEntityUtil { } + public static T findFirst(Collection objs) { + if (CollectionUtils.isEmpty(objs)) { + throw new SalaryRunTimeException("the collection can not be empty"); + } + return objs.stream().findFirst().orElse(null); + } + } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 838b498a5..2330fd003 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -1,13 +1,8 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; -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.dto.*; +import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; @@ -18,11 +13,9 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationDetailWrapper; import com.engine.salary.wrapper.TaxDeclarationWrapper; import com.engine.salary.wrapper.TaxDeclareRecordWrapper; -import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.web.bind.annotation.RequestParam; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -39,7 +32,6 @@ import java.text.ParseException; import java.time.LocalDate; import java.util.Collection; import java.util.List; -import java.util.Map; @Slf4j @@ -54,7 +46,7 @@ public class TaxDeclarationController { } private TaxDeclarationExcelService getTaxDeclarationExcelService(User user) { - return ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user); + return ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user); } private TaxDeclarationDetailWrapper getTaxDeclarationDetailWrapper(User user) { @@ -72,8 +64,8 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException { User user = HrmUserVarify.getUser(request, response); - queryParam.setFromSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr())); - queryParam.setEndSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr())); + queryParam.setFromSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr())); + queryParam.setEndSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr())); return new ResponseResult>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam); } @@ -159,14 +151,12 @@ public class TaxDeclarationController { * @param param 更新参数 * @return */ + @POST @Path("/updateIcon") - @ApiOperation("刷新个税申报表的待刷新标识") @Produces(MediaType.APPLICATION_JSON) - public String updateIcon(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclareRecordParam param) { - taxDeclareRecordWrapper.updateIcon(param.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(null); + public String updateIcon(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateIcon, taxDeclarationId); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateIcon, param.getTaxDeclareRecordId()); } /** @@ -175,12 +165,12 @@ public class TaxDeclarationController { * @param ids 个税申报记录id * @return */ + @POST @Path("/delete") - @ApiOperation("个税申报表生成") @Produces(MediaType.APPLICATION_JSON) - public WeaResult delete(@RequestBody Collection ids) { - taxDeclareRecordWrapper.delete(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(null); + public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, TaxDeclarationInfoDTO>(user).run(getTaxDeclareRecordWrapper(user)::delete, ids); } /** @@ -189,12 +179,12 @@ public class TaxDeclarationController { * @param index 进度缓存索引 * @return */ - @GetMapping("/getRate") - @ApiOperation("个税申报表是否已经生成") + @GET + @Path("/getRate") @Produces(MediaType.APPLICATION_JSON) - public WeaResult getRate(@RequestParam(value = "index") String index) { - TaxDeclarationRateDTO rateDTO = taxDeclareRecordWrapper.getRate(index, TenantContext.getCurrentTenantKey()); - return WeaResult.success(rateDTO); + public String getRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "index") String index) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getRate, index); } /** @@ -203,12 +193,12 @@ public class TaxDeclarationController { * @param id 个税申报记录id * @return */ - @GetMapping("/getTaxDeclarationTab") - @ApiOperation("获取个税申报记录下的个税申报表TAB") + @GET + @Path("/getTaxDeclarationTab") @Produces(MediaType.APPLICATION_JSON) - public WeaResult> getTaxDeclarationTab(@RequestParam(value = "id") Long id) { - List taxDeclarationTab = taxDeclareRecordWrapper.getTaxDeclarationTab(id, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(taxDeclarationTab); + public String getTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, id); } /** @@ -217,12 +207,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 在线申报参数 * @return */ + @POST @Path("/declare") - @ApiOperation("在线申报") @Produces(MediaType.APPLICATION_JSON) - public WeaResult declare(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String cacheKey = taxDeclareRecordWrapper.declare(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(cacheKey); + public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::declare, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -231,12 +221,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 申报反馈参数 * @return */ + @POST @Path("/getDeclareFeedback") - @ApiOperation("获取在线申报反馈") @Produces(MediaType.APPLICATION_JSON) - public WeaResult getDeclareFeedback(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String cacheKey = taxDeclareRecordWrapper.getDeclareFeedback(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(cacheKey); + public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -245,12 +235,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 作废参数 * @return */ + @POST @Path("/cancel") - @ApiOperation("作废") @Produces(MediaType.APPLICATION_JSON) - public WeaResult cancel(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String cacheKey = taxDeclareRecordWrapper.cancelDeclare(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(cacheKey); + public String cancel(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelDeclare, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -259,12 +249,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 作废反馈参数 * @return */ + @POST @Path("/getCancelFeedback") - @ApiOperation("获取作废反馈") @Produces(MediaType.APPLICATION_JSON) - public WeaResult getCancelFeedback(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String cacheKey = taxDeclareRecordWrapper.getCancelFeedback(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(cacheKey); + public String getCancelFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getCancelFeedback, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -273,12 +263,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 更正申报参数 * @return */ + @POST @Path("/updateDeclare") - @ApiOperation("更正申报") @Produces(MediaType.APPLICATION_JSON) - public WeaResult updateDeclare(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String cacheKey = taxDeclareRecordWrapper.updateDeclare(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(cacheKey); + public String updateDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -287,12 +277,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 查询参数 * @return */ + @POST @Path("/queryDeclareStatus") - @ApiOperation("税局端申报状态查询") @Produces(MediaType.APPLICATION_JSON) - public WeaResult queryDeclareStatus(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String res = taxDeclareRecordWrapper.queryDeclareStatus(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(res); + public String queryDeclareStatus(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryDeclareStatus, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -301,12 +291,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 查询申报明细参数 * @return */ + @POST @Path("/queryCompanyIncomes") - @ApiOperation("税局端申报明细查询") @Produces(MediaType.APPLICATION_JSON) - public WeaResult queryCompanyIncomes(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String res = taxDeclareRecordWrapper.queryCompanyIncomes(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(res); + public String queryCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -315,12 +305,12 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 刷新数据参数 * @return */ + @POST @Path("/refreshData") - @ApiOperation("刷新数据") @Produces(MediaType.APPLICATION_JSON) - public WeaResult refreshData(@RequestBody @Validated TaxDeclareRecordParam taxDeclareRecordParam) { - String cacheKey = taxDeclareRecordWrapper.refreshData(taxDeclareRecordParam.getTaxDeclareRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(cacheKey); + public String refreshData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::refreshData, taxDeclareRecordParam.getTaxDeclareRecordId()); } /** @@ -329,27 +319,28 @@ public class TaxDeclarationController { * @param queryParam 查询条件 * @return */ + @POST @Path("/detail/list") - @ApiOperation("个税申报表申报数据列表") @Produces(MediaType.APPLICATION_JSON) - public WeaResult> listTaxDeclarationValue(@RequestBody TaxDeclarationValueListQueryParam queryParam) { - WeaTable weaTable = taxDeclareRecordWrapper.listValuePage(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(weaTable); + public String listTaxDeclarationValue(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationValueListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::listValuePage, queryParam); } - /** - * 导出个税申报表申报数据 - * - * @param queryParam 导出参数 - * @return - */ - @Path("/detail/export") - @ApiOperation("导出个税申报表申报数据") - @Produces(MediaType.APPLICATION_JSON) - public WeaResult> exportTaxDeclaration(@RequestBody @Validated TaxDeclarationValueListQueryParam queryParam) { - Map map = taxDeclareRecordWrapper.exportTaxDeclarationValue(queryParam, UserContext.getCurrentUser()); - return WeaResult.success(map); - } +// /** +// * 导出个税申报表申报数据 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @POST +// @Path("/detail/export") +// @Produces(MediaType.APPLICATION_JSON) +// public String exportTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationValueListQueryParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::exportTaxDeclarationValue, queryParam); +// +// } /** * 个税申报表申报数据-人员未报送列表 @@ -357,12 +348,12 @@ public class TaxDeclarationController { * @param queryParam 查询条件 * @return */ + @POST @Path("/employee/list4NotDeclare") - @ApiOperation("个税申报表申报数据-人员未报送列表") @Produces(MediaType.APPLICATION_JSON) - public WeaResult> listEmployee4NotDeclare(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { - WeaTable weaTable = taxDeclareRecordWrapper.listEmployeePage4NotDeclare(queryParam, TenantContext.getCurrentTenantKey()); - return WeaResult.success(weaTable); + public String listEmployee4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4NotDeclare, queryParam); } /** @@ -371,12 +362,12 @@ public class TaxDeclarationController { * @param queryParam 查询条件 * @return */ + @POST @Path("/employee/list4NoValue") - @ApiOperation("个税申报表申报数据-报送人员无申报数据列表") @Produces(MediaType.APPLICATION_JSON) - public WeaResult> listEmployee4NoValue(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { - WeaTable weaTable = taxDeclareRecordWrapper.listEmployeePage4NoValue(queryParam, TenantContext.getCurrentTenantKey()); - return WeaResult.success(weaTable); + public String listEmployee4NoValue(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4NoValue, queryParam); } /** @@ -385,54 +376,55 @@ public class TaxDeclarationController { * @param queryParam 查询条件 * @return */ + @POST @Path("/employee/list4Fail") - @ApiOperation("个税申报表申报数据-申报失败列表") @Produces(MediaType.APPLICATION_JSON) - public WeaResult> listEmployee4Fail(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { - WeaTable weaTable = taxDeclareRecordWrapper.listEmployeePage4Fail(queryParam, TenantContext.getCurrentTenantKey()); - return WeaResult.success(weaTable); + public String listEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4Fail, queryParam); } - /** - * 个税申报表申报数据-导出人员未报送列表 - * - * @param queryParam 查询条件 - * @return - */ - @Path("/employee/export4NotDeclare") - @ApiOperation("个税申报表申报数据-导出人员未报送列表") - @Produces(MediaType.APPLICATION_JSON) - public WeaResult> exportEmployee4NotDeclare(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { - Map map = taxDeclareRecordWrapper.exportEmployee4NotDeclare(queryParam, UserContext.getCurrentUser()); - return WeaResult.success(map); - } +// /** +// * 个税申报表申报数据-导出人员未报送列表 +// * +// * @param queryParam 查询条件 +// * @return +// */ +// @POST +// @Path("/employee/export4NotDeclare") +// @Produces(MediaType.APPLICATION_JSON) +// public String exportEmployee4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { +// +// Map map = taxDeclareRecordWrapper.exportEmployee4NotDeclare(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(map); +// } - /** - * 个税申报表申报数据-导出报送人员无申报数据列表 - * - * @param queryParam 查询条件 - * @return - */ - @Path("/employee/export4NoValue") - @ApiOperation("个税申报表申报数据-导出报送人员无申报数据列表") - @Produces(MediaType.APPLICATION_JSON) - public WeaResult> exportEmployee4NoValue(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { - Map map = taxDeclareRecordWrapper.exportEmployee4NoValue(queryParam, UserContext.getCurrentUser()); - return WeaResult.success(map); - } - - /** - * 个税申报表申报数据-导出申报失败列表 - * - * @param queryParam 导出参数 - * @return - */ - @Path("/employee/export4Fail") - @ApiOperation("个税申报表申报数据-导出申报失败列表") - @Produces(MediaType.APPLICATION_JSON) - public WeaResult> exportEmployee4Fail(@RequestBody @Validated AbnormalEmployeeListQueryParam queryParam) { - Map map = taxDeclareRecordWrapper.exportEmployee4Fail(queryParam, UserContext.getCurrentUser()); - return WeaResult.success(map); - } +// /** +// * 个税申报表申报数据-导出报送人员无申报数据列表 +// * +// * @param queryParam 查询条件 +// * @return +// */ +// @POST +// @Path("/employee/export4NoValue") +// @Produces(MediaType.APPLICATION_JSON) +// public String exportEmployee4NoValue(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { +// Map map = taxDeclareRecordWrapper.exportEmployee4NoValue(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(map); +// } +// +// /** +// * 个税申报表申报数据-导出申报失败列表 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @POST +// @Path("/employee/export4Fail") +// @Produces(MediaType.APPLICATION_JSON) +// public String exportEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { +// Map map = taxDeclareRecordWrapper.exportEmployee4Fail(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(map); +// } } diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index eb956d57b..f9b70f44f 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -40,7 +40,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; -import java.time.temporal.ChronoUnit; import java.util.*; import java.util.stream.Collectors; @@ -114,7 +113,7 @@ public class EmployeeDeclareWrapper extends Service { List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam(queryParam); employeeDeclarePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), employeeDeclarePOS); List convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS); - PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),EmployeeDeclareListDTO.class); pageInfo.setList(convert); pageInfo.setTotal(employeeDeclarePOS.size()); @@ -186,7 +185,7 @@ public class EmployeeDeclareWrapper extends Service { // 查询上个月报送的人员 Set employeeIds = SalaryEntityUtil.properties(poPageInfo.getList(), EmployeeDeclarePO::getEmployeeId); List preTaxCycleEmployeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds( - queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), queryParam.getTaxAgentId(), employeeIds); + SalaryDateUtil.plusMonths(queryParam.getTaxCycle(),-1), queryParam.getTaxAgentId(), employeeIds); // 获取修改了哪些字段 Map> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares); for (EmployeeDeclareListDTO employeeDeclareListDTO : (List) dtoPageInfo.getList()) { diff --git a/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java index 63c136151..08674beb1 100644 --- a/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java @@ -3,10 +3,7 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; -import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; -import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnListDTO; -import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; -import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnResultDTO; +import com.engine.salary.entity.taxagent.dto.*; import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; @@ -42,16 +39,17 @@ import java.util.stream.Collectors; public class TaxAgentTaxReturnWrapper extends Service { private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { - return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class,user); + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); } private TaxAgentService getTaxAgentService(User user) { - return ServiceUtil.getService(TaxAgentServiceImpl.class,user); + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { - return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class,user); + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); } + /** * 请求类型:1.保存并验证 2.仅保存 */ @@ -84,7 +82,7 @@ public class TaxAgentTaxReturnWrapper extends Service { } // 查询个税扣缴义务人名称 TaxAgentPO agentPO = getTaxAgentService(user).getById(taxAgentId); - SalaryAssert.notNull(agentPO, SalaryI18nUtil.getI18nLabel( 100545, "个税扣缴义务人不存在")); + SalaryAssert.notNull(agentPO, SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); formDTO.setName(agentPO.getName()); return formDTO; } @@ -118,24 +116,12 @@ public class TaxAgentTaxReturnWrapper extends Service { } } - private TaxAgentTaxReturnResultDTO buildResultForm(TaxAgentTaxReturnCheckDTO resultDTO, TaxAgentTaxReturnResultDTO result) { -// TaxAgentTaxReturnCheckFormDTO checkDTO = resultDTO.getRecords().get(0); -// WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxAgentTaxReturnCheckFormDTO.class, checkDTO); -// // 如果不是分部门备案,隐藏 -// if (SalaryOnOffEnum.OFF.getValue().equals(checkDTO.getDivideFiling().getValue())) { -// weaForm.getLayout().forEach(e -> e.forEach(layout -> layout.setHide("departmentCode".equals(layout.getId()) || "departmentName".equals(layout.getId())))); -// } -// weaForm.getItems().forEach((k, v) -> { -// if (NEED_CUSTOM_ITEMS.contains(k)) { -// Map otherParams = new HashMap<>(2); -// otherParams.put("showCount", true); -// otherParams.put("autoTrim", true); -// otherParams.put("placeholder", SalaryI18nUtil.getI18nLabel( 85987, "请输入")); -// v.setOtherParams(otherParams); -// } -// }); -// return WeaResult.success(result.setForm(weaForm).setCompType(COMP_TYPE[0])); - return null; + private Map buildResultForm(TaxAgentTaxReturnCheckDTO resultDTO, TaxAgentTaxReturnResultDTO result) { + TaxAgentTaxReturnCheckFormDTO checkDTO = resultDTO.getRecords().get(0); + Map map = new HashMap<>(); + map.put("TaxAgentTaxReturnCheckFormDTO",checkDTO); + map.put("TaxAgentTaxReturnResultDTO",result); + return map; } diff --git a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java index 38670737a..aa39752db 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -134,12 +134,9 @@ public class TaxDeclarationWrapper extends Service { if (Objects.isNull(taxDeclaration)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); } - //日期转换 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth()); // 查询个税扣缴义务人 TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId()); - return TaxDeclarationInfoDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); + return TaxDeclarationInfoDTO.builder().salaryMonth(taxDeclaration.getSalaryMonth()).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); } /** diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 39f67ef2e..4dcae03d7 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -129,7 +129,7 @@ public class TaxDeclareRecordWrapper extends Service { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看")); } // 查询个税申报表详情 - PageInfo page = taxDeclarationValueService.listPageByTaxDeclarationIds(Collections.singleton(queryParam.getTaxDeclarationId())); + PageInfo page = taxDeclarationValueService.listPageByTaxDeclarationIds(queryParam,Collections.singleton(queryParam.getTaxDeclarationId())); TaxDeclarationValueListDTO taxDeclarationValueListDTO = taxDeclarationValueService.convert2List(taxDeclaration, page.getList()); PageInfo> dtoPage = new PageInfo(); dtoPage.setList(taxDeclarationValueListDTO.getData()); @@ -166,11 +166,10 @@ public class TaxDeclareRecordWrapper extends Service { // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId()); // 查询申报失败的数据 - PageInfo taxDeclareFailPOPageInfo = taxDeclareFailService.listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); - List list = taxDeclareFailPOPageInfo.getList(); + List taxDeclareFailPOPageInfo = taxDeclareFailService.listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 转换成dto PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), FailEmployeeListDTO.class); - dtoPage.setList(taxDeclareFailService.convert2FailEmployeeList(taxDeclareRecord, list)); + dtoPage.setList(taxDeclareFailService.convert2FailEmployeeList(taxDeclareRecord, taxDeclareFailPOPageInfo)); // 转成前端所需的格式 return dtoPage; } @@ -249,14 +248,14 @@ public class TaxDeclareRecordWrapper extends Service { * @param id * @return */ - public List getTaxDeclarationTab(Long id, Long employeeId) { + public List getTaxDeclarationTab(Long id) { // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id); // 查询个税申报记录下的个税申报表 List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); taxDeclarations = taxDeclarations.stream() - .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), employeeId)) + .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), (long)user.getUID())) .collect(Collectors.toList()); Map taxDeclarationMap = SalaryEntityUtil.convert2Map(taxDeclarations, TaxDeclarationPO::getIncomeCategory); List tabs = Lists.newArrayList(); @@ -409,7 +408,7 @@ public class TaxDeclareRecordWrapper extends Service { * * @param id */ - public String getDeclareFeedback(Long id, Long employeeId) { + public String getDeclareFeedback(Long id) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(182680, "获取申报反馈")); @@ -439,7 +438,7 @@ public class TaxDeclareRecordWrapper extends Service { * * @param id */ - public String cancelDeclare(Long id, Long employeeId) { + public String cancelDeclare(Long id) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(158842, "作废申报")); @@ -469,7 +468,7 @@ public class TaxDeclareRecordWrapper extends Service { * * @param id */ - public String getCancelFeedback(Long id, Long employeeId) { + public String getCancelFeedback(Long id) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(182681, "获取作废申报反馈")); @@ -498,10 +497,9 @@ public class TaxDeclareRecordWrapper extends Service { * 更正申报 * * @param id - * @param employeeId * @return */ - public String updateDeclare(Long id, Long employeeId) { + public String updateDeclare(Long id) { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); From 090b1007845ae726df596f807f1690c056741c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 14 Aug 2023 20:29:19 +0800 Subject: [PATCH 012/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308080603.sql | 4 +- resource/sqlupgrade/GS/sql202308080603.sql | 51 +++++ resource/sqlupgrade/JC/sql202308080603.sql | 4 +- resource/sqlupgrade/Mysql/sql202308080603.sql | 4 +- .../sqlupgrade/Oracle/sql202308080603.sql | 4 +- resource/sqlupgrade/PG/sql202308080603.sql | 4 +- .../sqlupgrade/SQLServer/sql202308080603.sql | 4 +- resource/sqlupgrade/ST/sql202308080603.sql | 4 +- .../salary/web/TaxDeclarationController.java | 195 +++++++++++------- .../wrapper/TaxDeclareRecordWrapper.java | 23 +-- 10 files changed, 200 insertions(+), 97 deletions(-) create mode 100644 resource/sqlupgrade/GS/sql202308080603.sql diff --git a/resource/sqlupgrade/DM/sql202308080603.sql b/resource/sqlupgrade/DM/sql202308080603.sql index 652e03173..3fa4e6655 100644 --- a/resource/sqlupgrade/DM/sql202308080603.sql +++ b/resource/sqlupgrade/DM/sql202308080603.sql @@ -7,7 +7,7 @@ create table hrsa_employee_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, request_id varchar2(100) ); / @@ -21,7 +21,7 @@ create table hrsa_employee_declare delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, employee_id number, employee_type number, employee_name varchar2(100), diff --git a/resource/sqlupgrade/GS/sql202308080603.sql b/resource/sqlupgrade/GS/sql202308080603.sql new file mode 100644 index 000000000..3fa4e6655 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308080603.sql b/resource/sqlupgrade/JC/sql202308080603.sql index 652e03173..3fa4e6655 100644 --- a/resource/sqlupgrade/JC/sql202308080603.sql +++ b/resource/sqlupgrade/JC/sql202308080603.sql @@ -7,7 +7,7 @@ create table hrsa_employee_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, request_id varchar2(100) ); / @@ -21,7 +21,7 @@ create table hrsa_employee_declare delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, employee_id number, employee_type number, employee_name varchar2(100), diff --git a/resource/sqlupgrade/Mysql/sql202308080603.sql b/resource/sqlupgrade/Mysql/sql202308080603.sql index 7e651187b..85c4d2db6 100644 --- a/resource/sqlupgrade/Mysql/sql202308080603.sql +++ b/resource/sqlupgrade/Mysql/sql202308080603.sql @@ -7,7 +7,7 @@ create table hrsa_employee_declare_record delete_type int default 0 comment 'Ƿɾ' , tenant_key varchar(10) comment '⻧KEY' , tax_agent_id bigint comment '˰۽' , - tax_cycle varchar(10) comment '˰' , + tax_cycle datetime comment '˰' , request_id varchar(100) comment 'Ӧ̵ϵͳrequestid' ) ; @@ -21,7 +21,7 @@ create table hrsa_employee_declare delete_type int default 0 comment 'Ƿɾ' , tenant_key varchar(10) comment '⻧KEY' , tax_agent_id bigint comment '˰۽ID' , - tax_cycle varchar(10) comment '˰' , + tax_cycle datetime comment '˰' , employee_id bigint comment 'Աid' , employee_type tinyint comment 'Ա' , employee_name varchar(100) comment '' , diff --git a/resource/sqlupgrade/Oracle/sql202308080603.sql b/resource/sqlupgrade/Oracle/sql202308080603.sql index c846543ba..d41df5b05 100644 --- a/resource/sqlupgrade/Oracle/sql202308080603.sql +++ b/resource/sqlupgrade/Oracle/sql202308080603.sql @@ -7,7 +7,7 @@ create table hrsa_employee_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, request_id varchar2(100) ) / @@ -21,7 +21,7 @@ create table hrsa_employee_declare delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, employee_id number, employee_type number, employee_name varchar2(100), diff --git a/resource/sqlupgrade/PG/sql202308080603.sql b/resource/sqlupgrade/PG/sql202308080603.sql index f5e88b1a1..e1bd1f70a 100644 --- a/resource/sqlupgrade/PG/sql202308080603.sql +++ b/resource/sqlupgrade/PG/sql202308080603.sql @@ -7,7 +7,7 @@ create table hrsa_employee_declare_record delete_type int default 0, tenant_key varchar(10), tax_agent_id bigint, - tax_cycle varchar(10), + tax_cycle timestamp, request_id varchar(100) ); / @@ -21,7 +21,7 @@ create table hrsa_employee_declare delete_type int default 0, tenant_key varchar(10), tax_agent_id bigint, - tax_cycle varchar(10), + tax_cycle timestamp, employee_id bigint, employee_type smallint, employee_name varchar(100), diff --git a/resource/sqlupgrade/SQLServer/sql202308080603.sql b/resource/sqlupgrade/SQLServer/sql202308080603.sql index 1438be357..2947c492a 100644 --- a/resource/sqlupgrade/SQLServer/sql202308080603.sql +++ b/resource/sqlupgrade/SQLServer/sql202308080603.sql @@ -7,7 +7,7 @@ create table hrsa_employee_declare_record delete_type int default 0, tenant_key nvarchar(10), tax_agent_id bigint, - tax_cycle nvarchar(10), + tax_cycle datetime, request_id nvarchar(100) ) GO @@ -21,7 +21,7 @@ create table hrsa_employee_declare delete_type int default 0, tenant_key nvarchar(10), tax_agent_id bigint, - tax_cycle nvarchar(10), + tax_cycle datetime, employee_id bigint, employee_type tinyint, employee_name nvarchar(100), diff --git a/resource/sqlupgrade/ST/sql202308080603.sql b/resource/sqlupgrade/ST/sql202308080603.sql index 652e03173..3fa4e6655 100644 --- a/resource/sqlupgrade/ST/sql202308080603.sql +++ b/resource/sqlupgrade/ST/sql202308080603.sql @@ -7,7 +7,7 @@ create table hrsa_employee_declare_record delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, request_id varchar2(100) ); / @@ -21,7 +21,7 @@ create table hrsa_employee_declare delete_type int default 0, tenant_key varchar2(10), tax_agent_id number, - tax_cycle varchar2(10), + tax_cycle date, employee_id number, employee_type number, employee_name varchar2(100), diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 2330fd003..11a7a7655 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -1,21 +1,22 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.entity.taxdeclaration.dto.*; +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationTabDTO; import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; import com.engine.salary.util.ResponseResult; -import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationDetailWrapper; import com.engine.salary.wrapper.TaxDeclarationWrapper; import com.engine.salary.wrapper.TaxDeclareRecordWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -24,14 +25,9 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.StreamingOutput; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.text.ParseException; -import java.time.LocalDate; import java.util.Collection; import java.util.List; +import java.util.Map; @Slf4j @@ -58,90 +54,147 @@ public class TaxDeclarationController { } - //个税申报表列表 +// //个税申报表列表 +// @POST +// @Path("/list") +// @Produces(MediaType.APPLICATION_JSON) +// public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException { +// User user = HrmUserVarify.getUser(request, response); +// queryParam.setFromSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr())); +// queryParam.setEndSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr())); +// return new ResponseResult>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam); +// } +// +// @POST +// @Path("/withDrawTaxDeclaration") +// @Produces(MediaType.APPLICATION_JSON) +// public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::withDrawTaxDeclaration, param.getTaxDeclarationId()); +// } +// +// +// //个税申报表表单 +// @GET +// @Path("/getForm") +// @Produces(MediaType.APPLICATION_JSON) +// public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getForm, id); +// } +// +// //个税申报表相关信息 +// @GET +// @Path("/getTaxDeclarationInfo") +// @Produces(MediaType.APPLICATION_JSON) +// public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getTaxDeclarationInfoById, taxDeclarationId); +// } +// +// //个税申报表生成 +// @POST +// @Path("/save") +// @Produces(MediaType.APPLICATION_JSON) +// public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { +// User user = HrmUserVarify.getUser(request, response); +// param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr())); +// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::save, param); +// } +// +// //个税申报表详情列表 +// @POST +// @Path("/detail/list") +// @Produces(MediaType.APPLICATION_JSON) +// public String listTaxDeclarationDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationDetailListQueryParam param) { +// User user = HrmUserVarify.getUser(request, response); +// param.setTaxDeclarationId(Long.parseLong(param.getTaxDeclarationIdStr())); +// return new ResponseResult(user).run(getTaxDeclarationDetailWrapper(user)::listPage, param); +// } +// +// //个税申报表相关信息 +// @GET +// @Path("/export") +// @Produces(MediaType.APPLICATION_OCTET_STREAM) +// public Response exportTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { +// try { +// User user = HrmUserVarify.getUser(request, response); +// XSSFWorkbook workbook = getTaxDeclarationExcelService(user).exportTaxDeclaration(taxDeclarationId); +// +// 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 queryParam 查询条件 + * @return + */ @POST @Path("/list") @Produces(MediaType.APPLICATION_JSON) - public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException { + public String listTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) { User user = HrmUserVarify.getUser(request, response); - queryParam.setFromSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr())); - queryParam.setEndSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr())); - return new ResponseResult>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::listPage, queryParam); } - @POST - @Path("/withDrawTaxDeclaration") - @Produces(MediaType.APPLICATION_JSON) - public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::withDrawTaxDeclaration, param.getTaxDeclarationId()); - } - - - //个税申报表表单 + /** + * 个税申报表表单 + * + * @param id 个税申报记录id + * @return + */ @GET @Path("/getForm") @Produces(MediaType.APPLICATION_JSON) - public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getForm, id); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getForm, id); } - //个税申报表相关信息 + /** + * 个税申报表相关信息 + * + * @param id 个税申报记录id + * @return + */ @GET @Path("/getTaxDeclarationInfo") @Produces(MediaType.APPLICATION_JSON) - public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { + public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getTaxDeclarationInfoById, taxDeclarationId); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, id); } - //个税申报表生成 - @POST + /** + * 个税申报表生成 + * + * @param saveParam 保存参数 + * @return + */ @Path("/save") - @Produces(MediaType.APPLICATION_JSON) - public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { - User user = HrmUserVarify.getUser(request, response); - param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr())); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::save, param); - } - - //个税申报表详情列表 @POST - @Path("/detail/list") @Produces(MediaType.APPLICATION_JSON) - public String listTaxDeclarationDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationDetailListQueryParam param) { + public String saveTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); - param.setTaxDeclarationId(Long.parseLong(param.getTaxDeclarationIdStr())); - return new ResponseResult(user).run(getTaxDeclarationDetailWrapper(user)::listPage, param); - } - - //个税申报表相关信息 - @GET - @Path("/export") - @Produces(MediaType.APPLICATION_OCTET_STREAM) - public Response exportTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { - try { - User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getTaxDeclarationExcelService(user).exportTaxDeclaration(taxDeclarationId); - - 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; - } + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::save, saveParam); } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 4dcae03d7..f361c78cb 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -209,19 +209,18 @@ public class TaxDeclareRecordWrapper extends Service { } } -// /** -// * 获取个税申报记录的表单 -// * -// * @param id -// * @param tenantKey -// * @return -// */ -// public WeaForm getForm(Long id) { + /** + * 获取个税申报记录的表单 + * + * @param id + * @return + */ + public Map getForm(Long id) { // TaxDeclareRecordFormDTO formDTO = new TaxDeclareRecordFormDTO(); // formDTO.setTaxAgentRange(TaxAgentRangeEnum.SELECT_TAX_AGENT); // // 判断当前是否开启了分权 -// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); -// Boolean isChief = taxAgentService.isChief(employeeId); +// Boolean openDevolution = taxAgentService.isOpenDevolution(); +// Boolean isChief = taxAgentService.isChief((long)user.getUID()); // // 转换成前端所需的数据格式 // WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclareRecordFormDTO.class, formDTO); // weaForm.getItems().forEach((k, v) -> { @@ -239,8 +238,8 @@ public class TaxDeclareRecordWrapper extends Service { // v.getOptions().remove(0); // } // }); -// return weaForm; -// } + return new HashMap(); + } /** * 获取个税申报记录下的个税申报表TAB From 81dae66ea2d7b21b0cc14135c4f826a2a0bb350f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 14 Aug 2023 21:03:40 +0800 Subject: [PATCH 013/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/TaxDeclarationSaveParam.java | 12 + .../impl/TaxDeclareRecordServiceImpl.java | 568 ++++++++---------- .../wrapper/TaxDeclareRecordWrapper.java | 162 ++--- 3 files changed, 334 insertions(+), 408 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java index 18b8c28c8..8e0f07d18 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java @@ -1,11 +1,13 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.time.YearMonth; +import java.util.List; /** * 生成个税申报表参数 @@ -36,6 +38,16 @@ public class TaxDeclarationSaveParam { */ private Long taxAgentId; + /** + * 个税扣缴义务人范围 + */ + private TaxAgentRangeEnum taxAgentRange; + + /** + * 个税扣缴义务人id + */ + private List taxAgentIds; + /** * 备注 */ diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 65e236f94..e7bc2f198 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1,6 +1,8 @@ package com.engine.salary.service.impl; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.YearMonthRange; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SzyhApiConstant; @@ -41,16 +43,19 @@ import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.service.*; import com.engine.salary.service.factory.TaxPaymentServiceFactory; import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; import weaver.general.Util; +import weaver.hrm.User; import java.math.BigDecimal; import java.time.YearMonth; @@ -68,42 +73,59 @@ import java.util.stream.Collectors; public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRecordService { - private TaxDeclareRecordMapper taxDeclareRecordMapper; - - private TaxDeclarationService taxDeclarationService; - - private TaxDeclarationValueService taxDeclarationValueService; - - private EmployeeDeclareService employeeDeclareService; - - private TaxAgentTaxReturnService taxAgentTaxReturnService; - - private TaxAgentService taxAgentService; - - private TaxDeclarationApiConfigService taxDeclarationApiConfigService; - - private AddUpSituationService addUpSituationService; - - private TaxDeclarationApiBillingService taxDeclarationApiBillingService; - - private TaxDeclareEmployeeService taxDeclareEmployeeService; - - private TaxDeclareFailService taxDeclareFailService; - - private SalaryAcctRecordService salaryAcctRecordService; + private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); + } + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + private AddUpSituationService getAddUpSituationService(User user) { + return ServiceUtil.getService(AddUpSituationServiceImpl.class, user); + } + private TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { + return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); + } + private TaxDeclareFailService getTaxDeclareFailService(User user) { + return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); + } + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } private SalaryAcctTaxAgentService salaryAcctTaxAgentService; - private SalaryAcctEmployeeService salaryAcctEmployeeService; - - private SalaryAcctResultService salaryAcctResultValueService; - - private SalaryItemService salaryItemService; - + private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { + return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); + } + private SalaryAcctResultService getSalaryAcctResultService(User user) { + return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); + } + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } private SalarySobTaxReportRuleService salarySobTaxReportRuleService; - private TaxReportColumnService taxReportColumnService; - + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } private SalarySobAddUpRuleService salarySobAddUpRuleService; private TaxPaymentServiceFactory taxPaymentServiceFactory; @@ -112,12 +134,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe @Override public TaxDeclareRecordPO getById(Long id) { - return taxDeclareRecordMapper.getById(id); + return getTaxDeclareRecordMapper().getById(id); } @Override public List listByIds(Collection ids) { - return taxDeclareRecordMapper.listSome(TaxDeclareRecordPO.builder().ids(ids).build()); + return getTaxDeclareRecordMapper().listSome(TaxDeclareRecordPO.builder().ids(ids).build()); } @Override @@ -129,7 +151,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (Objects.nonNull(taxCycleRange.getEndMonth())) { build.setEndDate(taxCycleRange.getEndMonth()); } - return taxDeclareRecordMapper.listSome(build); + return getTaxDeclareRecordMapper().listSome(build); } @Override @@ -137,7 +159,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { return Collections.emptyList(); } - return taxDeclareRecordMapper.listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).taxCycle(taxCycle).build()); + return getTaxDeclareRecordMapper().listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).taxCycle(taxCycle).build()); } @Override @@ -145,7 +167,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (Objects.isNull(salaryMonth) || CollectionUtils.isEmpty(taxAgentIds)) { return Collections.emptyList(); } - return taxDeclareRecordMapper.listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).salaryMonth(salaryMonth).build()); + return getTaxDeclareRecordMapper().listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).salaryMonth(salaryMonth).build()); } @Override @@ -161,20 +183,20 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } List taxAgentIds = new ArrayList<>(); if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { - List taxAgents = taxAgentService.list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build()); + List taxAgents = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build()); if (CollectionUtils.isEmpty(taxAgents)) { return pageInfo; } taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); } // 判断是否开启了分权 - Boolean openDevolution = taxAgentService.isOpenDevolution(); + Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); // 判断是否是总管理员 - Boolean isChief = taxAgentService.isChief((long) user.getUID()); + Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); // 可见范围内的个税扣缴义务人 Collection taxAgents = Lists.newArrayList(); if (openDevolution && !isChief) { - taxAgents = taxAgentService.listAllTaxAgentsAsAdmin((long) user.getUID()); + taxAgents = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); if (CollectionUtils.isEmpty(taxAgents)) { return pageInfo; } @@ -182,107 +204,83 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxAgentIds = taxAgentIds.stream().filter(taxAgentDevolution::contains).collect(Collectors.toList()); } build.setTaxAgentIds(taxAgentIds); - List taxDeclareRecordPOS = taxDeclareRecordMapper.listSome(build); - return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), - taxDeclareRecordPOS, TaxDeclareRecordPO.class); + List taxDeclareRecordPOS = getTaxDeclareRecordMapper().listSome(build); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclareRecordPOS, TaxDeclareRecordPO.class); } @Override public void save(TaxDeclarationSaveParam saveParam) { -// Date now = new Date(); -// Set needDeleteTaxDeclareRecordIds = Sets.newHashSet(); -// List newTaxDeclareRecords = Lists.newArrayList(); -// List newTaxDeclarations = Lists.newArrayList(); -// List newTaxDeclarationValues = Lists.newArrayList(); -// List newAddUpSituations = Lists.newArrayList(); -// // 根据个税扣缴义务人范围查询个税扣缴义务人 -// List taxAgents = queryByTaxAgentRange(saveParam); -// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); -// // 查询薪资所属月下的薪资核算记录,并按照权限过滤 -// LocalDateRange salaryMonthRange = new LocalDateRange() -// .setFromDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))) -// .setEndDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); -// List salaryAcctRecords = salaryAcctRecordService.listBySalaryMonth(salaryMonthRange); -// // 查询薪资核算记录关联的个税扣缴义务人 -// List salaryAcctTaxAgents = salaryAcctRecordService.listBySalaryAcctRecordIds( -// SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId)); -// // 按照saveParam中的个税扣缴义务人范围过滤 -// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); -// salaryAcctTaxAgents = salaryAcctTaxAgents.stream() -// .filter(e -> taxAgentIds.contains(e.getTaxAgentId())) -// .collect(Collectors.toList()); -// Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getSalaryAcctRecordId); -// salaryAcctRecords = salaryAcctRecords.stream() -// .filter(e -> salaryAcctRecordIds.contains(e.getId())) -// .collect(Collectors.toList()); -// // 校验是否可以生成个税申报表 -// // 返回目前已经生成的个税申报表 -// List taxDeclareRecords = checkBeforeSave(saveParam, taxAgentNameMap, salaryAcctRecords, salaryAcctTaxAgents); -// Map taxDeclareRecordMap = SalaryEntityUtil.convert2Map(taxDeclareRecords, e -> e.getTaxCycle() + "-" + e.getTaxAgentId()); -// // 查询薪资核算人员 -// List salaryAcctEmployees = salaryAcctEmployeeService.listByRecordIdsAndEmpIdAndTaxAgentId(salaryAcctRecordIds, null, taxAgents.get(0).getId()); -// // 薪资核算人员按照税款所属期聚合分类 -// Map> taxCycleKeyEmployeeMap = SalaryEntityUtil.group2Map( -// salaryAcctEmployees, SalaryAcctEmployeePO::getTaxCycle); -// for (Map.Entry> taxCycleEntry : taxCycleKeyEmployeeMap.entrySet()) { -// // 薪资核算人员按照个税扣缴义务人id聚合分类 -// Map> taxAgentIdKeyEmployeeMap = SalaryEntityUtil.group2Map( -// taxCycleEntry.getValue(), SalaryAcctEmployeePO::getTaxAgentId); -// for (Map.Entry> taxAgentIdEntry : taxAgentIdKeyEmployeeMap.entrySet()) { -// TaxDeclareRecordPO oldTaxDeclareRecord = taxDeclareRecordMap.get(taxCycleEntry.getKey() + "-" + taxAgentIdEntry.getKey()); -// // 如果已经生成了个税申报表,并且个税申报表已经申报过了,就跳过 -// if (oldTaxDeclareRecord != null) { -// if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) -// && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))) { -// continue; -// } -// needDeleteTaxDeclareRecordIds.add(oldTaxDeclareRecord.getId()); -// } -// TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO() -// .setId(IdGenerator.generate()) -// .setTaxAgentId(taxAgentIdEntry.getKey()) -// .setSalaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))) -// .setTaxCycle(taxCycleEntry.getKey()) -// .setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) -// .setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()) -// .setRemark(saveParam.getDescription()) -// .setCreator((long)user.getUID()) -// .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) -// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .setCreateTime(now) -// .setUpdateTime(now); -// newTaxDeclareRecords.add(taxDeclareRecord); -// // 生成个税申报表 -// TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue()); -// newTaxDeclarations.addAll(taxDeclarationResult.getTaxDeclarations()); -// newTaxDeclarationValues.addAll(taxDeclarationResult.getTaxDeclarationValues()); -// newAddUpSituations.addAll(taxDeclarationResult.getAddUpSituations()); -// } -// } -// -// // 删除原来生成的个税申报记录、个税申报表、个税申报表明细 -// deleteByIds(needDeleteTaxDeclareRecordIds); -// // 保存个税申报记录 -// if (CollectionUtils.isNotEmpty(newTaxDeclareRecords)) { -// saveBatch(newTaxDeclareRecords); -// } -// // 保存个税申报表 -// if (CollectionUtils.isNotEmpty(newTaxDeclarations)) { -// taxDeclarationService.saveBatch(newTaxDeclarations); -// } -// // 保存个税申报表明细 -// if (CollectionUtils.isNotEmpty(newTaxDeclarationValues)) { -// taxDeclarationValueService.batchSave(newTaxDeclarationValues); -// } -// // 保存累计情况 -// if (CollectionUtils.isNotEmpty(newAddUpSituations)) { -// Map> addUpSituationMap = SalaryEntityUtil.group2Map(newAddUpSituations, e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); -// for (Map.Entry> entry : addUpSituationMap.entrySet()) { -// addUpSituationService.deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), -// SalaryEntityUtil.properties(entry.getValue(), AddUpSituationPO::getTaxAgentId)); -// addUpSituationService.saveBatch(entry.getValue()); -// } -// } + Date now = new Date(); + Set needDeleteTaxDeclareRecordIds = Sets.newHashSet(); + List newTaxDeclareRecords = Lists.newArrayList(); + List newTaxDeclarations = Lists.newArrayList(); + List newTaxDeclarationValues = Lists.newArrayList(); + List newAddUpSituations = Lists.newArrayList(); + // 根据个税扣缴义务人范围查询个税扣缴义务人 + Collection taxAgents = queryByTaxAgentRange(saveParam); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + // 查询薪资所属月下的薪资核算记录,并按照权限过滤 + LocalDateRange salaryMonthRange = new LocalDateRange().setFromDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))).setEndDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); + List salaryAcctRecords = getSalaryAcctRecordService(user).listBySalaryMonth(salaryMonthRange); + // 查询薪资核算记录关联的个税扣缴义务人 + List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId)); + // 按照saveParam中的个税扣缴义务人范围过滤 + Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); + salaryAcctTaxAgents = salaryAcctTaxAgents.stream().filter(e -> taxAgentIds.contains(e.getTaxAgentId())).collect(Collectors.toList()); + Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getSalaryAcctRecordId); + salaryAcctRecords = salaryAcctRecords.stream().filter(e -> salaryAcctRecordIds.contains(e.getId())).collect(Collectors.toList()); + // 校验是否可以生成个税申报表 + // 返回目前已经生成的个税申报表 + List taxDeclareRecords = checkBeforeSave(saveParam, taxAgentNameMap, salaryAcctRecords, salaryAcctTaxAgents); + Map taxDeclareRecordMap = SalaryEntityUtil.convert2Map(taxDeclareRecords, e -> e.getTaxCycle() + "-" + e.getTaxAgentId()); + // 查询薪资核算人员 + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByRecordIdsAndEmpIdAndTaxAgentId(salaryAcctRecordIds, null, taxAgents.stream().findFirst().orElse(new TaxAgentPO()).getId()); + // 薪资核算人员按照税款所属期聚合分类 + Map> taxCycleKeyEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getTaxCycle); + for (Map.Entry> taxCycleEntry : taxCycleKeyEmployeeMap.entrySet()) { + // 薪资核算人员按照个税扣缴义务人id聚合分类 + Map> taxAgentIdKeyEmployeeMap = SalaryEntityUtil.group2Map(taxCycleEntry.getValue(), SalaryAcctEmployeePO::getTaxAgentId); + for (Map.Entry> taxAgentIdEntry : taxAgentIdKeyEmployeeMap.entrySet()) { + TaxDeclareRecordPO oldTaxDeclareRecord = taxDeclareRecordMap.get(taxCycleEntry.getKey() + "-" + taxAgentIdEntry.getKey()); + // 如果已经生成了个税申报表,并且个税申报表已经申报过了,就跳过 + if (oldTaxDeclareRecord != null) { + if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))) { + continue; + } + needDeleteTaxDeclareRecordIds.add(oldTaxDeclareRecord.getId()); + } + TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now); + newTaxDeclareRecords.add(taxDeclareRecord); + // 生成个税申报表 + TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue()); + newTaxDeclarations.addAll(taxDeclarationResult.getTaxDeclarations()); + newTaxDeclarationValues.addAll(taxDeclarationResult.getTaxDeclarationValues()); + newAddUpSituations.addAll(taxDeclarationResult.getAddUpSituations()); + } + } + + // 删除原来生成的个税申报记录、个税申报表、个税申报表明细 + deleteByIds(needDeleteTaxDeclareRecordIds); + // 保存个税申报记录 + if (CollectionUtils.isNotEmpty(newTaxDeclareRecords)) { + getTaxDeclareRecordMapper().batchInsert(newTaxDeclareRecords); + } + // 保存个税申报表 + if (CollectionUtils.isNotEmpty(newTaxDeclarations)) { + getTaxDeclarationService(user).saveBatch(newTaxDeclarations); + } + // 保存个税申报表明细 + if (CollectionUtils.isNotEmpty(newTaxDeclarationValues)) { + getTaxDeclarationValueService(user).batchSave(newTaxDeclarationValues); + } + // 保存累计情况 + if (CollectionUtils.isNotEmpty(newAddUpSituations)) { + Map> addUpSituationMap = SalaryEntityUtil.group2Map(newAddUpSituations, e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); + for (Map.Entry> entry : addUpSituationMap.entrySet()) { + getAddUpSituationService(user).deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), SalaryEntityUtil.properties(entry.getValue(), AddUpSituation::getTaxAgentId)); + getAddUpSituationService(user).batchSave(entry.getValue()); + } + } // // 记录日志 // for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { // LoggerContext loggerContext = new LoggerContext<>(); @@ -307,49 +305,41 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (Objects.isNull(taxDeclareRecord)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); } - if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) - && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) { + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182700, "对不起,只有未申报状态下可以刷新数据")); } // 查询税款所属期下的薪资核算人员 - SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder() - .taxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())) - .taxCycle(taxDeclareRecord.getTaxCycle()) - .build(); - List salaryAcctEmployees = salaryAcctEmployeeService.listByParam(salaryAcctEmployeeQueryParam); + SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder().taxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())).taxCycle(taxDeclareRecord.getTaxCycle()).build(); + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByParam(salaryAcctEmployeeQueryParam); // 查询薪资核算记录 Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); - List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds); + List salaryAcctRecords = getSalaryAcctRecordService(user).listByIds(salaryAcctRecordIds); // 如果存在未归档的薪资核算记录,不允许生成个税申报表 - boolean notArchived = salaryAcctRecords.stream() - .anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); + boolean notArchived = salaryAcctRecords.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报") - .replace("{0}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getSalaryMonth()))); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报").replace("{0}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getSalaryMonth()))); } TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, salaryAcctEmployees); // 更新个税申报记录 taxDeclareRecord.setDisplayUpdateIcon(0).setUpdateTime(new Date()); - taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 删除原来的申报表,保存新生成的 - taxDeclarationService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + getTaxDeclarationService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarations())) { - taxDeclarationService.saveBatch(taxDeclarationResult.getTaxDeclarations()); + getTaxDeclarationService(user).saveBatch(taxDeclarationResult.getTaxDeclarations()); } // 删除原来的申报表明细,保存新生成的 - taxDeclarationValueService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + getTaxDeclarationValueService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarationValues())) { - taxDeclarationValueService.batchSave(taxDeclarationResult.getTaxDeclarationValues()); + getTaxDeclarationValueService(user).batchSave(taxDeclarationResult.getTaxDeclarationValues()); } // 保存累计情况 if (CollectionUtils.isNotEmpty(taxDeclarationResult.getAddUpSituations())) { - Map> addUpSituationMap = SalaryEntityUtil.group2Map(taxDeclarationResult.getAddUpSituations(), - e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); + Map> addUpSituationMap = SalaryEntityUtil.group2Map(taxDeclarationResult.getAddUpSituations(), e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); for (Map.Entry> entry : addUpSituationMap.entrySet()) { - addUpSituationService.deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), - SalaryEntityUtil.properties(entry.getValue(), AddUpSituation::getTaxAgentId)); - addUpSituationService.batchSave(entry.getValue()); + getAddUpSituationService(user).deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), SalaryEntityUtil.properties(entry.getValue(), AddUpSituation::getTaxAgentId)); + getAddUpSituationService(user).batchSave(entry.getValue()); } } } @@ -360,77 +350,42 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List taxDeclarationValues = Lists.newArrayList(); List addUpSituations = Lists.newArrayList(); // 查询薪资项目 - List salaryItems = salaryItemService.listAll(); + List salaryItems = getSalaryItemService(user).listAll(); // 查询个税申报表列 - List taxReportColumns = taxReportColumnService.listAll(); + List taxReportColumns = getTaxReportColumnService(user).listAll(); Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); // 查询薪资核算记录 Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); - List salaryAcctRecords = salaryAcctRecordService.listByIds(salaryAcctRecordIds); + List salaryAcctRecords = getSalaryAcctRecordService(user).listByIds(salaryAcctRecordIds); Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId); // 查询薪资核算结果 Set salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getId); - List salaryAcctResultValues = salaryAcctResultValueService.listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); + List salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); // 查询薪资账套的累计字段对应关系 Set salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalarySobId); List salarySobAddUpRules = salarySobAddUpRuleService.listBySalarySobIds(salarySobIds); - Map salarySobAddUpRuleMap = SalaryEntityUtil.convert2Map(salarySobAddUpRules, - e -> e.getSalarySobId() + "-" + e.getAddUpColumnDataIndex()); + Map salarySobAddUpRuleMap = SalaryEntityUtil.convert2Map(salarySobAddUpRules, e -> e.getSalarySobId() + "-" + e.getAddUpColumnDataIndex()); // 查询薪资账套的个税申报表对应规则 List salarySobTaxReportRules = salarySobTaxReportRuleService.listBySalarySobIds(salarySobIds); Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, e -> e.getSalarySobId() + "-" + e.getReportColumnDataIndex()); // 薪资核算结果按照薪资核算人员id聚合分类 - Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map( - salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); // 薪资核算人员按照所得项目聚合分类 - Map> incomeCategoryKeyEmployeeMap = SalaryEntityUtil.group2Map( - salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); + Map> incomeCategoryKeyEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); for (Map.Entry> incomeCategoryEntry : incomeCategoryKeyEmployeeMap.entrySet()) { - List controlViewSalaryAcctRecords = incomeCategoryEntry.getValue().stream() - .map(e -> salaryAcctRecordMap.get(e.getSalaryAcctRecordId())) - .distinct() - .filter(e -> Objects.equals(e.getControlView(), 1)) - .collect(Collectors.toList()); - TaxDeclarationPO taxDeclaration = TaxDeclarationPO.builder() - .id(IdGenerator.generate()) - .taxDeclareRecordId(taxDeclareRecord.getId()) - .incomeCategory(Util.getIntValue(incomeCategoryEntry.getKey())) - .taxAgentId(taxDeclareRecord.getTaxAgentId()) - .salaryMonth(taxDeclareRecord.getSalaryMonth()) - .taxCycle(taxDeclareRecord.getTaxCycle()) - .description(taxDeclareRecord.getRemark()) - .controlView(CollectionUtils.isEmpty(controlViewSalaryAcctRecords) ? 0 : 1) - .creator((long) user.getUID()) - .createTime(now) - .updateTime(now) - .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); + List controlViewSalaryAcctRecords = incomeCategoryEntry.getValue().stream().map(e -> salaryAcctRecordMap.get(e.getSalaryAcctRecordId())).distinct().filter(e -> Objects.equals(e.getControlView(), 1)).collect(Collectors.toList()); + TaxDeclarationPO taxDeclaration = TaxDeclarationPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecord.getId()).incomeCategory(Util.getIntValue(incomeCategoryEntry.getKey())).taxAgentId(taxDeclareRecord.getTaxAgentId()).salaryMonth(taxDeclareRecord.getSalaryMonth()).taxCycle(taxDeclareRecord.getTaxCycle()).description(taxDeclareRecord.getRemark()).controlView(CollectionUtils.isEmpty(controlViewSalaryAcctRecords) ? 0 : 1).creator((long) user.getUID()).createTime(now).updateTime(now).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); taxDeclarations.add(taxDeclaration); // 薪资核算结果 Set salaryAcctEmployeeIdSet = SalaryEntityUtil.properties(incomeCategoryEntry.getValue(), SalaryAcctEmployeePO::getId); - List> resultValues = salaryAcctEmployeeIdSet.stream() - .map(salaryAcctResultValueMap::get) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - TaxDeclareContext taxDeclareContext = new TaxDeclareContext() - .setSalaryAcctRecordMap(salaryAcctRecordMap) - .setSalaryAcctEmployees(incomeCategoryEntry.getValue()) - .setSalaryAcctResultValues(salaryAcctResultValues) - .setTaxDeclaration(taxDeclaration) - .setSalarySobTaxReportRuleMap(salarySobTaxReportRuleMap) - .setSalarySobAddUpRuleMap(salarySobAddUpRuleMap) - .setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())) - .setSalaryItems(salaryItems); + List> resultValues = salaryAcctEmployeeIdSet.stream().map(salaryAcctResultValueMap::get).filter(Objects::nonNull).collect(Collectors.toList()); + TaxDeclareContext taxDeclareContext = new TaxDeclareContext().setSalaryAcctRecordMap(salaryAcctRecordMap).setSalaryAcctEmployees(incomeCategoryEntry.getValue()).setSalaryAcctResultValues(salaryAcctResultValues).setTaxDeclaration(taxDeclaration).setSalarySobTaxReportRuleMap(salarySobTaxReportRuleMap).setSalarySobAddUpRuleMap(salarySobAddUpRuleMap).setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())).setSalaryItems(salaryItems); TaxDeclarationStrategy taxDeclarationStrategy = new TaxDeclarationCommon(); TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext, (long) user.getUID()); taxDeclarationValues.addAll(generateResult.getTaxDeclarationValues()); addUpSituations.addAll(generateResult.getAddUpSituations()); } - return new TaxDeclarationResult() - .setTaxDeclarations(taxDeclarations) - .setTaxDeclarationValues(taxDeclarationValues) - .setAddUpSituations(addUpSituations); + return new TaxDeclarationResult().setTaxDeclarations(taxDeclarations).setTaxDeclarationValues(taxDeclarationValues).setAddUpSituations(addUpSituations); } /** @@ -441,73 +396,59 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe * @param salaryAcctRecords * @param salaryAcctTaxAgents */ - private List checkBeforeSave(TaxDeclarationSaveParam saveParam, - Map taxAgentNameMap, - List salaryAcctRecords, - List salaryAcctTaxAgents) { + private List checkBeforeSave(TaxDeclarationSaveParam saveParam, Map taxAgentNameMap, List salaryAcctRecords, List salaryAcctTaxAgents) { List resultList = Lists.newArrayList(); // 如果存在未归档的薪资核算记录,不允许生成个税申报表 - boolean notArchived = salaryAcctRecords.stream() - .anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); + boolean notArchived = salaryAcctRecords.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报") - .replace("{0}", saveParam.getSalaryMonth().toString())); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报").replace("{0}", saveParam.getSalaryMonth().toString())); } // 查询已归档的薪资核算记录 - List archivedSalaryAcctRecords = salaryAcctRecords.stream() - .filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue())) - .collect(Collectors.toList()); + List archivedSalaryAcctRecords = salaryAcctRecords.stream().filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue())).collect(Collectors.toList()); // 无已归档的薪资核算记录,不允许生成个税申报表 if (CollectionUtils.isEmpty(archivedSalaryAcctRecords)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177860, "{0}无可申报数据") - .replace("{0}", saveParam.getSalaryMonth().toString())); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177860, "{0}无可申报数据").replace("{0}", saveParam.getSalaryMonth().toString())); } // 查询已归档的薪资核算记录是否已经生成过个税申报表 Map> taxCycleKeySalaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle); for (Map.Entry> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) { Set archivedTaxAgentIds = SalaryEntityUtil.properties(taxCycleEntry.getValue(), SalaryAcctTaxAgentPO::getTaxAgentId); List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)), archivedTaxAgentIds); - TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream() - .filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) - && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) - || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))) - .findAny() - .orElse(null); + TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream().filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null); // 已经申报成功了的个税申报表的个税扣缴义务人不允许重新生成 if (Objects.nonNull(declareSuccessTaxDeclareRecord)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成") - .replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(declareSuccessTaxDeclareRecord.getTaxCycle()))); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成").replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())).replace("{1}", SalaryDateUtil.getFormatYearMonth(declareSuccessTaxDeclareRecord.getTaxCycle()))); } resultList.addAll(taxDeclareRecords); } return resultList; } - // /** -// * 根据个税扣缴义务人范围查询个税扣缴义务人 -// * -// * @param saveParam -// * @return -// */ -// private List queryByTaxAgentRange(TaxDeclarationSaveParam saveParam) { -// List taxAgents; -// if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ALL_TAX_AGENT) { -// // 判断当前是否开启了分权 -// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); -// // 判断是否是总管理员 -// Boolean isChief = taxAgentService.isChief(employeeId); -// if (openDevolution && !isChief) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160523, "对不起,您不是薪酬模块的总管理员,不具备生成所有个税扣缴义务人的权限")); -// } -// taxAgents = taxAgentService.listAll(tenantKey); -// } else if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ADMIN_TAX_AGENT) { -// taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId); -// } else { -// taxAgents = taxAgentService.listByIds(saveParam.getTaxAgentIds()); -// } -// return taxAgents; -// } + /** + * 根据个税扣缴义务人范围查询个税扣缴义务人 + * + * @param saveParam + * @return + */ + private Collection queryByTaxAgentRange(TaxDeclarationSaveParam saveParam) { + Collection taxAgents; + if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ALL_TAX_AGENT) { + // 判断当前是否开启了分权 + Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); + // 判断是否是总管理员 + Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); + if (openDevolution && !isChief) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160523, "对不起,您不是薪酬模块的总管理员,不具备生成所有个税扣缴义务人的权限")); + } + taxAgents = getTaxAgentService(user).listAll(); + } else if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ADMIN_TAX_AGENT) { + taxAgents = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + } else { + taxAgents = getTaxAgentService(user).listByIds(saveParam.getTaxAgentIds()); + } + return taxAgents; + } + @Override public void updateIcon(Long id, Integer displayIcon) { TaxDeclareRecordPO taxDeclareRecord = getById(id); @@ -516,7 +457,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } taxDeclareRecord.setDisplayUpdateIcon(displayIcon); taxDeclareRecord.setUpdateTime(new Date()); - taxDeclareRecordMapper.update(taxDeclareRecord); + getTaxDeclareRecordMapper().update(taxDeclareRecord); } @Override @@ -531,7 +472,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Date now = new Date(); taxDeclareRecords.forEach(e -> { e.setDisplayUpdateIcon(1).setUpdateTime(now); - taxDeclareRecordMapper.update(e); + getTaxDeclareRecordMapper().update(e); }); } @@ -542,16 +483,16 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // return false; // } // // 判断是否开启了分权 -// Boolean openDevolution = taxAgentService.isOpenDevolution(tenantKey); +// Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(tenantKey); // // 判断是否是总管理员 -// Boolean isChief = taxAgentService.isChief(employeeId); +// Boolean isChief = getTaxAgentService(user).isChief(employeeId); // // 可见范围内的个税扣缴义务人 // List taxAgents = Lists.newArrayList(); // if (openDevolution) { // if (isChief) { -// taxAgents = taxAgentService.listAsChief(true, true); +// taxAgents = getTaxAgentService(user).listAsChief(true, true); // } else { -// taxAgents = taxAgentService.listAllTaxAgentsAsAdmin(employeeId); +// taxAgents = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); // } // if (CollectionUtils.isEmpty(taxAgents)) { // return false; @@ -572,25 +513,22 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (CollectionUtils.isEmpty(taxDeclareRecords)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160524, "个税申报表不存在或已被删除")); } - List cantDeleteTaxDeclareRecords = taxDeclareRecords.stream() - .filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) - && Objects.equals(e.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))) - .collect(Collectors.toList()); + List cantDeleteTaxDeclareRecords = taxDeclareRecords.stream().filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(e.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(cantDeleteTaxDeclareRecords)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177854, "个税申报表已经申报,无法删除")); } - taxDeclareRecordMapper.deleteByIds(ids); + getTaxDeclareRecordMapper().deleteByIds(ids); // 删除个税申报表 - taxDeclarationService.deleteByTaxDeclareRecordIds(ids); + getTaxDeclarationService(user).deleteByTaxDeclareRecordIds(ids); // 删除个税申报表明细 - taxDeclarationValueService.deleteByTaxDeclareRecordIds(ids); + getTaxDeclarationValueService(user).deleteByTaxDeclareRecordIds(ids); // 记录日志 // writeDeleteLog(taxDeclareRecords); } // private void writeDeleteLog(List taxDeclareRecords) { // // 记录日志 -// List taxAgents = taxAgentService.listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); +// List taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); // Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); // for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { // LoggerContext loggerContext = new LoggerContext<>(); @@ -617,37 +555,31 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } // 查询个税申报表 - List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); if (CollectionUtils.isEmpty(taxDeclarations)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据")); } - AbnormalEmployeeListQueryParam queryParam = new AbnormalEmployeeListQueryParam() - .setTaxDeclareRecordId(taxDeclareRecord.getId()) - .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) - .setTaxCycle(taxDeclareRecord.getTaxCycle()); + AbnormalEmployeeListQueryParam queryParam = new AbnormalEmployeeListQueryParam().setTaxDeclareRecordId(taxDeclareRecord.getId()).setTaxAgentId(taxDeclareRecord.getTaxAgentId()).setTaxCycle(taxDeclareRecord.getTaxCycle()); // 查询是否存在有未报送的人 - List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam); + List notDeclareTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); if (CollectionUtils.isNotEmpty(notDeclareTaxDeclareEmployees)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(162125, "存在有未报送的人,请先报送相关人员后再申报个税")); } // 查询是否存在没有申报数据的人 - List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam); + List noValueTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); if (CollectionUtils.isNotEmpty(noValueTaxDeclareEmployees)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160535, "存在没有申报数据的人,请重新核算这些人的薪资后再来申报个税")); } // 查询个税申报表的申报数据 Set taxDeclarationIds = SalaryEntityUtil.properties(taxDeclarations, TaxDeclarationPO::getId); - List taxDeclarationValues = taxDeclarationValueService.listByTaxDeclarationIds(taxDeclarationIds); + List taxDeclarationValues = getTaxDeclarationValueService(user).listByTaxDeclarationIds(taxDeclarationIds); // 查询本税款所属期内报送成功的人员 - List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), - taxDeclareRecord.getTaxAgentId()); - employeeDeclares = employeeDeclares.stream() - .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) - .collect(Collectors.toList()); + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); + employeeDeclares = employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())).collect(Collectors.toList()); TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); // 查询个税申报表的表头 - List taxReportColumns = taxReportColumnService.listAll(); + List taxReportColumns = getTaxReportColumnService(user).listAll(); // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 @@ -675,9 +607,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); taxDeclareRecord.setUpdateTime(new Date()); - taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 删除个税申报申报失败的数据 - taxDeclareFailService.deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 记录日志 // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -721,14 +653,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } // 查询报送的人员 - List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentId( - taxDeclareRecord.getTaxCycle(), - taxDeclareRecord.getTaxAgentId()); - Map employeeInfoMap = SalaryEntityUtil.convert2Map(employeeDeclares, - e -> e.getEmployeeName() + "-" + e.getCardNum()); + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); + Map employeeInfoMap = SalaryEntityUtil.convert2Map(employeeDeclares, e -> e.getEmployeeName() + "-" + e.getCardNum()); // 流量统计 - TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper - = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(taxDeclareRecord.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION); + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(taxDeclareRecord.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION); Date now = new Date(); List errorMsg = Lists.newArrayList(); @@ -745,19 +673,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe String employeeName = Util.null2String(detail.get(0)); String cardNum = Util.null2String(detail.get(2)); String incomeCategoryCode = Util.null2String(detail.get(4)); - TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder() - .id(IdGenerator.generate()) - .taxDeclareRecordId(taxDeclareRecord.getId()) - .employeeName(employeeName) - .cardNum(cardNum) - .incomeCategory(incomeCategoryCode) - .errorMsg(msg) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .creator((long) user.getUID()) - .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .createTime(now) - .updateTime(now) - .build(); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecord.getId()).employeeName(employeeName).cardNum(cardNum).incomeCategory(incomeCategoryCode).errorMsg(msg).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).creator((long) user.getUID()).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).createTime(now).updateTime(now).build(); taxDeclareFails.add(taxDeclareFailPO); // 流量使用记录 EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); @@ -790,8 +706,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setUpdateTime(new Date()); BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); BigDecimal payAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); - if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) - || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) { + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) { // 如果是已缴纳状态,则更新已缴纳金额,判断是否需要线下退税 if (purePaidAmount.compareTo(payAmount) > 0) { taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); @@ -808,10 +723,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); } // 更新个税申报记录 - taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 如果申报失败 if (CollectionUtils.isNotEmpty(taxDeclareFails)) { - taxDeclareFailService.saveBatch(taxDeclareFails); + getTaxDeclareFailService(user).saveBatch(taxDeclareFails); } // 更新流量使用记录 employeeInfoMap.forEach((key, value) -> { @@ -819,7 +734,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()); apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); }); - taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper); + getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); // 记录日志 // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -844,8 +759,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182701, "更正申报后不允许作废")); } // 只有申报成功,无需缴款/申报成功,未缴款的状态才能作废 - if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) - && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废")); } // 供应商信息 @@ -878,7 +792,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); taxDeclareRecord.setUpdateTime(new Date()); - taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // // 记录日志 // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -898,8 +812,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe public void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) - || StringUtils.isEmpty(taxDeclareRecord.getRequestId())) { + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(taxDeclareRecord.getRequestId())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156500, "请先点击「作废申报」后再来点击「申报反馈」按钮获取结果")); } // 供应商信息 @@ -917,24 +830,20 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(cancelDeclareFeedbackResponse.getHead().getMsg()); } // 作废是否成功 - CancelDeclareStatusEnum cancelDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue( - SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("fkztbj"), 10), CancelDeclareStatusEnum.class); + CancelDeclareStatusEnum cancelDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("fkztbj"), 10), CancelDeclareStatusEnum.class); if (cancelDeclareStatusEnum == CancelDeclareStatusEnum.CANCEL_FAIL) { String feedbackBody = Util.null2String(cancelDeclareFeedbackResponse.getBody().get("fknr")).replace("\\", ""); - List errorMsgList = JsonUtil.parseList(feedbackBody, Map.class).stream() - .map(e -> Util.null2String(e.get("msg"))) - .collect(Collectors.toList()); + List errorMsgList = JsonUtil.parseList(feedbackBody, Map.class).stream().map(e -> Util.null2String(e.get("msg"))).collect(Collectors.toList()); taxDeclarationRate.setStatus(false).setMsg(SalaryI18nUtil.getI18nLabel(156508, "作废失败:") + StringUtils.join(errorMsgList, ",")); } - TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue( - SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("sbztbj"), 1), TaxDeclareStatusEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("sbztbj"), 1), TaxDeclareStatusEnum.class); if (taxDeclareStatusEnum == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); taxDeclareRecord.setRequestId(""); taxDeclareRecord.setUpdateTime(new Date()); - taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 记录日志 // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -954,11 +863,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe public void updateDeclare(Long id) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - List taxDeclareStatusEnumValueList = Lists.newArrayList( - TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), - TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), - TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), - TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); + List taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "对不起,只有申报成功后才允许更正申报")); } @@ -989,7 +894,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); taxDeclareRecord.setRequestId(""); taxDeclareRecord.setUpdateTime(new Date()); - taxDeclareRecordMapper.updateIgnoreNull(taxDeclareRecord); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 记录日志 // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -1051,7 +956,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe private TaxDeclareRequest buildTaxDeclareRequest(Long id) { // 查询供应商信息 - TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(true); + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); if (apiConfig == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量")); } @@ -1061,18 +966,15 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); } // 查询个税扣缴义务人 - TaxAgentPO taxAgent = taxAgentService.getById(taxDeclareRecord.getTaxAgentId()); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); // 查询个税扣缴义务人关联的企业信息 - TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(taxDeclareRecord.getTaxAgentId()); + TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(taxDeclareRecord.getTaxAgentId()); if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); } // 注册的企业信息-->请求参数 Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); - return new TaxDeclareRequest().setTaxDeclarationApiConfig(apiConfig) - .setTaxAgent(taxAgent) - .setTaxDeclareRecord(taxDeclareRecord) - .setRequestParam(requestParam); + return new TaxDeclareRequest().setTaxDeclarationApiConfig(apiConfig).setTaxAgent(taxAgent).setTaxDeclareRecord(taxDeclareRecord).setRequestParam(requestParam); } } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index f361c78cb..9cfe582fd 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -1,5 +1,6 @@ package com.engine.salary.wrapper; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -15,6 +16,7 @@ import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; @@ -32,6 +34,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.stereotype.Component; import weaver.general.Util; +import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; @@ -48,24 +51,33 @@ import java.util.stream.Collectors; public class TaxDeclareRecordWrapper extends Service { - private TaxDeclareRecordService taxDeclareRecordService; - - private TaxAgentService taxAgentService; - - private SalaryEmployeeService hrmCommonEmployeeService; - - private SalaryCacheService salaryCacheService; - - private TaxDeclarationService taxDeclarationService; - - private TaxDeclarationValueService taxDeclarationValueService; - - private TaxDeclarationExcelService taxDeclarationExcelService; - - private TaxDeclareEmployeeService taxDeclareEmployeeService; - - private TaxDeclareFailService taxDeclareFailService; - + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + private SalaryCacheService getSalaryCacheService(User user) { + return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); + } + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + private TaxDeclarationExcelService getTaxDeclarationExcelService(User user) { + return ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user); + } + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { + return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); + } + private TaxDeclareFailService getTaxDeclareFailService(User user) { + return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); + } /** * 个税申报记录列表 * @@ -73,17 +85,17 @@ public class TaxDeclareRecordWrapper extends Service { * @return */ public PageInfo listPage(TaxDeclarationListQueryParam queryParam) { - PageInfo page = taxDeclareRecordService.listPageByParam(queryParam); + PageInfo page = getTaxDeclareRecordService(user).listPageByParam(queryParam); List list = page.getList(); PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareRecordListDTO.class); if (CollectionUtils.isNotEmpty(list)) { // 查询个税扣缴义务人 Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclareRecordPO::getTaxAgentId); - List taxAgents = taxAgentService.listByIds(taxAgentIds); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); // 查询人员姓名 List employeeIds = SalaryEntityUtil.properties(list, TaxDeclareRecordPO::getCreator, Collectors.toList()); - List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(employeeIds); List dtoList = Lists.newArrayList(); Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); @@ -122,15 +134,15 @@ public class TaxDeclareRecordWrapper extends Service { */ public PageInfo listValuePage(TaxDeclarationValueListQueryParam queryParam) { // 查询个税申报表 - TaxDeclarationPO taxDeclaration = taxDeclarationService.getById(queryParam.getTaxDeclarationId()); + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(queryParam.getTaxDeclarationId()); // 判断是否有权限查看 - boolean canSee = taxDeclareRecordService.checkByAuthority(taxDeclaration); + boolean canSee = getTaxDeclareRecordService(user).checkByAuthority(taxDeclaration); if (!canSee) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看")); } // 查询个税申报表详情 - PageInfo page = taxDeclarationValueService.listPageByTaxDeclarationIds(queryParam,Collections.singleton(queryParam.getTaxDeclarationId())); - TaxDeclarationValueListDTO taxDeclarationValueListDTO = taxDeclarationValueService.convert2List(taxDeclaration, page.getList()); + PageInfo page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam,Collections.singleton(queryParam.getTaxDeclarationId())); + TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclaration, page.getList()); PageInfo> dtoPage = new PageInfo(); dtoPage.setList(taxDeclarationValueListDTO.getData()); return dtoPage; @@ -164,41 +176,41 @@ public class TaxDeclareRecordWrapper extends Service { */ public PageInfo listEmployeePage4Fail(AbnormalEmployeeListQueryParam queryParam) { // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId()); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); // 查询申报失败的数据 - List taxDeclareFailPOPageInfo = taxDeclareFailService.listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + List taxDeclareFailPOPageInfo = getTaxDeclareFailService(user).listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 转换成dto PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), FailEmployeeListDTO.class); - dtoPage.setList(taxDeclareFailService.convert2FailEmployeeList(taxDeclareRecord, taxDeclareFailPOPageInfo)); + dtoPage.setList(getTaxDeclareFailService(user).convert2FailEmployeeList(taxDeclareRecord, taxDeclareFailPOPageInfo)); // 转成前端所需的格式 return dtoPage; } private PageInfo listEmployeePage(String key, AbnormalEmployeeListQueryParam queryParam) { // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(queryParam.getTaxDeclareRecordId()); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); if (StringUtils.isEmpty(queryParam.getKeyword())) { // 查询个税申报记录的人员 PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareEmployeePO.class); if (StringUtils.equals("NotDeclare", key)) { - page = taxDeclareEmployeeService.listPage4NotDeclareByParam(queryParam); + page = getTaxDeclareEmployeeService(user).listPage4NotDeclareByParam(queryParam); } else if (StringUtils.equals("NoValue", key)) { - page = taxDeclareEmployeeService.listPage4NoValueByParam(queryParam); + page = getTaxDeclareEmployeeService(user).listPage4NoValueByParam(queryParam); } PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AbnormalEmployeeListDTO.class); - dtoPage.setList(taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, page.getList())); + dtoPage.setList(getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, page.getList())); return dtoPage; } else { // 查询条件中包含"keyword"时,不好通过SQL分页,所以在内存中分页 List taxDeclareEmployees = Collections.emptyList(); if (StringUtils.equals("NotDeclare", key)) { - taxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam); + taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); } else if (StringUtils.equals("NoValue", key)) { - taxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam); + taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); } - List dtos = taxDeclareEmployeeService.convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees) + List dtos = getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees) .stream() .filter(e -> StringUtils.contains(e.getEmployeeName(), queryParam.getKeyword()) || StringUtils.contains(e.getJobNum(), queryParam.getKeyword()) @@ -219,8 +231,8 @@ public class TaxDeclareRecordWrapper extends Service { // TaxDeclareRecordFormDTO formDTO = new TaxDeclareRecordFormDTO(); // formDTO.setTaxAgentRange(TaxAgentRangeEnum.SELECT_TAX_AGENT); // // 判断当前是否开启了分权 -// Boolean openDevolution = taxAgentService.isOpenDevolution(); -// Boolean isChief = taxAgentService.isChief((long)user.getUID()); +// Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); +// Boolean isChief = getTaxAgentService(user).isChief((long)user.getUID()); // // 转换成前端所需的数据格式 // WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclareRecordFormDTO.class, formDTO); // weaForm.getItems().forEach((k, v) -> { @@ -249,9 +261,9 @@ public class TaxDeclareRecordWrapper extends Service { */ public List getTaxDeclarationTab(Long id) { // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id); // 查询个税申报记录下的个税申报表 - List taxDeclarations = taxDeclarationService.listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); taxDeclarations = taxDeclarations.stream() .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), (long)user.getUID())) @@ -279,7 +291,7 @@ public class TaxDeclareRecordWrapper extends Service { */ public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { // 查询个税申报表 - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRecordService.getById(id); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id); if (Objects.isNull(taxDeclareRecord)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); } @@ -288,13 +300,13 @@ public class TaxDeclareRecordWrapper extends Service { .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) .setTaxCycle(taxDeclareRecord.getTaxCycle()); // 查询是否存在有未报送的人 - List notDeclareTaxDeclareEmployees = taxDeclareEmployeeService.list4NotDeclareByParam(queryParam); + List notDeclareTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); // 查询是否存在没有申报数据的人 - List noValueTaxDeclareEmployees = taxDeclareEmployeeService.list4NoValueByParam(queryParam); + List noValueTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); // 查询是否存在申报失败的人 - List taxDeclareFails = taxDeclareFailService.listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + List taxDeclareFails = getTaxDeclareFailService(user).listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 查询个税扣缴义务人 - TaxAgentPO taxAgentPO = taxAgentService.getById(taxDeclareRecord.getTaxAgentId()); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); return TaxDeclarationInfoDTO.builder() @@ -323,12 +335,12 @@ public class TaxDeclareRecordWrapper extends Service { TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true) .setIndex(Util.null2String(IdGenerator.generate())) .setMsg(SalaryI18nUtil.getI18nLabel(95836, "生成申报表")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.save(saveParam); + getTaxDeclareRecordService(user).save(saveParam); taxDeclarationRate.setStatus(true).setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -336,7 +348,7 @@ public class TaxDeclareRecordWrapper extends Service { log.error("个税申报表生成报错:{}", e.getMessage(), e); taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187276, "个税申报表生成报错:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -350,7 +362,7 @@ public class TaxDeclareRecordWrapper extends Service { * @param id */ public void updateIcon(Long id) { - taxDeclareRecordService.updateIcon(id, NumberUtils.INTEGER_ZERO); + getTaxDeclareRecordService(user).updateIcon(id, NumberUtils.INTEGER_ZERO); } /** @@ -359,7 +371,7 @@ public class TaxDeclareRecordWrapper extends Service { * @param ids */ public void delete(Collection ids) { - taxDeclareRecordService.deleteByIds(ids); + getTaxDeclareRecordService(user).deleteByIds(ids); } /** @@ -369,7 +381,7 @@ public class TaxDeclareRecordWrapper extends Service { * @return */ public TaxDeclarationRateDTO getRate(String index) { - return salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION + index); + return getSalaryCacheService(user).get(SalaryCacheKey.TAX_DECLARATION + index); } /** @@ -381,12 +393,12 @@ public class TaxDeclareRecordWrapper extends Service { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.declare(id); + getTaxDeclareRecordService(user).declare(id); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -394,7 +406,7 @@ public class TaxDeclareRecordWrapper extends Service { log.error("在线申报失败:{}", e.getMessage(), e); taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187274, "在线申报失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -411,12 +423,12 @@ public class TaxDeclareRecordWrapper extends Service { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(182680, "获取申报反馈")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.getDeclareFeedback(id, taxDeclarationRate); + getTaxDeclareRecordService(user).getDeclareFeedback(id, taxDeclarationRate); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -424,7 +436,7 @@ public class TaxDeclareRecordWrapper extends Service { log.error("获取申报反馈失败:{}", e.getMessage(), e); taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187255, "获取申报反馈失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -441,12 +453,12 @@ public class TaxDeclareRecordWrapper extends Service { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(158842, "作废申报")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.cancelDeclare(id); + getTaxDeclareRecordService(user).cancelDeclare(id); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -454,7 +466,7 @@ public class TaxDeclareRecordWrapper extends Service { log.error("作废申报失败:{}", e.getMessage(), e); taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187272, "作废申报失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -471,12 +483,12 @@ public class TaxDeclareRecordWrapper extends Service { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(182681, "获取作废申报反馈")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.getCancelFeedback(id, taxDeclarationRate); + getTaxDeclareRecordService(user).getCancelFeedback(id, taxDeclarationRate); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -484,7 +496,7 @@ public class TaxDeclareRecordWrapper extends Service { log.error("获取作废反馈结果失败:{}", e.getMessage(), e); taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187270, "获取作废反馈结果失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -502,12 +514,12 @@ public class TaxDeclareRecordWrapper extends Service { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.updateDeclare(id); + getTaxDeclareRecordService(user).updateDeclare(id); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -515,7 +527,7 @@ public class TaxDeclareRecordWrapper extends Service { log.error("更正申报失败:{}", e.getMessage(), e); taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187269, "更正申报失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -530,7 +542,7 @@ public class TaxDeclareRecordWrapper extends Service { * @return */ public String queryDeclareStatus(Long id) { - return taxDeclareRecordService.queryDeclareStatus(id); + return getTaxDeclareRecordService(user).queryDeclareStatus(id); } /** @@ -540,7 +552,7 @@ public class TaxDeclareRecordWrapper extends Service { * @return */ public String queryCompanyIncomes(Long id) { - return taxDeclareRecordService.queryCompanyIncomes(id); + return getTaxDeclareRecordService(user).queryCompanyIncomes(id); } /** @@ -553,12 +565,12 @@ public class TaxDeclareRecordWrapper extends Service { checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { try { - taxDeclareRecordService.refreshData(id); + getTaxDeclareRecordService(user).refreshData(id); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -566,7 +578,7 @@ public class TaxDeclareRecordWrapper extends Service { log.error("刷新数据失败:{}", e.getMessage(), e); taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187268, "刷新数据失败:") + e.getMessage()); } finally { - salaryCacheService.set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); } } }; @@ -575,7 +587,7 @@ public class TaxDeclareRecordWrapper extends Service { } private void checkBefore(Long id) { - TaxDeclarationRateDTO taxDeclarationRate = salaryCacheService.get(SalaryCacheKey.TAX_DECLARATION + Util.null2String(id)); + TaxDeclarationRateDTO taxDeclarationRate = getSalaryCacheService(user).get(SalaryCacheKey.TAX_DECLARATION + Util.null2String(id)); if (taxDeclarationRate != null && !taxDeclarationRate.isFinish()) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182691, "当前正处于「{0}」中,请稍后再试").replace("{0}", taxDeclarationRate.getMsg())); } @@ -595,7 +607,7 @@ public class TaxDeclareRecordWrapper extends Service { // LocalRunnable localRunnable = new LocalRunnable() { // @Override // public void execute() { -// taxDeclarationExcelService.exportTaxDeclarationValue(excelExportParam, queryParam, simpleEmployee); +// getTaxDeclarationExcelService(user).exportTaxDeclarationValue(excelExportParam, queryParam, simpleEmployee); // } // }; // ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportTaxDeclarationValue", localRunnable); @@ -617,7 +629,7 @@ public class TaxDeclareRecordWrapper extends Service { // LocalRunnable localRunnable = new LocalRunnable() { // @Override // public void execute() { -// taxDeclarationExcelService.exportEmployee4NotDeclare(excelExportParam, queryParam, simpleEmployee); +// getTaxDeclarationExcelService(user).exportEmployee4NotDeclare(excelExportParam, queryParam, simpleEmployee); // } // }; // ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NotDeclare", localRunnable); @@ -639,7 +651,7 @@ public class TaxDeclareRecordWrapper extends Service { // LocalRunnable localRunnable = new LocalRunnable() { // @Override // public void execute() { -// taxDeclarationExcelService.exportEmployee4NoValue(excelExportParam, queryParam, simpleEmployee); +// getTaxDeclarationExcelService(user).exportEmployee4NoValue(excelExportParam, queryParam, simpleEmployee); // } // }; // ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NoValue", localRunnable); @@ -661,7 +673,7 @@ public class TaxDeclareRecordWrapper extends Service { // LocalRunnable localRunnable = new LocalRunnable() { // @Override // public void execute() { -// taxDeclarationExcelService.exportEmployee4Fail(excelExportParam, queryParam, simpleEmployee); +// getTaxDeclarationExcelService(user).exportEmployee4Fail(excelExportParam, queryParam, simpleEmployee); // } // }; // ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4Fail", localRunnable); From 7275eb15d1bebf8f380b3599dea80bec9d709224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 15 Aug 2023 09:52:58 +0800 Subject: [PATCH 014/298] fixbug --- .../employeedeclare/EmployeeDeclareMapper.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 4a9d04d67..f430542e3 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -166,8 +166,8 @@ AND successfully_declared = #{successfullyDeclared} - - AND new_employee_info = #{newEmployeeinfo} + + AND new_employee_info = #{newEmployeeInfo} AND declare_status = #{declareStatus} @@ -280,7 +280,7 @@ successfully_declared, - + new_employee_info, @@ -378,8 +378,8 @@ #{successfullyDeclared}, - - #{newEmployeeinfo}, + + #{newEmployeeInfo}, #{declareStatus}, @@ -432,7 +432,7 @@ martyr_dependents_card_no=#{martyrDependentsCardNo}, deduct_expenses=#{deductExpenses}, successfully_declared=#{successfullyDeclared}, - new_employee_info=#{newEmployeeinfo}, + new_employee_info=#{newEmployeeInfo}, declare_status=#{declareStatus}, declare_error_msg=#{declareErrorMsg}, tenant_key=#{tenantKey}, @@ -518,8 +518,8 @@ successfully_declared=#{successfullyDeclared}, - - new_employee_info=#{newEmployeeinfo}, + + new_employee_info=#{newEmployeeInfo}, declare_status=#{declareStatus}, From cf22685fca19126edd94243177713a6ec965cf8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 15 Aug 2023 20:48:09 +0800 Subject: [PATCH 015/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94=E3=80=81=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308150303.sql | 29 ++ resource/sqlupgrade/GS/sql202308150303.sql | 29 ++ resource/sqlupgrade/JC/sql202308150303.sql | 29 ++ resource/sqlupgrade/Mysql/sql202308150303.sql | 25 ++ .../sqlupgrade/Oracle/sql202308150303.sql | 28 ++ resource/sqlupgrade/PG/sql202308150303.sql | 22 + .../sqlupgrade/SQLServer/sql202308150303.sql | 23 ++ resource/sqlupgrade/ST/sql202308150303.sql | 29 ++ .../dto/EmployeeDeclareFromDTO.java | 148 +------ .../po/EmployeeDeclareRecordPO.java | 8 +- .../entity/salaryitem/bo/SysSalaryItemBO.java | 29 ++ .../entity/salarysob/bo/SalarySobInitEnv.java | 25 ++ .../entity/salarysob/bo/SalarySobItemBO.java | 2 + .../param/SalarySobBasicSaveParam.java | 4 +- .../salarysob/po/SalarySobAddUpRulePO.java | 32 +- .../po/SalarySobDefaultItemGroupPO.java | 1 + .../entity/salarysob/po/SalarySobItemPO.java | 12 + .../entity/salarysob/po/SalarySobPO.java | 2 + .../po/SalarySobTaxReportRulePO.java | 11 + .../po/TaxDeclareEmployeePO.java | 5 +- .../taxdeclaration/po/TaxDeclareFailPO.java | 4 + .../taxdeclaration/po/TaxReportColumnPO.java | 8 +- .../enums/salarysob/IncomeCategoryEnum.java | 1 + .../employeedeclare/EmployeeDeclareMapper.xml | 4 +- .../EmployeeDeclareRecordMapper.java | 2 + .../EmployeeDeclareRecordMapper.xml | 27 +- .../salarysob/SalarySobAddUpRuleMapper.java | 80 ++++ .../salarysob/SalarySobAddUpRuleMapper.xml | 342 +++++++++++++++ .../SalarySobDefaultItemGroupMapper.xml | 6 + .../mapper/salarysob/SalarySobItemMapper.xml | 18 +- .../SalarySobTaxReportRuleMapper.java | 80 ++++ .../SalarySobTaxReportRuleMapper.xml | 349 ++++++++++++++++ .../TaxDeclarationValueMapper.xml | 22 +- .../taxdeclaration/TaxDeclareRecordMapper.xml | 38 +- .../service/SalarySobAddUpRuleService.java | 3 + .../SalarySobDefaultEmpFieldService.java | 16 +- .../SalarySobDefaultItemGroupService.java | 25 ++ .../salary/service/SalarySobInitService.java | 22 + .../SalarySobTaxReportRuleService.java | 2 + .../impl/AbstractSalarySobInitService.java | 81 ++++ .../EmployeeDeclareRecordServiceImpl.java | 30 +- .../impl/EmployeeDeclareServiceImpl.java | 2 +- .../impl/SalarySobAddUpRuleServiceImpl.java | 173 ++++++++ .../SalarySobDefaultEmpFieldServiceImpl.java | 27 +- .../SalarySobDefaultItemGroupServiceImpl.java | 38 ++ .../impl/SalarySobInitServiceImpl.java | 389 ++++++++++++++++++ .../service/impl/SalarySobServiceImpl.java | 41 +- .../SalarySobTaxReportRuleServiceImpl.java | 169 ++++++++ .../engine/salary/util/SalaryEnumUtil.java | 1 + .../salary/web/EmployeeDeclareController.java | 4 +- .../salary/web/SalarySobController.java | 74 +++- .../wrapper/EmployeeDeclareWrapper.java | 14 +- .../SalarySobTaxReportRuleWrapper.java | 46 +++ 53 files changed, 2343 insertions(+), 288 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202308150303.sql create mode 100644 resource/sqlupgrade/GS/sql202308150303.sql create mode 100644 resource/sqlupgrade/JC/sql202308150303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308150303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308150303.sql create mode 100644 resource/sqlupgrade/PG/sql202308150303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308150303.sql create mode 100644 resource/sqlupgrade/ST/sql202308150303.sql create mode 100644 src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml create mode 100644 src/com/engine/salary/service/SalarySobDefaultItemGroupService.java create mode 100644 src/com/engine/salary/service/SalarySobInitService.java create mode 100644 src/com/engine/salary/service/impl/AbstractSalarySobInitService.java create mode 100644 src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java create mode 100644 src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java diff --git a/resource/sqlupgrade/DM/sql202308150303.sql b/resource/sqlupgrade/DM/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308150303.sql b/resource/sqlupgrade/GS/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308150303.sql b/resource/sqlupgrade/JC/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308150303.sql b/resource/sqlupgrade/Mysql/sql202308150303.sql new file mode 100644 index 000000000..6b6d9b03f --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308150303.sql @@ -0,0 +1,25 @@ +alter table hrsa_salary_sob_item add income_category varchar(100) +; + +alter table hrsa_salary_sob_item modify column income_category varchar(100) default '1' +; + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1') +; + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2') +; + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4') +; + +alter table hrsa_salary_sob_item add salary_item_code varchar(100) +; + +update hrsa_salary_sob_item a, hrsa_salary_item b +set a.salary_item_code = b.code +where a.salary_item_id = b.id +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150303.sql b/resource/sqlupgrade/Oracle/sql202308150303.sql new file mode 100644 index 000000000..d73054258 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150303.sql @@ -0,0 +1,28 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100) +/ + +alter table hrsa_salary_sob_item modify income_category default '1' +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1') +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2') +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4') +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100) +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150303.sql b/resource/sqlupgrade/PG/sql202308150303.sql new file mode 100644 index 000000000..84a6d6a8c --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308150303.sql @@ -0,0 +1,22 @@ +alter table hrsa_salary_sob_item add income_category varchar(100); +/ + +alter table hrsa_salary_sob_item alter column income_category set default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar(100); +/ + +update hrsa_salary_sob_item a set salary_item_code = b.code from hrsa_salary_item b where a.salary_item_id = b.id and a.delete_type = 0; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150303.sql b/resource/sqlupgrade/SQLServer/sql202308150303.sql new file mode 100644 index 000000000..a57b1b4ac --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308150303.sql @@ -0,0 +1,23 @@ +alter table hrsa_salary_sob_item add income_category nvarchar(100) +GO + +alter table hrsa_salary_sob_item add constraint hssi_income_category_default default '1' for income_category +GO + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1') +GO + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2') +GO + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4') +GO + +alter table hrsa_salary_sob_item add salary_item_code nvarchar(100) +GO + +update a set a.salary_item_code = b.code from hrsa_salary_sob_item a, hrsa_salary_item b where a.salary_item_id = b.id +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308150303.sql b/resource/sqlupgrade/ST/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java index 5e8da8b2b..29a0d7886 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -7,13 +7,14 @@ import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; import com.engine.salary.enums.employeedeclare.GenderEnum; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import java.time.LocalDate; +import java.util.Date; /** * @description: 人员报送(人员)表单 @@ -33,216 +34,83 @@ public class EmployeeDeclareFromDTO { private Long id; // 个税扣缴义务人id - private Long taxAgentId; -// @SalaryForm( -// label = "系统名称", -// labelId = 160460, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.TYPESBROWSER, browserModule = "hrmsalary", -// browserType = "salaryEmployeeCombinationBrowser", required = true) -// } -// ) // 系统名称 @TableTitle(title = "系统名称", dataIndex = "employee", key = "employee") private String employee; -// @SalaryForm( -// label = "证件姓名", -// labelId = 160461, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40", required = true) -// } -// ) // 证件姓名 @TableTitle(title = "证件姓名", dataIndex = "employeeName", key = "employeeName") private String employeeName; -// @SalaryForm( -// label = "工号", -// labelId = 86317, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40") -// } -// ) // 工号 @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") private String jobNum; -// @SalaryForm( -// label = "国籍", -// labelId = 156406, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, readOnly = true) -// } -// ) // 国籍 @TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality") private String nationality; -// @SalaryForm( -// label = "证件类型", -// labelId = 105139, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.SELECT, readOnly = true, optionsEnum = CardTypeEnum.class, -// required = true) -// } -// ) // 证件类型 @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") private CardTypeEnum cardType; -// @SalaryForm( -// label = "证件号码", -// labelId = 86318, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true, maxLength = "18") -// } -// ) // 证件号码 @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") private String cardNum; -// @SalaryForm( -// label = "性别", -// labelId = 98622, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = GenderEnum.class) -// } -// ) // 性别 @TableTitle(title = "性别", dataIndex = "gender", key = "gender") private GenderEnum gender; -// @SalaryForm( -// label = "出生日期", -// labelId = 98624, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) -// } -// ) // 出生日期 @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") - private LocalDate birthday; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date birthday; -// @SalaryForm( -// label = "状态", -// labelId = 91075, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = EmploymentStatusEnum.class) -// } -// ) // 状态 @TableTitle(title = "状态", dataIndex = "employmentStatus", key = "employmentStatus") private EmploymentStatusEnum employmentStatus; -// @SalaryForm( -// label = "手机号码", -// labelId = 98621, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true) -// } -// ) // 手机号码 @TableTitle(title = "手机号码", dataIndex = "mobile", key = "mobile") private String mobile; -// @SalaryForm( -// label = "任职受雇从业类型", -// labelId = 156396, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = EmploymentTypeEnum.class) -// } -// ) // 任职受雇从业类型 @TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType") private EmploymentTypeEnum employmentType; -// @SalaryForm( -// label = "任职受雇从业日期", -// labelId = 156409, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) -// } -// ) // 任职受雇从业日期 @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") - private LocalDate employmentDate; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date employmentDate; -// @SalaryForm( -// label = "离职日期", -// labelId = 95228, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER) -// } -// ) // 离职日期 @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") - private LocalDate dismissDate; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date dismissDate; -// @SalaryForm( -// label = "是否残疾", -// labelId = 156399, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) -// } -// ) // 是否残疾 @TableTitle(title = "是否残疾", dataIndex = "disability", key = "disability") private SalaryOnOffEnum disability; -// @SalaryForm( -// label = "残疾证号", -// labelId = 156412, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT) -// } -// ) // 残疾证号 @TableTitle(title = "残疾证号", dataIndex = "disabilityCardNo", key = "disabilityCardNo") private String disabilityCardNo; -// @SalaryForm( -// label = "是否孤老", -// labelId = 156400, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) -// } -// ) // 是否孤老 @TableTitle(title = "是否孤老", dataIndex = "lonelyOld", key = "lonelyOld") private SalaryOnOffEnum lonelyOld; -// @SalaryForm( -// label = "是否是烈属", -// labelId = 156401, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) -// } -// ) // 是否是烈属 @TableTitle(title = "是否是烈属", dataIndex = "martyrDependents", key = "martyrDependents") private SalaryOnOffEnum martyrDependents; -// @SalaryForm( -// label = "烈属证号", -// labelId = 156413, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.INPUT) -// } -// ) // 烈属证号 @TableTitle(title = "烈属证号", dataIndex = "martyrDependentsCardNo", key = "martyrDependentsCardNo") private String martyrDependentsCardNo; -// @SalaryForm( -// label = "是否扣除减除费用", -// labelId = 156402, -// items = { -// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class) -// } -// ) // 是否扣除减除费用 @TableTitle(title = "是否扣除减除费用", dataIndex = "deductExpenses", key = "deductExpenses") private SalaryOnOffEnum deductExpenses; diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java index bf715c633..c7b6bec24 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java @@ -1,6 +1,9 @@ package com.engine.salary.entity.employeedeclare.po; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.util.Collection; @@ -15,6 +18,9 @@ import java.util.Date; */ @Data @Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor //"hrsa_employee_declare_record") public class EmployeeDeclareRecordPO { @@ -29,7 +35,7 @@ public class EmployeeDeclareRecordPO { /** * 税款所属期 */ - private String taxCycle; + private Date taxCycle; /** * 请求的requestId */ diff --git a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java index 544550acf..494338449 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java @@ -9,6 +9,7 @@ import com.engine.salary.enums.SalaryRoundingModeEnum; import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.util.SalaryI18nUtil; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; @@ -158,4 +159,32 @@ public class SysSalaryItemBO { .sharedType(sysSalaryItemPO.getSharedType()) .build(); } + + /** + * 系统薪资项目转换成自定义薪资项目 + * + * @param sysSalaryItemPO 系统薪资项目 + * @param employeeId 人员id + * @return + */ + public static SalaryItemPO convert2SalaryItemPO(SysSalaryItemPO sysSalaryItemPO, Date now, Long employeeId) { + if (sysSalaryItemPO == null) { + return null; + } + long id = IdGenerator.generate(); + return SalaryItemPO.builder() + .id(id) + .code(sysSalaryItemPO.getCode()) + .name(sysSalaryItemPO.getName()) + .systemType(SalarySystemTypeEnum.SYSTEM.getValue()) + .sysSalaryItemId(sysSalaryItemPO.getId()) + .dataType(sysSalaryItemPO.getDataType()) + .description(sysSalaryItemPO.getDescription()) + .creator(employeeId) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + } } diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java new file mode 100644 index 000000000..8208952d3 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.salarysob.bo; + +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import lombok.Data; +import weaver.hrm.User; + +import java.util.List; + +/** + * @description: 初始化薪资账套 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/5/18 15:36 + * @version:v1.0 + */ +@Data +public class SalarySobInitEnv { + + private User currentUser; + private SalarySobBasicSaveParam saveParam; + private SalarySobPO salarySob; + private List salarySobItems; +} diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java index 3e2513908..ffb902b90 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -117,6 +117,7 @@ public class SalarySobItemBO { .salarySobId(salarySobId) .salarySobItemGroupId(salarySobItemGroupIdMap.getOrDefault(salarySobDefaultItemPO.getSobDefaultItemGroupId(), NumberUtils.LONG_ZERO)) .salaryItemId(salaryItemPO.getId()) + .salaryItemCode(salaryItemPO.getCode()) .formulaId(salaryItemPO.getFormulaId()) .sortedIndex(salarySobDefaultItemPO.getSortedIndex()) .description(salaryItemPO.getDescription()) @@ -157,6 +158,7 @@ public class SalarySobItemBO { .salarySobId(salarySobId) .salarySobItemGroupId(NumberUtils.LONG_ZERO) .salaryItemId(salaryItemPO.getId()) + .salaryItemCode(salaryItemPO.getCode()) .formulaId(salaryItemPO.getFormulaId()) .sortedIndex(i) .description(salaryItemPO.getDescription()) diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java index bd86de4d6..d0357f414 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java @@ -40,11 +40,11 @@ public class SalarySobBasicSaveParam { private Long taxAgentId; /** - * 薪资类型不允许为空 + * 所得项目不允许为空 * * @see IncomeCategoryEnum */ - @DataCheck(require = true, message = "薪资类型不允许为空") + @DataCheck(require = true, message = "所得项目不允许为空") private Integer taxableItems; /** diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java index 7417857d4..bab688ced 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java @@ -1,9 +1,12 @@ package com.engine.salary.entity.salarysob.po; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import java.time.LocalDateTime; +import java.util.Collection; import java.util.Date; /** @@ -15,27 +18,32 @@ import java.util.Date; */ @Data @Accessors(chain = true) -//"hrsa_sob_add_up_rule") +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_sob_add_up_rule public class SalarySobAddUpRulePO { - //主键id") + //主键id private Long id; - //薪资账套id") + //薪资账套id private Long salarySobId; - //收入所得项目") + //收入所得项目 private String incomeCategory; - //薪资项目id") + //薪资项目id private Long salaryItemId; - //往期累计情况的字段索引") + //往期累计情况的字段索引 private String addUpColumnDataIndex; - //租户key", ignore = true) + //租户key private String tenantKey; - //创建人id", ignore = true) + //创建人id private Long creator; - //是否删除", ignore = true) + //是否删除 private Integer deleteType; - //创建时间", ignore = true) + //创建时间 private Date createTime; - //更新时间", ignore = true) + //更新时间 private Date updateTime; + + private Collection salarySobIds; } diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java index bca70753e..58c0b1473 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java @@ -76,4 +76,5 @@ public class SalarySobDefaultItemGroupPO { private Date updateTime; Collection ids; + Collection incomeCategorys; } diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java index 0464d63f8..01dcdee14 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java @@ -33,11 +33,23 @@ public class SalarySobItemPO { */ private Long salarySobId; + /** + * 所得项目 + */ + private String incomeCategory; + /** * 薪资项目的id */ private Long salaryItemId; + /** + * 薪资项目的code + */ + private String salaryItemCode; + + + /** * 薪资账套薪资项目分组id */ diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java index 921fad01c..3d62f68c1 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salarysob.po; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -35,6 +36,7 @@ public class SalarySobPO { /** * 应税项目。1:正常工资薪金所得 + * @see IncomeCategoryEnum */ private Integer incomeCategory; /** diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java index 339e8e012..33b403f44 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java @@ -1,8 +1,12 @@ package com.engine.salary.entity.salarysob.po; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; +import java.util.Collection; import java.util.Date; /** @@ -14,6 +18,9 @@ import java.util.Date; */ @Data @Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor //hrsa_sob_tax_report_rule public class SalarySobTaxReportRulePO { @@ -37,4 +44,8 @@ public class SalarySobTaxReportRulePO { private Date createTime; //更新时间", ignore = true) private Date updateTime; + + + private Collection ids; + private Collection salarySobIds; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java index 60cb134ec..f3af4c3de 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java @@ -1,7 +1,8 @@ package com.engine.salary.entity.taxdeclaration.po; -import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; /** * @description: 个税申报中的人员 @@ -11,6 +12,8 @@ import lombok.Data; * @version:v1.0 */ @Data +@AllArgsConstructor +@NoArgsConstructor public class TaxDeclareEmployeePO { //人员id") diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java index 82aecf953..6182b83ea 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java @@ -1,8 +1,10 @@ package com.engine.salary.entity.taxdeclaration.po; import com.engine.salary.report.enums.IncomeCategoryEnum; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; @@ -19,6 +21,8 @@ import java.util.Date; @Data @Accessors(chain = true) @Builder +@AllArgsConstructor +@NoArgsConstructor //hrsa_tax_declare_fail") public class TaxDeclareFailPO implements Serializable { diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index ad84be201..16c3be741 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -1,8 +1,11 @@ package com.engine.salary.entity.taxdeclaration.po; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -14,7 +17,8 @@ import java.util.Date; */ @Data @Builder -//name = "个税申报表表头") +@AllArgsConstructor +@NoArgsConstructor //hrsa_tax_report_column") public class TaxReportColumnPO { @@ -44,4 +48,6 @@ public class TaxReportColumnPO { private Date createTime; //name = "更新时间", ignore = true) private Date updateTime; + + Collection ids; } diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 72d52afb0..762b3e581 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -19,6 +19,7 @@ import java.util.Objects; **/ public enum IncomeCategoryEnum implements BaseEnum { + // todo 多语言 WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487), REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488), ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489), diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index f430542e3..363ed51cf 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -558,9 +558,9 @@ SET delete_type=1, update_time = #{date} WHERE delete_type = 0 - + AND id IN - + #{id} diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java index 9fe80ed26..c64292115 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java @@ -4,6 +4,7 @@ import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; import org.apache.ibatis.annotations.Param; import java.util.Collection; +import java.util.Date; import java.util.List; public interface EmployeeDeclareRecordMapper { @@ -77,4 +78,5 @@ public interface EmployeeDeclareRecordMapper { */ void deleteByIds(@Param("ids") Collection ids); + void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml index e2f16e7ac..8e3da7cdd 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml @@ -205,7 +205,7 @@ #{item.deleteType,jdbcType=INTEGER}, #{item.tenantKey,jdbcType=VARCHAR}, #{item.taxAgentId,jdbcType=DOUBLE}, - #{item.taxCycle,jdbcType=VARCHAR}, + #{item.taxCycle,jdbcType=DATE}, #{item.requestId,jdbcType=DOUBLE}, from dual @@ -227,15 +227,15 @@ ) VALUES ( - #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxCycle,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.requestId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.requestId}, ) @@ -308,5 +308,12 @@ + + UPDATE hrsa_employee_declare_record + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_cycle = #{taxCycle} + AND tax_agent_id = #{taxAgentId} + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java new file mode 100644 index 000000000..f5245c10c --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalarySobAddUpRuleMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(SalarySobAddUpRulePO sobAddUpRule); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + SalarySobAddUpRulePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param sobAddUpRule 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 批量插入 + * + * @param sobAddUpRule + */ + void batchInsert(@Param("collection") List sobAddUpRule); + + /** + * 修改,修改所有字段 + * + * @param sobAddUpRule 修改的记录 + * @return 返回影响行数 + */ + int update(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 修改,忽略null字段 + * + * @param sobAddUpRule 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 删除记录 + * + * @param sobAddUpRule 待删除的记录 + * @return 返回影响行数 + */ + int delete(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBySalarySobIds(Collection salarySobIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml new file mode 100644 index 000000000..d42b5e766 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml @@ -0,0 +1,342 @@ + + + + + + + + + + + + + + + + + + + t + . + add_up_column_data_index + , t.create_time + , t.creator + , t.delete_type + , t.id + , t.income_category + , t.salary_item_id + , t.salary_sob_id + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_sob_add_up_rule + + + + add_up_column_data_index, + + + create_time, + + + creator, + + + delete_type, + + + id, + + + income_category, + + + salary_item_id, + + + salary_sob_id, + + + tenant_key, + + + update_time, + + + + + #{addUpColumnDataIndex}, + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{incomeCategory}, + + + #{salaryItemId}, + + + #{salarySobId}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + INSERT INTO hrsa_sob_add_up_rule + ( + add_up_column_data_index, + create_time, + creator, + delete_type, + id, + income_category, + salary_item_id, + salary_sob_id, + tenant_key, + update_time + ) + VALUES + ( + + #{item.addUpColumnDataIndex}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.id}, + #{item.incomeCategory}, + #{item.salaryItemId}, + #{item.salarySobId}, + #{item.tenantKey}, + #{item.updateTime} + + ) + + + + + INSERT INTO hrsa_sob_add_up_rule ( + add_up_column_data_index, + create_time, + creator, + delete_type, + id, + income_category, + salary_item_id, + salary_sob_id, + tenant_key, + update_time, + ) + + + select + #{item.addUpColumnDataIndex,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.incomeCategory,jdbcType=VARCHAR}, + #{item.salaryItemId,jdbcType=DOUBLE}, + #{item.salarySobId,jdbcType=DOUBLE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE}, + from dual + + + + + + + INSERT INTO hrsa_sob_add_up_rule ( + add_up_column_data_index, + create_time, + creator, + delete_type, + id, + income_category, + salary_item_id, + salary_sob_id, + tenant_key, + update_time, + ) + VALUES + ( + #{item.addUpColumnDataIndex}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.id}, + #{item.incomeCategory}, + #{item.salaryItemId}, + #{item.salarySobId}, + #{item.tenantKey}, + #{item.updateTime}, + ) + + + + + + UPDATE hrsa_sob_add_up_rule + + add_up_column_data_index=#{addUpColumnDataIndex}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + income_category=#{incomeCategory}, + salary_item_id=#{salaryItemId}, + salary_sob_id=#{salarySobId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_add_up_rule + + + add_up_column_data_index=#{addUpColumnDataIndex}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + income_category=#{incomeCategory}, + + + salary_item_id=#{salaryItemId}, + + + salary_sob_id=#{salarySobId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_add_up_rule + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_sob_add_up_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_sob_add_up_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_sob_id IN + + #{salarySobId} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml index 81e68abdd..10a98cf87 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml @@ -89,6 +89,12 @@ #{id} + + AND income_category IN + + #{incomeCategory} + + ORDER BY id DESC diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml index cf3d2173e..31debaf2f 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -15,6 +15,7 @@ + @@ -34,6 +35,7 @@ , t.tenant_key , t.update_time ,t.can_delete + ,t.salary_item_code @@ -160,6 +162,7 @@ , t.tenant_key , t.update_time ,t.can_delete + ,t.salary_item_code ,h.item_hide FROM hrsa_salary_sob_item t LEFT JOIN hrsa_salary_item_hide h ON t.salary_item_id=h.salary_item_id and t.salary_sob_id = h.salary_sob_id @@ -364,7 +367,7 @@ INSERT INTO hrsa_salary_sob_item(salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,salary_item_code) VALUES ( @@ -379,13 +382,14 @@ #{item.creator}, #{item.deleteType}, #{item.tenantKey}, - #{item.canDelete} + #{item.canDelete}, + #{item.salaryItemCode} ) INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,salary_item_code) select @@ -400,14 +404,15 @@ #{item.creator,jdbcType=DOUBLE}, #{item.deleteType,jdbcType=INTEGER}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.canDelete,jdbcType=INTEGER} + #{item.canDelete,jdbcType=INTEGER}, + #{item.salaryItemCode,jdbcType=INTEGER} from dual INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,salary_item_code) VALUES ( #{item.salarySobId}, @@ -421,7 +426,8 @@ #{item.creator}, #{item.deleteType}, #{item.tenantKey}, - #{item.canDelete} + #{item.canDelete}, + #{item.salaryItemCode} ) diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.java new file mode 100644 index 000000000..cf737d731 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalarySobTaxReportRuleMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(SalarySobTaxReportRulePO sobTaxReportRule); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + SalarySobTaxReportRulePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param sobTaxReportRule 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 批量插入 + * + * @param sobTaxReportRule + */ + void batchInsert(@Param("collection") List sobTaxReportRule); + + /** + * 修改,修改所有字段 + * + * @param sobTaxReportRule 修改的记录 + * @return 返回影响行数 + */ + int update(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 修改,忽略null字段 + * + * @param sobTaxReportRule 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 删除记录 + * + * @param sobTaxReportRule 待删除的记录 + * @return 返回影响行数 + */ + int delete(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBySalarySobIds(@Param("salarySobIds")Collection salarySobIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml new file mode 100644 index 000000000..e0c68ae3a --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.salary_sob_id + , t.income_category + , t.report_column_data_index + , t.salary_item_id + + + + + + + + + + + + + + + INSERT INTO hrsa_sob_tax_report_rule + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + salary_sob_id, + + + income_category, + + + report_column_data_index, + + + salary_item_id, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{salarySobId}, + + + #{incomeCategory}, + + + #{reportColumnDataIndex}, + + + #{salaryItemId}, + + + + + + + + INSERT INTO hrsa_sob_tax_report_rule + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + salary_sob_id, + income_category, + report_column_data_index, + salary_item_id, + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.salarySobId}, + #{item.incomeCategory}, + #{item.reportColumnDataIndex}, + #{item.salaryItemId}, + + ) + + + + + INSERT INTO hrsa_sob_tax_report_rule ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + salary_sob_id, + income_category, + report_column_data_index, + salary_item_id, + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.salarySobId,jdbcType=DOUBLE}, + #{item.incomeCategory,jdbcType=VARCHAR}, + #{item.reportColumnDataIndex,jdbcType=VARCHAR}, + #{item.salaryItemId,jdbcType=DOUBLE}, + from dual + + + + + + + INSERT INTO hrsa_sob_tax_report_rule ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + salary_sob_id, + income_category, + report_column_data_index, + salary_item_id, + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.salarySobId}, + #{item.incomeCategory}, + #{item.reportColumnDataIndex}, + #{item.salaryItemId}, + ) + + + + + + UPDATE hrsa_sob_tax_report_rule + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + salary_sob_id=#{salarySobId}, + income_category=#{incomeCategory}, + report_column_data_index=#{reportColumnDataIndex}, + salary_item_id=#{salaryItemId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_report_rule + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + salary_sob_id=#{salarySobId}, + + + income_category=#{incomeCategory}, + + + report_column_data_index=#{reportColumnDataIndex}, + + + salary_item_id=#{salaryItemId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_report_rule + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_sob_tax_report_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_sob_tax_report_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_sob_id IN + + #{salarySobId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index f42226d71..4c511ee99 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -227,17 +227,17 @@ select - #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxDeclareRecordId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxDeclarationId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.employeeType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.employeeId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.resultValueJson,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE}, + #{item.taxDeclarationId,jdbcType=DOUBLE}, + #{item.employeeType,jdbcType=INTEGER}, + #{item.employeeId,jdbcType=DOUBLE}, + #{item.resultValueJson,jdbcType=VARCHAR}, from dual diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml index e3d62fdcc..5c491a027 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -401,25 +401,25 @@ ) VALUES ( - #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.salaryMonth,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxCycle,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.remark,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.requestId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxDeclareType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxDeclareStatus,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.displayUpdateIcon,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxPayAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.personNum,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxDeclareErrorMsg,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxPaidAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxPurePaidAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.salaryMonth}, + #{item.taxCycle}, + #{item.remark}, + #{item.requestId}, + #{item.taxDeclareType}, + #{item.taxDeclareStatus}, + #{item.displayUpdateIcon}, + #{item.taxPayAmount}, + #{item.personNum}, + #{item.taxDeclareErrorMsg}, + #{item.taxPaidAmount}, + #{item.taxPurePaidAmount}, ) diff --git a/src/com/engine/salary/service/SalarySobAddUpRuleService.java b/src/com/engine/salary/service/SalarySobAddUpRuleService.java index 7c4e240b4..81a376a23 100644 --- a/src/com/engine/salary/service/SalarySobAddUpRuleService.java +++ b/src/com/engine/salary/service/SalarySobAddUpRuleService.java @@ -45,4 +45,7 @@ public interface SalarySobAddUpRuleService { * @param salarySobIds */ void deleteBySalarySobIds(Collection salarySobIds); + + void saveBatch(List salarySobAddUpRules); + } diff --git a/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java b/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java index a221b9f3c..6968b1512 100644 --- a/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java +++ b/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java @@ -1,5 +1,9 @@ package com.engine.salary.service; +import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO; + +import java.util.List; + /** * @description: 薪资账套默认的员工信息字段 * @author: xiajun @@ -9,10 +13,10 @@ package com.engine.salary.service; */ public interface SalarySobDefaultEmpFieldService { -// /** -// * 获取所有的薪资账套默认的员工信息字段 -// * -// * @return -// */ -// List list(); + /** + * 获取所有的薪资账套默认的员工信息字段 + * + * @return + */ + List list(); } diff --git a/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java b/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java new file mode 100644 index 000000000..aaa8aef3e --- /dev/null +++ b/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java @@ -0,0 +1,25 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; + +import java.util.Collection; +import java.util.List; + +/** + * @description: 薪资账套默认的薪资项目分类 + * @author: xiajun + * @modified By: xiajun + * @date: 2022/3/11 15:05 + * @version:v1.0 + */ +public interface SalarySobDefaultItemGroupService { + + /** + * 根据所得项目获取薪资账套默认的薪资项目分类 + * + * @param incomeCategories + * @return + */ + List listByIncomeCategoryIn(Collection incomeCategories); +} diff --git a/src/com/engine/salary/service/SalarySobInitService.java b/src/com/engine/salary/service/SalarySobInitService.java new file mode 100644 index 000000000..56800617f --- /dev/null +++ b/src/com/engine/salary/service/SalarySobInitService.java @@ -0,0 +1,22 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobPO; + +/** + * @description: 薪资账套初始化 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/5/18 17:27 + * @version:v1.0 + */ +public interface SalarySobInitService { + + /** + * 薪资账套初始化 + * + * @param saveParam 初始化参数 + * @return + */ + SalarySobPO init(SalarySobBasicSaveParam saveParam); +} diff --git a/src/com/engine/salary/service/SalarySobTaxReportRuleService.java b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java index 4c75a31f7..f39074fa2 100644 --- a/src/com/engine/salary/service/SalarySobTaxReportRuleService.java +++ b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java @@ -45,4 +45,6 @@ public interface SalarySobTaxReportRuleService { * @param salarySobIds */ void deleteBySalarySobIds(Collection salarySobIds); + + void saveBatch(List salarySobTaxReportRules); } diff --git a/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java b/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java new file mode 100644 index 000000000..ba22b9329 --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java @@ -0,0 +1,81 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.bo.SalarySobInitEnv; +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.service.SalarySobInitService; + +/** + * @description: 薪资账套初始化 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/5/18 15:23 + * @version:v1.0 + */ +public abstract class AbstractSalarySobInitService extends Service implements SalarySobInitService { + + @Override + public SalarySobPO init(SalarySobBasicSaveParam saveParam) { + SalarySobInitEnv env = new SalarySobInitEnv(); + env.setSaveParam(saveParam); + env.setCurrentUser(user); + + // 初始化基础设置 + initBasic(env); + // 初始化员工信息字段 + initEmpField(env); + // 初始化薪资项目、薪资项目分组 + initItem(env); + // 初始化回算薪资项目 + initBackItem(env); + // 初始化累计字段对应规则 + initAddUpRule(env); + // 初始化个税申报表字段对应规则 + initTaxReportRule(env); + + return env.getSalarySob(); + } + + /** + * 初始化基础设置 + * + * @param env 公共变量 + */ + protected abstract void initBasic(SalarySobInitEnv env); + + /** + * 初始化人员信息字段 + * + * @param env 公共变量 + */ + protected abstract void initEmpField(SalarySobInitEnv env); + + /** + * 初始化薪资项目、薪资项目分组 + * + * @param env 公共变量 + */ + protected abstract void initItem(SalarySobInitEnv env); + + /** + * 初始化回算薪资项目 + * + * @param env 公共变量 + */ + protected abstract void initBackItem(SalarySobInitEnv env); + + /** + * 初始化累计字段对应规则 + * + * @param env 公共变量 + */ + protected abstract void initAddUpRule(SalarySobInitEnv env); + + /** + * 初始化个税申报表字段对应规则 + * + * @param env 公共变量 + */ + protected abstract void initTaxReportRule(SalarySobInitEnv env); +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java index 9a4f14760..b96c1f775 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java @@ -2,9 +2,13 @@ package com.engine.salary.service.impl; import com.engine.core.impl.Service; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareRecordMapper; import com.engine.salary.service.EmployeeDeclareRecordService; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; import java.util.Date; +import java.util.List; /** * @description: 员工报送记录 @@ -15,32 +19,26 @@ import java.util.Date; */ public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService { + private EmployeeDeclareRecordMapper getEmployeeDeclareRecordMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareRecordMapper.class); + } + @Override public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { -// return new LambdaQueryChainWrapper<>(baseMapper) -// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey) -// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString()) -// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId) -// .one(); + List employeeDeclareRecordPOS = getEmployeeDeclareRecordMapper().listSome(EmployeeDeclareRecordPO.builder().taxCycle(taxCycle).taxAgentId(taxAgentId).build()); + if (CollectionUtils.isNotEmpty(employeeDeclareRecordPOS)) { + return employeeDeclareRecordPOS.get(0); + } return null; } @Override public void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { -// new LambdaUpdateChainWrapper<>(baseMapper) -// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey) -// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString()) -// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId) -// .set(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) -// .set(EmployeeDeclareRecordPO::getUpdateTime, LocalDateTime.now()) -// .update(); + getEmployeeDeclareRecordMapper().deleteByTaxCycleAndTaxAgentId(taxCycle, taxAgentId); } @Override public void save(EmployeeDeclareRecordPO employeeDeclareRecord) { - - + getEmployeeDeclareRecordMapper().insertIgnoreNull(employeeDeclareRecord); } } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index b68952c24..56b87056b 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -586,7 +586,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclareRecord = new EmployeeDeclareRecordPO() .setId(IdGenerator.generate()) .setTaxAgentId(param.getTaxAgentId()) - .setTaxCycle(param.getTaxCycle().toString()) + .setTaxCycle(param.getTaxCycle()) .setRequestId(asyncRequestIdDTO.getRequestId()) .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .setCreator((long) user.getUID()) diff --git a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java new file mode 100644 index 000000000..22dc5be83 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java @@ -0,0 +1,173 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalarySobAddUpRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobAddUpRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.salarysob.SalarySobAddUpRuleMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import dm.jdbc.util.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.lang.reflect.Field; +import java.util.*; + +/** + * @description: 薪资账套的累计字段对应 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/1/4 10:09 AM + * @version:v1.0 + */ +public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobAddUpRuleService { + + private SalarySobAddUpRuleMapper getSalarySobAddUpRuleMapper() { + return MapperProxyFactory.getProxy(SalarySobAddUpRuleMapper.class); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + @Override + public List listBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return new ArrayList<>(); + } + return getSalarySobAddUpRuleMapper().listSome(SalarySobAddUpRulePO.builder().salarySobIds(salarySobIds).build()); + } + + @Override + public List listSalarySobAddUpRuleDTO(Long salarySobId) { + List resultList = Lists.newArrayList(); + // 查询薪资账套 + SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId); + // 薪资账套的收入所得项目 + Integer incomeCategoryId = salarySob.getIncomeCategory(); + // 薪资账套的薪资项目 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId); + // 薪资账套的回算薪资项目 + List salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId); + // 薪资项目 + Set salaryItemIds = Sets.newHashSet(); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId)); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId)); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + // 薪资账套的已经存在的对应关系 + List salarySobAddUpRulePOS = listBySalarySobIds(Collections.singleton(salarySobId)); + Map salarySobAddUpMap = SalaryEntityUtil.convert2Map(salarySobAddUpRulePOS, + e -> e.getIncomeCategory() + "-" + e.getAddUpColumnDataIndex(), SalarySobAddUpRulePO::getSalaryItemId); + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId); + if (incomeCategoryEnum != IncomeCategoryEnum.WAGES_AND_SALARIES + && incomeCategoryEnum != IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN + && incomeCategoryEnum != IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER + && incomeCategoryEnum != IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) { + return resultList; + } + List addUpRules = Lists.newArrayList(); + Field[] declaredFields = AddUpSituation.class.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { + continue; + } + SalaryFormulaVar annotation = declaredField.getAnnotation(SalaryFormulaVar.class); + SalarySobAddUpRuleDTO.AddUpRuleDTO addUpRuleDTO = new SalarySobAddUpRuleDTO.AddUpRuleDTO(); + addUpRuleDTO.setId(IdGenerator.generate()); + addUpRuleDTO.setAddUpColumnName(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel())); + addUpRuleDTO.setAddUpColumnDataIndex(declaredField.getName()); + addUpRuleDTO.setSalaryItem(Collections.emptyList()); + addUpRuleDTO.setCanEdit(true); + + Long salaryItemId = salarySobAddUpMap.get(incomeCategoryId + "-" + declaredField.getName()); + SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); + if (Objects.nonNull(salaryItem)) { + Map dataMap = Maps.newHashMap(); + dataMap.put("id", salaryItem.getId().toString()); + dataMap.put("name", salaryItem.getName()); + dataMap.put("icon", "Icon-N-Salary-item-management"); + addUpRuleDTO.setSalaryItem(Collections.singletonList(dataMap)); + } + addUpRules.add(addUpRuleDTO); + } + SalarySobAddUpRuleDTO salarySobAddUpRuleDTO = new SalarySobAddUpRuleDTO(); + salarySobAddUpRuleDTO.setIncomeCategoryId(incomeCategoryId.toString()); + salarySobAddUpRuleDTO.setIncomeCategoryName(SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + salarySobAddUpRuleDTO.setAddUpRules(addUpRules); + resultList.add(salarySobAddUpRuleDTO); + return resultList; + } + + @Override + public void saveByParam(SalarySobAddUpRuleSaveParam saveParam) { + // 校验参数是否合法 + // 根据保存参数构建出po + Date now = new Date(); + List salarySobAddUpRulePOS = Lists.newArrayList(); + for (SalarySobAddUpRuleSaveParam.AddUpRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { + for (SalarySobAddUpRuleSaveParam.AddUpRuleParam addUpRuleParam : incomeCategoryParam.getAddUpRuleParams()) { + SalarySobAddUpRulePO salarySobAddUpRulePO = new SalarySobAddUpRulePO() + .setId(IdGenerator.generate()) + .setSalarySobId(saveParam.getSalarySobId()) + .setIncomeCategory(incomeCategoryParam.getIncomeCategory()) + .setSalaryItemId(addUpRuleParam.getSalaryItemId()) + .setAddUpColumnDataIndex(addUpRuleParam.getAddUpColumnDataIndex()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreator((long) user.getUID()) + .setCreateTime(now) + .setUpdateTime(now); + salarySobAddUpRulePOS.add(salarySobAddUpRulePO); + } + } + // 删除原来的配置,保存新的 + deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId())); + if (CollectionUtils.isNotEmpty(salarySobAddUpRulePOS)) { + saveBatch(salarySobAddUpRulePOS); + } + } + + @Override + public void deleteBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isNotEmpty(salarySobIds)) { + getSalarySobAddUpRuleMapper().deleteBySalarySobIds(salarySobIds); + } + } + + @Override + public void saveBatch(List salarySobAddUpRules) { + if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) { + salarySobAddUpRules.forEach(o->getSalarySobAddUpRuleMapper().insertIgnoreNull(o)); +// getSalarySobAddUpRuleMapper().batchInsert(salarySobAddUpRules); + } + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java index aa63617a8..1df38c8b8 100644 --- a/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java @@ -1,6 +1,12 @@ package com.engine.salary.service.impl; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO; +import com.engine.salary.mapper.salarysob.SalarySobDefaultEmpFieldMapper; import com.engine.salary.service.SalarySobDefaultEmpFieldService; +import com.engine.salary.util.db.MapperProxyFactory; + +import java.util.List; /** * 薪资账套默认的员工信息字段 @@ -10,17 +16,14 @@ import com.engine.salary.service.SalarySobDefaultEmpFieldService; * @author qiantao * @version 1.0 **/ -public class SalarySobDefaultEmpFieldServiceImpl implements SalarySobDefaultEmpFieldService { +public class SalarySobDefaultEmpFieldServiceImpl extends Service implements SalarySobDefaultEmpFieldService { -// -// private SalarySobDefaultEmpFieldMapper salarySobDefaultEmpFieldMapper; -// -// @Override -// public List list() { -// -// return new LambdaQueryChainWrapper<>(salarySobDefaultEmpFieldMapper) -// .eq(SalarySobDefaultEmpFieldPO::getTenantKey, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) -// .eq(SalarySobDefaultEmpFieldPO::getDeleteType, 0) -// .list(); -// } + private SalarySobDefaultEmpFieldMapper getSalarySobDefaultEmpFieldMapper() { + return MapperProxyFactory.getProxy(SalarySobDefaultEmpFieldMapper.class); + } + + @Override + public List list() { + return getSalarySobDefaultEmpFieldMapper().listAll(); + } } diff --git a/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java new file mode 100644 index 000000000..e599b2688 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java @@ -0,0 +1,38 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.salarysob.SalarySobDefaultItemGroupMapper; +import com.engine.salary.service.SalarySobDefaultItemGroupService; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @description: + * @author: xiajun + * @modified By: xiajun + * @date: 2022/3/11 15:07 + * @version:v1.0 + */ +public class SalarySobDefaultItemGroupServiceImpl extends Service implements SalarySobDefaultItemGroupService { + + private SalarySobDefaultItemGroupMapper getSalarySobDefaultItemGroupMapper() { + return MapperProxyFactory.getProxy(SalarySobDefaultItemGroupMapper.class); + } + + @Override + public List listByIncomeCategoryIn(Collection incomeCategories) { + if (CollectionUtils.isEmpty(incomeCategories)) { + return Collections.emptyList(); + } + List incomeCategoryValues = SalaryEntityUtil.properties(incomeCategories, IncomeCategoryEnum::getValue, Collectors.toList()); + return getSalarySobDefaultItemGroupMapper().listSome(SalarySobDefaultItemGroupPO.builder().incomeCategorys(incomeCategoryValues).build()); + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java new file mode 100644 index 000000000..253fb6dc7 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -0,0 +1,389 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; +import com.engine.salary.entity.salarysob.bo.SalarySobInitEnv; +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.*; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.SalaryCycleTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salarysob.SalarySobMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import weaver.hrm.User; + +import java.lang.reflect.Field; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @description: 薪资账套初始化 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/5/18 15:32 + * @version:v1.0 + */ +public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { + + private SalarySobMapper getSalarySobMapper() { + return MapperProxyFactory.getProxy(SalarySobMapper.class); + } + + private SalarySobDefaultEmpFieldService getSalarySobDefaultEmpFieldService(User user) { + return ServiceUtil.getService(SalarySobDefaultEmpFieldServiceImpl.class, user); + } + + private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) { + return ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user); + } + + private SalarySobDefaultItemGroupService getSalarySobDefaultItemGroupService(User user) { + return ServiceUtil.getService(SalarySobDefaultItemGroupServiceImpl.class, user); + } + + private SalarySobDefaultItemService getSalarySobDefaultItemService(User user) { + return ServiceUtil.getService(SalarySobDefaultItemServiceImpl.class, user); + } + + private SysSalaryItemService getSysSalaryItemService(User user) { + return ServiceUtil.getService(SysSalaryItemServiceImpl.class, user); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobItemGroupService getSalarySobItemGroupService(User user) { + return ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + + @Override + protected void initBasic(SalarySobInitEnv env) { + if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) { + throw new SalaryRunTimeException("Invalid arguments"); + } + // 因为薪资账套的「名称」支持了"小地球",所以在打开新建表单时,后端就会将id传给前端,所以新建保存的时候前端是会将id传给后端的 + // 当前端未将id传给后端时,后端自动生成一个id + SalarySobBasicSaveParam saveParam = env.getSaveParam(); + if (saveParam.getId() == null) { + saveParam.setId(IdGenerator.generate()); + } + + Date now = new Date(); + SalarySobPO salarySob = new SalarySobPO() +// .setId(saveParam.getId()) + .setTaxAgentId(saveParam.getTaxAgentId()) + .setName(saveParam.getName()) + .setIncomeCategory(saveParam.getTaxableItems()) + .setSalaryCycleType(saveParam.getSalaryCycleType()) + .setSalaryCycleFromDay(saveParam.getSalaryCycleFromDay()) + .setTaxCycleType(SalaryCycleTypeEnum.THIS_MONTH.getValue()) + .setAttendCycleType(saveParam.getAttendCycleType()) + .setAttendCycleFromDay(saveParam.getAttendCycleFromDay()) + .setSocialSecurityCycleType(saveParam.getSocialSecurityCycleType()) + .setDisable(0) + .setDescription(saveParam.getDescription()) +// .setOriginSalarySobId(saveParam.getId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + getSalarySobMapper().insertIgnoreNull(salarySob); + env.setSalarySob(salarySob); + } + + @Override + protected void initEmpField(SalarySobInitEnv env) { + if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) { + throw new SalaryRunTimeException("Invalid arguments"); + } + // 查询薪资账套默认的员工信息字段 + List salarySobDefaultEmpFields = getSalarySobDefaultEmpFieldService(user).list(); + + Date now = new Date(); + List salarySobEmpFields = salarySobDefaultEmpFields.stream() + .map(field -> new SalarySobEmpFieldPO() +// .setId(IdGenerator.generate()) + .setSalarySobId(env.getSalarySob().getId()) + .setFieldCode(field.getFieldCode()) + .setSortedIndex(field.getSortedIndex()) + .setCanDelete(field.getCanDelete()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now)) + .collect(Collectors.toList()); + getSalarySobEmpFieldService(user).batchSave(salarySobEmpFields); + } + + @Override + protected void initItem(SalarySobInitEnv env) { + if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) { + throw new SalaryRunTimeException("Invalid arguments"); + } + Date now = new Date(); + // 根据所得项目查询默认的账套薪资项目分组 + List salarySobDefaultItemGroups = getSalarySobDefaultItemGroupService(user) + .listByIncomeCategoryIn(Collections.singletonList(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems()))); + // 根据所得项目查询默认的账套薪资项目 + List salarySobDefaultItems = getSalarySobDefaultItemService(user) + .listByIncomeCategory(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems())); + // 根据默认的账套薪资项目查询关联的系统薪资项目id + Set sysSalaryItemIds = SalaryEntityUtil.properties(salarySobDefaultItems, + SalarySobDefaultItemPO::getSysSalaryItemId); + List sysSalaryItems = getSysSalaryItemService(user).listByIds(sysSalaryItemIds); + Map sysSalaryItemMap = SalaryEntityUtil.convert2Map(sysSalaryItems, SysSalaryItemPO::getId); + // 根据系统薪资项目id查询当前租户的自定义薪资项目 + // 如果默认的账套薪资项目查询关联的系统薪资项目id没有生成自定义薪资项目,需要自动生成对应的自定义薪资项目 + List needInsertSalaryItems = new ArrayList<>(); + List salaryItems = getSalaryItemService(user).listBySysSalaryItemIds(sysSalaryItemIds); + // key:系统薪资项目id;value:薪资项目po + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, + SalaryItemPO::getSysSalaryItemId); + for (SysSalaryItemPO sysSalaryItem : sysSalaryItems) { + salaryItemMap.computeIfAbsent(sysSalaryItem.getId(), key -> { + SalaryItemPO salaryItem = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItem, now, (long) env.getCurrentUser().getUID()); + needInsertSalaryItems.add(salaryItem); + return salaryItem; + }); + } + + // key:默认的账套薪资项目分组id;value:账套薪资项目分组po + Map salarySobItemGroupMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroups.size()); + // 遍历默认的账套薪资项目分组,生成账套薪资项目分组po + for (SalarySobDefaultItemGroupPO salarySobDefaultItemGroup : salarySobDefaultItemGroups) { + SalarySobItemGroupPO salarySobItemGroup = SalarySobItemGroupPO.builder() + .id(IdGenerator.generate()) + .name(salarySobDefaultItemGroup.getName()) + .salarySobId(env.getSalarySob().getId()) + .sortedIndex(salarySobDefaultItemGroup.getSortedIndex()) + .description(salarySobDefaultItemGroup.getDescription()) +// .incomeCategory(salarySobDefaultItemGroup.getIncomeCategory().toString()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) env.getCurrentUser().getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + salarySobItemGroupMap.put(salarySobDefaultItemGroup.getId(), salarySobItemGroup); + } + + List salarySobItems = new ArrayList<>(salarySobDefaultItems.size()); + // 遍历默认的账套薪资项目,生成账套薪资项目po + for (SalarySobDefaultItemPO salarySobDefaultItem : salarySobDefaultItems) { + // 账套薪资项目分组 + SalarySobItemGroupPO salarySobItemGroup = salarySobItemGroupMap.get(salarySobDefaultItem.getSobDefaultItemGroupId()); + // 关联的薪资项目、系统薪资项目 + SalaryItemPO salaryItem = salaryItemMap.get(salarySobDefaultItem.getSysSalaryItemId()); + SysSalaryItemPO sysSalaryItem = sysSalaryItemMap.get(salarySobDefaultItem.getSysSalaryItemId()); + if (salaryItem == null || sysSalaryItem == null) { + throw new SalaryRunTimeException("Invalid arguments,salaryItem can not be null"); + } + SalarySobItemPO salarySobItem = SalarySobItemPO.builder() +// .id(IdGenerator.generate()) + .salarySobId(env.getSalarySob().getId()) + .incomeCategory(salarySobDefaultItem.getIncomeCategory().toString()) + .salaryItemId(salaryItem.getId()) + .salaryItemCode(salaryItem.getCode()) + .salarySobItemGroupId(Optional.ofNullable(salarySobItemGroup).map(SalarySobItemGroupPO::getId).orElse(0L)) +// .useInEmployeeSalary(0) +// .dataType(salaryItem.getDataType()) +// .roundingMode(sysSalaryItem.getRoundingMode()) +// .pattern(sysSalaryItem.getPattern()) +// .valueType(sysSalaryItem.getValueType()) + .formulaId(sysSalaryItem.getFormulaId()) +// .hideSwitch(0) +// .sumSwitch(0) +// .readonlySwitch(0) + .sortedIndex(salarySobDefaultItem.getSortedIndex()) + .description(salaryItem.getDescription()) +// .canEdit(1) + .canDelete(1) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) env.getCurrentUser().getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + salarySobItems.add(salarySobItem); + } + if (CollectionUtils.isNotEmpty(needInsertSalaryItems)) { + getSalaryItemService(user).batchSave(needInsertSalaryItems); + } + if (MapUtils.isNotEmpty(salarySobItemGroupMap)) { + getSalarySobItemGroupService(user).batchSave(salarySobItemGroupMap.values()); + } + if (CollectionUtils.isNotEmpty(salarySobItems)) { + getSalarySobItemService(user).batchSave(salarySobItems); + } + env.setSalarySobItems(salarySobItems); + } + + @Override + protected void initBackItem(SalarySobInitEnv env) { + // 只有「正常工资薪金」才默认生成回算薪资项目 + boolean contains = Objects.equals(env.getSaveParam().getTaxableItems(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()); + if (!contains) { + return; + } + // 746777981115629575L--已发薪资合计 + // 746777981115629576L--补发薪资合计 + List sysSalaryItemIds = Lists.newArrayList(746777981115629575L, 746777981115629576L); + List sysSalaryItems = getSysSalaryItemService(user).listByIds(sysSalaryItemIds); + // 根据系统薪资项目id查询当前租户的自定义薪资项目 + // 如果默认的账套薪资项目查询关联的系统薪资项目id没有生成自定义薪资项目,需要自动生成对应的自定义薪资项目 + List salaryItems = getSalaryItemService(user).listBySysSalaryItemIds(sysSalaryItemIds); + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getSysSalaryItemId); + + Date now = new Date(); + List needInsertSalaryItems = new ArrayList<>(); + List salarySobBackItems = new ArrayList<>(); + for (SysSalaryItemPO sysSalaryItem : sysSalaryItems) { + SalaryItemPO salaryItem = salaryItemMap.computeIfAbsent(sysSalaryItem.getId(), key -> { + SalaryItemPO temp = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItem, now, (long) env.getCurrentUser().getUID()); + needInsertSalaryItems.add(temp); + return temp; + }); + SalarySobBackItemPO salarySobBackItem = SalarySobBackItemPO.builder() + .id(IdGenerator.generate()) + .salarySobId(env.getSalarySob().getId()) +// .incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()) + .salaryItemId(salaryItem.getId()) + .salaryItemCode(salaryItem.getCode()) + .dataType(salaryItem.getDataType()) + .roundingMode(sysSalaryItem.getRoundingMode()) + .pattern(sysSalaryItem.getPattern()) + .valueType(sysSalaryItem.getValueType()) + .formulaId(sysSalaryItem.getFormulaId()) +// .hideSwitch(0) +// .sumSwitch(0) +// .readonlySwitch(0) +// .sortedIndex(0) + .backCalcType(Objects.equals(sysSalaryItem.getId(), 746777981115629575L) ? 0 : 1) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) +// .breator((long) env.getCurrentUser().getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + salarySobBackItems.add(salarySobBackItem); + } + if (CollectionUtils.isNotEmpty(needInsertSalaryItems)) { + getSalaryItemService(user).batchSave(needInsertSalaryItems); + } + if (CollectionUtils.isNotEmpty(salarySobBackItems)) { + getSalarySobBackItemService(user).batchInsert(salarySobBackItems); + } + } + + @Override + protected void initAddUpRule(SalarySobInitEnv env) { + // 只有「正常工资薪金」才默认生成累计字段对应规则 + boolean contains = Objects.equals(env.getSaveParam().getTaxableItems(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()); + if (!contains) { + return; + } + Date now = new Date(); + List salarySobAddUpRules = new ArrayList<>(); + // 账套薪资项目 + List salarySobItems = env.getSalarySobItems().stream() + .filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString())) + .collect(Collectors.toList()); + // AddUpSituationPO.class带有SalaryFormulaVar.class注解字段的name和账套薪资项目的code都是对应的,除了「addUpAdvanceTax」 + // 遍历AddUpSituationPO.class的SalaryFormulaVar.class注解,生成累计字段对应规则po + Map salarySobItemMap = SalaryEntityUtil.convert2Map(salarySobItems, + SalarySobItemPO::getSalaryItemCode); + for (Field declaredField : AddUpSituation.class.getDeclaredFields()) { + SalarySobItemPO salarySobItem = salarySobItemMap.get(declaredField.getName()); + if (Objects.equals(declaredField.getName(), "addUpAdvanceTax")) { + salarySobItem = salarySobItemMap.get("addUpTaxPayable"); + } + if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class) || Objects.isNull(salarySobItem)) { + continue; + } + SalarySobAddUpRulePO salarySobAddUpRule = new SalarySobAddUpRulePO() + .setId(IdGenerator.generate()) + .setSalarySobId(env.getSalarySob().getId()) + .setIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()) + .setSalaryItemId(salarySobItem.getSalaryItemId()) + .setAddUpColumnDataIndex(declaredField.getName()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + salarySobAddUpRules.add(salarySobAddUpRule); + } + if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) { + getSalarySobAddUpRuleService(user).saveBatch(salarySobAddUpRules); + } + } + + @Override + protected void initTaxReportRule(SalarySobInitEnv env) { + // 查询个税申报表的表头 + List taxReportColumns = new ArrayList<>(getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems()))); + Date now = new Date(); + // 个税申报表表头的reportColumnDataIndex和账套薪资项目的code都是对应的 + // 遍历个税申报表的表头,生成个税申报表字段对应规则po + List salarySobTaxReportRules = Lists.newArrayList(); + Map salarySobItemMap = SalaryEntityUtil.convert2Map(env.getSalarySobItems(), + e -> e.getIncomeCategory() + "-" + e.getSalaryItemCode()); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + SalarySobItemPO salarySobItem = salarySobItemMap.get(taxReportColumn.getIncomeCategory() + "-" + taxReportColumn.getReportColumnDataIndex()); + if (Objects.nonNull(salarySobItem)) { + SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO() + .setId(IdGenerator.generate()) + .setSalarySobId(env.getSalarySob().getId()) + .setIncomeCategory(salarySobItem.getIncomeCategory()) + .setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex()) + .setSalaryItemId(salarySobItem.getSalaryItemId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + salarySobTaxReportRules.add(salarySobTaxReportRule); + } + } + if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) { + getSalarySobTaxReportRuleService(user).saveBatch(salarySobTaxReportRules); + } + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 0a851f5db..0e58c83e3 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -131,6 +131,10 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalarySobInitService getSalarySobInitService(User user) { + return ServiceUtil.getService(SalarySobInitServiceImpl.class, user); + } + @Override public SalarySobPO getById(Long id) { return salarySobMapper.getById(id); @@ -272,23 +276,26 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98403, "薪资账套名称已存在")); } - // 保存参数转换成薪资账套po - SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID()); - // 保存薪资账套 - salarySobMapper.insert(salarySobPO); - //todo 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套") + ": " + salarySobPO.getName()); -// loggerContext.setOldValues(salarySobPO); -// salarySobLoggerTemplate.write(loggerContext); - // 新建薪资账套时,保存默认的员工信息字段 - saveDefaultEmpField(salarySobPO); - // 新建薪资账套时,保存默认的薪资项目 - saveDefaultItem(salarySobPO); + SalarySobPO salarySobPO = getSalarySobInitService(user).init(saveParam); + + +// // 保存参数转换成薪资账套po +// SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID()); +// // 保存薪资账套 +// salarySobMapper.insert(salarySobPO); +// //todo 记录日志 +//// LoggerContext loggerContext = new LoggerContext<>(); +//// loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); +//// loggerContext.setTargetName(salarySobPO.getName()); +//// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +//// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套")); +//// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套") + ": " + salarySobPO.getName()); +//// loggerContext.setOldValues(salarySobPO); +//// salarySobLoggerTemplate.write(loggerContext); +// // 新建薪资账套时,保存默认的员工信息字段 +// saveDefaultEmpField(salarySobPO); +// // 新建薪资账套时,保存默认的薪资项目 +// saveDefaultItem(salarySobPO); // 新建薪资账套时,保存默认的关联人员范围及从范围中排除 saveDefaultEmployeeRange(salarySobPO); // 返回薪资账套的主键id diff --git a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java new file mode 100644 index 000000000..2d55c7d86 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java @@ -0,0 +1,169 @@ +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.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.salarysob.SalarySobTaxReportRuleMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import dm.jdbc.util.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + * @description: 薪资账套的个税申报表规则 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/29 5:19 PM + * @version:v1.0 + */ +public class SalarySobTaxReportRuleServiceImpl extends Service implements SalarySobTaxReportRuleService { + + + private SalarySobTaxReportRuleMapper salarySobTaxReportRuleMapper() { + return MapperProxyFactory.getProxy(SalarySobTaxReportRuleMapper.class); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + + @Override + public List listBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return Collections.emptyList(); + } + return salarySobTaxReportRuleMapper().listSome(SalarySobTaxReportRulePO.builder().salarySobIds(salarySobIds).build()); + } + + @Override + public List getSalarySobTaxReportRuleDTO(Long salarySobId) { + List resultList = Lists.newArrayList(); + // 查询薪资账套 + SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId); + Integer incomeCategory = salarySob.getIncomeCategory(); + List incomeCategoryIds = Collections.singletonList(incomeCategory); + // 薪资账套的薪资项目 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId); + // 薪资账套的回算薪资项目 + List salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId); + // 薪资项目 + Set salaryItemIds = Sets.newHashSet(); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId)); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId)); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + // 薪资账套中已经存在的对应关系 + List salarySobTaxReportRules = listBySalarySobIds(Collections.singleton(salarySobId)); + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, + e -> e.getIncomeCategory() + "-" + e.getReportColumnDataIndex(), SalarySobTaxReportRulePO::getSalaryItemId); + + for (Integer incomeCategoryId : incomeCategoryIds) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List taxReportRules = Lists.newArrayList(); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + SalarySobTaxReportRuleDTO.TaxReportRuleDTO taxReportRuleDTO = new SalarySobTaxReportRuleDTO.TaxReportRuleDTO(); + taxReportRuleDTO.setId(taxReportColumn.getId()); + taxReportRuleDTO.setReportColumnName(taxReportColumn.getReportColumnName()); + taxReportRuleDTO.setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex()); + taxReportRuleDTO.setSalaryItem(Collections.emptyList()); + taxReportRuleDTO.setCanEdit(true); + Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxReportColumn.getReportColumnDataIndex()); + SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); + if (Objects.nonNull(salaryItem)) { + Map dataMap = Maps.newHashMap(); + dataMap.put("id", salaryItem.getId().toString()); + dataMap.put("name", salaryItem.getName()); + dataMap.put("icon", "Icon-N-Salary-item-management"); + taxReportRuleDTO.setSalaryItem(Collections.singletonList(dataMap)); + } + taxReportRules.add(taxReportRuleDTO); + } + + SalarySobTaxReportRuleDTO salarySobTaxReportRuleDTO = new SalarySobTaxReportRuleDTO(); + salarySobTaxReportRuleDTO.setIncomeCategoryId(incomeCategoryId.toString()); + salarySobTaxReportRuleDTO.setIncomeCategoryName(incomeCategoryEnum == null ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + salarySobTaxReportRuleDTO.setTaxReportRules(taxReportRules); + resultList.add(salarySobTaxReportRuleDTO); + } + return resultList; + } + + @Override + public void saveByParam(SalarySobTaxReportRuleSaveParam saveParam) { + // 校验参数是否合法 + // 构建po + Date now = new Date(); + List salarySobTaxReportRules = Lists.newArrayList(); + for (SalarySobTaxReportRuleSaveParam.TaxReportRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { + for (SalarySobTaxReportRuleSaveParam.TaxReportRuleParam taxReportRuleParam : incomeCategoryParam.getTaxReportRuleParams()) { + SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO() + .setId(IdGenerator.generate()) + .setSalarySobId(saveParam.getSalarySobId()) + .setIncomeCategory(incomeCategoryParam.getIncomeCategory()) + .setReportColumnDataIndex(taxReportRuleParam.getReportColumnDataIndex()) + .setSalaryItemId(taxReportRuleParam.getSalaryItemId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) user.getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + salarySobTaxReportRules.add(salarySobTaxReportRule); + } + } + deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId())); + if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) { + salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); + } + } + + @Override + public void deleteBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return; + } + salarySobTaxReportRuleMapper().deleteBySalarySobIds(salarySobIds); + } + + @Override + public void saveBatch(List salarySobTaxReportRules) { + if (CollectionUtils.isEmpty(salarySobTaxReportRules)) { + return; + } + salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); + } +} diff --git a/src/com/engine/salary/util/SalaryEnumUtil.java b/src/com/engine/salary/util/SalaryEnumUtil.java index f9ffcbc08..5e1eb1954 100644 --- a/src/com/engine/salary/util/SalaryEnumUtil.java +++ b/src/com/engine/salary/util/SalaryEnumUtil.java @@ -92,6 +92,7 @@ public class SalaryEnumUtil { for (BaseEnum enumMessage : enums) { Map hashMap = new HashMap(); + hashMap.put("enum", enumMessage); hashMap.put("value", enumMessage.getValue()); hashMap.put("defaultLabel", enumMessage.getDefaultLabel()); hashMap.put("labelId", enumMessage.getLabelId()); diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index e8e62dcdc..193f25559 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -216,7 +216,7 @@ public class EmployeeDeclareController { @Produces(MediaType.APPLICATION_JSON) public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam); } /** @@ -230,7 +230,7 @@ public class EmployeeDeclareController { @Produces(MediaType.APPLICATION_JSON) public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); } /** diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 840e1bc33..df122bd61 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -71,6 +71,9 @@ public class SalarySobController { return ServiceUtil.getService(SalarySobBackItemWrapper.class, user); } + private SalarySobTaxReportRuleWrapper getSalarySobTaxReportRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleWrapper.class, user); + } /**********************************薪资账套 start*********************************/ /** @@ -244,13 +247,13 @@ public class SalarySobController { public Response downloadSobRangeTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { User user = HrmUserVarify.getUser(request, response); SalarySobPO salarySobPO = Objects.isNull(salarySobId) ? null : getSalarySobWrapper(user).getSalarySobService(user).getById(salarySobId); - if(Objects.isNull(salarySobPO)){ + if (Objects.isNull(salarySobPO)) { throw new SalaryRunTimeException("薪资账套不存在或已被删除"); } try { XSSFWorkbook workbook = getSalarySobRangeWrapper(user).exportImportTemplate(); String time = LocalDate.now().toString(); - String fileName = salarySobPO.getName() + "人员范围导入模板" + time ; + String fileName = salarySobPO.getName() + "人员范围导入模板" + time; try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); } catch (UnsupportedEncodingException e) { @@ -261,17 +264,15 @@ public class SalarySobController { outputStream.flush(); }; response.setContentType("application/octet-stream"); - return Response.ok(output). - header("Content-disposition", "attachment;filename=" + fileName). - header("Cache-Control", "no-cache").build(); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); } catch (Exception e) { throw e; } } /** - * @description 薪资账套人员范围导入预览 * @return String + * @description 薪资账套人员范围导入预览 * @author Harryxzy * @date 2023/1/9 13:32 */ @@ -284,8 +285,8 @@ public class SalarySobController { } /** - * @description 薪资账套人员范围导入 * @return String + * @description 薪资账套人员范围导入 * @author Harryxzy * @date 2023/1/9 13:32 */ @@ -309,7 +310,7 @@ public class SalarySobController { @Produces(MediaType.APPLICATION_JSON) public String listSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSearchParam queryParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult >(user).run(getSalarySobItemWrapper(user)::listPage4SalaryItem, queryParam); + return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::listPage4SalaryItem, queryParam); } @@ -368,32 +369,28 @@ public class SalarySobController { } - - - /**********************************薪资账套的薪资项目 end*********************************/ - /**********************************薪资账套的回算项目 start*********************************/ - + /** - * @description 薪资账套回算项目列表 * @return String + * @description 薪资账套回算项目列表 * @author Harryxzy * @date 2022/11/16 14:01 */ @GET @Path("/backitem/getAggregate") @Produces(MediaType.APPLICATION_JSON) - public String getSalarySobBackItemAggregate(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "salarySobId") Long salarySobId) { + public String getSalarySobBackItemAggregate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getAggregate, salarySobId); + return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getAggregate, salarySobId); } /** - * @description 薪资账套回算项目详情(编辑前获取) * @return null + * @description 薪资账套回算项目详情(编辑前获取) * @author Harryxzy * @date 2022/11/16 14:02 */ @@ -401,28 +398,61 @@ public class SalarySobController { @Path("/backitem/getForm") @ApiOperation("薪资账套回算项目详情") @Produces(MediaType.APPLICATION_JSON) - public String getSalarySobBackItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value ="id") Long id) { + public String getSalarySobBackItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getForm, id); + return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getForm, id); } /** * @description 保存薪资账套回算项目 - * @return String * @author Harryxzy * @date 2022/11/16 15:05 */ @POST @Path("/backitem/save") @Produces(MediaType.APPLICATION_JSON) - public String saveSalarySobBackItem(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalarySobBackItemSaveParam saveParam) { + public String saveSalarySobBackItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobBackItemSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalarySobBackItemWrapper(user)::save, saveParam); + return new ResponseResult>(user).run(getSalarySobBackItemWrapper(user)::save, saveParam); } /**********************************薪资账套的回算项目 end*********************************/ + /**********************************薪资账套的个税申报表规则 start*********************************/ + + /** + * 薪资账套下的个税申报表规则的详情 + * + * @param id 薪资账套id + * @return + */ + @GET + @Path("/taxreportrule/getForm") + @ApiOperation("薪资账套下的个税申报表规则的详情") + @Produces(MediaType.APPLICATION_JSON) + public String getSalarySobTaxReportRuleForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobTaxReportRuleWrapper(user)::getForm, id); + } + + /** + * 保存薪资账套下的个税申报表规则的 + * + * @param saveParam 保存参数 + * @return + */ + @POST + @Path("/taxreportrule/save") + @ApiOperation("保存薪资账套下的个税申报表规则的") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobTaxReportRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobTaxReportRuleSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobTaxReportRuleWrapper(user)::save, saveParam); + } + + /**********************************薪资账套的个税申报表规则 end*********************************/ + /**********************************调薪计薪规则 start*********************************/ diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index f9b70f44f..c3f36f70a 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -113,7 +113,7 @@ public class EmployeeDeclareWrapper extends Service { List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam(queryParam); employeeDeclarePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), employeeDeclarePOS); List convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS); - PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),EmployeeDeclareListDTO.class); + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class); pageInfo.setList(convert); pageInfo.setTotal(employeeDeclarePOS.size()); @@ -147,7 +147,7 @@ public class EmployeeDeclareWrapper extends Service { PageInfo addPoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), addPOList, EmployeeDeclarePO.class); List addDTOList = getEmployeeDeclareService(user).convert(addPoPageInfo.getList()); // 分页 - PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class); pageInfo.setList(addDTOList); pageInfo.setTotal(addPOList.size()); @@ -185,7 +185,7 @@ public class EmployeeDeclareWrapper extends Service { // 查询上个月报送的人员 Set employeeIds = SalaryEntityUtil.properties(poPageInfo.getList(), EmployeeDeclarePO::getEmployeeId); List preTaxCycleEmployeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds( - SalaryDateUtil.plusMonths(queryParam.getTaxCycle(),-1), queryParam.getTaxAgentId(), employeeIds); + SalaryDateUtil.plusMonths(queryParam.getTaxCycle(), -1), queryParam.getTaxAgentId(), employeeIds); // 获取修改了哪些字段 Map> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares); for (EmployeeDeclareListDTO employeeDeclareListDTO : (List) dtoPageInfo.getList()) { @@ -270,12 +270,12 @@ public class EmployeeDeclareWrapper extends Service { .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS) .setCardNum(employeeDeclare.getCardNum()) .setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class)) - .setBirthday(SalaryDateUtil.dateToLocalDate(employeeDeclare.getBirthday())) + .setBirthday(employeeDeclare.getBirthday()) .setEmploymentStatus(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class)) .setMobile(employeeDeclare.getMobile()) .setEmploymentType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class)) - .setEmploymentDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getEmploymentDate())) - .setDismissDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getDismissDate())) + .setEmploymentDate(employeeDeclare.getEmploymentDate()) + .setDismissDate(employeeDeclare.getDismissDate()) .setDisability(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class)) .setDisabilityCardNo(employeeDeclare.getDisabilityCardNo()) .setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class)) @@ -531,7 +531,7 @@ public class EmployeeDeclareWrapper extends Service { * @return */ public EmployeeDeclareRateDTO getRate(String index) { - return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE+ index); + return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE + index); } // /** diff --git a/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java new file mode 100644 index 000000000..ce55fcd45 --- /dev/null +++ b/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java @@ -0,0 +1,46 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam; +import com.engine.salary.service.SalarySobTaxReportRuleService; +import com.engine.salary.service.impl.SalarySobTaxReportRuleServiceImpl; +import org.springframework.stereotype.Component; +import weaver.hrm.User; + +import java.util.List; + +/** + * @description: 薪资账套的个税申报表规则 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/12/7 4:27 PM + * @version:v1.0 + */ +@Component +public class SalarySobTaxReportRuleWrapper extends Service { + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + + /** + * 薪资账套的个税申报表规则 + * + * @param salarySobId + * @return + */ + public List getForm(Long salarySobId) { + return getSalarySobTaxReportRuleService(user).getSalarySobTaxReportRuleDTO(salarySobId); + } + + /** + * 保存薪资账套的个税申报表规则 + * + * @param saveParam + */ + public void save(SalarySobTaxReportRuleSaveParam saveParam) { + getSalarySobTaxReportRuleService(user).saveByParam(saveParam); + } +} From 3004394e96dd518e62158b1f48aced167b798eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 15 Aug 2023 20:50:47 +0800 Subject: [PATCH 016/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94=E3=80=81=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308150603.sql | 62 +++++++++++++++++++ resource/sqlupgrade/GS/sql202308150603.sql | 62 +++++++++++++++++++ resource/sqlupgrade/JC/sql202308150603.sql | 62 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202308150603.sql | 58 +++++++++++++++++ .../sqlupgrade/Oracle/sql202308150603.sql | 57 +++++++++++++++++ resource/sqlupgrade/PG/sql202308150603.sql | 61 ++++++++++++++++++ .../sqlupgrade/SQLServer/sql202308150603.sql | 58 +++++++++++++++++ resource/sqlupgrade/ST/sql202308150603.sql | 62 +++++++++++++++++++ 8 files changed, 482 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202308150603.sql create mode 100644 resource/sqlupgrade/GS/sql202308150603.sql create mode 100644 resource/sqlupgrade/JC/sql202308150603.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308150603.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308150603.sql create mode 100644 resource/sqlupgrade/PG/sql202308150603.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308150603.sql create mode 100644 resource/sqlupgrade/ST/sql202308150603.sql diff --git a/resource/sqlupgrade/DM/sql202308150603.sql b/resource/sqlupgrade/DM/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome'); +/ + diff --git a/resource/sqlupgrade/GS/sql202308150603.sql b/resource/sqlupgrade/GS/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome'); +/ + diff --git a/resource/sqlupgrade/JC/sql202308150603.sql b/resource/sqlupgrade/JC/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome'); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308150603.sql b/resource/sqlupgrade/Mysql/sql202308150603.sql new file mode 100644 index 000000000..e7e16eeb1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308150603.sql @@ -0,0 +1,58 @@ +create table hrsa_sob_add_up_rule +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + salary_sob_id bigint comment 'н׵id' , + income_category varchar(100) comment 'Ŀ' , + salary_item_id bigint comment 'нĿid' , + add_up_column_data_index varchar(100) comment 'ۼֶ' +) +; +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings') +; + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax' +; + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax') +; +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable' +; +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome') +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150603.sql b/resource/sqlupgrade/Oracle/sql202308150603.sql new file mode 100644 index 000000000..824a4ce82 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150603.sql @@ -0,0 +1,57 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +) +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings') +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax' +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax') +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable' +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome') +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150603.sql b/resource/sqlupgrade/PG/sql202308150603.sql new file mode 100644 index 000000000..001f75870 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308150603.sql @@ -0,0 +1,61 @@ +create table hrsa_sob_add_up_rule +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + salary_sob_id bigint, + income_category varchar(100), + salary_item_id bigint, + add_up_column_data_index varchar(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150603.sql b/resource/sqlupgrade/SQLServer/sql202308150603.sql new file mode 100644 index 000000000..4cf555b00 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308150603.sql @@ -0,0 +1,58 @@ +create table hrsa_sob_add_up_rule +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + salary_sob_id bigint, + income_category nvarchar(100), + salary_item_id bigint, + add_up_column_data_index nvarchar(100) +) +GO + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings') +GO +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax' +GO + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax') +GO +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable' +GO +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome') +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308150603.sql b/resource/sqlupgrade/ST/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome'); +/ + From 4ba4dbc09001c353e379696e7af72fb729aec327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 15 Aug 2023 20:56:14 +0800 Subject: [PATCH 017/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94=E3=80=81=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/web/SalarySobController.java | 36 ++++++++++++++++ .../wrapper/SalarySobAddUpRuleWrapper.java | 43 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index df122bd61..e09071f23 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -74,6 +74,10 @@ public class SalarySobController { private SalarySobTaxReportRuleWrapper getSalarySobTaxReportRuleWrapper(User user) { return ServiceUtil.getService(SalarySobTaxReportRuleWrapper.class, user); } + + private SalarySobAddUpRuleWrapper getSalarySobAddUpRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleWrapper.class, user); + } /**********************************薪资账套 start*********************************/ /** @@ -418,6 +422,38 @@ public class SalarySobController { /**********************************薪资账套的回算项目 end*********************************/ + /**********************************薪资账套的累计字段对应关系 start*********************************/ + + /** + * 薪资账套下的累计字段对应关系 + * + * @param id 薪资账套id + * @return + */ + @GET + @Path("/adduprule/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getSalarySobAddUpForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobAddUpRuleWrapper(user)::getForm, id); + } + + /** + * 保存薪资账套下的累计字段对应关系 + * + * @param saveParam 保存参数 + * @return + */ + @POST + @Path("/adduprule/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobAddUp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobAddUpRuleSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobAddUpRuleWrapper(user)::save, saveParam); + } + + /**********************************薪资账套的累计字段对应关系 end*********************************/ + /**********************************薪资账套的个税申报表规则 start*********************************/ diff --git a/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java new file mode 100644 index 000000000..1c9e2c5c3 --- /dev/null +++ b/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java @@ -0,0 +1,43 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.dto.SalarySobAddUpRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobAddUpRuleSaveParam; +import com.engine.salary.service.SalarySobAddUpRuleService; +import com.engine.salary.service.impl.SalarySobAddUpRuleServiceImpl; +import weaver.hrm.User; + +import java.util.List; + +/** + * @description: 薪资账套的累计字段对应关系 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/1/4 10:36 AM + * @version:v1.0 + */ +public class SalarySobAddUpRuleWrapper extends Service { + + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } + /** + * 获取薪资账套的累计字段对应关系 + * + * @param salarySobId + * @return + */ + public List getForm(Long salarySobId) { + return getSalarySobAddUpRuleService(user).listSalarySobAddUpRuleDTO(salarySobId); + } + + /** + * 保存薪资账套的累计字段对应关系 + * + * @param saveParam + */ + public void save(SalarySobAddUpRuleSaveParam saveParam) { + getSalarySobAddUpRuleService(user).saveByParam(saveParam); + } +} From 414f960346ac970d793e659175c1322871796936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 17 Aug 2023 09:22:09 +0800 Subject: [PATCH 018/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94=E3=80=81=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308150503.sql | 60 ++ resource/sqlupgrade/DM/sql202308160103.sql | 23 + resource/sqlupgrade/GS/sql202308150503.sql | 60 ++ resource/sqlupgrade/GS/sql202308160103.sql | 23 + resource/sqlupgrade/JC/sql202308150503.sql | 60 ++ resource/sqlupgrade/JC/sql202308160103.sql | 23 + resource/sqlupgrade/Mysql/sql202308150503.sql | 619 +++++++++++++++ resource/sqlupgrade/Mysql/sql202308160103.sql | 22 + .../sqlupgrade/Oracle/sql202308150503.sql | 49 ++ .../sqlupgrade/Oracle/sql202308160103.sql | 23 + resource/sqlupgrade/PG/sql202308150503.sql | 728 ++++++++++++++++++ resource/sqlupgrade/PG/sql202308160103.sql | 22 + .../sqlupgrade/SQLServer/sql202308150503.sql | 619 +++++++++++++++ .../sqlupgrade/SQLServer/sql202308160103.sql | 22 + resource/sqlupgrade/ST/sql202308150503.sql | 60 ++ resource/sqlupgrade/ST/sql202308160103.sql | 23 + .../entity/browser/dto/BrowserDataDTO.java | 30 + .../browser/param/BrowserDataQueryParam.java | 24 + .../dto/EmployeeDeclareFromDTO.java | 4 +- .../salarysob/po/SalarySobAddUpRulePO.java | 1 + .../salaryacct/SalaryAcctEmployeeMapper.xml | 40 +- .../salaryacct/SalaryAcctRecordMapper.java | 2 +- .../salarysob/SalarySobAddUpRuleMapper.xml | 8 +- .../SalarySobTaxReportRuleMapper.xml | 12 +- .../TaxAgentTaxReturnCheckServiceFactory.java | 14 - .../impl/SalaryAcctTaxAgentServiceImpl.java | 112 +++ .../SalarySobTaxReportRuleServiceImpl.java | 6 +- .../impl/TaxDeclareRecordServiceImpl.java | 25 +- .../salary/web/SalaryCommonController.java | 17 +- .../salary/web/TaxDeclarationController.java | 8 +- .../wrapper/EmployeeDeclareWrapper.java | 31 +- .../salary/wrapper/SalaryCommonWrapper.java | 35 + .../salary/wrapper/TaxPaymentWrapper.java | 60 ++ 33 files changed, 2787 insertions(+), 78 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202308150503.sql create mode 100644 resource/sqlupgrade/DM/sql202308160103.sql create mode 100644 resource/sqlupgrade/GS/sql202308150503.sql create mode 100644 resource/sqlupgrade/GS/sql202308160103.sql create mode 100644 resource/sqlupgrade/JC/sql202308150503.sql create mode 100644 resource/sqlupgrade/JC/sql202308160103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308150503.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308160103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308150503.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308160103.sql create mode 100644 resource/sqlupgrade/PG/sql202308150503.sql create mode 100644 resource/sqlupgrade/PG/sql202308160103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308150503.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308160103.sql create mode 100644 resource/sqlupgrade/ST/sql202308150503.sql create mode 100644 resource/sqlupgrade/ST/sql202308160103.sql create mode 100644 src/com/engine/salary/entity/browser/dto/BrowserDataDTO.java create mode 100644 src/com/engine/salary/entity/browser/param/BrowserDataQueryParam.java create mode 100644 src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java create mode 100644 src/com/engine/salary/wrapper/TaxPaymentWrapper.java diff --git a/resource/sqlupgrade/DM/sql202308150503.sql b/resource/sqlupgrade/DM/sql202308150503.sql new file mode 100644 index 000000000..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/DM/sql202308160103.sql b/resource/sqlupgrade/DM/sql202308160103.sql new file mode 100644 index 000000000..99fd849d7 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308160103.sql @@ -0,0 +1,23 @@ +create table hrsa_acct_tax_agent +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + salary_month date, + tax_cycle date, +income_category varchar2(100) +); +/ + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); +/ + diff --git a/resource/sqlupgrade/GS/sql202308150503.sql b/resource/sqlupgrade/GS/sql202308150503.sql new file mode 100644 index 000000000..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/GS/sql202308160103.sql b/resource/sqlupgrade/GS/sql202308160103.sql new file mode 100644 index 000000000..99fd849d7 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308160103.sql @@ -0,0 +1,23 @@ +create table hrsa_acct_tax_agent +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + salary_month date, + tax_cycle date, +income_category varchar2(100) +); +/ + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); +/ + diff --git a/resource/sqlupgrade/JC/sql202308150503.sql b/resource/sqlupgrade/JC/sql202308150503.sql new file mode 100644 index 000000000..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/JC/sql202308160103.sql b/resource/sqlupgrade/JC/sql202308160103.sql new file mode 100644 index 000000000..99fd849d7 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308160103.sql @@ -0,0 +1,23 @@ +create table hrsa_acct_tax_agent +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + salary_month date, + tax_cycle date, +income_category varchar2(100) +); +/ + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308150503.sql b/resource/sqlupgrade/Mysql/sql202308150503.sql new file mode 100644 index 000000000..6b97fb8f1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308150503.sql @@ -0,0 +1,619 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz') +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308160103.sql b/resource/sqlupgrade/Mysql/sql202308160103.sql new file mode 100644 index 000000000..877dd233d --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308160103.sql @@ -0,0 +1,22 @@ +create table hrsa_acct_tax_agent +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + salary_acct_record_id bigint comment 'нʺ¼id' , + tax_agent_id bigint comment '˰۽˵id' , + salary_month datetime comment 'н' , + tax_cycle datetime comment '˰' , + income_category varchar(100) +) +; + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, tax_agent_id, tax_cycle) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150503.sql b/resource/sqlupgrade/Oracle/sql202308150503.sql new file mode 100644 index 000000000..b51e6e345 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150503.sql @@ -0,0 +1,49 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark') +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark' +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308160103.sql b/resource/sqlupgrade/Oracle/sql202308160103.sql new file mode 100644 index 000000000..efcd65cef --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308160103.sql @@ -0,0 +1,23 @@ +create table hrsa_acct_tax_agent +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + salary_month date, + tax_cycle date, +income_category varchar2(100) +) +/ + + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150503.sql b/resource/sqlupgrade/PG/sql202308150503.sql new file mode 100644 index 000000000..60602a663 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308150503.sql @@ -0,0 +1,728 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308160103.sql b/resource/sqlupgrade/PG/sql202308160103.sql new file mode 100644 index 000000000..32f325165 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308160103.sql @@ -0,0 +1,22 @@ +create table hrsa_acct_tax_agent +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + salary_acct_record_id bigint, + tax_agent_id bigint, + salary_month timestamp, + tax_cycle timestamp, +income_category varchar(100) +); +/ + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150503.sql b/resource/sqlupgrade/SQLServer/sql202308150503.sql new file mode 100644 index 000000000..49e43f18a --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308150503.sql @@ -0,0 +1,619 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz') +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308160103.sql b/resource/sqlupgrade/SQLServer/sql202308160103.sql new file mode 100644 index 000000000..b9219cc81 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308160103.sql @@ -0,0 +1,22 @@ +create table hrsa_acct_tax_agent +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + salary_acct_record_id bigint, + tax_agent_id bigint, + salary_month datetime, + tax_cycle datetime, +income_category nvarchar(100) +) +GO + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308150503.sql b/resource/sqlupgrade/ST/sql202308150503.sql new file mode 100644 index 000000000..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/ST/sql202308160103.sql b/resource/sqlupgrade/ST/sql202308160103.sql new file mode 100644 index 000000000..99fd849d7 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308160103.sql @@ -0,0 +1,23 @@ +create table hrsa_acct_tax_agent +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + salary_month date, + tax_cycle date, +income_category varchar2(100) +); +/ + +insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) +select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle +from hrsa_salary_acct_emp +where delete_type = 0 + and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); +/ + diff --git a/src/com/engine/salary/entity/browser/dto/BrowserDataDTO.java b/src/com/engine/salary/entity/browser/dto/BrowserDataDTO.java new file mode 100644 index 000000000..193876e79 --- /dev/null +++ b/src/com/engine/salary/entity/browser/dto/BrowserDataDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.browser.dto; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 浏览按钮 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class BrowserDataDTO { + + private Long id; + + @TableTitle(title = "名称", dataIndex = "name", key = "name") + private String name; + +} diff --git a/src/com/engine/salary/entity/browser/param/BrowserDataQueryParam.java b/src/com/engine/salary/entity/browser/param/BrowserDataQueryParam.java new file mode 100644 index 000000000..d23be6e5f --- /dev/null +++ b/src/com/engine/salary/entity/browser/param/BrowserDataQueryParam.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.browser.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 浏览按钮 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BrowserDataQueryParam extends BaseQueryParam { + private String type; + private String jsonParam; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java index 29a0d7886..a37015af5 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -15,6 +15,8 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.util.Date; +import java.util.List; +import java.util.Map; /** * @description: 人员报送(人员)表单 @@ -38,7 +40,7 @@ public class EmployeeDeclareFromDTO { // 系统名称 @TableTitle(title = "系统名称", dataIndex = "employee", key = "employee") - private String employee; + private List> employee; // 证件姓名 @TableTitle(title = "证件姓名", dataIndex = "employeeName", key = "employeeName") diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java index bab688ced..454381960 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java @@ -45,5 +45,6 @@ public class SalarySobAddUpRulePO { //更新时间 private Date updateTime; + private Collection ids; private Collection salarySobIds; } diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index d48bd3629..676f38710 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -927,6 +927,7 @@ + @@ -958,72 +959,75 @@ parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO"> SELECT + ,r.tax_cycle,b.income_category FROM hrsa_salary_acct_emp t - WHERE delete_type = 0 + left join hrsa_salary_acct_record r on t.salary_acct_record_id = r.id + left join hrsa_salary_sob b on r.salary_sob_id = b.id + WHERE t.delete_type = 0 and r.delete_type = 0 and b.delete_type = 0 - AND id = #{id} + AND t.id = #{id} - AND salary_acct_record_id = #{salaryAcctRecordId} + AND t.salary_acct_record_id = #{salaryAcctRecordId} - AND salary_sob_id = #{salarySobId} + AND t.salary_sob_id = #{salarySobId} - AND employee_id = #{employeeId} + AND t.employee_id = #{employeeId} - AND tax_agent_id = #{taxAgentId} + AND t.tax_agent_id = #{taxAgentId} - AND salary_month = #{salaryMonth} + AND t.salary_month = #{salaryMonth} - AND creator = #{creator} + AND t.creator = #{creator} - AND create_time = #{createTime} + AND t.create_time = #{createTime} - AND update_time = #{updateTime} + AND t.update_time = #{updateTime} - AND delete_type = #{deleteType} + AND t.delete_type = #{deleteType} - AND tenant_key = #{tenantKey} + AND t.tenant_key = #{tenantKey} - AND id IN + AND t.id IN #{id} - AND salary_acct_record_id IN + AND t.salary_acct_record_id IN #{salaryAcctRecordId} - AND employee_id IN + AND t.employee_id IN #{employeeId} - AND tax_agent_id IN + AND t.tax_agent_id IN #{taxAgentId} - AND salary_month IN + AND t.salary_month IN #{salaryMonth} - ORDER BY id DESC + ORDER BY t.id DESC diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java index 0863b5358..6b76b15f3 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java @@ -86,5 +86,5 @@ public interface SalaryAcctRecordMapper { * @param salaryAcctIds * @return */ - List listAcctTaxAgent(Collection salaryAcctIds); + List listAcctTaxAgent(@Param("salaryAcctRecordIds")Collection salaryAcctIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml index d42b5e766..8f0b84e4a 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml @@ -208,7 +208,7 @@ salary_item_id, salary_sob_id, tenant_key, - update_time, + update_time ) @@ -222,7 +222,7 @@ #{item.salaryItemId,jdbcType=DOUBLE}, #{item.salarySobId,jdbcType=DOUBLE}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.updateTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE} from dual @@ -240,7 +240,7 @@ salary_item_id, salary_sob_id, tenant_key, - update_time, + update_time ) VALUES ( @@ -253,7 +253,7 @@ #{item.salaryItemId}, #{item.salarySobId}, #{item.tenantKey}, - #{item.updateTime}, + #{item.updateTime} ) diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml index e0c68ae3a..d49f3cdfe 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml @@ -183,7 +183,7 @@ salary_sob_id, income_category, report_column_data_index, - salary_item_id, + salary_item_id ) VALUES ( @@ -197,7 +197,7 @@ #{item.salarySobId}, #{item.incomeCategory}, #{item.reportColumnDataIndex}, - #{item.salaryItemId}, + #{item.salaryItemId} ) @@ -214,7 +214,7 @@ salary_sob_id, income_category, report_column_data_index, - salary_item_id, + salary_item_id ) @@ -228,7 +228,7 @@ #{item.salarySobId,jdbcType=DOUBLE}, #{item.incomeCategory,jdbcType=VARCHAR}, #{item.reportColumnDataIndex,jdbcType=VARCHAR}, - #{item.salaryItemId,jdbcType=DOUBLE}, + #{item.salaryItemId,jdbcType=DOUBLE} from dual @@ -246,7 +246,7 @@ salary_sob_id, income_category, report_column_data_index, - salary_item_id, + salary_item_id ) VALUES ( @@ -259,7 +259,7 @@ #{item.salarySobId}, #{item.incomeCategory}, #{item.reportColumnDataIndex}, - #{item.salaryItemId}, + #{item.salaryItemId} ) diff --git a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java index a807422bf..31b50a2a7 100644 --- a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java +++ b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java @@ -14,14 +14,6 @@ import weaver.hrm.User; **/ public class TaxAgentTaxReturnCheckServiceFactory { - // private final Map serviceMap = new ConcurrentHashMap<>(); -// -// public TaxAgentTaxReturnCheckServiceFactory(Map map) { -// for (Map.Entry entry : map.entrySet()) { -// serviceMap.putIfAbsent(entry.getValue().getCheckType(), entry.getValue()); -// } -// } - private User user; public TaxAgentTaxReturnCheckServiceFactory(User user) { @@ -30,12 +22,6 @@ public class TaxAgentTaxReturnCheckServiceFactory { public TaxAgentTaxReturnCheckService get(Integer type) { -// TaxAgentTaxReturnCheckService service = serviceMap.get(type); -// if (service == null) { -// throw new SalaryRunTimeException("TaxAgentTaxReturnCheckService is null"); -// } -// return service; - //验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码 AbstractTaxAgentTaxReturnCheckService service = null; if (type == 1) { diff --git a/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java new file mode 100644 index 000000000..49acd5b52 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java @@ -0,0 +1,112 @@ +//package com.engine.salary.service.impl; +// +//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +//import com.baomidou.mybatisplus.core.toolkit.Wrappers; +//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +//import com.engine.core.impl.Service; +//import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +//import com.engine.salary.service.SalaryAcctTaxAgentService; +//import com.google.common.collect.Lists; +//import com.google.common.collect.Sets; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.common.hr.util.Util; +//import com.weaver.hrm.salary.common.YearMonthRange; +//import com.weaver.hrm.salary.dao.SalaryAcctTaxAgentMapper; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +//import org.apache.commons.collections4.CollectionUtils; +//import org.springframework.transaction.annotation.Transactional; +// +//import java.time.LocalDateTime; +//import java.util.*; +// +///** +// * @description: +// * @author: xiajun +// * @modified By: xiajun +// * @date: 2022/7/29 9:45 +// * @version:v1.0 +// */ +//public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService { +// +// private SalaryAcctTaxAgentMapper salaryAcctTaxAgentMapper; +// +// @Override +// public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { +// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { +// return Collections.emptyList(); +// } +// return new LambdaQueryChainWrapper<>(salaryAcctTaxAgentMapper) +// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey) +// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds) +// .list(); +// } +// +// @Override +// public List listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey) { +// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); +// queryWrapper.eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey); +// queryWrapper.eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()); +// if (Objects.nonNull(taxCycleRange.getStartMonth())) { +// queryWrapper.ge(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getStartMonth().toString()); +// } +// if (Objects.nonNull(taxCycleRange.getEndMonth())) { +// queryWrapper.le(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getEndMonth().toString()); +// } +// return salaryAcctTaxAgentMapper.selectList(queryWrapper); +// } +// +// @Override +// public List initBySalaryAcctEmployees(List salaryAcctEmployees, Long employeeId, String tenantKey) { +// if (CollectionUtils.isEmpty(salaryAcctEmployees)) { +// return Collections.emptyList(); +// } +// LocalDateTime now = LocalDateTime.now(); +// Set keySet = Sets.newHashSet(); +// List salaryAcctTaxAgents = Lists.newArrayList(); +// for (SalaryAcctEmployeePO salaryAcctEmployee : salaryAcctEmployees) { +// String key = salaryAcctEmployee.getTaxAgentId() + "-" + salaryAcctEmployee.getTaxCycle() + "-" + salaryAcctEmployee.getIncomeCategory(); +// if (!keySet.contains(key)) { +// keySet.add(key); +// SalaryAcctTaxAgentPO salaryAcctTaxAgent = new SalaryAcctTaxAgentPO() +// .setId(IdGenerator.generate()) +// .setSalaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) +// .setIncomeCategory(Util.getIntValue(salaryAcctEmployee.getIncomeCategory())) +// .setTaxAgentId(salaryAcctEmployee.getTaxAgentId()) +// .setSalaryMonth(salaryAcctEmployee.getSalaryMonth()) +// .setTaxCycle(salaryAcctEmployee.getTaxCycle()) +// .setCreator(employeeId) +// .setTenantKey(tenantKey) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// salaryAcctTaxAgents.add(salaryAcctTaxAgent); +// } +// } +// return salaryAcctTaxAgents; +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void batchSave(List salaryAcctTaxAgents, String tenantKey) { +// if (CollectionUtils.isNotEmpty(salaryAcctTaxAgents)) { +// saveBatch(salaryAcctTaxAgents); +// } +// } +// +// @Override +// public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { +// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { +// return; +// } +// new LambdaUpdateChainWrapper<>(salaryAcctTaxAgentMapper) +// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey) +// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds) +// .set(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) +// .set(SalaryAcctTaxAgentPO::getUpdateTime, LocalDateTime.now()) +// .update(); +// } +//} diff --git a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java index 2d55c7d86..fc49f01fa 100644 --- a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java @@ -147,7 +147,8 @@ public class SalarySobTaxReportRuleServiceImpl extends Service implements Salary } deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId())); if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) { - salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); + salarySobTaxReportRules.forEach(salarySobTaxReportRuleMapper()::insertIgnoreNull); +// salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); } } @@ -164,6 +165,7 @@ public class SalarySobTaxReportRuleServiceImpl extends Service implements Salary if (CollectionUtils.isEmpty(salarySobTaxReportRules)) { return; } - salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); + salarySobTaxReportRules.forEach(salarySobTaxReportRuleMapper()::insertIgnoreNull); +// salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index e7bc2f198..2cc75b0cd 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -121,12 +121,15 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe private SalaryItemService getSalaryItemService(User user) { return ServiceUtil.getService(SalaryItemServiceImpl.class, user); } - private SalarySobTaxReportRuleService salarySobTaxReportRuleService; - + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } private TaxReportColumnService getTaxReportColumnService(User user) { return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); } - private SalarySobAddUpRuleService salarySobAddUpRuleService; + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } private TaxPaymentServiceFactory taxPaymentServiceFactory; @@ -217,7 +220,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List newTaxDeclarationValues = Lists.newArrayList(); List newAddUpSituations = Lists.newArrayList(); // 根据个税扣缴义务人范围查询个税扣缴义务人 - Collection taxAgents = queryByTaxAgentRange(saveParam); + Collection taxAgents = queryByTaxAgentRange(saveParam); Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); // 查询薪资所属月下的薪资核算记录,并按照权限过滤 LocalDateRange salaryMonthRange = new LocalDateRange().setFromDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))).setEndDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); @@ -355,18 +358,18 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List taxReportColumns = getTaxReportColumnService(user).listAll(); Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); // 查询薪资核算记录 - Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); + List salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId, Collectors.toList()); List salaryAcctRecords = getSalaryAcctRecordService(user).listByIds(salaryAcctRecordIds); Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId); // 查询薪资核算结果 - Set salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getId); + List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getId, Collectors.toList()); List salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); // 查询薪资账套的累计字段对应关系 - Set salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalarySobId); - List salarySobAddUpRules = salarySobAddUpRuleService.listBySalarySobIds(salarySobIds); + List salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalarySobId, Collectors.toList()); + List salarySobAddUpRules = getSalarySobAddUpRuleService(user).listBySalarySobIds(salarySobIds); Map salarySobAddUpRuleMap = SalaryEntityUtil.convert2Map(salarySobAddUpRules, e -> e.getSalarySobId() + "-" + e.getAddUpColumnDataIndex()); // 查询薪资账套的个税申报表对应规则 - List salarySobTaxReportRules = salarySobTaxReportRuleService.listBySalarySobIds(salarySobIds); + List salarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(salarySobIds); Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, e -> e.getSalarySobId() + "-" + e.getReportColumnDataIndex()); // 薪资核算结果按照薪资核算人员id聚合分类 Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); @@ -444,7 +447,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } else if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ADMIN_TAX_AGENT) { taxAgents = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); } else { - taxAgents = getTaxAgentService(user).listByIds(saveParam.getTaxAgentIds()); +// taxAgents = getTaxAgentService(user).listByIds(saveParam.getTaxAgentIds()); + TaxAgentPO po = getTaxAgentService(user).getById(saveParam.getTaxAgentId()); + return Collections.singletonList(po); } return taxAgents; } diff --git a/src/com/engine/salary/web/SalaryCommonController.java b/src/com/engine/salary/web/SalaryCommonController.java index ca7a439dc..afd17de39 100644 --- a/src/com/engine/salary/web/SalaryCommonController.java +++ b/src/com/engine/salary/web/SalaryCommonController.java @@ -1,19 +1,20 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.browser.dto.BrowserDataDTO; +import com.engine.salary.entity.browser.param.BrowserDataQueryParam; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.SalaryCommonWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.List; @@ -51,5 +52,11 @@ public class SalaryCommonController { return new ResponseResult(user).run(getSalaryCommonWrapper(user)::removeCache, key); } - + @POST + @Path("/browser/data") + @Produces(MediaType.APPLICATION_JSON) + public String removeCache(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody BrowserDataQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryCommonWrapper(user)::getBrowserData, param); + } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 11a7a7655..cc8d93841 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -11,6 +11,7 @@ import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationDetailWrapper; import com.engine.salary.wrapper.TaxDeclarationWrapper; @@ -164,7 +165,7 @@ public class TaxDeclarationController { @GET @Path("/getForm") @Produces(MediaType.APPLICATION_JSON) - public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) { + public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getForm, id); } @@ -178,7 +179,7 @@ public class TaxDeclarationController { @GET @Path("/getTaxDeclarationInfo") @Produces(MediaType.APPLICATION_JSON) - public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) { + public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, id); } @@ -192,8 +193,9 @@ public class TaxDeclarationController { @Path("/save") @POST @Produces(MediaType.APPLICATION_JSON) - public String saveTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationSaveParam saveParam) { + public String saveTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); + saveParam.setSalaryMonth(SalaryDateUtil.String2YearMonth(saveParam.getSalaryMonthStr())); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::save, saveParam); } diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index c3f36f70a..553151fe5 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -16,14 +16,8 @@ import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.service.EmployeeDeclareService; -import com.engine.salary.service.SalaryCacheService; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.impl.EmployeeDeclareServiceImpl; -import com.engine.salary.service.impl.SalaryCacheServiceImpl; -import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; -import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; @@ -33,6 +27,7 @@ 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 com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; @@ -61,6 +56,10 @@ public class EmployeeDeclareWrapper extends Service { return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); } + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } @@ -69,7 +68,6 @@ public class EmployeeDeclareWrapper extends Service { return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); } - /** * 人员报送的个税扣缴义务人列表 * @@ -254,16 +252,21 @@ public class EmployeeDeclareWrapper extends Service { if (Objects.nonNull(id)) { employeeDeclare = getEmployeeDeclareService(user).getById(id); // 查询人员信息 - List employeeList = getSalaryEmployeeService(user).getEmployeeByIdsAll(Arrays.asList(employeeDeclare.getEmployeeId())); - Optional employee; + Map employeeMap = Maps.newHashMap(); if (Objects.equals(employeeDeclare.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { - employee = employeeList.stream().filter(e -> e.isExtEmp() == false).findFirst(); + DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(employeeDeclare.getEmployeeId()); + employeeMap.put("id", simpleEmployee.getEmployeeId()); + employeeMap.put("name", simpleEmployee.getUsername()); + employeeMap.put("_entityType", EmployeeTypeEnum.ORGANIZATION); } else { - employee = employeeList.stream().filter(e -> e.isExtEmp() == true).findFirst(); + DataCollectionEmployee extEmployee = getExtEmpService(user).getEmployeeById(employeeDeclare.getEmployeeId()); + employeeMap.put("id",extEmployee.getEmployeeId()); + employeeMap.put("name", extEmployee.getUsername()); + employeeMap.put("_entityType", EmployeeTypeEnum.EXT_EMPLOYEE); } employeeDeclareFrom.setId(employeeDeclare.getId()) .setTaxAgentId(employeeDeclare.getTaxAgentId()) - .setEmployee(employee.isPresent() ? employee.get().getUsername() : "") + .setEmployee(Collections.singletonList(employeeMap)) .setEmployeeName(employeeDeclare.getEmployeeName()) .setJobNum(employeeDeclare.getJobNum()) .setNationality(SalaryI18nUtil.getI18nLabel(94731, "中国")) diff --git a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java index baec86d91..bc013dba6 100644 --- a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java @@ -2,10 +2,23 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.browser.dto.BrowserDataDTO; +import com.engine.salary.entity.browser.param.BrowserDataQueryParam; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.service.SalaryCacheService; +import com.engine.salary.service.SalarySobItemService; import com.engine.salary.service.impl.SalaryCacheServiceImpl; +import com.engine.salary.service.impl.SalarySobItemServiceImpl; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + public class SalaryCommonWrapper extends Service { @@ -13,6 +26,10 @@ public class SalaryCommonWrapper extends Service { return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); } + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + public String getCacheInfo(String key) { return getSalaryCacheService(user).get(key); } @@ -20,4 +37,22 @@ public class SalaryCommonWrapper extends Service { public void removeCache(String key) { getSalaryCacheService(user).remove(key); } + + + public PageInfo getBrowserData(BrowserDataQueryParam param) { + String type = param.getType(); + + if (StringUtils.equals(type, "salaryItemBrowser")) { + Map map = JsonUtil.parseMap(param.getJsonParam(), String.class); + Long salarySobId = Long.valueOf(map.get("salarySobId")); + String key = map.get("key"); + List list = getSalarySobItemService(user).listBySalarySobId4SalaryItem(salarySobId); + list = list.stream().filter(po -> po.getName().contains(key)).collect(Collectors.toList()); + List collect = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), list).stream().map(po -> BrowserDataDTO.builder().id(po.getId()).name(po.getName()).build()).collect(Collectors.toList()); + PageInfo salarySobItemPOPageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), collect, BrowserDataDTO.class); + return salarySobItemPOPageInfo; + } + return null; + } + } diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java new file mode 100644 index 000000000..9d94f0f3c --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -0,0 +1,60 @@ +//package com.engine.salary.wrapper; +// +//import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +//import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +//import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +//import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +//import com.engine.salary.service.factory.TaxPaymentServiceFactory; +//import com.weaver.common.component.form.WeaForm; +//import com.weaver.hrm.salary.entity.taxpayment.dto.TaxPayTypeFormDTO; +//import com.weaver.hrm.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +//import com.weaver.hrm.salary.util.SalaryFormatUtil; +//import lombok.extern.slf4j.Slf4j; +// +///** +// * 个税辅助缴款 +// * +// * @author chengliming +// * @date: 2022-08-31 13:29:14 +// */ +//@Slf4j +//public class TaxPaymentWrapper { +// private TaxPaymentServiceFactory taxPaymentServiceFactory; +// +// public TaxFeedbackResultDTO getAgreementFeedback(TaxPaymentQueryParam param) { +// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).getFeedback(param); +// } +// +// public TaxFeedbackResultDTO payAgreementFeedback(TaxPaymentQueryParam param) { +// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue()).getFeedback(param); +// } +// +// public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { +// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).getFeedback(param); +// } +// +// public String getRequestId(TaxPaymentQueryParam param) { +// return taxPaymentServiceFactory.get(param.getType()).getRequestId(param); +// } +// +// public WeaForm queryTaxAmount(TaxPaymentQueryParam param) { +// TaxAmountFormDTO formDTO = taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param); +// return SalaryFormatUtil.getInstance().buildForm(TaxAmountFormDTO.class, formDTO); +// } +// +// public WeaForm payType() { +// return SalaryFormatUtil.getInstance().buildForm(TaxPayTypeFormDTO.class, new TaxPayTypeFormDTO()); +// } +// +// public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { +// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue()).getWithheldVoucher(param); +// } +// +// public void getSyncWithholdingFeedback(TaxPaymentQueryParam param) { +// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).syncWithholdingFeedback(param); +// } +// +// public void cancelVoucher(TaxPaymentQueryParam param) { +// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(param); +// } +//} From 914963135a0cdab93190adf48c77e71c89a8a057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 17 Aug 2023 14:55:32 +0800 Subject: [PATCH 019/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E8=BE=85=E5=8A=A9=E7=BC=B4=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308170103.sql | 3 + resource/sqlupgrade/GS/sql202308170103.sql | 3 + resource/sqlupgrade/JC/sql202308170103.sql | 3 + resource/sqlupgrade/Mysql/sql202308170103.sql | 2 + .../sqlupgrade/Oracle/sql202308170103.sql | 2 + resource/sqlupgrade/PG/sql202308170103.sql | 2 + .../sqlupgrade/SQLServer/sql202308170103.sql | 2 + resource/sqlupgrade/ST/sql202308170103.sql | 3 + .../datacollection/bo/DataCollectionBO.java | 418 +++++++++++++++++- .../entity/salaryBill/bo/SalaryBillBO.java | 4 +- .../taxpayment/dto/TaxAgreementFormDTO.java | 2 +- .../param/TaxPaymentQueryParam.java | 5 +- .../taxpayment/po/TaxPaymentRequestPO.java | 3 +- .../taxpayment/TaxPaymentRequestMapper.java | 86 ++++ .../taxpayment/TaxPaymentRequestMapper.xml | 412 +++++++++++++++++ .../SalaryStatisticsEmployeeWrapper.java | 2 +- .../TaxDeclarationApiFlowWarnService.java | 8 +- .../service/TaxDeclareRecordService.java | 3 + .../factory/TaxPaymentServiceFactory.java | 33 +- .../impl/AbstractTaxPaymentService.java | 317 +++++++++++++ .../impl/AttendQuoteDataServiceImpl.java | 6 +- .../impl/SalaryArchiveServiceImpl.java | 4 +- .../service/impl/SalarySendServiceImpl.java | 16 +- .../impl/SalaryTemplateServiceImpl.java | 4 +- .../TaxDeclarationApiFlowWarnServiceImpl.java | 12 +- .../impl/TaxDeclareRecordServiceImpl.java | 5 + .../impl/TaxPaymentAgreementServiceImpl.java | 98 ++++ .../TaxPaymentWithheldVoucherServiceImpl.java | 66 +++ .../TaxPaymentWithholdingServiceImpl.java | 141 ++++++ ...xPaymentWithholdingVoucherServiceImpl.java | 180 ++++++++ .../wrapper/SalaryBillBaseSetWrapper.java | 2 +- .../salary/wrapper/SalaryCommonWrapper.java | 6 +- .../salary/wrapper/TaxPaymentWrapper.java | 113 +++-- 33 files changed, 1838 insertions(+), 128 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202308170103.sql create mode 100644 resource/sqlupgrade/GS/sql202308170103.sql create mode 100644 resource/sqlupgrade/JC/sql202308170103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308170103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308170103.sql create mode 100644 resource/sqlupgrade/PG/sql202308170103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308170103.sql create mode 100644 resource/sqlupgrade/ST/sql202308170103.sql create mode 100644 src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java create mode 100644 src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml create mode 100644 src/com/engine/salary/service/impl/AbstractTaxPaymentService.java create mode 100644 src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java diff --git a/resource/sqlupgrade/DM/sql202308170103.sql b/resource/sqlupgrade/DM/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/resource/sqlupgrade/GS/sql202308170103.sql b/resource/sqlupgrade/GS/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/resource/sqlupgrade/JC/sql202308170103.sql b/resource/sqlupgrade/JC/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308170103.sql b/resource/sqlupgrade/Mysql/sql202308170103.sql new file mode 100644 index 000000000..c97cc02f4 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308170103.sql b/resource/sqlupgrade/Oracle/sql202308170103.sql new file mode 100644 index 000000000..040162f3a --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308170103.sql b/resource/sqlupgrade/PG/sql202308170103.sql new file mode 100644 index 000000000..d313f1fb1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308170103.sql b/resource/sqlupgrade/SQLServer/sql202308170103.sql new file mode 100644 index 000000000..c29a44b44 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308170103.sql b/resource/sqlupgrade/ST/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java index e216ddc7d..db9a2241d 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -1,17 +1,125 @@ package com.engine.salary.entity.datacollection.bo; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import dm.jdbc.util.IdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + /** * @Description: 数据采集 * @Author: wangxiangzhong * @Date: 2021/11/29 13:28 */ public class DataCollectionBO { + private static final Logger logger = LoggerFactory.getLogger(DataCollectionBO.class); - @Override - public String toString() { - return "DataCollectionBO{}"; - } - +// @Override +// public String toString() { +// return "DataCollectionBO{}"; +// } +// +// /** +// * PO转DTO:累计专项附加扣除加密字段赋值 +// * +// * @param po +// * @param dto +// */ +// public static void poToDTO4AddUpDeduction(AddUpDeduction po, AddUpDeductionListDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setAddUpChildEducation(SalaryEntityUtil.thousandthConvert(po.getAddUpChildEducation())); +// dto.setAddUpContinuingEducation(SalaryEntityUtil.thousandthConvert(po.getAddUpContinuingEducation())); +// dto.setAddUpHousingLoanInterest(SalaryEntityUtil.thousandthConvert(po.getAddUpHousingLoanInterest())); +// dto.setAddUpHousingRent(SalaryEntityUtil.thousandthConvert(po.getAddUpHousingRent())); +// dto.setAddUpSupportElderly(SalaryEntityUtil.thousandthConvert(po.getAddUpSupportElderly())); +// dto.setAddUpIllnessMedical(SalaryEntityUtil.thousandthConvert(po.getAddUpIllnessMedical())); +// dto.setAddUpInfantCare(SalaryEntityUtil.thousandthConvert(po.getAddUpInfantCare())); +// dto.setLastUpdateTime(po.getLastUpdateTime()); +// dto.setDataSource(Optional.ofNullable(EnumAddUpDeductionDataSource.parseByValue(po.getDataSource())) +// .map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel())) +// .orElse(SalaryI18nUtil.getI18nLabel(EnumAddUpDeductionDataSource.MANUAL.getLabelId(), EnumAddUpDeductionDataSource.MANUAL.getDefaultLabel()))); +// } +// +// /** +// * PO转DTO:往期累计情况加密字段赋值 +// * +// * @param po +// * @param dto +// */ +// public static void poToDTO4AddUpSituationPOVal(AddUpSituationPO po, AddUpSituationListDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setAddUpIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpIncome())); +// dto.setAddUpSubtraction(SalaryEntityUtil.thousandthConvert(po.getAddUpSubtraction())); +// dto.setAddUpSocialSecurityTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpSocialSecurityTotal())); +// dto.setAddUpAccumulationFundTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpAccumulationFundTotal())); +// dto.setAddUpEnterpriseAndOther(SalaryEntityUtil.thousandthConvert(po.getAddUpEnterpriseAndOther())); +// dto.setAddUpOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getAddUpOtherDeduction())); +// dto.setAddUpTaxExemptIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxExemptIncome())); +// dto.setAddUpAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getAddUpAllowedDonation())); +// dto.setAddUpTaxSavings(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxSavings())); +// dto.setAddUpAdvanceTax(SalaryEntityUtil.thousandthConvert(po.getAddUpAdvanceTax())); +// dto.setAddUpTaxableIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxableIncome())); +// } +// +// public static void poToDTO4AddUpSituationRecordPOVal(AddUpSituationPO po, AddUpSituationRecordDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setAddUpIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpIncome())); +// dto.setAddUpSubtraction(SalaryEntityUtil.thousandthConvert(po.getAddUpSubtraction())); +// dto.setAddUpSocialSecurityTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpSocialSecurityTotal())); +// dto.setAddUpAccumulationFundTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpAccumulationFundTotal())); +// dto.setAddUpEnterpriseAndOther(SalaryEntityUtil.thousandthConvert(po.getAddUpEnterpriseAndOther())); +// dto.setAddUpOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getAddUpOtherDeduction())); +// dto.setAddUpTaxExemptIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxExemptIncome())); +// dto.setAddUpAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getAddUpAllowedDonation())); +// dto.setAddUpTaxSavings(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxSavings())); +// dto.setAddUpAdvanceTax(SalaryEntityUtil.thousandthConvert(po.getAddUpAdvanceTax())); +// dto.setAddUpTaxableIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxableIncome())); +// } +// +// public static void convert2Po4UpdateSituation(AddUpSituationPO po, AddUpSituationUpdateParam param) { +// if (param == null || po == null) { +// return; +// } +// po.setAddUpIncome(param.getAddUpIncome()); +// po.setAddUpSubtraction(param.getAddUpSubtraction()); +// po.setAddUpSocialSecurityTotal(param.getAddUpSocialSecurityTotal()); +// po.setAddUpAccumulationFundTotal(param.getAddUpAccumulationFundTotal()); +// po.setAddUpEnterpriseAndOther(param.getAddUpEnterpriseAndOther()); +// po.setAddUpOtherDeduction(param.getAddUpOtherDeduction()); +// po.setAddUpTaxExemptIncome(param.getAddUpTaxExemptIncome()); +// po.setAddUpAllowedDonation(param.getAddUpAllowedDonation()); +// po.setAddUpTaxSavings(param.getAddUpTaxSavings()); +// po.setAddUpAdvanceTax(param.getAddUpAdvanceTax()); +// po.setAddUpTaxableIncome(param.getAddUpTaxableIncome()); +// } +// +// /** +// * PO转DTO:其他免税扣除加密字段赋值 +// * +// * @param po +// * @param dto +// */ +// public static void poToDTO4OtherDeductionPOVal(OtherDeductionPO po, OtherDeductionListDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setBusinessHealthyInsurance(SalaryEntityUtil.thousandthConvert(po.getBusinessHealthyInsurance())); +// dto.setTaxDelayEndowmentInsurance(SalaryEntityUtil.thousandthConvert(po.getTaxDelayEndowmentInsurance())); +// dto.setOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getOtherDeduction())); +// dto.setDeductionAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getDeductionAllowedDonation())); +// } +// // /** // * 添加日期范围 // * @@ -31,22 +139,296 @@ public class DataCollectionBO { // } // // /** -// * 获取身份证号 +// * 忽略身份证号码搜索条件 // * -// * @param employeeId -// * @param simpleUserInfos +// * @param clazz // */ -// public static String getIdNo(Long employeeId, List simpleUserInfos) { -// if (employeeId == null || CollectionUtils.isEmpty(simpleUserInfos)) { -// return StringUtils.EMPTY; +// public static void ingoreIdNoSearchCondition(Class clazz) { +// try { +// Field idNoField = clazz.getDeclaredField("idNo"); +// SalarySearchCondition targetAnnotation = idNoField.getAnnotation(SalarySearchCondition.class); +//// boolean oldValue = targetAnnotation.ignore(); +//// System.out.println("修改之前的注解值:" + oldValue); +// //获取 targetAnnotation 这个代理实例所持有的 InvocationHandler +// InvocationHandler invocationHandler = Proxy.getInvocationHandler(targetAnnotation); +// // 获取 AnnotationInvocationHandler 的 memberValues 字段 +// Field declaredField = invocationHandler.getClass().getDeclaredField("memberValues"); +// // 因为这个字段事 private final 修饰,所以要打开权限 +// declaredField.setAccessible(true); +// // 获取 memberValues +// Map memberValues = (Map) declaredField.get(invocationHandler); +// // 修改 ignore 属性值 +// memberValues.put("ignore", true); +//// boolean newValue = targetAnnotation.ignore(); +//// System.out.println("修改之后的注解值:" + newValue); +// } catch (Exception e) { +// logger.error("忽略idNo失败:{}", e.getMessage(), e); // } -// Optional optionalSimpleUserInfo = simpleUserInfos.stream() -// .filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser())).findFirst(); -// String idNo = StringUtils.EMPTY; -// if (optionalSimpleUserInfo.isPresent()) { -// SimpleUserInfo simpleUserInfo = optionalSimpleUserInfo.get(); -// idNo = Optional.of(simpleUserInfo).map(SimpleUserInfo::getIdNo).orElse(StringUtils.EMPTY); +// } +// +// /** +// * 构建新建基础表单 +// * +// * @param taxAgentList +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// public static WeaForm buildBaseInfoAddForm(Collection taxAgentList, Long employeeId, String tenantKey) { +// // 构建表单 +// WeaForm baseInfoForm = new WeaForm(); +// // 控件项目 +// Map items = baseInfoForm.getItems(); +// +// WeaFormItem declareMonthItem = new WeaFormItem(WeaFormItemType.DATEPICKER); +// declareMonthItem.setRequired(true); +// Map otherParams = new HashMap<>(); +// otherParams.put("type", "month"); +// declareMonthItem.setOtherParams(otherParams); +// items.put("declareMonth", declareMonthItem); +// +// WeaFormItem taxAgentItem = new WeaFormItem(WeaFormItemType.SELECT); +// taxAgentItem.setRequired(true); +// taxAgentItem.setOptions(taxAgentList.stream() +// .map(t -> { +// WeaFormOption weaFormOption = new WeaFormOption(); +// weaFormOption.setId("" + t.getId()); +// weaFormOption.setContent(t.getName()); +// return weaFormOption; +// }).collect(Collectors.toList())); +// items.put("taxAgent", taxAgentItem); +// +// WeaFormItem employeeItem = new WeaFormItem(WeaFormItemType.BROWSER); +// employeeItem.setRequired(true); +// employeeItem.setBrowserBean(new WeaBrowserBean("hrmsalary", "dataCollectionEmployeeBrowser")); +// items.put("employee", employeeItem); +// +// // 控件布局 +// String groupId = "baseInfo"; +// List> layout = baseInfoForm.getLayout(); +// layout.add(Lists.newArrayList(new WeaFormLayout("1", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86176, "税款所属期"), groupId, new String[]{"declareMonth"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("2", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "个税扣缴义务人"), groupId, new String[]{"taxAgent"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("3", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100133, "人员"), groupId, new String[]{"employee"}))); +// layout.forEach(ll-> ll.forEach(wl-> wl.setLabelSpan(8))); +// baseInfoForm.setGroups(Collections.singletonList(new WeaFormGroup(groupId, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86124, "基础信息")))); +// return baseInfoForm; +// } +// +// /** +// * 构建基础信息表单 +// * +// * @param employee +// * @param taxAgent +// * @param enableHr +// * @param declareMonth +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// public static WeaForm buildBaseInfoForm(SimpleEmployee employee, String taxAgent, boolean enableHr, String idNo, LocalDate declareMonth, Long employeeId, String tenantKey) { +// // 构建表单 +// WeaForm baseInfoForm = new WeaForm(); +// // 控件项目 +// Map items = baseInfoForm.getItems(); +// +// List itemNames = Arrays.asList("username", "taxAgent", "declareMonth", "department", "position", "hiredate", "mobile", "jobNum", "employeeStatus"); +// itemNames.forEach(itemName -> { +// WeaFormItem item = new WeaFormItem(WeaFormItemType.INPUT); +// item.setReadOnly(true); +// items.put(itemName, item); +// }); +// +// if (enableHr) { +// WeaFormItem idNoItem = new WeaFormItem(WeaFormItemType.INPUT); +// idNoItem.setReadOnly(true); +// items.put("idNo", idNoItem); +// } else { +// WeaFormItem emptyItem = new WeaFormItem(WeaFormItemType.INPUT); +// emptyItem.setReadOnly(true); +// items.put("empty", emptyItem); // } -// return idNo; +// +// // 控件布局 +// List> layout = baseInfoForm.getLayout(); +// String groupId = "baseInfo"; +// layout.add(Lists.newArrayList(new WeaFormLayout("1", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 85429, "姓名"), groupId, new String[]{"username"}), new WeaFormLayout("2", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "个税扣缴义务人"), groupId, new String[]{"taxAgent"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("3", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86176, "税款所属期"), groupId, new String[]{"declareMonth"}), new WeaFormLayout("4", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86185, "部门"), groupId, new String[]{"department"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("5", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 90633, "岗位"), groupId, new String[]{"position"}), new WeaFormLayout("6", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86319, "入职日期"), groupId, new String[]{"hiredate"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("7", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86186, "手机号"), groupId, new String[]{"mobile"}), new WeaFormLayout("8", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86317, "工号"), groupId, new String[]{"jobNum"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("9", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 109332, "人事状态"), groupId, new String[]{"employeeStatus"}), enableHr ? new WeaFormLayout("10", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 106277, "身份证号码"), groupId, new String[]{"idNo"}) : new WeaFormLayout("10", " ", new String[]{"empty"}))); +// +// layout.forEach(ll-> ll.forEach(wl-> wl.setLabelSpan(8))); +// // 控件数据 +// Map data = baseInfoForm.getData(); +// data.put("username", employee.getUsername()); +// data.put("taxAgent", taxAgent); +// data.put("declareMonth", declareMonth == null ? "" : declareMonth + ""); +// data.put("department", employee.getDepartment() == null ? "" : employee.getDepartment().getName()); +// data.put("position", employee.getPosition() == null ? "" : employee.getPosition().getName()); +// data.put("hiredate", SalaryDateUtil.getFormatLocalDate(employee.getHiredate())); +// data.put("mobile", employee.getMobile()); +// data.put("jobNum", employee.getJobNum()); +// data.put("idNo", idNo); +// data.put("employeeStatus", employee.getPersonnelStatus()); +// baseInfoForm.setData(data); +// baseInfoForm.setGroups(Collections.singletonList(new WeaFormGroup(groupId, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86124, "基础信息")))); +// +// return baseInfoForm; +// } +// +// +// public static AddUpSituationFormDTO po2AddUpSituationFormDTO(AddUpSituationPO situationPO) { +// return AddUpSituationFormDTO.builder() +// .addUpAdvanceTax(situationPO.getAddUpAdvanceTax()) +// .addUpTaxableIncome(situationPO.getAddUpTaxableIncome()) +// .addUpAllowedDonation(situationPO.getAddUpAllowedDonation()) +// .addUpAccumulationFundTotal(situationPO.getAddUpAccumulationFundTotal()) +// .addUpIncome(situationPO.getAddUpIncome()) +// .addUpSubtraction(situationPO.getAddUpSubtraction()) +// .addUpOtherDeduction(situationPO.getAddUpOtherDeduction()) +// .addUpTaxSavings(situationPO.getAddUpTaxSavings()) +// .addUpTaxExemptIncome(situationPO.getAddUpTaxExemptIncome()) +// .addUpEnterpriseAndOther(situationPO.getAddUpEnterpriseAndOther()) +// .addUpSocialSecurityTotal(situationPO.getAddUpSocialSecurityTotal()) +// .id(situationPO.getId()) +// .taxYearMonth(situationPO.getTaxYearMonth()) +// .taxAgent(situationPO.getTaxAgentId()) +// .employeeType(EmployeeTypeEnum.parseByValue(situationPO.getEmployeeType()).toString()) +// .build(); +// } + + public static Map getApiBaseQueryParams(TaxAgentTaxReturnPO returnPO, String taxAgentName, String taxMonth) { + Map requestParam = new HashMap<>(32); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentName); + requestParam.put("nsrsbh", returnPO.getTaxCode()); + requestParam.put("areaid", returnPO.getAreaCode()); + requestParam.put("skssq", taxMonth); + requestParam.put("sfrysb", SalaryOnOffEnum.OFF.getValue()); + requestParam.put("mmlx", returnPO.getPasswordType()); + requestParam.put("jmsbmm", 1); + requestParam.put("jmsmmm", 1); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + requestParam.computeIfAbsent("smzh", e -> realNamePwd ? returnPO.getRealAccount() : null); + requestParam.computeIfAbsent("smmm", e -> realNamePwd ? returnPO.getPwd() : null); + requestParam.computeIfAbsent("sbmm", e -> realNamePwd ? null : returnPO.getPwd()); + requestParam.computeIfAbsent("djxhid", e -> StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + requestParam.computeIfAbsent("bmbh", e -> StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + requestParam.computeIfAbsent("bmmc", e -> StringUtils.isNotEmpty(returnPO.getDepartmentName()) ? returnPO.getDepartmentName() : null); + return requestParam; + } + +// public static List> getEmployeeList(List declarePOList) { +// List> employeeList = new ArrayList<>(); +// for (EmployeeDeclarePO employeeDeclarePO : declarePOList) { +// Map employeeMap = new HashMap<>(32); +// employeeMap.put("xm", employeeDeclarePO.getEmployeeName()); +// employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); +// employeeMap.put("zzhm", employeeDeclarePO.getCardNum()); +// employeeMap.put("lxdh", employeeDeclarePO.getMobile()); +// employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel()); +// employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel()); +// employeeMap.put("rzsgrq", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getEmploymentDate())); +// employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel()); +// employeeMap.put("csny", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getBirthday())); +// employeeMap.put("gj", "中国"); +// employeeMap.put("rydq", "境内"); +// boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability()); +// boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents()); +// employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel()); +// employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null); +// employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); +// employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); +// employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel()); +// employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel()); +// employeeList.add(employeeMap); +// } +// return employeeList; +// } +// +// public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) { +// return AddUpDeduction.builder() +// .id(IdGenerator.generate()) +// .addUpChildEducation(feedback.getLjznjyzc().toString()) +// .addUpContinuingEducation(feedback.getLjjxjyzc().toString()) +// .addUpHousingRent(feedback.getLjzfzjzc().toString()) +// .addUpInfantCare(feedback.getLjyyezhzc().toString()) +// .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString()) +// .addUpSupportElderly(feedback.getLjsylrzc().toString()) +// .addUpIllnessMedical("0") +// .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue()) +// .lastUpdateTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .build(); +// } +// +// public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, +// AddUpDeductionRequestPO requestPO, +// Long employeeId) { +// return AddUpDeductionRequestFailPO.builder() +// .id(IdGenerator.generate()) +// .requestId(requestPO.getRequestId()) +// .outerRequestId(requestPO.getOuterRequestId()) +// .taxYearMonth(requestPO.getTaxYearMonth()) +// .taxAgentId(requestPO.getTaxAgentId()) +// .employeeId(Optional.ofNullable(employeeId).orElse(0L)) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .creator(requestWrapper.getCurrentEmployeeId()) +// .tenantKey(requestPO.getTenantKey()) +// .build(); +// } +// +// public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) { +// return AddUpDeductionRequestResultDTO.builder() +// .requestId(requestId.toString()) +// .msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "共成功获取数据%s条,失败%s条"), +// requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(), +// requestWrapper.getFailPOList().size())) +// .result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success") +// .finish(true) +// .build(); +// } +// +// public static AddUpDeduction buildAddUpDeductionPO(AddUpDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { +// return AddUpDeduction.builder() +// .id(IdGenerator.generate()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .deleteType(NumberUtils.INTEGER_ZERO) +// .tenantKey(currentTenantKey) +// .dataSource(EnumAddUpDeductionDataSource.MANUAL.getValue()) +// .lastUpdateTime(LocalDateTime.now()) +// .declareMonth(saveParam.getDeclareMonth().atDay(1)) +// .taxAgentId(saveParam.getTaxAgentId()) +// .employeeId(saveParam.getEmployeeId()) +// .addUpChildEducation(saveParam.getAddUpChildEducation()) +// .addUpInfantCare(saveParam.getAddUpInfantCare()) +// .addUpHousingRent(saveParam.getAddUpHousingRent()) +// .addUpIllnessMedical(saveParam.getAddUpIllnessMedical()) +// .addUpSupportElderly(saveParam.getAddUpSupportElderly()) +// .addUpHousingLoanInterest(saveParam.getAddUpHousingLoanInterest()) +// .addUpContinuingEducation(saveParam.getAddUpContinuingEducation()) +// .build(); +// } +// +// public static OtherDeductionPO buildOtherDeductionPO(OtherDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { +// return OtherDeductionPO.builder() +// .id(IdGenerator.generate()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .deleteType(NumberUtils.INTEGER_ZERO) +// .tenantKey(currentTenantKey) +// .declareMonth(saveParam.getDeclareMonth().atDay(1)) +// .taxAgentId(saveParam.getTaxAgentId()) +// .employeeId(saveParam.getEmployeeId()) +// .businessHealthyInsurance(saveParam.getBusinessHealthyInsurance()) +// .taxDelayEndowmentInsurance(saveParam.getTaxDelayEndowmentInsurance()) +// .otherDeduction(saveParam.getOtherDeduction()) +// .deductionAllowedDonation(saveParam.getDeductionAllowedDonation()) +// .build(); // } } diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java index c298b33fd..882d2acd9 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java @@ -207,7 +207,7 @@ public class SalaryBillBO { // * @param currentTenantKey // * @return // */ -// public static SendMessageEntity buildSendMessage(Map e, Map allEmployeeMap, SalaryBillSendDTO salaryBillSendParam, Long currentEmployeeId, String currentTenantKey) { +// public static SendMessageEntity buildSendMessage(Map e, Map allEmployeeMap, SalaryBillSendDTO salaryBillSendParam) { // // 构建用户基本信息 // SalaryBillBO.buildEmployeeInfo(salaryBillSendParam.getEmployeeInformation(), allEmployeeMap.get(e.get("employeeId").toString()), salaryBillSendParam.getEmployeeField()); // // 消息接收者 @@ -403,7 +403,7 @@ public class SalaryBillBO { // * @param currentTenantKey // * @return // */ -// public static CancleMessageEntity buildCancleMessageEntity(long msgId, String text, String title, Long currentEmployeeId, String currentTenantKey) { +// public static CancleMessageEntity buildCancleMessageEntity(long msgId, String text, String title) { // CancleMessageEntity cme = new CancleMessageEntity(); // cme.setMsgId(msgId); // // 模块 diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java index d8ab743e9..c4d42ef2f 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java @@ -21,7 +21,7 @@ import java.util.Map; @ApiModel("查询缴费信息") public class TaxAgreementFormDTO extends TaxFeedbackResultDTO { -// private WeaForm form; + private Map form; private Map count; } diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index ac2787246..7bbc468f0 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -1,12 +1,11 @@ package com.engine.salary.entity.taxpayment.param; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; /** * 查询企业三方信息 @@ -24,7 +23,7 @@ public class TaxPaymentQueryParam { private Long taxAgentId; //税款所属期") - private YearMonth taxYearMonth; + private Date taxYearMonth; //个税申报记录id") private Long taxDeclareRecordId; diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 3ad3e8367..dbf3c7094 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -6,7 +6,6 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; -import java.time.LocalDate; import java.util.Date; /** @@ -46,7 +45,7 @@ public class TaxPaymentRequestPO implements Serializable { * 税款所属期 */ //税款所属期") - private LocalDate taxYearMonth; + private Date taxYearMonth; /** * 异步请求ID diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java new file mode 100644 index 000000000..6ec65e30f --- /dev/null +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java @@ -0,0 +1,86 @@ +package com.engine.salary.mapper.taxpayment; + +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxPaymentRequestMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxPaymentRequestPO taxPaymentRequest); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxPaymentRequestPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxPaymentRequest 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 批量插入 + * + * @param taxPaymentRequest + */ + void batchInsert(@Param("collection") List taxPaymentRequest); + + /** + * 修改,修改所有字段 + * + * @param taxPaymentRequest 修改的记录 + * @return 返回影响行数 + */ + int update(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 修改,忽略null字段 + * + * @param taxPaymentRequest 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 删除记录 + * + * @param taxPaymentRequest 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + void updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO build); + + void updateFeedbackByTaxDeclareRecordId(TaxPaymentRequestPO build); + + TaxPaymentRequestPO getOne(TaxPaymentRequestPO build); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml new file mode 100644 index 000000000..e64c5ec32 --- /dev/null +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.feedback + , t.id + , t.request_id + , t.request_type + , t.tax_agent_id + , t.tax_declare_record_id + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_payment_request + + + + create_time, + + + creator, + + + delete_type, + + + feedback, + + + id, + + + request_id, + + + request_type, + + + tax_agent_id, + + + tax_declare_record_id, + + + tax_year_month, + + + tenant_key, + + + update_time + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{feedback}, + + + #{id}, + + + #{requestId}, + + + #{requestType}, + + + #{taxAgentId}, + + + #{taxDeclareRecordId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime} + + + + + + + + INSERT INTO hrsa_tax_payment_request + ( + create_time, + creator, + delete_type, + feedback, + id, + request_id, + request_type, + tax_agent_id, + tax_declare_record_id, + tax_year_month, + tenant_key, + update_time + ) + VALUES + ( + + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.feedback}, + #{item.id}, + #{item.requestId}, + #{item.requestType}, + #{item.taxAgentId}, + #{item.taxDeclareRecordId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime} + + ) + + + + + INSERT INTO hrsa_tax_payment_request ( + create_time, + creator, + delete_type, + feedback, + id, + request_id, + request_type, + tax_agent_id, + tax_declare_record_id, + tax_year_month, + tenant_key, + update_time + ) + + + select + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.feedback,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.requestId,jdbcType=DOUBLE}, + #{item.requestType,jdbcType=INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE}, + #{item.taxYearMonth,jdbcType=DATE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE} + from dual + + + + + + + INSERT INTO hrsa_tax_payment_request ( + create_time, + creator, + delete_type, + feedback, + id, + request_id, + request_type, + tax_agent_id, + tax_declare_record_id, + tax_year_month, + tenant_key, + update_time + ) + VALUES + ( + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.feedback}, + #{item.id}, + #{item.requestId}, + #{item.requestType}, + #{item.taxAgentId}, + #{item.taxDeclareRecordId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime} + ) + + + + + + UPDATE hrsa_tax_payment_request + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + feedback=#{feedback}, + request_id=#{requestId}, + request_type=#{requestType}, + tax_agent_id=#{taxAgentId}, + tax_declare_record_id=#{taxDeclareRecordId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_payment_request + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + feedback=#{feedback}, + + + request_id=#{requestId}, + + + request_type=#{requestType}, + + + tax_agent_id=#{taxAgentId}, + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_payment_request + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_payment_request + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_tax_payment_request + + + request_id=#{requestId} + + feedback=#{feedback} + + WHERE delete_type = 0 + AND request_type=#{requestType} + AND tax_agent_id=#{taxAgentId} + AND tax_year_month=#{taxYearMonth} + + + + UPDATE hrsa_tax_payment_request + + feedback=#{feedback} + + WHERE delete_type = 0 + AND tax_declare_record_id=#{taxDeclareRecordId} + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java index 6ba44dc79..528cfd8d9 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java @@ -120,7 +120,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service { } // public Map exportDetailList(SalaryStatisticsEmployeeDetailQueryParam queryParam) { -// SalaryAssert.notNull(queryParam.getEmployeeId(), SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 163974, "人员id不能为空")); +// SalaryAssert.notNull(queryParam.getEmployeeId(), SalaryI18nUtil.getI18nLabel( 163974, "人员id不能为空")); // // 构建异步导出参数 // Map map = salaryBatchService.buildeExportParam("exportSalaryStatisticsEmployeeDetailList"); // LocalRunnable localRunnable = new LocalRunnable() { diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java index 47335fa71..de75cf036 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -51,7 +51,7 @@ public interface TaxDeclarationApiFlowWarnService { * @param currentTenantKey * @return */ - TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id, Long currentEmployeeId, String currentTenantKey); + TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id); /** * 保存或编辑提醒对象 @@ -60,7 +60,7 @@ public interface TaxDeclarationApiFlowWarnService { * @param currentEmployeeId * @param currentTenantKey */ - void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param, Long currentEmployeeId, String currentTenantKey); + void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param); /** * 创建提醒规则 @@ -69,7 +69,7 @@ public interface TaxDeclarationApiFlowWarnService { * @param currentEmployeeId * @param currentTenantKey */ - void createMessageRule(CreateMessageRuleParam param, Long currentEmployeeId, String currentTenantKey); + void createMessageRule(CreateMessageRuleParam param); /** * 保存流量不足提醒配置 @@ -79,7 +79,7 @@ public interface TaxDeclarationApiFlowWarnService { * @param currentTenantKey * @return */ - String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param, Long currentEmployeeId, String currentTenantKey); + String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param); /** * 获取推送规则的业务ID diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 4fdfb64aa..78b1dff15 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -164,4 +164,7 @@ public interface TaxDeclareRecordService { * @param id */ String queryCompanyIncomes(Long id); + + void updateById(TaxDeclareRecordPO taxDeclareRecord); + } diff --git a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java index bae9778b7..90fbb0cc4 100644 --- a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java +++ b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java @@ -1,10 +1,9 @@ package com.engine.salary.service.factory; -import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.common.util.ServiceUtil; import com.engine.salary.service.TaxPaymentService; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; +import com.engine.salary.service.impl.*; +import weaver.hrm.User; /** * @author chengliming @@ -12,20 +11,28 @@ import java.util.concurrent.ConcurrentHashMap; **/ public class TaxPaymentServiceFactory { - private final Map serviceMap = new ConcurrentHashMap<>(); + private User user; - - public TaxPaymentServiceFactory(Map map) { - for (Map.Entry entry : map.entrySet()) { - serviceMap.putIfAbsent(entry.getValue().getServiceType(), entry.getValue()); - } + public TaxPaymentServiceFactory(User user) { + this.user = user; } public TaxPaymentService get(Integer type) { - TaxPaymentService service = serviceMap.get(type); - if (service == null) { - throw new SalaryRunTimeException("TaxPaymentService is null"); + AbstractTaxPaymentService service = null; + if (type == 1) { + service = ServiceUtil.getService(TaxPaymentAgreementServiceImpl.class, user); + } else if (type == 2) { + service = ServiceUtil.getService(TaxPaymentWithholdingServiceImpl.class, user); + } else if(type == 3){ + service = ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user); + }else if(type == 4){ + service = ServiceUtil.getService(TaxPaymentWithheldVoucherServiceImpl.class, user); } + return service; } + + + + } diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java new file mode 100644 index 000000000..38f8fd8c0 --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -0,0 +1,317 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +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.datacollection.response.QuerySpecialAmountResponse; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxpayment.TaxPaymentRequestMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +import dm.jdbc.util.IdGenerator; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import weaver.hrm.User; + +import java.math.BigDecimal; +import java.util.*; + +/** + * @author chengliming + * @date 2022-12-09 6:26 PM + **/ +@Slf4j +public abstract class AbstractTaxPaymentService extends Service implements TaxPaymentService { + + protected TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + protected TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + protected TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + protected TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + protected TaxPaymentRequestMapper getTaxPaymentRequestMapper() { + return MapperProxyFactory.getProxy(TaxPaymentRequestMapper.class); + } + + /** + * 获取requestId + * + * @param returnPO + * @param taxAgentName + * @param param + * @param apiConfig + * @param clazz + * @return + */ + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + throw new SalaryRunTimeException("暂无实现"); + } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + throw new SalaryRunTimeException("暂无实现"); + } + + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("暂无实现"); + } + + /** + * 发起请求获取requestId + * + * @param apiConfig + * @param url + * @param requestParam + * @return + */ + protected T postRequest(TaxDeclarationApiConfigPO apiConfig, + String url, + Map requestParam, + Class clazz) { + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("getAsyncQueryResponse4Payment url: {}, params:\n{}\n", url, reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("getAsyncQueryResponse4Payment response --- \n{}\n", res); + return JsonUtil.parseObject(res, clazz); + } + + /** + * 发起请求获取反馈 + * + * @param apiConfig + * @param requestId + * @param url + * @return + */ + protected String getRequest(TaxDeclarationApiConfigPO apiConfig, String requestId, String url) { + Map params = new HashMap<>(1); + params.put("requestId", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + return HttpUtil.getRequest(url, header, params); + } + + protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnService(user).getByTaxAgentId(param.getTaxAgentId()); + SalaryAssert.isTrue(Objects.nonNull(taxReturnPO) && TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(taxReturnPO.getCheckStatus()), SalaryI18nUtil.getI18nLabel(184010, "企业未通过验证,请先在【个税扣缴义务人】菜单验证企业报税信息")); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(param.getTaxAgentId()); + SalaryAssert.notNull(taxAgentPO, SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + SalaryAssert.notNull(taxDeclareRecord, "申报表不存在"); + return new TempWrapper(apiConfigPO, taxReturnPO, taxAgentPO, taxDeclareRecord); + } + + @Transactional(rollbackFor = Exception.class) + public String getRequestId(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + QuerySpecialAmountResponse queryResponse = getRequestIdResponse(tempWrapper.taxReturnPO, tempWrapper.taxAgentPO.getName(), + param, tempWrapper.apiConfigPO, QuerySpecialAmountResponse.class); + // 校验请求结果 + String responseCode = Optional.ofNullable(queryResponse) + .map(QuerySpecialAmountResponse::getHead) + .map(SzyhResponseHead::getCode) + .orElse(null); + String requestId = Optional.ofNullable(queryResponse) + .map(QuerySpecialAmountResponse::getBody) + .map(QuerySpecialAmountResponse.QuerySpecialAmountBody::getRequestId) + .orElse(null); + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(requestId)) { + log.info("getAsyncQueryResponse4Payment code error:{}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + // 存储 + TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestPO(param); + if (paymentRequestPO != null) { + if (SalaryOnOffEnum.ON.getValue().equals(paymentRequestPO.getFeedback())) { + getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO + .builder() + .requestId(requestId) + .feedback(SalaryOnOffEnum.OFF.getValue()) + .requestType(param.getType()) + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .build()); + } + } else { + paymentRequestPO = TaxPaymentRequestPO.builder() + .id(IdGenerator.generate()) + .creator((long) user.getUID()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .createTime(new Date()) + .updateTime(new Date()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .taxDeclareRecordId(param.getTaxDeclareRecordId()) + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .requestId(requestId) + .requestType(param.getType()) + .feedback(SalaryOnOffEnum.OFF.getValue()) + .build(); + getTaxPaymentRequestMapper().insertIgnoreNull(paymentRequestPO); + } + return requestId; + } + + protected TaxPaymentRequestPO getTaxPaymentRequestPO(TaxPaymentQueryParam param) { + List paymentRequests = getTaxPaymentRequestMapper().listSome(TaxPaymentRequestPO + .builder() + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .build()); + if (Objects.isNull(param.getCheckFeedback()) || SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { + TaxPaymentRequestPO notFeedback = paymentRequests.stream().filter(e -> { + boolean conditionA = getServiceType().equals(e.getRequestType()) + || TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue().equals(e.getRequestType()); + boolean conditionB = SalaryOnOffEnum.OFF.getValue().equals(e.getFeedback()); + return !conditionA && conditionB; + }).findFirst().orElse(null); + + if (Objects.nonNull(notFeedback)) { + TaxPaymentServiceTypeEnum notFeedbackType = TaxPaymentServiceTypeEnum.parseByValue(notFeedback.getRequestType()); + throw new SalaryRunTimeException("请先获取上次" + notFeedbackType.getDefaultLabel() + "的缴款反馈结果后,再进行其他缴款"); + } + } + return paymentRequests.stream().filter(e -> getServiceType().equals(e.getRequestType())).findFirst().orElse(null); + } + + protected void updateTaxPaymentRequest(TaxPaymentQueryParam param) { + TaxPaymentRequestPO paymentRequest = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO + .builder() + .requestType(getServiceType()) + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .build()); + SalaryAssert.notNull(paymentRequest, "请先点击[三方缴款]或[银行端凭证缴款]按钮发起缴款请求后,再点击[缴款反馈]按钮"); + paymentRequest.setFeedback(SalaryOnOffEnum.ON.getValue()); + paymentRequest.setUpdateTime(new Date()); + getTaxPaymentRequestMapper().updateIgnoreNull(paymentRequest); + } + + protected BaseResponse checkBeforeGetFeedbackResponse(TaxPaymentQueryParam param) { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(param.getTaxAgentId()); + SalaryAssert.notNull(taxAgentPO, SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestPO(param); + String button = TaxPaymentServiceTypeEnum.parseByValue(getServiceType()).getDefaultLabel(); + if (Objects.isNull(param.getCheckFeedback()) || SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { + Integer feedback = Optional.ofNullable(paymentRequestPO).map(TaxPaymentRequestPO::getFeedback).orElse(SalaryOnOffEnum.ON.getValue()); + if (TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue().equals(getServiceType())) { + SalaryAssert.isTrue(SalaryOnOffEnum.OFF.getValue().equals(feedback), SalaryI18nUtil.getI18nLabel(184011, "三方信息查询请求获取失败")); + } else { + SalaryAssert.isTrue(SalaryOnOffEnum.OFF.getValue().equals(feedback), String.format(SalaryI18nUtil.getI18nLabel(184012, "请先点击[%s]按钮发起缴款请求后,再点击[缴款反馈]按钮"), button)); + } + } + BaseResponse response = getFeedbackResponse(apiConfigPO, paymentRequestPO.getRequestId()); + log.info("{} data : {} , paymentRequest : {}", button, response, JsonUtil.toJsonString(paymentRequestPO)); + return response; + } + + @Override + public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + SalaryAssert.notNull(taxDeclareRecord, "个税申报记录不存在"); + if (!TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) { + throw new SalaryRunTimeException("当前申报状态不是[申报成功,未缴费],暂时无法获取"); + } + if (taxDeclareRecord.getTaxPayAmount() == null || taxDeclareRecord.getPersonNum() == null) { + throw new SalaryRunTimeException("未获取到应缴信息,请先进行个税在线申报"); + } + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + SalaryAssert.notNull(taxAgentPO, "个税扣缴义务人不存在"); + + return TaxAmountFormDTO.builder() + .taxAgent(taxAgentPO.getName()) + .amount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPayAmount())) + .personNum(taxDeclareRecord.getPersonNum().toString()) + .build(); + } + + protected TaxDeclareRecordPO updateTaxDeclareRecord(TaxPaymentQueryParam param, BigDecimal totalPaid) { + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) { + throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态"); + } + BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); + BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); + if (SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()).equals(totalPaid) + && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) { + throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态"); + } + taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue()); + taxDeclareRecord.setTaxPaidAmount(totalPaid.toString()); + taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); + taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString()); + taxDeclareRecord.setUpdateTime(new Date()); + getTaxDeclareRecordService(user).updateById(taxDeclareRecord); + // 填充回去后续返回数据用 + taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString()); + return taxDeclareRecord; + } + + @Override + public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { + throw new SalaryRunTimeException("暂无实现"); + } + + @Override + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("暂无实现"); + } + + @Override + public void syncWithholdingFeedback(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("暂无实现"); + } + + @Override + public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("暂无实现"); + } + + @Data + @AllArgsConstructor + public static class TempWrapper { + private TaxDeclarationApiConfigPO apiConfigPO; + private TaxAgentTaxReturnPO taxReturnPO; + private TaxAgentPO taxAgentPO; + private TaxDeclareRecordPO taxDeclareRecord; + } +} diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index a3e279fec..f5557d517 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -375,7 +375,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa } // todo 记录日志 -// recordLog(attendQuote, currentEmployeeId, currentTenantKey, null); +// recordLog(attendQuote, null); return null; } @@ -890,13 +890,13 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa // * @param currentTenantKey // * @param clientIp // */ -// private void recordLog(AttendQuotePO attendQuote, Long currentEmployeeId, String currentTenantKey, String clientIp) { +// private void recordLog(AttendQuotePO attendQuote, String clientIp) { // List salarySobs = new LambdaQueryChainWrapper<>(getSalarySobMapper()) // .eq(SalarySobPO::getTenantKey, TenantContext.getCurrentTenantKey()) // .eq(SalarySobPO::getDeleteType, 0) // .eq(SalarySobPO::getId, attendQuote.getSalarySobId()) // .list(); -// String sourceType = AttendQuoteSourceTypeEnum.getDefaultLabelByValue(attendQuote.getSourceType(), currentEmployeeId, currentTenantKey); +// String sourceType = AttendQuoteSourceTypeEnum.getDefaultLabelByValue(attendQuote.getSourceType()); // // LoggerContext loggerContext = new LoggerContext(); // loggerContext.setTargetId(String.valueOf(attendQuote.getId())); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index d96fd7a2b..1fa5338ea 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -598,7 +598,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe BeanUtils.copyProperties(salaryArchive, oldSalaryArchive); List oldList = Collections.singletonList(oldSalaryArchive); // 收入所得项目 -// boolean checkIncomeCategory = saveParam.getIncomeCategory() == null || StringUtils.isEmpty(SalaryArchiveBO.getIncomeCategoryByValue(saveParam.getIncomeCategory(), currentEmployeeId, currentTenantKey)); +// boolean checkIncomeCategory = saveParam.getIncomeCategory() == null || StringUtils.isEmpty(SalaryArchiveBO.getIncomeCategoryByValue(saveParam.getIncomeCategory())); // if (checkIncomeCategory) { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(122085, "收入所得项目不能为空或不存在")); // } else { @@ -706,7 +706,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // List salarySobList = getSalarySobList(currentEmployeeId, currentTenantKey); // List salarySobIds = salarySobList.stream().map(SalarySobPO::getId).filter(id -> saveParam.getSalarySobIds().contains(id)).collect(Collectors.toList()); -// List salaryArchiveSobSaveList = SalaryArchiveBO.buildSalaryArchiveSob(salaryArchive.getId(), salarySobIds, LocalDateTime.now(), currentEmployeeId, currentTenantKey); +// List salaryArchiveSobSaveList = SalaryArchiveBO.buildSalaryArchiveSob(salaryArchive.getId(), salarySobIds, LocalDateTime.now()); // this.salaryArchiveSobService.saveBatchBySalaryArchiveIdsAndSaves(Collections.singletonList(salaryArchive.getId()), salaryArchiveSobSaveList, currentTenantKey); return StringUtils.EMPTY; diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index d13a0f2b9..c12a923e8 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -1241,7 +1241,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // * @param salaryTemplate // * @param currentTenantKey // */ -// private void sendMessage(SalarySendPO salarySend, List> enableSendList, SalaryTemplatePO salaryTemplate, String tenantName, Long currentEmployeeId, String currentTenantKey) { +// private void sendMessage(SalarySendPO salarySend, List> enableSendList, SalaryTemplatePO salaryTemplate, String tenantName) { // if (StringUtils.isNotBlank(salaryTemplate.getBackground())) { // FileData fileByte = fileDownloadClient.getFileByte(Long.valueOf(salaryTemplate.getBackground()), currentTenantKey); // String encode = Base64Encoder.encode(fileByte.getData()); @@ -1251,17 +1251,17 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // boolean isEmailOpen = salaryTemplate.getEmailStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()); // // LocalDate salaryMonth = salarySend.getSalaryMonth(); -// String yearI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100325, "年"); -// String monthI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100326, "月"); +// String yearI18n = SalaryI18nUtil.getI18nLabel( 100325, "年"); +// String monthI18n = SalaryI18nUtil.getI18nLabel( 100326, "月"); // String text = salaryMonth.getYear() + // yearI18n + // salaryMonth.getMonth().getValue() + // monthI18n + -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100520, "工资待发明细"); +// SalaryI18nUtil.getI18nLabel( 100520, "工资待发明细"); // // UserEntity sendUser = null; // // 标题 -// String title = getBillTitle(salaryTemplate.getTheme(), salaryMonth, tenantName, currentEmployeeId, currentTenantKey); +// String title = getBillTitle(salaryTemplate.getTheme(), salaryMonth, tenantName); // // // 获取所有人员信息 // List ids = enableSendList.stream().map(e->Long.valueOf(e.get("employeeId").toString())).collect(Collectors.toList()); @@ -1278,7 +1278,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // // List receivers = Collections.singletonList( // SalarySendBO.buildUser(Long.valueOf(e.get("employeeId").toString()), e.get("email") == null ? "" : e.get("email").toString(), currentTenantKey)); -// Entity entity = SalarySendBO.buildEntity(e.get("id").toString(), SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 94626, "工资单")); +// Entity entity = SalarySendBO.buildEntity(e.get("id").toString(), SalaryI18nUtil.getI18nLabel( 94626, "工资单")); // EmailEntity emailInfo = new EmailEntity(); // // 邮箱打开 // if (isEmailOpen) { @@ -1348,8 +1348,8 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // SalaryLoggerUtil.recordUpdateSingleLog(salarySendLoggerTemplate, // salarySend.getId(), // salarySend.getSalaryMonth() + "-" + (CollectionUtils.isNotEmpty(salarySobs) ? salarySobs.get(0).getName() : ""), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"), +// SalaryI18nUtil.getI18nLabel( 100521, "撤回工资单发放"), +// SalaryI18nUtil.getI18nLabel( 100521, "撤回工资单发放"), // salarySend, // salarySendNew); diff --git a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java index 7d0b790c5..ee35404dc 100644 --- a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java @@ -97,8 +97,8 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate // SalaryLoggerUtil.recordUpdateSingleLog(salaryTemplateLoggerTemplate, // salaryTemplate.getId(), // salaryTemplateNew.getName(), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100534, "设为默认使用"), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100534, "设为默认使用"), +// SalaryI18nUtil.getI18nLabel( 100534, "设为默认使用"), +// SalaryI18nUtil.getI18nLabel( 100534, "设为默认使用"), // salaryTemplate, // salaryTemplateNew); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 75fc36ec4..8eeeabbd2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -101,14 +101,14 @@ // } // // @Override -// public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id, Long currentEmployeeId, String currentTenantKey) { +// public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id) { // TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id, currentTenantKey); // SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); // // 查找人员信息 // List simpleEmployees = salaryEmployeeService.listAll(currentTenantKey); // Map empMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); // SimpleEmployee simpleEmployee = empMap.get(receiverPO.getEmployeeId()); -// SalaryAssert.notNull(simpleEmployee, SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 139811, "人员不存在")); +// SalaryAssert.notNull(simpleEmployee, SalaryI18nUtil.getI18nLabel( 139811, "人员不存在")); // // return TaxDeclarationApiFlowWarnReceiverFormDTO.builder() // .id(receiverPO.getId()) @@ -129,7 +129,7 @@ // // @Override // @Transactional(rollbackFor = Exception.class) -// public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param, Long currentEmployeeId, String currentTenantKey) { +// public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param) { // if (param.getId() != null) { // TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(param.getId(), currentTenantKey); // SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); @@ -170,7 +170,7 @@ // } // // @Override -// public void createMessageRule(CreateMessageRuleParam param, Long currentEmployeeId, String currentTenantKey) { +// public void createMessageRule(CreateMessageRuleParam param) { // CreateRuleEntity createRule = new CreateRuleEntity() // .setBusinessId(param.getBusinessId()) // .setEvent(MessageEvent.PAYROLL) @@ -183,7 +183,7 @@ // // @Override // @Transactional(rollbackFor = Exception.class) -// public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param, Long currentEmployeeId, String currentTenantKey) { +// public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param) { // TaxDeclarationApiFlowWarnConfigPO warnConfigPO; // if (param.getId() != null) { // warnConfigPO = taxDeclarationApiFlowWarnConfigMapper.selectById(param.getId()); @@ -208,7 +208,7 @@ // } // if (StringUtils.isNotEmpty(param.getConfig())) { // CreateRuleEntity createRule = new CreateRuleEntity() -// .setName(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 159146, "流量不足提醒")) +// .setName(SalaryI18nUtil.getI18nLabel( 159146, "流量不足提醒")) // .setUser(new UserEntity(currentEmployeeId, currentTenantKey)) // .setModule(MessageModule.HRSA) // .setEvent(MessageEvent.PAYROLL) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 2cc75b0cd..b73fe5d28 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -959,6 +959,11 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return res; } + @Override + public void updateById(TaxDeclareRecordPO taxDeclareRecord) { + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + } + private TaxDeclareRequest buildTaxDeclareRequest(Long id) { // 查询供应商信息 TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); diff --git a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java new file mode 100644 index 000000000..eeaf53914 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -0,0 +1,98 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxpayment.dto.TaxAgreementBankFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxAgreementFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.response.AgreementQueryFeedbackResponse; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.*; + +/** + * 三方信息查询 + * + * @author chengliming + * @date 2022-09-02 9:27 AM + **/ +@Slf4j +public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { + + @Override + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + AgreementQueryFeedbackResponse feedbackResponse = (AgreementQueryFeedbackResponse) checkBeforeGetFeedbackResponse(param); + // 校验请求结果 + String responseCode = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + String msg = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); + TaxAgreementFormDTO agreementFormDTO = new TaxAgreementFormDTO(); + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + // 如果接口仍在处理中,则继续轮询 + return agreementFormDTO.setFinish(false); + } + // 获取返回的人员信息列表 + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.error("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(msg); + } + List feedbacks = Optional.of(feedbackResponse) + .map(AgreementQueryFeedbackResponse::getBody) + .map(AgreementQueryFeedbackResponse.Body::getSflb) + .orElse(new ArrayList<>()); + if (feedbacks.isEmpty()) { + log.error("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); + } + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + // 组装表单数据 + TaxAgreementBankFormDTO bankFormDTO = TaxAgreementBankFormDTO.builder() + .bank(feedbacks.get(0).getSfxyh()) + .bankNo(feedbacks.get(0).getKhhhh()) + .build(); + Map form = new HashMap<>(); + form.put("bankForm", bankFormDTO); + form.put("feedbacks", feedbacks); + + Map map = new HashMap<>(); + feedbacks.forEach(e -> { + map.put(e.getSfxyh(), e.getKhhhh()); + }); + + agreementFormDTO.setForm(form); + agreementFormDTO.setCount(map); + return agreementFormDTO.setFinish(true); + } + + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_AGREEMENT; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + return postRequest(apiConfig, url, requestParam, clazz); + } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_AGREEMENT_QUERY_FEEDBACK; + String res = getRequest(apiConfig, requestId, url); + return JsonUtil.parseObject(res, AgreementQueryFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java new file mode 100644 index 000000000..6d17e266a --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -0,0 +1,66 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +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.extern.slf4j.Slf4j; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 完税证明 + * + * @author chengliming + * @date 2022-09-02 9:27 AM + **/ +@Slf4j +public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentService { + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, String taxAgentName, TaxPaymentQueryParam param, TaxDeclarationApiConfigPO apiConfig, Class clazz) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + return postRequest(apiConfig, url, requestParam, clazz); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + WithheldVoucherResponse queryResponse = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), + param, tempWrapper.getApiConfigPO(), WithheldVoucherResponse.class); + // 校验请求结果 + String responseCode = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(WithheldVoucherResponse.Body::getZhsd).orElse(null); + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(feedback)) { + log.info("getWithheldVoucher code error:{}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 95828, "税局接口异常,请稍后重试")); + } + Integer status = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); + if (status.equals(1)) { + log.info("getWithheldVoucher status error:{}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(feedback.getJksbyy()); + } + List vouchers = new ArrayList<>(); + for (int i = 1; i <= feedback.getWszmlb().size(); i++) { + vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel( 184013, "完税证明") + i, feedback.getWszmlb().get(i - 1))); + } + return new TaxWithheldVoucherResultDTO().setVouchers(vouchers); + } +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java new file mode 100644 index 000000000..eb389ee94 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -0,0 +1,141 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxpayment.dto.TaxAgreementFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.*; +import lombok.extern.slf4j.Slf4j; + +import java.math.BigDecimal; +import java.util.Map; +import java.util.Optional; + +/** + * 三方缴款 + * + * @author chengliming + * @date 2022-09-02 9:27 AM + **/ +@Slf4j +public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService { + + @Override + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + WithholdingFeedbackResponse feedbackResponse = (WithholdingFeedbackResponse) checkBeforeGetFeedbackResponse(param); + // 校验请求结果 + String responseCode = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + String msg = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + // 如果接口仍在处理中,则继续轮询 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缴款还在处理中,请稍后点击缴款反馈")); + } + // 获取返回的人员信息列表 + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(msg); + } + WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) + .map(WithholdingFeedbackResponse::getBody) + .map(WithholdingFeedbackResponse.Body::getZhsdjk) + .orElse(null); + if (feedback == null) { + log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); + } + TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param); + // 判断缴款状态是否成功 + Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); + TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); + if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { + throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt())); + } + // 累计实缴金额 + BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); + // 更新个税申报记录状态为已缴款 + TaxDeclareRecordPO taxDeclareRecord = updateTaxDeclareRecord(param, totalPaid); + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + BigDecimal otherAmount = totalPaid.subtract(SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount())); + return new TaxAgreementFeedbackResultDTO() + .setPayAmount(SalaryEntityUtil.thousandthConvert(totalPaid.toString())) + .setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString())) + .setPersonNum(taxAmountFormDTO.getPersonNum()); + } + + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + SalaryAssert.notBlank(param.getProtocolNumber(), SalaryI18nUtil.getI18nLabel(184071, "三方缴费参数错误")); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + requestParam.put("sfxyh", param.getProtocolNumber()); + requestParam.put("ynse", param.getTaxAmount()); + requestParam.put("sblx", "1"); + return postRequest(apiConfig, url, requestParam, clazz); + } + + @Override + protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + requestParam.put("sblx", 1); + cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); + return tempWrapper; + } + + @Override + public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { + TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO + .builder() + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .build()); + + if (paymentRequestPO != null) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) + .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) + || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); + + getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO + .builder() + .feedback(SalaryOnOffEnum.ON.getValue()) + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .build()); + } + } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING_FEEDBACK; + String res = getRequest(apiConfig, requestId, url); + return JsonUtil.parseObject(res, WithholdingFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java new file mode 100644 index 000000000..697fcb52f --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -0,0 +1,180 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxpayment.bo.TaxPaymentBO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithholdingVoucherFeedbackDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.entity.taxpayment.response.SyncWithholdingFeedbackResponse; +import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse; +import com.engine.salary.entity.taxpayment.response.WithholdingVoucherFeedbackResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 缴款凭证 + * + * @author chengliming + * @date 2022-09-02 9:27 AM + **/ +@Slf4j +public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentService { + + @Override + @Transactional(rollbackFor = Exception.class) + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + WithholdingVoucherFeedbackResponse feedbackResponse = (WithholdingVoucherFeedbackResponse) checkBeforeGetFeedbackResponse(param); + // 校验请求结果 + String responseCode = Optional.ofNullable(feedbackResponse).map(WithholdingVoucherFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + String msg = Optional.ofNullable(feedbackResponse).map(WithholdingVoucherFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + // 如果接口仍在处理中,则继续轮询 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缴款还在处理中,请稍后点击缴款反馈")); + } + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(msg); + } + if (feedbackResponse.getBody() == null) { + log.info("getAgreementQueryFeedbackResponse body null: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175339, "税局接口异常,请稍后重试")); + } + // 获取返回的信息列表 + WithholdingVoucherFeedbackResponse.Feedback synthesize = feedbackResponse.getBody().getZhsd(); + if (synthesize.getFkzt().equals("1")) { + throw new SalaryRunTimeException(synthesize.getFkms()); + } + if (SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { + return new TaxFeedbackResultDTO().setFinish(true); + } + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + // 组装数据 + TaxWithholdingVoucherFeedbackDTO feedbackDTO = TaxPaymentBO.buildTaxWithholdingVoucherFeedbackDTO(synthesize); + List details = synthesize.getJkpzmxlb().stream().map(e -> { + TaxWithholdingVoucherFeedbackDTO.Detail detail = new TaxWithholdingVoucherFeedbackDTO.Detail(); + detail.setPaymentCode(e.getZsxmmc()); + detail.setPaymentItem(e.getZspmmc()); + detail.setPayAmount(e.getYjse()); + return detail; + }).collect(Collectors.toList()); + feedbackDTO.setDetails(details); + return feedbackDTO; + } + + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + boolean syncStatus = clazz == SyncWithholdingFeedbackResponse.class; + String api = syncStatus ? SzyhApiConstant.GET_SYNC_WITHHOLDING_FEEDBACK : SzyhApiConstant.WITHHOLDING_VOUCHER; + String url = apiConfig.getHost() + api; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + if (syncStatus) { + requestParam.put("bblx", "1"); + } + return postRequest(apiConfig, url, requestParam, clazz); + } + + @Override + public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { + TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO + .builder() + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .build()); + if (paymentRequestPO != null) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) + .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()), head.getMsg()); + getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO + .builder() + .feedback(SalaryOnOffEnum.ON.getValue()) + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .build()); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void syncWithholdingFeedback(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + SyncWithholdingFeedbackResponse response = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), + param, tempWrapper.getApiConfigPO(), SyncWithholdingFeedbackResponse.class); + // 校验请求结果 + String responseCode = Optional.ofNullable(response) + .map(SyncWithholdingFeedbackResponse::getHead) + .map(SzyhResponseHead::getCode) + .orElse(null); + WithholdingFeedbackResponse.Feedback body = Optional.ofNullable(response) + .map(SyncWithholdingFeedbackResponse::getBody) + .orElse(null); + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(body)) { + log.info("syncWithholdingFeedback code error:{}", JSON.toJSONString(response)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "税局接口异常,请稍后重试")); + } + Integer paymentStatus = SalaryEntityUtil.getIntValue(body.getJkzt(), -1); + TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); + if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { + throw new SalaryRunTimeException(String.format("查询失败,失败原因:%s,申报状态:%s", body.getJksbyy(), body.getSbzt())); + } + // 累计实缴金额 + BigDecimal totalPaid = body.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); + // 更新个税申报记录状态为已缴款 + updateTaxDeclareRecord(param, totalPaid); + // 更新三方缴款反馈状态 + getTaxPaymentRequestMapper().updateFeedbackByTaxDeclareRecordId(TaxPaymentRequestPO + .builder() + .feedback(SalaryOnOffEnum.ON.getValue()) + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxDeclareRecordId(param.getTaxDeclareRecordId()) + .build()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + requestParam.put("sblx", 1); + cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); + } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + String url = apiConfig.getHost() + SzyhApiConstant.WITHHOLDING_VOUCHER_FEEDBACK; + String res = getRequest(apiConfig, requestId, url); + return JsonUtil.parseObject(res, WithholdingVoucherFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java index 63f0b3d37..74015dee9 100644 --- a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java @@ -35,7 +35,7 @@ public class SalaryBillBaseSetWrapper extends Service { * @return */ // public Boolean isBaseSetHasRight(Long currentEmployeeId, String currentTenantKey) { -// return taxAgentService.isHasPermission(SalaryBillWatermarkBO.PERMISSION_SET_CODE, currentEmployeeId, currentTenantKey); +// return taxAgentService.isHasPermission(SalaryBillWatermarkBO.PERMISSION_SET_CODE); // } /** diff --git a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java index bc013dba6..6b112cee8 100644 --- a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java @@ -47,8 +47,10 @@ public class SalaryCommonWrapper extends Service { Long salarySobId = Long.valueOf(map.get("salarySobId")); String key = map.get("key"); List list = getSalarySobItemService(user).listBySalarySobId4SalaryItem(salarySobId); - list = list.stream().filter(po -> po.getName().contains(key)).collect(Collectors.toList()); - List collect = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), list).stream().map(po -> BrowserDataDTO.builder().id(po.getId()).name(po.getName()).build()).collect(Collectors.toList()); + if (StringUtils.isNotBlank(key)) { + list = list.stream().filter(po -> po.getName().contains(key)).collect(Collectors.toList()); + } + List collect = list.stream().map(po -> BrowserDataDTO.builder().id(po.getId()).name(po.getName()).build()).collect(Collectors.toList()); PageInfo salarySobItemPOPageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), collect, BrowserDataDTO.class); return salarySobItemPOPageInfo; } diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java index 9d94f0f3c..be75a6efa 100644 --- a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -1,60 +1,53 @@ -//package com.engine.salary.wrapper; -// -//import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; -//import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; -//import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; -//import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; -//import com.engine.salary.service.factory.TaxPaymentServiceFactory; -//import com.weaver.common.component.form.WeaForm; -//import com.weaver.hrm.salary.entity.taxpayment.dto.TaxPayTypeFormDTO; -//import com.weaver.hrm.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; -//import com.weaver.hrm.salary.util.SalaryFormatUtil; -//import lombok.extern.slf4j.Slf4j; -// -///** -// * 个税辅助缴款 -// * -// * @author chengliming -// * @date: 2022-08-31 13:29:14 -// */ -//@Slf4j -//public class TaxPaymentWrapper { -// private TaxPaymentServiceFactory taxPaymentServiceFactory; -// -// public TaxFeedbackResultDTO getAgreementFeedback(TaxPaymentQueryParam param) { -// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).getFeedback(param); -// } -// -// public TaxFeedbackResultDTO payAgreementFeedback(TaxPaymentQueryParam param) { -// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue()).getFeedback(param); -// } -// -// public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { -// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).getFeedback(param); -// } -// -// public String getRequestId(TaxPaymentQueryParam param) { -// return taxPaymentServiceFactory.get(param.getType()).getRequestId(param); -// } -// -// public WeaForm queryTaxAmount(TaxPaymentQueryParam param) { -// TaxAmountFormDTO formDTO = taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param); -// return SalaryFormatUtil.getInstance().buildForm(TaxAmountFormDTO.class, formDTO); -// } -// -// public WeaForm payType() { -// return SalaryFormatUtil.getInstance().buildForm(TaxPayTypeFormDTO.class, new TaxPayTypeFormDTO()); -// } -// -// public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { -// return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue()).getWithheldVoucher(param); -// } -// -// public void getSyncWithholdingFeedback(TaxPaymentQueryParam param) { -// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).syncWithholdingFeedback(param); -// } -// -// public void cancelVoucher(TaxPaymentQueryParam param) { -// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(param); -// } -//} +package com.engine.salary.wrapper; + +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.service.factory.TaxPaymentServiceFactory; +import lombok.extern.slf4j.Slf4j; + +/** + * 个税辅助缴款 + * + * @author chengliming + * @date: 2022-08-31 13:29:14 + */ +@Slf4j +public class TaxPaymentWrapper { + private TaxPaymentServiceFactory taxPaymentServiceFactory; + + public TaxFeedbackResultDTO getAgreementFeedback(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).getFeedback(param); + } + + public TaxFeedbackResultDTO payAgreementFeedback(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue()).getFeedback(param); + } + + public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).getFeedback(param); + } + + public String getRequestId(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(param.getType()).getRequestId(param); + } + + public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { + TaxAmountFormDTO formDTO = taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param); + return formDTO; + } + + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue()).getWithheldVoucher(param); + } + + public void getSyncWithholdingFeedback(TaxPaymentQueryParam param) { + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).syncWithholdingFeedback(param); + } + + public void cancelVoucher(TaxPaymentQueryParam param) { + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(param); + } +} From 0d8606c956d61858d417374944c381a86b1a9760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 17 Aug 2023 19:04:20 +0800 Subject: [PATCH 020/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxdeclaration/bo/TaxDeclarationBO.java | 2 +- .../dto/TaxDeclareRecordFormDTO.java | 5 +- .../dto/TaxDeclareRecordListDTO.java | 41 ++++++---- .../param/TaxDeclarationListQueryParam.java | 9 +- .../param/TaxDeclarationSaveParam.java | 6 +- .../po/TaxDeclarationValuePO.java | 2 + .../datacollection/AddUpSituationManager.java | 7 +- .../salarysob/SalarySobAddUpRuleMapper.java | 2 +- .../taxdeclaration/TaxDeclarationMapper.java | 2 + .../taxdeclaration/TaxDeclarationMapper.xml | 27 ++++-- .../TaxDeclarationValueMapper.java | 2 +- .../TaxDeclarationValueMapper.xml | 12 +-- .../taxdeclaration/TaxDeclareRecordMapper.xml | 12 +-- .../taxdeclaration/TaxReportColumnMapper.xml | 2 +- .../impl/TaxDeclarationServiceImpl.java | 14 ++-- .../impl/TaxDeclarationValueServiceImpl.java | 82 ++++++++++--------- .../impl/TaxDeclareRecordServiceImpl.java | 26 ++++-- .../salary/web/SalarySobController.java | 4 +- .../salary/web/TaxDeclarationController.java | 2 - .../wrapper/TaxDeclareRecordWrapper.java | 1 + 20 files changed, 155 insertions(+), 105 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java index 4fe0d32c3..2eae67f14 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java @@ -661,7 +661,7 @@ public class TaxDeclarationBO { .id(IdGenerator.generate()) .incomeCategory(incomeCategory) .taxAgentId(taxAgentId) - .salaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))) + .salaryMonth(saveParam.getSalaryMonth()) .taxCycle(taxCycle) .description(saveParam.getDescription()) .creator((long) user.getUID()) diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java index 4d7b82a8e..37e1acf6c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -2,13 +2,12 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; import java.util.List; import java.util.Map; @@ -27,7 +26,7 @@ import java.util.Map; public class TaxDeclareRecordFormDTO { //薪资所属月") - private YearMonth salaryMonth; + private Date salaryMonth; //个税扣缴义务人范围") private TaxAgentRangeEnum taxAgentRange; diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java index 2e952ba37..2d606a6aa 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -1,7 +1,9 @@ package com.engine.salary.entity.taxdeclaration.dto; +import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -23,47 +25,58 @@ public class TaxDeclareRecordListDTO { @JsonSerialize(using = ToStringSerializer.class) private Long id; - //个税扣缴义务人") + //个税扣缴义务人 @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - //个税扣缴义务人名称") + //个税扣缴义务人名称 + @TableTitle(title = "个税扣缴义务人名称",dataIndex = "taxAgentName",key = "taxAgentName") private String taxAgentName; - //薪资所属月") + //薪资所属月 + @TableTitle(title = "薪资所属月",dataIndex = "salaryMonth",key = "salaryMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date salaryMonth; - //税款所属期") + //税款所属期 + @TableTitle(title = "税款所属期",dataIndex = "taxCycle",key = "taxCycle") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxCycle; - //申报类型") + //申报类型 private TaxDeclareTypeEnum taxDeclareType; - //申报类型") + //申报类型 + @TableTitle(title = "申报类型",dataIndex = "taxDeclareTypeDesc",key = "taxDeclareTypeDesc") private String taxDeclareTypeDesc; - //申报状态") + //申报状态 private TaxDeclareStatusEnum taxDeclareStatus; - //申报状态") + //申报状 + @TableTitle(title = "申报状态",dataIndex = "taxDeclareStatusDesc",key = "taxDeclareStatusDesc") private String taxDeclareStatusDesc; - //已缴金额") + //已缴金额 + @TableTitle(title = "已缴金额",dataIndex = "taxPaidAmount",key = "taxPaidAmount") private String taxPaidAmount; - //操作人id") + //操作人id @JsonSerialize(using = ToStringSerializer.class) private Long operateEmployeeId; - //操作人名称") + //操作人名称 + @TableTitle(title = "操作人名称",dataIndex = "operateEmployeeName",key = "operateEmployeeName") private String operateEmployeeName; - //操作时间") + //操作时间 + @TableTitle(title = "操作时间",dataIndex = "operateTime",key = "operateTime") private String operateTime; - //备注") + //备注 + @TableTitle(title = "备注",dataIndex = "description",key = "description") private String description; - //是否展示图标") + //是否展示图标 private boolean displayIcon; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java index c08de0b62..83f65672c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.common.BaseQueryParam; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -23,15 +24,13 @@ import java.util.Date; public class TaxDeclarationListQueryParam extends BaseQueryParam { //薪资所属月范围起点 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date fromSalaryMonth; - //薪资所属月范围终点 + //薪资所属月范围终点 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date endSalaryMonth; - private String fromSalaryMonthStr; - - private String endSalaryMonthStr; - //个税扣缴义务人菜单") private String taxAgentName; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java index 8e0f07d18..871b6b195 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java @@ -1,12 +1,13 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; import java.util.List; /** @@ -31,7 +32,8 @@ public class TaxDeclarationSaveParam { /** * 薪资所属月 */ - private YearMonth salaryMonth; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date salaryMonth; /** * 个税扣缴义务人 diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index 12d4d0844..d6e12c548 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.po; +import com.engine.salary.annotation.Encrypt; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -58,6 +59,7 @@ public class TaxDeclarationValuePO implements Serializable { /** * 薪资核算结果(只在加密解密中使用) */ + @Encrypt private String resultValueJson; /** diff --git a/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java b/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java index c65d02559..da05677cb 100644 --- a/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java +++ b/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java @@ -7,14 +7,11 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationMapper; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; -import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; import weaver.general.BaseBean; import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.YearMonth; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -50,11 +47,9 @@ public class AddUpSituationManager extends Service { bb.writeLog("开始删除生成:" + po.getTaxAgentId() + "-" + po.getSalaryMonth()); // 删除记录 int delete = getTaxDeclarationMapper().deleteByIdZj(po.getId()); - LocalDate localDate = SalaryDateUtil.dateToLocalDate(po.getSalaryMonth()); // 调用生成申报单接口 - YearMonth yearMonth = YearMonth.of(localDate.getYear(), localDate.getMonth()); try { - getTaxDeclarationService().save(TaxDeclarationSaveParam.builder().salaryMonth(yearMonth).taxAgentId(po.getTaxAgentId()).build()); + getTaxDeclarationService().save(TaxDeclarationSaveParam.builder().salaryMonth(po.getSalaryMonth()).taxAgentId(po.getTaxAgentId()).build()); } catch (Exception e) { bb.writeLog("错误:" + e); result = false; diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java index f5245c10c..f13fd838e 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java +++ b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java @@ -76,5 +76,5 @@ public interface SalarySobAddUpRuleMapper { */ void deleteByIds(@Param("ids") Collection ids); - void deleteBySalarySobIds(Collection salarySobIds); + void deleteBySalarySobIds(@Param("salarySobIds")Collection salarySobIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java index 5785ed794..cbdf9a2ae 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java @@ -41,4 +41,6 @@ public interface TaxDeclarationMapper { void deleteByIds(@Param("ids") Collection ids); int deleteByIdZj(Long id); + + void deleteByTaxDeclareRecordIds(@Param("taxDeclareRecordIds") Collection taxDeclareRecordIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml index 1810e8970..5b9a8e1cc 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml @@ -13,6 +13,7 @@ + @@ -30,6 +31,7 @@ , t.tenant_key , t.update_time ,t.income_category + ,t.tax_declare_record_id @@ -77,7 +79,7 @@ INSERT INTO hrsa_tax_declaration(id, salary_month, tax_cycle, tax_agent_id, description, - creator, create_time, update_time, delete_type, tenant_key ,income_category) + creator, create_time, update_time, delete_type, tenant_key ,income_category,tax_declare_record_id) VALUES ( @@ -91,13 +93,14 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.incomeCategory} + #{item.incomeCategory}, + #{item.taxDeclareRecordId} ) INSERT INTO hrsa_tax_declaration(id,salary_month, tax_cycle, tax_agent_id, description, - creator, create_time, update_time, delete_type, tenant_key ,income_category) + creator, create_time, update_time, delete_type, tenant_key ,income_category,tax_declare_record_id) select @@ -111,14 +114,15 @@ #{item.updateTime,jdbcType=DATE}, #{item.deleteType,jdbcType=INTEGER}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.incomeCategory,jdbcType=INTEGER} + #{item.incomeCategory,jdbcType=INTEGER}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE} from dual INSERT INTO hrsa_tax_declaration(id,salary_month, tax_cycle, tax_agent_id, description, - creator, create_time, update_time, delete_type, tenant_key ,income_category) + creator, create_time, update_time, delete_type, tenant_key ,income_category,tax_declare_record_id) VALUES ( #{item.id}, @@ -131,7 +135,8 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.incomeCategory} + #{item.incomeCategory}, + #{item.taxDeclareRecordId} ) @@ -147,4 +152,14 @@ + + UPDATE hrsa_tax_declaration + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_declare_record_id IN + + #{taxDeclareRecordId} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java index 985cf7459..9443a07f1 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java @@ -77,5 +77,5 @@ public interface TaxDeclarationValueMapper { */ void deleteByIds(@Param("ids") Collection ids); - void deleteBytaxDeclareRecordIds(Collection taxDeclareRecordIds); + void deleteBytaxDeclareRecordIds(@Param("taxDeclareRecordIds")Collection taxDeclareRecordIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index 4c511ee99..b2015f8fc 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -189,7 +189,7 @@ tax_declaration_id, employee_type, employee_id, - result_value_json, + result_value_json ) VALUES ( @@ -204,7 +204,7 @@ #{item.taxDeclarationId}, #{item.employeeType}, #{item.employeeId}, - #{item.resultValueJson}, + #{item.resultValueJson} ) @@ -222,7 +222,7 @@ tax_declaration_id, employee_type, employee_id, - result_value_json, + result_value_json ) @@ -237,7 +237,7 @@ #{item.taxDeclarationId,jdbcType=DOUBLE}, #{item.employeeType,jdbcType=INTEGER}, #{item.employeeId,jdbcType=DOUBLE}, - #{item.resultValueJson,jdbcType=VARCHAR}, + #{item.resultValueJson,jdbcType=VARCHAR} from dual @@ -256,7 +256,7 @@ tax_declaration_id, employee_type, employee_id, - result_value_json, + result_value_json ) VALUES ( @@ -270,7 +270,7 @@ #{item.taxDeclarationId}, #{item.employeeType}, #{item.employeeId}, - #{item.resultValueJson}, + #{item.resultValueJson} ) diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml index 5c491a027..7edc1e580 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -298,7 +298,7 @@ person_num, tax_declare_error_msg, tax_paid_amount, - tax_pure_paid_amount, + tax_pure_paid_amount ) VALUES ( @@ -321,7 +321,7 @@ #{item.personNum}, #{item.taxDeclareErrorMsg}, #{item.taxPaidAmount}, - #{item.taxPurePaidAmount}, + #{item.taxPurePaidAmount} ) @@ -347,7 +347,7 @@ person_num, tax_declare_error_msg, tax_paid_amount, - tax_pure_paid_amount, + tax_pure_paid_amount ) @@ -370,7 +370,7 @@ #{item.personNum,jdbcType=INTEGER}, #{item.taxDeclareErrorMsg,jdbcType=VARCHAR}, #{item.taxPaidAmount,jdbcType=VARCHAR}, - #{item.taxPurePaidAmount,jdbcType=VARCHAR}, + #{item.taxPurePaidAmount,jdbcType=VARCHAR} from dual @@ -397,7 +397,7 @@ person_num, tax_declare_error_msg, tax_paid_amount, - tax_pure_paid_amount, + tax_pure_paid_amount ) VALUES ( @@ -419,7 +419,7 @@ #{item.personNum}, #{item.taxDeclareErrorMsg}, #{item.taxPaidAmount}, - #{item.taxPurePaidAmount}, + #{item.taxPurePaidAmount} ) diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml index 025135981..1002208a0 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml @@ -104,7 +104,7 @@ #{id}
- ORDER BY id DESC + ORDER BY id diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 42ac51716..20ed01799 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -178,7 +178,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); // 薪资所属月的日期范围 - LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); + LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(saveParam.getSalaryMonth()); if (Objects.isNull(salaryMonthDateRange)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "薪资所属月参数错误")); } @@ -189,13 +189,13 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration if (CollectionUtils.isNotEmpty(taxDeclarationPOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(107986, "{0}在{1}已经生成过个税申报表,不允许再次生成") .replace("{0}", taxAgentNameMap.get(taxDeclarationPOS.get(0).getTaxAgentId())) - .replace("{1}", saveParam.getSalaryMonth().toString())); + .replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询薪资所属月的薪资核算记录 List salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build()); // 无薪资核算记录,不允许生成个税申报表 if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", saveParam.getSalaryMonth().toString())); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询薪资核算结果 List salaryAcctResultPOS = getSalaryAcctResultService(user) @@ -204,7 +204,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration // 无薪资核算结果,不允许生成个税申报表 if (CollectionUtils.isEmpty(salaryAcctResultPOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}无可申报数据") - .replace("{0}", saveParam.getSalaryMonth().toString())); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId); @@ -213,14 +213,14 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration boolean notArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报") - .replace("{0}", saveParam.getSalaryMonth().toString())); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表 Date taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle(); boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0); if (differentTaxCycle) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}存在不同的税款所属期,无法正常生成个税申报表,请调整账套设置,重新核算后再生成个税申报表") - .replace("{0}", saveParam.getSalaryMonth().toString())); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询薪资账套 Set salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId); @@ -341,7 +341,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { return; } - getTaxDeclarationMapper().deleteByIds(taxDeclareRecordIds); + getTaxDeclarationMapper().deleteByTaxDeclareRecordIds(taxDeclareRecordIds); // new LambdaUpdateChainWrapper<>(baseMapper) // .eq(TaxDeclarationPO::getTenantKey, tenantKey) // .eq(TaxDeclarationPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 9dbf8ea30..7363aebc2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -1,7 +1,9 @@ package com.engine.salary.service.impl; import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.extemp.po.ExtEmpPO; @@ -15,13 +17,16 @@ import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.service.*; -import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; @@ -35,59 +40,64 @@ import java.util.stream.Collectors; */ @Slf4j public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclarationValueService { + public EncryptUtil encryptUtil = new EncryptUtil(); - private TaxDeclarationValueMapper taxDeclarationValueMapper; -// private DataSecurityService dataSecurityService; - - private SalaryEmployeeService salaryEmployeeService; - - private ExtEmpService extEmployeeService; - - private EmployeeDeclareService employeeDeclareService; - - private TaxReportColumnService taxReportColumnService; - + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } @Override public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds) { - List taxDeclarationValuePOS = taxDeclarationValueMapper.listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationValuePOS, TaxDeclarationValuePO.class); } @Override public List listByTaxDeclarationIds(Collection taxDeclarationIds) { - List taxDeclarationValues = taxDeclarationValueMapper.listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + List taxDeclarationValues = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); return decryptBatch(taxDeclarationValues); } @Override public List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds) { - return taxDeclarationValueMapper.listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + return getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); } @Override public TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues) { // 查询个税申报表表头 IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - List taxReportColumns = taxReportColumnService.listByIncomeCategory(incomeCategoryEnum); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); // 人员id Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); // 查询报送的人员 - List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); // 查询人员信息 List simpleEmployeeIds = taxDeclarationValues.stream() .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) .map(TaxDeclarationValuePO::getEmployeeId) .distinct() .collect(Collectors.toList()); - List simpleEmployees = salaryEmployeeService.getEmployeeByIds(simpleEmployeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); // 查询人员薪资(身份证号码等) - List simpleUserInfos = salaryEmployeeService.getEmployeeByIds(simpleEmployeeIds); + List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); // 查询外部人员 List extEmployeeIds = taxDeclarationValues.stream() .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) .map(TaxDeclarationValuePO::getEmployeeId) .collect(Collectors.toList()); - List extEmployees = extEmployeeService.getExtEmpByIds(extEmployeeIds); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); // 列表表头 List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); @@ -101,17 +111,15 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar @Override public void batchSave(List taxDeclarationValues) { if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { - throw new RuntimeException("todo"); -// // 加密 -// taxDeclarationValues.forEach(taxDeclarationValue -> -// taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); -// taxDeclarationValues = dataSecurityService.encryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); -// // 分批保存 -// int batchSize = SalaryPageUtil.getBatchSize(); -// List> partition = Lists.partition(taxDeclarationValues, batchSize); -// for (List subTaxDeclarationValues : partition) { -// baseMapper.batchInsert(subTaxDeclarationValues); -// } + // 加密 + taxDeclarationValues.forEach(taxDeclarationValue -> + taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues = encryptUtil.encryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + // 分批保存 + List> partition = Lists.partition(taxDeclarationValues, 100); + for (List subTaxDeclarationValues : partition) { + getTaxDeclarationValueMapper().batchInsert(subTaxDeclarationValues); + } } } @@ -120,18 +128,18 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { return; } - taxDeclarationValueMapper.deleteBytaxDeclareRecordIds(taxDeclareRecordIds); + getTaxDeclarationValueMapper().deleteBytaxDeclareRecordIds(taxDeclareRecordIds); } private List decryptBatch(List taxDeclarationValues) { if (CollectionUtils.isEmpty(taxDeclarationValues)) { return Collections.emptyList(); } -// // 解密 -// taxDeclarationValues = dataSecurityService.decryptBatch(taxDeclarationValues, TaxDeclarationValuePO.class, tenantKey); -// taxDeclarationValues.forEach(salaryAcctResultValue -> { -// salaryAcctResultValue.setResultValue(JsonUtil.parseMap(salaryAcctResultValue.getResultValueJson(), String.class)); -// }); + // 解密 + taxDeclarationValues = encryptUtil.decryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + taxDeclarationValues.forEach(salaryAcctResultValue -> { + salaryAcctResultValue.setResultValue(JsonUtil.parseMap(salaryAcctResultValue.getResultValueJson(), String.class)); + }); return taxDeclarationValues; } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index b73fe5d28..600dbb8b8 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -73,60 +73,76 @@ import java.util.stream.Collectors; public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRecordService { - private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); } + private TaxDeclarationService getTaxDeclarationService(User user) { return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); } + private EmployeeDeclareService getEmployeeDeclareService(User user) { return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); } + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); } + private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); } + private AddUpSituationService getAddUpSituationService(User user) { return ServiceUtil.getService(AddUpSituationServiceImpl.class, user); } + private TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); } + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); } + private TaxDeclareFailService getTaxDeclareFailService(User user) { return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); } + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); } + private SalaryAcctTaxAgentService salaryAcctTaxAgentService; private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } + private SalaryAcctResultService getSalaryAcctResultService(User user) { return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); } + private SalaryItemService getSalaryItemService(User user) { return ServiceUtil.getService(SalaryItemServiceImpl.class, user); } + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); } + private TaxReportColumnService getTaxReportColumnService(User user) { return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); } + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); } @@ -220,10 +236,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List newTaxDeclarationValues = Lists.newArrayList(); List newAddUpSituations = Lists.newArrayList(); // 根据个税扣缴义务人范围查询个税扣缴义务人 - Collection taxAgents = queryByTaxAgentRange(saveParam); + Collection taxAgents = queryByTaxAgentRange(saveParam); Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); // 查询薪资所属月下的薪资核算记录,并按照权限过滤 - LocalDateRange salaryMonthRange = new LocalDateRange().setFromDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))).setEndDate(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); + LocalDateRange salaryMonthRange = new LocalDateRange().setFromDate(saveParam.getSalaryMonth()).setEndDate(saveParam.getSalaryMonth()); List salaryAcctRecords = getSalaryAcctRecordService(user).listBySalaryMonth(salaryMonthRange); // 查询薪资核算记录关联的个税扣缴义务人 List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId)); @@ -252,7 +268,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } needDeleteTaxDeclareRecordIds.add(oldTaxDeclareRecord.getId()); } - TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now); + TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(saveParam.getSalaryMonth()).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now); newTaxDeclareRecords.add(taxDeclareRecord); // 生成个税申报表 TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue()); @@ -416,7 +432,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map> taxCycleKeySalaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle); for (Map.Entry> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) { Set archivedTaxAgentIds = SalaryEntityUtil.properties(taxCycleEntry.getValue(), SalaryAcctTaxAgentPO::getTaxAgentId); - List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)), archivedTaxAgentIds); + List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(saveParam.getSalaryMonth(), archivedTaxAgentIds); TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream().filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null); // 已经申报成功了的个税申报表的个税扣缴义务人不允许重新生成 if (Objects.nonNull(declareSuccessTaxDeclareRecord)) { diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index e09071f23..aba305a74 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -435,7 +435,7 @@ public class SalarySobController { @Produces(MediaType.APPLICATION_JSON) public String getSalarySobAddUpForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobAddUpRuleWrapper(user)::getForm, id); + return new ResponseResult>(user).run(getSalarySobAddUpRuleWrapper(user)::getForm, id); } /** @@ -449,7 +449,7 @@ public class SalarySobController { @Produces(MediaType.APPLICATION_JSON) public String saveSalarySobAddUp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobAddUpRuleSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalarySobAddUpRuleWrapper(user)::save, saveParam); + return new ResponseResult(user).run(getSalarySobAddUpRuleWrapper(user)::save, saveParam); } /**********************************薪资账套的累计字段对应关系 end*********************************/ diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index cc8d93841..52cc9c8d4 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -11,7 +11,6 @@ import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; import com.engine.salary.util.ResponseResult; -import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationDetailWrapper; import com.engine.salary.wrapper.TaxDeclarationWrapper; @@ -195,7 +194,6 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String saveTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); - saveParam.setSalaryMonth(SalaryDateUtil.String2YearMonth(saveParam.getSalaryMonthStr())); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::save, saveParam); } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 9cfe582fd..27b3fcf8b 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -89,6 +89,7 @@ public class TaxDeclareRecordWrapper extends Service { List list = page.getList(); PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareRecordListDTO.class); + dtoPage.setTotal(page.getTotal()); if (CollectionUtils.isNotEmpty(list)) { // 查询个税扣缴义务人 Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclareRecordPO::getTaxAgentId); From d88c43c3c6e9657916bae5cb280fd407fbb66540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 18 Aug 2023 09:27:16 +0800 Subject: [PATCH 021/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/EmployeeDeclareRefresh.java | 2 +- .../EmployeeDeclareMapper.java | 9 + .../employeedeclare/EmployeeDeclareMapper.xml | 463 +++++++++++++----- .../salarysob/SalarySobAddUpRuleMapper.xml | 6 + .../impl/EmployeeDeclareServiceImpl.java | 16 +- .../engine/salary/util/SalaryDateUtil.java | 17 +- .../wrapper/EmployeeDeclareWrapper.java | 4 +- 7 files changed, 383 insertions(+), 134 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index f12575e8c..84eb0944b 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -119,7 +119,7 @@ public class EmployeeDeclareRefresh { .setCardNum(idNum) .setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()) - .setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday())) + .setBirthday(simpleUserInfo == null || simpleUserInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday())) .setMobile(hrmEmployeeComInfo.getMobile()); if (StringUtils.isEmpty(idNum)) { employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java index 29be31ae8..ce04c325a 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java @@ -47,6 +47,15 @@ public interface EmployeeDeclareMapper { */ int insertIgnoreNull(EmployeeDeclarePO employeeDeclare); + + + /** + * 批量插入 + * + * @param employeeDeclare + */ + void batchInsert(@Param("collection") List employeeDeclare); + /** * 修改,修改所有字段 * diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 363ed51cf..e137ec1ab 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -2,43 +2,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - t.id + t + . + id , t.tax_agent_id , t.tax_cycle , t.employee_id @@ -75,7 +77,7 @@ @@ -83,15 +85,16 @@ - SELECT - + FROM hrsa_employee_declare t WHERE delete_type = 0 @@ -306,105 +309,332 @@ - + #{id}, - + #{taxAgentId}, - + #{taxCycle}, - + #{employeeId}, - + #{employeeType}, - + #{employeeName}, - + #{jobNum}, - + #{cardType}, - + #{cardNum}, - + #{gender}, - + #{birthday}, - + #{employmentStatus}, - + #{mobile}, - + #{employmentType}, - + #{employmentFirstYear}, - + #{employmentDate}, - + #{dismissDate}, - + #{disability}, - + #{disabilityCardNo}, - + #{lonelyOld}, - + #{martyrDependents}, - + #{martyrDependentsCardNo}, - + #{deductExpenses}, - + #{successfullyDeclared}, - + #{newEmployeeInfo}, - + #{declareStatus}, - + #{declareErrorMsg}, - + #{tenantKey}, - + #{creator}, - + #{deleteType}, - + #{createTime}, - + #{updateTime}, + + + INSERT INTO hrsa_employee_declare + ( + birthday, + card_num, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_date, + employee_id, + employee_name, + employee_type, + employment_date, + employment_first_year, + employment_status, + employment_type, + gender, + id, + job_Num, + lonely_old, + martyr_dependents, + martyr_dependents_card_no, + mobile, + new_employee_info, + successfully_declared, + tax_agent_id, + tax_cycle, + tenant_key, + update_time + ) + VALUES + ( + + #{item.birthday}, + #{item.cardNum}, + #{item.cardType}, + #{item.createTime}, + #{item.creator}, + #{item.declareErrorMsg}, + #{item.declareStatus}, + #{item.deductExpenses}, + #{item.deleteType}, + #{item.disability}, + #{item.disabilityCardNo}, + #{item.dismissDate}, + #{item.employeeId}, + #{item.employeeName}, + #{item.employeeType}, + #{item.employmentDate}, + #{item.employmentFirstYear}, + #{item.employmentStatus}, + #{item.employmentType}, + #{item.gender}, + #{item.id}, + #{item.jobNum}, + #{item.lonelyOld}, + #{item.martyrDependents}, + #{item.martyrDependentsCardNo}, + #{item.mobile}, + #{item.newEmployeeInfo}, + #{item.successfullyDeclared}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.tenantKey}, + #{item.updateTime} + + ) + + + + + INSERT INTO hrsa_employee_declare ( + birthday, + card_num, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_date, + employee_id, + employee_name, + employee_type, + employment_date, + employment_first_year, + employment_status, + employment_type, + gender, + id, + job_Num, + lonely_old, + martyr_dependents, + martyr_dependents_card_no, + mobile, + new_employee_info, + successfully_declared, + tax_agent_id, + tax_cycle, + tenant_key, + update_time + ) + + + select + #{item.birthday,jdbcType=DATE}, + #{item.cardNum,jdbcType=VARCHAR}, + #{item.cardType,jdbcType=}, + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.declareErrorMsg,jdbcType=VARCHAR}, + #{item.declareStatus,jdbcType=INTEGER}, + #{item.deductExpenses,jdbcType=INTEGER}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.disability,jdbcType=INTEGER}, + #{item.disabilityCardNo,jdbcType=VARCHAR}, + #{item.dismissDate,jdbcType=DATE}, + #{item.employeeId,jdbcType=DOUBLE}, + #{item.employeeName,jdbcType=VARCHAR}, + #{item.employeeType,jdbcType=INTEGER}, + #{item.employmentDate,jdbcType=DATE}, + #{item.employmentFirstYear,jdbcType=VARCHAR}, + #{item.employmentStatus,jdbcType=INTEGER}, + #{item.employmentType,jdbcType=INTEGER}, + #{item.gender,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.jobNum,jdbcType=VARCHAR}, + #{item.lonelyOld,jdbcType=INTEGER}, + #{item.martyrDependents,jdbcType=INTEGER}, + #{item.martyrDependentsCardNo,jdbcType=VARCHAR}, + #{item.mobile,jdbcType=VARCHAR}, + #{item.newEmployeeInfo,jdbcType=INTEGER}, + #{item.successfullyDeclared,jdbcType=INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.taxCycle,jdbcType=DATE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE} + from dual + + + + + + + INSERT INTO hrsa_employee_declare ( + birthday, + card_num, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_date, + employee_id, + employee_name, + employee_type, + employment_date, + employment_first_year, + employment_status, + employment_type, + gender, + id, + job_Num, + lonely_old, + martyr_dependents, + martyr_dependents_card_no, + mobile, + new_employee_info, + successfully_declared, + tax_agent_id, + tax_cycle, + tenant_key, + update_time + ) + VALUES + ( + #{item.birthday}, + #{item.cardNum}, + #{item.cardType}, + #{item.createTime}, + #{item.creator}, + #{item.declareErrorMsg}, + #{item.declareStatus}, + #{item.deductExpenses}, + #{item.deleteType}, + #{item.disability}, + #{item.disabilityCardNo}, + #{item.dismissDate}, + #{item.employeeId}, + #{item.employeeName}, + #{item.employeeType}, + #{item.employmentDate}, + #{item.employmentFirstYear}, + #{item.employmentStatus}, + #{item.employmentType}, + #{item.gender}, + #{item.id}, + #{item.jobNum}, + #{item.lonelyOld}, + #{item.martyrDependents}, + #{item.martyrDependentsCardNo}, + #{item.mobile}, + #{item.newEmployeeInfo}, + #{item.successfullyDeclared}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.tenantKey}, + #{item.updateTime} + ) + + + + UPDATE hrsa_employee_declare @@ -449,97 +679,97 @@ UPDATE hrsa_employee_declare - + tax_agent_id=#{taxAgentId}, - + tax_cycle=#{taxCycle}, - + employee_id=#{employeeId}, - + employee_type=#{employeeType}, - + employee_name=#{employeeName}, - + job_num=#{jobNum}, - + card_type=#{cardType}, - + card_num=#{cardNum}, - + gender=#{gender}, - + birthday=#{birthday}, - + employment_status=#{employmentStatus}, - + mobile=#{mobile}, - + employment_type=#{employmentType}, - + employment_first_year=#{employmentFirstYear}, - + employment_date=#{employmentDate}, - + dismiss_date=#{dismissDate}, - + disability=#{disability}, - + disability_card_no=#{disabilityCardNo}, - + lonely_old=#{lonelyOld}, - + martyr_dependents=#{martyrDependents}, - + martyr_dependents_card_no=#{martyrDependentsCardNo}, - + deduct_expenses=#{deductExpenses}, - + successfully_declared=#{successfullyDeclared}, - + new_employee_info=#{newEmployeeInfo}, - + declare_status=#{declareStatus}, - + declare_error_msg=#{declareErrorMsg}, - + tenant_key=#{tenantKey}, - + creator=#{creator}, - + delete_type=#{deleteType}, - + create_time=#{createTime}, - + update_time=#{updateTime}, @@ -551,12 +781,13 @@ UPDATE hrsa_employee_declare SET delete_type=1 - WHERE id = #{id} AND delete_type = 0 + WHERE id = #{id} + AND delete_type = 0 UPDATE hrsa_employee_declare SET delete_type=1, - update_time = #{date} + update_time = #{date} WHERE delete_type = 0 AND id IN @@ -633,20 +864,20 @@ AND deduct_expenses = #{param.deductExpenses.value} - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml index 8f0b84e4a..34eefce6a 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml @@ -89,6 +89,12 @@ #{id}
+ + AND salary_sob_id IN + + #{salarySobId} + + ORDER BY id DESC diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 56b87056b..1c1ae3b06 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -498,14 +498,16 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // .setSimpleUserInfos(newSimpleUserInfos) // .setExtEmployees(newExtEmployees) EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId); -// // 保存新增的人员 -// if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) { -// saveBatch(result.getNewEmployeeDeclares()); -// } -// // 更新已有人员 -// if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) { + // 保存新增的人员 + if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) { + result.getNewEmployeeDeclares().forEach(getEmployeeDeclareMapper()::insertIgnoreNull); +// getEmployeeDeclareMapper().batchInsert((result.getNewEmployeeDeclares())); + } + // 更新已有人员 + if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) { + result.getEmployeeDeclares().forEach(getEmployeeDeclareMapper()::updateIgnoreNull); // updateBatchById(result.getEmployeeDeclares()); -// } + } // // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); diff --git a/src/com/engine/salary/util/SalaryDateUtil.java b/src/com/engine/salary/util/SalaryDateUtil.java index af3eb35e2..ba9349296 100644 --- a/src/com/engine/salary/util/SalaryDateUtil.java +++ b/src/com/engine/salary/util/SalaryDateUtil.java @@ -224,7 +224,7 @@ public class SalaryDateUtil { Calendar c = Calendar.getInstance(); c.setTime(localDate); int year = c.get(Calendar.YEAR); - return year ; + return year; } public static LocalDateRange localDate2Range(Date localDate) { @@ -254,6 +254,7 @@ public class SalaryDateUtil { cal.set(Calendar.DAY_OF_MONTH, last); return cal.getTime(); } + public static Date getFirstDayDateOfMonthWithMinutesAndSeconds(final Date date) { final Calendar cal = Calendar.getInstance(); cal.setTime(date); @@ -291,8 +292,6 @@ public class SalaryDateUtil { } - - public static String getMonthBegin(String specifiedDay) { int year; int month; @@ -495,7 +494,7 @@ public class SalaryDateUtil { localDate = format.parse(date); } } catch (Exception e) { - log.error("日期解析异常,{}", date); + log.error("日期解析异常,{}", date, e); localDate = null; } @@ -514,7 +513,7 @@ public class SalaryDateUtil { localDate = format.parse(date); } } catch (Exception e) { - log.error("日期解析异常,{}", date); + log.error("日期解析异常,{}", date, e); localDate = null; } @@ -532,7 +531,7 @@ public class SalaryDateUtil { localDate = format.parse(date); } } catch (Exception e) { - log.error("日期解析异常,{}", date); + log.error("日期解析异常,{}", date, e); localDate = null; } @@ -563,9 +562,10 @@ public class SalaryDateUtil { /** * 转换时间对象 - * @see SalaryDateUtil#toDate(LocalDateTime, String) + * * @param dateTime LocalDateTime * @return Date + * @see SalaryDateUtil#toDate(LocalDateTime, String) */ public static Date toDate(LocalDateTime dateTime) { return toDate(dateTime, null); @@ -574,8 +574,9 @@ public class SalaryDateUtil { /** * 转换时间对象 + * * @param dateTime LocalDateTime - * @param offset 时区,e.g. +8 + * @param offset 时区,e.g. +8 * @return Date */ public static Date toDate(LocalDateTime dateTime, String offset) { diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 553151fe5..8cae00d11 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -108,12 +108,12 @@ public class EmployeeDeclareWrapper extends Service { */ public Map list(EmployeeDeclareListQueryParam queryParam) { ValidUtil.doValidator(queryParam); + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class); List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam(queryParam); + pageInfo.setTotal(employeeDeclarePOS.size()); employeeDeclarePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), employeeDeclarePOS); List convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS); - PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class); pageInfo.setList(convert); - pageInfo.setTotal(employeeDeclarePOS.size()); // // 判断是否开启分部 // boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); From 2f59f8283aadea20d1dbb29aea3813b7bbac80c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Sun, 20 Aug 2023 14:03:43 +0800 Subject: [PATCH 022/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxdeclaration/bo/TaxDeclarationBO.java | 2 - .../bo/TaxDeclarationValueList.java | 12 ++-- .../dto/AbnormalEmployeeListDTO.java | 7 ++- .../dto/TaxDeclarationInfoDTO.java | 5 +- .../param/TaxDeclarationSaveParam.java | 2 - .../EmployeeDeclareRecordMapper.java | 2 +- .../TaxDeclarationDetailMapper.java | 10 ---- .../TaxDeclarationValueMapper.java | 42 +++++++++++++ .../TaxDeclarationValueMapper.xml | 59 +++++++++++++++++++ .../impl/AddUpSituationServiceImpl.java | 1 + .../impl/EmployeeDeclareServiceImpl.java | 2 +- .../TaxDeclarationApiBillingServiceImpl.java | 16 +++-- .../impl/TaxDeclarationValueServiceImpl.java | 9 ++- .../impl/TaxDeclareEmployeeServiceImpl.java | 41 +++++++------ .../impl/TaxDeclareFailServiceImpl.java | 22 ++++--- .../impl/TaxDeclareRecordServiceImpl.java | 7 ++- .../engine/salary/util/SalaryI18nUtil.java | 2 +- .../salary/util/page/SalaryPageUtil.java | 10 ++++ .../salary/web/SalaryAcctController.java | 2 +- .../salary/web/TaxDeclarationController.java | 9 +-- .../wrapper/TaxDeclareRecordWrapper.java | 29 ++++++--- 21 files changed, 216 insertions(+), 75 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java index 2eae67f14..e26135d00 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java @@ -44,7 +44,6 @@ import java.util.stream.Collectors; * @version 1.0 **/ public class TaxDeclarationBO { - private static EncryptUtil encryptUtil = new EncryptUtil(); public static List convert2ListDTO(List taxDeclarations, List simpleEmployees, @@ -469,7 +468,6 @@ public class TaxDeclarationBO { .tenantKey(taxDeclaration.getTenantKey()) .deleteType(NumberUtils.INTEGER_ZERO) .build(); - encryptUtil.encrypt(accumulatedSituation, AddUpSituation.class); result.getNeedInsertAddUpSituations().add(accumulatedSituation); }); } diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index fa0392444..e2b6b60f4 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -39,13 +39,13 @@ public class TaxDeclarationValueList { */ public static List buildTableColumns(List taxReportColumns) { List weaTableColumns = Lists.newArrayList(); - weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum", "120")); - weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username", "120")); - weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(105139, "证件类型"), "cardType", "120")); - weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86318, "证件号码"), "cardNum", "150")); - weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(102786, "所得项目"), "incomeCategory", "120")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(105139, "证件类型"), "cardType")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(86318, "证件号码"), "cardNum")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(102786, "所得项目"), "incomeCategory")); for (TaxReportColumnPO taxReportColumn : taxReportColumns) { - weaTableColumns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(taxReportColumn.getReportColumnLabel(), taxReportColumn.getReportColumnName()), taxReportColumn.getReportColumnDataIndex(), "120")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(taxReportColumn.getReportColumnLabel(), taxReportColumn.getReportColumnName()), taxReportColumn.getReportColumnDataIndex())); } return weaTableColumns; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java index 8d497acc9..a1ea62e89 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -1,9 +1,9 @@ package com.engine.salary.entity.taxdeclaration.dto; +import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; @@ -30,20 +30,25 @@ public class AbnormalEmployeeListDTO { private Long employeeId; //姓名") + @TableTitle(title = "姓名",dataIndex = "employeeName",key = "employeeName") private String employeeName; //工号") + @TableTitle(title = "工号",dataIndex = "jobNum",key = "jobNum") private String jobNum; //证件类型") + @TableTitle(title = "证件类型",dataIndex = "cardType",key = "cardType") private String cardType; //证件号码") + @TableTitle(title = "证件号码",dataIndex = "cardNum",key = "cardNum") private String cardNum; //报送状态") private DeclareStatusEnum declareStatus; //报送状态") + @TableTitle(title = "报送状态",dataIndex = "declareStatusDesc",key = "declareStatusDesc") private String declareStatusDesc; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java index acb55f5b7..af74d366e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModelProperty; @@ -27,11 +28,11 @@ public class TaxDeclarationInfoDTO { @ApiModelProperty("薪资所属月") - @JsonSerialize(using = ToStringSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date salaryMonth; @ApiModelProperty("税款所属期") - @JsonSerialize(using = ToStringSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date taxCycle; @ApiModelProperty("个税扣缴义务人id") diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java index 871b6b195..0a5003f69 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java @@ -54,6 +54,4 @@ public class TaxDeclarationSaveParam { * 备注 */ private String description; - - private String salaryMonthStr; } diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java index c64292115..88a771f4e 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java @@ -78,5 +78,5 @@ public interface EmployeeDeclareRecordMapper { */ void deleteByIds(@Param("ids") Collection ids); - void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); + void deleteByTaxCycleAndTaxAgentId(@Param("taxCycle")Date taxCycle,@Param("taxAgentId") Long taxAgentId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java index 3ee8b562a..cbe931b93 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java @@ -1,10 +1,8 @@ package com.engine.salary.mapper.taxdeclaration; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationEmployeeDTO; -import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -72,12 +70,4 @@ public interface TaxDeclarationDetailMapper { List listAll(); int batchUpdate(@Param("collection") List taxDeclarationDetailPos); - - List listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); - - List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); - - List listPage4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); - - List list4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java index 9443a07f1..1515f916c 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java @@ -1,6 +1,8 @@ package com.engine.salary.mapper.taxdeclaration; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -78,4 +80,44 @@ public interface TaxDeclarationValueMapper { void deleteByIds(@Param("ids") Collection ids); void deleteBytaxDeclareRecordIds(@Param("taxDeclareRecordIds")Collection taxDeclareRecordIds); + + /** + * 查询个税申报表明细中未报送成功的人员 + * + * @param queryParam + * @return + */ + List listPage4NotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 查询个税申报表明细中未报送成功的人员 + * + * @param queryParam + * @return + */ + List list4NotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 查询个税申报表明细中未报送成功的人员 + * + * @param queryParam + * @return + */ + List listPage4NoValueByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 查询个税申报表明细中未报送成功的人员 + * + * @param queryParam + * @return + */ + List list4NoValueByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 批量插入 + * + * @param taxDeclarationValues + */ + void batchInsert(@Param("collection") Collection taxDeclarationValues); + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index b2015f8fc..3bb9937ac 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -361,5 +361,64 @@ + + + + + + + employee_id, employee_type + + + + SELECT DISTINCT + + FROM hrsa_tax_declaration_value + WHERE delete_type = 0 + AND tax_declare_record_id = #{param.taxDeclareRecordId} + AND employee_id NOT IN ( + SELECT employee_id + FROM hrsa_employee_declare hed + WHERE hed.delete_type = 0 + AND hed.tax_agent_id = #{param.taxAgentId} + AND hed.tax_cycle = #{param.taxCycle} + AND hed.successfully_declared = 1 + AND hed.employment_status = 0 + AND hed.declare_status IN (4) + ) + + + + + + + + SELECT + + FROM hrsa_employee_declare + WHERE delete_type = 0 + AND tax_agent_id = #{param.taxAgentId} + AND tax_cycle = #{param.taxCycle} + AND successfully_declared = 1 + AND employment_status = 0 + AND employee_id NOT IN ( + SELECT employee_id + FROM hrsa_tax_declaration_value htdv + WHERE htdv.delete_type = 0 + AND htdv.tax_declare_record_id = #{param.taxDeclareRecordId} + ) + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index e4965928c..5a81ad857 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -1150,6 +1150,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public void batchSave(List list) { if (CollectionUtils.isNotEmpty(list)) { + list = encryptUtil.encryptList(list,AddUpSituation.class); List> partition = Lists.partition(list, 50); partition.forEach(getAddUpSituationMapper()::insertData); } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 1c1ae3b06..c380c98b8 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -563,7 +563,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 企业信息 Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); // 税款所属期 - requestParam.put("skssq", param.getTaxCycle().toString().replace("-", "")); + requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()).replace("-", "")); // 人员列表 requestParam.put("rylb", employeeInfoMapList); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index 6c76e9bf4..2b7c36eb9 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -11,6 +11,7 @@ import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationApiBillingService; import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import lombok.Data; @@ -30,8 +31,9 @@ import java.util.Map; @Slf4j public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService { - private TaxDeclarationApiFlowRecordMapper taxDeclarationApiFlowRecordMapper; - + private TaxDeclarationApiFlowRecordMapper getTaxDeclarationApiFlowRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiFlowRecordMapper.class); + } public TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -41,7 +43,9 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax // private SalaryBatchService salaryBatchService; private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService; - +// public TaxDeclarationApiFlowWarnService getTaxDeclarationApiFlowWarnService(User user) { +// return ServiceUtil.getService(TaxDeclarationApiFlowWarnServiceImpl.class, user); +// } // private ComInfoCache comInfoCache; // private ExtEmployeeService extEmployeeService; @@ -51,13 +55,13 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax // 保存流量使用详情 saveApiFlowRecord(updateWrapper); // 流量不足提醒 - taxDeclarationApiFlowWarnService.sendFlowWarnMessage(updateWrapper); +// taxDeclarationApiFlowWarnService.sendFlowWarnMessage(updateWrapper); } private void saveApiFlowRecord(ApiFlowUpdateWrapper updateWrapper) { if (!updateWrapper.getApiFlowDetailPOList().isEmpty()) { List> failPartition = Lists.partition(updateWrapper.getApiFlowDetailPOList(), 1000); - failPartition.forEach(list -> taxDeclarationApiFlowRecordMapper.batchInsert(list)); + failPartition.forEach(list -> getTaxDeclarationApiFlowRecordMapper().batchInsert(list)); } } @@ -106,7 +110,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax // } // // private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { -// LambdaQueryChainWrapper chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper) +// LambdaQueryChainWrapper chainWrapper = new LambdaQueryChainWrapper<>(getTaxDeclarationApiFlowRecordMapper()) // .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) // .eq(TaxDeclarationApiFlowRecordPO::getTenantKey) // .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId()) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 7363aebc2..cc45c6428 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -45,21 +45,27 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private ExtEmpService getExtEmpService(User user) { return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } + private EmployeeDeclareService getEmployeeDeclareService(User user) { return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); } + private TaxReportColumnService getTaxReportColumnService(User user) { return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); } + @Override public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds) { List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + taxDeclarationValuePOS = decryptBatch(taxDeclarationValuePOS); return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationValuePOS, TaxDeclarationValuePO.class); } @@ -118,7 +124,8 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 分批保存 List> partition = Lists.partition(taxDeclarationValues, 100); for (List subTaxDeclarationValues : partition) { - getTaxDeclarationValueMapper().batchInsert(subTaxDeclarationValues); + subTaxDeclarationValues.forEach(getTaxDeclarationValueMapper()::insertIgnoreNull); +// getTaxDeclarationValueMapper().batchInsert(subTaxDeclarationValues); } } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java index 9c58579b5..6d41daebb 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -10,16 +11,17 @@ import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryPa import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; -import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxDeclareEmployeeService; -import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; import java.util.Collections; import java.util.List; @@ -37,37 +39,42 @@ import java.util.stream.Collectors; public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclareEmployeeService { - // private TaxDeclarationValueMapper taxDeclarationValueMapper; - private TaxDeclarationDetailMapper taxDeclarationValueMapper; + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } - private SalaryEmployeeService hrmCommonEmployeeService; + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } - private SalaryEmployeeService salaryEmployeeService; + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } - private ExtEmpService extEmployeeService; - - private EmployeeDeclareService employeeDeclareService; + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } @Override public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { - List list = taxDeclarationValueMapper.listPage4NotDeclareByParam(queryParam); + List list = getTaxDeclarationValueMapper().listPage4NotDeclareByParam(queryParam); return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, TaxDeclareEmployeePO.class); } @Override public List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { - return taxDeclarationValueMapper.list4NotDeclareByParam(queryParam); + return getTaxDeclarationValueMapper().list4NotDeclareByParam(queryParam); } @Override public PageInfo listPage4NoValueByParam(AbnormalEmployeeListQueryParam queryParam) { - List list = taxDeclarationValueMapper.listPage4NoValueByParam(queryParam); + List list = getTaxDeclarationValueMapper().listPage4NoValueByParam(queryParam); return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, TaxDeclareEmployeePO.class); } @Override public List list4NoValueByParam(AbnormalEmployeeListQueryParam queryParam) { - return taxDeclarationValueMapper.list4NoValueByParam(queryParam); + return getTaxDeclarationValueMapper().list4NoValueByParam(queryParam); } @Override @@ -78,7 +85,7 @@ public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclare // 人员id Set employeeIds = SalaryEntityUtil.properties(taxDeclareEmployees, TaxDeclareEmployeePO::getEmployeeId); // 查询报送的人员 - List employeeDeclares = employeeDeclareService.listByTaxCycleAndTaxAgentIdAndEmployeeIds( + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds( taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId(), employeeIds); // 查询人员信息 List simpleEmployeeIds = taxDeclareEmployees.stream() @@ -86,15 +93,15 @@ public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclare .map(TaxDeclareEmployeePO::getEmployeeId) .distinct() .collect(Collectors.toList()); - List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(simpleEmployeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); // 查询人员薪资(身份证号码等) - List simpleUserInfos = salaryEmployeeService.listByIds(simpleEmployeeIds); + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(simpleEmployeeIds); // 查询外部人员 List extEmployeeIds = taxDeclareEmployees.stream() .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) .map(TaxDeclareEmployeePO::getEmployeeId) .collect(Collectors.toList()); - List extEmployees = extEmployeeService.getExtEmpByIds(extEmployeeIds); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); return TaxDeclareEmployeeBO.convert2AbnormalEmployee(taxDeclareEmployees, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees); } diff --git a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java index 4324c74e7..8da65dc33 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; @@ -10,9 +11,11 @@ import com.engine.salary.mapper.taxdeclaration.TaxDeclareFailMapper; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclareFailService; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; import java.util.Collection; import java.util.Collections; @@ -28,22 +31,27 @@ import java.util.Map; */ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFailService { - private TaxDeclareFailMapper taxDeclareFailMapper; - private TaxAgentService taxAgentService; + private TaxDeclareFailMapper getTaxDeclareFailMapper() { + return MapperProxyFactory.getProxy(TaxDeclareFailMapper.class); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } @Override public List listPageByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { - return taxDeclareFailMapper.listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); + return getTaxDeclareFailMapper().listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); } @Override public List listByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { - return taxDeclareFailMapper.listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); + return getTaxDeclareFailMapper().listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); } @Override public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { - taxDeclareFailMapper.deleteBytaxDeclareRecordIds(taxDeclareRecordIds); + getTaxDeclareFailMapper().deleteBytaxDeclareRecordIds(taxDeclareRecordIds); } @Override @@ -52,7 +60,7 @@ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFail return Collections.emptyList(); } // 查询个税扣缴义务人 - TaxAgentPO taxAgent = taxAgentService.getById(taxDeclareRecord.getTaxAgentId()); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); Map incomeCategoryEnumMap = Maps.newHashMap(); for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { incomeCategoryEnumMap.put(incomeCategoryEnum.getCode(), incomeCategoryEnum); @@ -76,7 +84,7 @@ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFail @Override public void saveBatch(List taxDeclareFails) { if (CollectionUtils.isNotEmpty(taxDeclareFails)) { - taxDeclareFailMapper.batchInsert(taxDeclareFails); + getTaxDeclareFailMapper().batchInsert(taxDeclareFails); } } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 600dbb8b8..321c84023 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -244,9 +244,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 查询薪资核算记录关联的个税扣缴义务人 List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId)); // 按照saveParam中的个税扣缴义务人范围过滤 - Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); + List taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); salaryAcctTaxAgents = salaryAcctTaxAgents.stream().filter(e -> taxAgentIds.contains(e.getTaxAgentId())).collect(Collectors.toList()); - Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getSalaryAcctRecordId); + List salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getSalaryAcctRecordId, Collectors.toList()); salaryAcctRecords = salaryAcctRecords.stream().filter(e -> salaryAcctRecordIds.contains(e.getId())).collect(Collectors.toList()); // 校验是否可以生成个税申报表 // 返回目前已经生成的个税申报表 @@ -300,6 +300,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getAddUpSituationService(user).batchSave(entry.getValue()); } } + + //更新核算记录状态 + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); // // 记录日志 // for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { // LoggerContext loggerContext = new LoggerContext<>(); diff --git a/src/com/engine/salary/util/SalaryI18nUtil.java b/src/com/engine/salary/util/SalaryI18nUtil.java index f7d9272ce..d85f6984b 100644 --- a/src/com/engine/salary/util/SalaryI18nUtil.java +++ b/src/com/engine/salary/util/SalaryI18nUtil.java @@ -17,7 +17,7 @@ public class SalaryI18nUtil { * @param defaultLabel 默认中文 * @return */ - public static String getI18nLabel(int labelId, String defaultLabel) { + public static String getI18nLabel(Integer labelId, String defaultLabel) { return defaultLabel; } // diff --git a/src/com/engine/salary/util/page/SalaryPageUtil.java b/src/com/engine/salary/util/page/SalaryPageUtil.java index 062b5408f..201dd799f 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -1,11 +1,13 @@ package com.engine.salary.util.page; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public class SalaryPageUtil { @@ -90,4 +92,12 @@ public class SalaryPageUtil { return source.subList(startIndex > source.size() ? source.size() : startIndex, endIndex > source.size() ? source.size() : endIndex); } + + + public static List convertList(List columns){ + if(CollectionUtils.isNotEmpty(columns)){ + return columns.stream().map(c->Column.builder().title(c.getText()).key(c.getColumn()).dataIndex(c.getColumn()).build()).collect(Collectors.toList()); + } + return new ArrayList<>(); + } } diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 078060a02..5aea365d2 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -523,7 +523,7 @@ public class SalaryAcctController { @GET @Path("/acctresult/importField") @Produces(MediaType.APPLICATION_JSON) - public String accounting(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { + public String importField(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getSalaryAcctExcelService(user)::getImportField, salaryAcctRecordId); } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 52cc9c8d4..e30cd63e2 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -1,10 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationTabDTO; +import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; @@ -213,7 +210,7 @@ public class TaxDeclarationController { } /** - * 个税申报表生成 + * 删除个税申报表 * * @param ids 个税申报记录id * @return @@ -434,7 +431,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String listEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4Fail, queryParam); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4Fail, queryParam); } // /** diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 27b3fcf8b..00d5c9674 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -54,30 +54,39 @@ public class TaxDeclareRecordWrapper extends Service { private TaxDeclareRecordService getTaxDeclareRecordService(User user) { return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); } + private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalaryCacheService getSalaryCacheService(User user) { return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); } + private TaxDeclarationService getTaxDeclarationService(User user) { return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); } + private TaxDeclarationExcelService getTaxDeclarationExcelService(User user) { return ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user); } + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); } + private TaxDeclareFailService getTaxDeclareFailService(User user) { return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); } + /** * 个税申报记录列表 * @@ -142,10 +151,11 @@ public class TaxDeclareRecordWrapper extends Service { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看")); } // 查询个税申报表详情 - PageInfo page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam,Collections.singleton(queryParam.getTaxDeclarationId())); + PageInfo page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam, Collections.singleton(queryParam.getTaxDeclarationId())); TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclaration, page.getList()); - PageInfo> dtoPage = new PageInfo(); - dtoPage.setList(taxDeclarationValueListDTO.getData()); + PageInfo> dtoPage = SalaryPageUtil.buildPage(page.getPageNum(), page.getPageSize(), taxDeclarationValueListDTO.getData()); + dtoPage.setColumns(SalaryPageUtil.convertList(taxDeclarationValueListDTO.getColumns())); + dtoPage.setTotal(page.getTotal()); return dtoPage; } @@ -181,8 +191,8 @@ public class TaxDeclareRecordWrapper extends Service { // 查询申报失败的数据 List taxDeclareFailPOPageInfo = getTaxDeclareFailService(user).listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 转换成dto - PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), FailEmployeeListDTO.class); - dtoPage.setList(getTaxDeclareFailService(user).convert2FailEmployeeList(taxDeclareRecord, taxDeclareFailPOPageInfo)); + List failEmployeeListDTOS = getTaxDeclareFailService(user).convert2FailEmployeeList(taxDeclareRecord, taxDeclareFailPOPageInfo); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), failEmployeeListDTOS,FailEmployeeListDTO.class); // 转成前端所需的格式 return dtoPage; } @@ -202,6 +212,7 @@ public class TaxDeclareRecordWrapper extends Service { } PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AbnormalEmployeeListDTO.class); dtoPage.setList(getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, page.getList())); + dtoPage.setTotal(page.getTotal()); return dtoPage; } else { // 查询条件中包含"keyword"时,不好通过SQL分页,所以在内存中分页 @@ -266,9 +277,9 @@ public class TaxDeclareRecordWrapper extends Service { // 查询个税申报记录下的个税申报表 List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); - taxDeclarations = taxDeclarations.stream() - .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), (long)user.getUID())) - .collect(Collectors.toList()); +// taxDeclarations = taxDeclarations.stream() +// .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), (long)user.getUID())) +// .collect(Collectors.toList()); Map taxDeclarationMap = SalaryEntityUtil.convert2Map(taxDeclarations, TaxDeclarationPO::getIncomeCategory); List tabs = Lists.newArrayList(); for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { @@ -287,7 +298,7 @@ public class TaxDeclareRecordWrapper extends Service { /** * 查询个税申报表的基本信息 * - * @param id 个税申报表id + * @param id 个税申报表id * @return */ public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { From 215e25fa31c443e986f6a94b79adef912044cdf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 21 Aug 2023 10:30:13 +0800 Subject: [PATCH 023/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/FailEmployeeListDTO.java | 21 ++++++++++++------- src/com/engine/salary/util/page/PageInfo.java | 10 ++++++++- .../wrapper/TaxDeclareRecordWrapper.java | 11 ++++++---- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index 40fde19f7..870fc2c89 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -1,8 +1,8 @@ package com.engine.salary.entity.taxdeclaration.dto; +import com.engine.salary.annotation.TableTitle; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; @@ -17,26 +17,31 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class FailEmployeeListDTO { - //主键id") + //主键id @JsonSerialize(using = ToStringSerializer.class) private Long id; - //姓名") + //姓名 + @TableTitle(title = "姓名",dataIndex = "employeeName",key = "employeeName") private String employeeName; - //个税扣缴义务人id") + //个税扣缴义务人id @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - //个税扣缴义务人名称") + //个税扣缴义务人名称 + @TableTitle(title = "个税扣缴义务人名称",dataIndex = "taxAgentName",key = "taxAgentName") private String taxAgentName; - //证件号码") + //证件号码 + @TableTitle(title = "证件号码",dataIndex = "cardNum",key = "cardNum") private String cardNum; - //失败原因") + //失败原因 + @TableTitle(title = "失败原因",dataIndex = "errorMsg",key = "errorMsg") private String errorMsg; - //所得项目") + //所得项目 + @TableTitle(title = "所得项目",dataIndex = "incomeCategory",key = "incomeCategory") private String incomeCategory; } diff --git a/src/com/engine/salary/util/page/PageInfo.java b/src/com/engine/salary/util/page/PageInfo.java index 86f73f742..44676ad56 100644 --- a/src/com/engine/salary/util/page/PageInfo.java +++ b/src/com/engine/salary/util/page/PageInfo.java @@ -38,9 +38,17 @@ public class PageInfo extends com.github.pagehelper.PageInfo { this.columns = buildColumns(); } + public PageInfo(int pageNum, int pageSize, long total, List columns, List list) { + super(list); + super.setPageNum(pageNum); + super.setPageSize(pageSize); + super.setTotal(total); + this.columns = columns; + } + public List buildColumns() { - if(clazz==null){ + if (clazz == null) { return this.columns; } Field[] fields = clazz.getDeclaredFields(); diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 00d5c9674..dad092eb4 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -153,9 +153,12 @@ public class TaxDeclareRecordWrapper extends Service { // 查询个税申报表详情 PageInfo page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam, Collections.singleton(queryParam.getTaxDeclarationId())); TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclaration, page.getList()); - PageInfo> dtoPage = SalaryPageUtil.buildPage(page.getPageNum(), page.getPageSize(), taxDeclarationValueListDTO.getData()); - dtoPage.setColumns(SalaryPageUtil.convertList(taxDeclarationValueListDTO.getColumns())); - dtoPage.setTotal(page.getTotal()); + PageInfo> dtoPage = new PageInfo<>( + page.getPageNum(), + page.getPageSize(), + page.getTotal(), + SalaryPageUtil.convertList(taxDeclarationValueListDTO.getColumns()), + taxDeclarationValueListDTO.getData()); return dtoPage; } @@ -192,7 +195,7 @@ public class TaxDeclareRecordWrapper extends Service { List taxDeclareFailPOPageInfo = getTaxDeclareFailService(user).listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 转换成dto List failEmployeeListDTOS = getTaxDeclareFailService(user).convert2FailEmployeeList(taxDeclareRecord, taxDeclareFailPOPageInfo); - PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), failEmployeeListDTOS,FailEmployeeListDTO.class); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), failEmployeeListDTOS, FailEmployeeListDTO.class); // 转成前端所需的格式 return dtoPage; } From bb2d2d64e66431cdc1b7da806595f7b73836d28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 21 Aug 2023 19:35:14 +0800 Subject: [PATCH 024/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sql/个税对接表.sql | 2 - resource/sql/还原.sql | 138 ------------------ .../salary/constant/SzyhApiConstant.java | 2 +- .../bo/EmployeeDeclareRefresh.java | 81 +++++----- .../employeedeclare/po/EmployeeDeclarePO.java | 2 - .../bo/TaxDeclarationCommon.java | 3 +- .../salaryacct/SalaryAcctEmployeeMapper.xml | 3 + .../TaxDeclarationValueMapper.xml | 11 +- .../service/SalaryAcctEmployeeService.java | 2 + .../impl/EmployeeDeclareServiceImpl.java | 78 +++++----- .../impl/SalaryAcctEmployeeServiceImpl.java | 7 +- .../TaxDeclarationApiBillingServiceImpl.java | 2 +- .../impl/TaxDeclareRecordServiceImpl.java | 20 ++- .../engine/salary/util/SalaryDateUtil.java | 13 ++ .../wrapper/EmployeeDeclareWrapper.java | 6 +- 15 files changed, 132 insertions(+), 238 deletions(-) delete mode 100644 resource/sql/个税对接表.sql delete mode 100644 resource/sql/还原.sql diff --git a/resource/sql/个税对接表.sql b/resource/sql/个税对接表.sql deleted file mode 100644 index 18eaca552..000000000 --- a/resource/sql/个税对接表.sql +++ /dev/null @@ -1,2 +0,0 @@ -hrsa_tax_declare_api_profile - diff --git a/resource/sql/还原.sql b/resource/sql/还原.sql deleted file mode 100644 index fc70ed7b0..000000000 --- a/resource/sql/还原.sql +++ /dev/null @@ -1,138 +0,0 @@ -delete from hrsa_acct_result_temp where 1=1 -; -delete from hrsa_add_up_deduction where 1=1 -; -delete from hrsa_add_up_situation where 1=1 -; -delete from hrsa_attend_quote where 1=1 -; -delete from hrsa_attend_quote_data where 1=1 -; -delete from hrsa_attend_quote_data_value where 1=1 -; -delete from hrsa_attend_quote_field where 1=1 -; -delete from hrsa_attend_quote_sync_set where 1=1 -; - - -delete from hrsa_scheme_detail where 1=1 -; -delete from hrsa_social_archives where 1=1 -; -delete from hrsa_fund_archives where 1=1 -; -delete from hrsa_other_archives where 1=1 -; - - -delete from hrsa_bill_batch where 1=1 -; - -delete from hrsa_bill_detail where 1=1 -; -delete from hrsa_bill_detail_temp where 1=1 -; -delete from hrsa_bill_inspect where 1=1 -; - - - -delete from hrsa_check_result where 1=1 -; -delete from hrsa_check_result_record where 1=1 -; -delete from hrsa_ck_result_detail_temp where 1=1 -; -delete from hrsa_excel_acct_result where 1=1 -; - -delete from hrsa_other_deduction where 1=1 -; -delete from hrsa_salary_acct_emp where 1=1 -; -delete from hrsa_salary_acct_record where 1=1 -; -delete from hrsa_salary_acct_result where 1=1 -; -delete from hrsa_salary_archive where 1=1 -; -delete from hrsa_salary_archive_dimission where 1=1 -; -delete from hrsa_salary_archive_item where 1=1 -; -delete from hrsa_salary_archive_tax_agent where 1=1 -; -delete from hrsa_salary_item where 1=1 -; -delete from hrsa_salary_send where 1=1 -; -delete from hrsa_salary_send_info where 1=1 -; -delete from hrsa_salary_sob where 1=1 -; -delete from hrsa_salary_sob_adjust_rule where 1=1 -; -delete from hrsa_salary_sob_emp_field where 1=1 -; -delete from hrsa_salary_sob_item where 1=1 -; -delete from hrsa_salary_sob_item_group where 1=1 -; -delete from hrsa_salary_sob_range where 1=1 -; -delete from hrsa_salary_template where 1=1 -; - -delete from hrsa_social_security_scheme where 1=1 -; -delete from hrsa_sys_tax_rate_base where 1=1 -; -delete from hrsa_sys_tax_rate_detail where 1=1 -; -delete from hrsa_tax_agent where 1=1 -; -delete from hrsa_tax_agent_emp where 1=1 -; -delete from hrsa_tax_agent_emp_change where 1=1 -; -delete from hrsa_tax_agent_admin where 1=1 -; -delete from hrsa_tax_agent_manage_range where 1=1 -; - -delete from hrsa_tax_agent_sub_admin where 1=1 -; -delete from hrsa_tax_agent_sub_admin_emp where 1=1 -; - -delete from hrsa_tax_declaration where 1=1 -; -delete from hrsa_tax_declaration_detail where 1=1 -; -delete from hrsa_tax_rate_base where 1=1 -; -delete from hrsa_tax_rate_detail where 1=1 -; -delete from hrsa_salary_acct_result_report where 1=1 -; - -delete from hrsa_insurance_base_info where 1=1 -; - - -delete from hrsa_salary_sob_back_item where 1=1 -; -delete from hrsa_salary_send_range where 1=1 -; -delete from hrsa_salary_send_range_obj where 1=1 -; -delete from hrsa_compensation_log where 1=1 -; -delete from hrsa_compensation_config where 1=1 -; -delete from hrsa_special_add_deduction where 1=1 -; - - - diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 1559b25de..8dc473191 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -16,7 +16,7 @@ public class SzyhApiConstant { /** * 测试接口host */ - public static final String TEST_HOST_URL = "https://ddapi-t.bigfintax.com/"; + public static final String TEST_HOST_URL = "https://uat-ddapi.bigfintax.com/"; /** * 企业注册接口 diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index 84eb0944b..19a93bf9a 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -47,8 +47,9 @@ public class EmployeeDeclareRefresh { // 对已有人员处理「人员状态」、「离职日期」、「任职受雇从业类型」 for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) { SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); - if (salaryArchive != null && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) - || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { + if (salaryArchive != null && + (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { if (Objects.equals(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue()) || Objects.equals(Util.null2String(employeeDeclare.getDismissDate()), Util.null2String(salaryArchive.getPayEndDate()))) { employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); @@ -75,11 +76,11 @@ public class EmployeeDeclareRefresh { if (!employeeIds.contains(preTaxCycleEmployeeDeclare.getEmployeeId())) { EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO(); BeanUtils.copyProperties(preTaxCycleEmployeeDeclare, employeeDeclare); - employeeDeclare.setId(IdGenerator.generate()) - .setTaxCycle(dto.getTaxCycle()) - .setNewEmployeeInfo(0) - .setCreateTime(now) - .setUpdateTime(now); + employeeDeclare.setId(IdGenerator.generate()); + employeeDeclare.setTaxCycle(dto.getTaxCycle()); + employeeDeclare.setNewEmployeeInfo(0); + employeeDeclare.setCreateTime(now); + employeeDeclare.setUpdateTime(now); // 对人员处理「人员状态」、「离职日期」、「任职受雇从业类型」 SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); if (salaryArchive != null && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) @@ -112,15 +113,14 @@ public class EmployeeDeclareRefresh { EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId); DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId()); String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo(); - employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()) - .setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()) - .setEmployeeName(hrmEmployeeComInfo.getUsername()) - .setJobNum(hrmEmployeeComInfo.getWorkcode()) - .setCardNum(idNum) - .setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) - ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()) - .setBirthday(simpleUserInfo == null || simpleUserInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday())) - .setMobile(hrmEmployeeComInfo.getMobile()); + employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); + employeeDeclare.setEmployeeName(hrmEmployeeComInfo.getUsername()); + employeeDeclare.setJobNum(hrmEmployeeComInfo.getWorkcode()); + employeeDeclare.setCardNum(idNum); + employeeDeclare.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()); + employeeDeclare.setBirthday(simpleUserInfo == null || simpleUserInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday())); + employeeDeclare.setMobile(hrmEmployeeComInfo.getMobile()); if (StringUtils.isEmpty(idNum)) { employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); @@ -175,30 +175,31 @@ public class EmployeeDeclareRefresh { } private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, Date taxCycle, Date now, Long employeeId) { - return new EmployeeDeclarePO() - .setId(IdGenerator.generate()) - .setTaxAgentId(taxAgentId) - .setTaxCycle(taxCycle) - .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) - .setGender(GenderEnum.MALE.getValue()) - .setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue()) - .setEmploymentType(EmploymentTypeEnum.EMPLOYEE.getValue()) - .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) - .setDeclareErrorMsg("") - .setDisability(SalaryOnOffEnum.OFF.getValue()) - .setDisabilityCardNo("") - .setLonelyOld(SalaryOnOffEnum.OFF.getValue()) - .setMartyrDependents(SalaryOnOffEnum.OFF.getValue()) - .setMartyrDependentsCardNo("") - .setDeductExpenses(SalaryOnOffEnum.ON.getValue()) - .setSuccessfullyDeclared(0) - .setNewEmployeeInfo(0) - .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setCreator(employeeId) - .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .setCreateTime(now) - .setUpdateTime(now); + EmployeeDeclarePO employeeDeclarePO = new EmployeeDeclarePO(); + employeeDeclarePO.setId(IdGenerator.generate()); + employeeDeclarePO.setTaxAgentId(taxAgentId); + employeeDeclarePO.setTaxCycle(taxCycle); + employeeDeclarePO.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); + employeeDeclarePO.setGender(GenderEnum.MALE.getValue()); + employeeDeclarePO.setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue()); + employeeDeclarePO.setEmploymentType(EmploymentTypeEnum.EMPLOYEE.getValue()); + employeeDeclarePO.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclarePO.setDeclareErrorMsg(""); + employeeDeclarePO.setDisability(SalaryOnOffEnum.OFF.getValue()); + employeeDeclarePO.setDisabilityCardNo(""); + employeeDeclarePO.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); + employeeDeclarePO.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); + employeeDeclarePO.setMartyrDependentsCardNo(""); + employeeDeclarePO.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); + employeeDeclarePO.setSuccessfullyDeclared(0); + employeeDeclarePO.setNewEmployeeInfo(0); + employeeDeclarePO.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclarePO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + employeeDeclarePO.setCreator(employeeId); + employeeDeclarePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + employeeDeclarePO.setCreateTime(now); + employeeDeclarePO.setUpdateTime(now); + return employeeDeclarePO; } @Data diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index 0f2e3d4c8..276371c78 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -5,7 +5,6 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import java.util.Collection; import java.util.Date; @@ -24,7 +23,6 @@ import java.util.Date; @Builder @AllArgsConstructor @NoArgsConstructor -@Accessors(chain = true) //hrsa_employee_declare public class EmployeeDeclarePO { diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index b9eda1e21..a0879108a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -148,7 +149,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { // .employeeType(lastSalaryAcctEmployee.getEmployeeType()) .taxAgentId(lastSalaryAcctEmployee.getTaxAgentId()) .taxYearMonth(taxDeclaration.getTaxCycle()) - .year(taxDeclaration.getTaxCycle().getYear()) + .year(SalaryDateUtil.date2Year(taxDeclaration.getTaxCycle())) .addUpIncome(valueMap.get("addUpIncome")) .addUpSocialSecurityTotal(valueMap.get("addUpSocialSecurityTotal")) .addUpAccumulationFundTotal(valueMap.get("addUpAccumulationFundTotal")) diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index 676f38710..e9c85421a 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -982,6 +982,9 @@ AND t.salary_month = #{salaryMonth} + + AND r.tax_cycle = #{taxCycle} + AND t.creator = #{creator} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index 3bb9937ac..dfcaecaf1 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -94,6 +94,12 @@ #{id}
+ + AND tax_declaration_id IN + + #{taxDeclarationId} + + ORDER BY id DESC @@ -367,7 +373,8 @@ - employee_id, employee_type + employee_id + , employee_type @@ -400,7 +407,7 @@ SELECT FROM hrsa_employee_declare - WHERE delete_type = 0 + WHERE delete_type = 0 AND tax_agent_id = #{param.taxAgentId} AND tax_cycle = #{param.taxCycle} AND successfully_declared = 1 diff --git a/src/com/engine/salary/service/SalaryAcctEmployeeService.java b/src/com/engine/salary/service/SalaryAcctEmployeeService.java index 91bc0ec48..b3882c68c 100644 --- a/src/com/engine/salary/service/SalaryAcctEmployeeService.java +++ b/src/com/engine/salary/service/SalaryAcctEmployeeService.java @@ -124,6 +124,8 @@ public interface SalaryAcctEmployeeService { */ List listByParam(SalaryAcctEmployeeQueryParam queryParam); + List listByTaxCycleAndTaxAgentId(SalaryAcctEmployeeQueryParam queryParam); + /** * 根据薪资核算结果列表的列表查询条件查询薪资核算人员(分页) * diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index c380c98b8..ec666839b 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -143,7 +143,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla @Override public List list4AddByParam(EmployeeDeclareAddListQueryParam queryParam) { - queryParam.setPreTaxCycle(SalaryDateUtil.plusMonths(queryParam.getTaxCycle(),-1)); + queryParam.setPreTaxCycle(SalaryDateUtil.plusMonths(queryParam.getTaxCycle(), -1)); return getEmployeeDeclareMapper().list4AddByParam(queryParam); } @@ -185,40 +185,40 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla @Override public void save(EmployeeDeclareSaveParam saveParam) { Date now = new Date(); - EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() - .setTaxAgentId(saveParam.getTaxAgentId()) - .setTaxCycle(saveParam.getTaxCycle()) - .setEmployeeName(saveParam.getEmployeeName()) - .setJobNum(saveParam.getJobNum()) - .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) - .setCardNum(saveParam.getCardNum()) - .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()) - .setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))) - .setEmploymentStatus(saveParam.getEmploymentStatus().getValue()) - .setMobile(saveParam.getMobile()) - .setEmploymentType(saveParam.getEmploymentType().getValue()) - .setEmploymentFirstYear("") - .setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate())) - .setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate())) - .setDisability(saveParam.getDisability().getValue()) - .setDisabilityCardNo(saveParam.getDisabilityCardNo()) - .setLonelyOld(saveParam.getLonelyOld().getValue()) - .setMartyrDependents(saveParam.getMartyrDependents().getValue()) - .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo()) - .setDeductExpenses(saveParam.getDeductExpenses().getValue()) - .setSuccessfullyDeclared(0) - .setNewEmployeeInfo(0) - .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) - .setDeclareErrorMsg(""); + EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO(); + employeeDeclare.setTaxAgentId(saveParam.getTaxAgentId()); + employeeDeclare.setTaxCycle(saveParam.getTaxCycle()); + employeeDeclare.setEmployeeName(saveParam.getEmployeeName()); + employeeDeclare.setJobNum(saveParam.getJobNum()); + employeeDeclare.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); + employeeDeclare.setCardNum(saveParam.getCardNum()); + employeeDeclare.setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()); + employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))); + employeeDeclare.setEmploymentStatus(saveParam.getEmploymentStatus().getValue()); + employeeDeclare.setMobile(saveParam.getMobile()); + employeeDeclare.setEmploymentType(saveParam.getEmploymentType().getValue()); + employeeDeclare.setEmploymentFirstYear(""); + employeeDeclare.setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate())); + employeeDeclare.setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate())); + employeeDeclare.setDisability(saveParam.getDisability().getValue()); + employeeDeclare.setDisabilityCardNo(saveParam.getDisabilityCardNo()); + employeeDeclare.setLonelyOld(saveParam.getLonelyOld().getValue()); + employeeDeclare.setMartyrDependents(saveParam.getMartyrDependents().getValue()); + employeeDeclare.setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo()); + employeeDeclare.setDeductExpenses(saveParam.getDeductExpenses().getValue()); + employeeDeclare.setSuccessfullyDeclared(0); + employeeDeclare.setNewEmployeeInfo(0); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); if (Objects.isNull(saveParam.getId())) { - employeeDeclare.setId(IdGenerator.generate()) - .setEmployeeId(saveParam.getEmployeeId()) - .setEmployeeType(saveParam.getEmployeeType().getValue()) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setCreator((long) user.getUID()) - .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .setCreateTime(now) - .setUpdateTime(now); + employeeDeclare.setId(IdGenerator.generate()); + employeeDeclare.setEmployeeId(saveParam.getEmployeeId()); + employeeDeclare.setEmployeeType(saveParam.getEmployeeType().getValue()); + employeeDeclare.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + employeeDeclare.setCreator((long) user.getUID()); + employeeDeclare.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + employeeDeclare.setCreateTime(now); + employeeDeclare.setUpdateTime(now); getEmployeeDeclareMapper().insertIgnoreNull(employeeDeclare); // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); @@ -239,11 +239,11 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅")); } - employeeDeclare.setId(originEmployeeDeclare.getId()) - .setEmployeeId(originEmployeeDeclare.getEmployeeId()) - .setEmployeeType(originEmployeeDeclare.getEmployeeType()) - .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()) - .setUpdateTime(now); + employeeDeclare.setId(originEmployeeDeclare.getId()); + employeeDeclare.setEmployeeId(originEmployeeDeclare.getEmployeeId()); + employeeDeclare.setEmployeeType(originEmployeeDeclare.getEmployeeType()); + employeeDeclare.setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()); + employeeDeclare.setUpdateTime(now); // 判断本次编辑是否有修改人员信息 if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { employeeDeclare.setNewEmployeeInfo(1); diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 391289aaa..c9cdcf7e6 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -207,13 +207,18 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct @Override public List listByParam(SalaryAcctEmployeeQueryParam queryParam) { - ValidUtil.doValidator(queryParam); +// ValidUtil.doValidator(queryParam); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); return getSalaryAcctEmployeeMapper().list(queryParam); } + @Override + public List listByTaxCycleAndTaxAgentId(SalaryAcctEmployeeQueryParam queryParam) { + return getSalaryAcctEmployeeMapper().listSome(SalaryAcctEmployeePO.builder().taxAgentIds(queryParam.getTaxAgentIds()).taxCycle(queryParam.getTaxCycle()).build()); + } + @Override public PageInfo listPageByResultQueryParam(SalaryAcctResultQueryParam queryParam) { ValidUtil.doValidator(queryParam); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index 2b7c36eb9..e12dc25a8 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -53,7 +53,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax @Override public void updateApiFlowInfo(ApiFlowUpdateWrapper updateWrapper) { // 保存流量使用详情 - saveApiFlowRecord(updateWrapper); +// saveApiFlowRecord(updateWrapper); // 流量不足提醒 // taxDeclarationApiFlowWarnService.sendFlowWarnMessage(updateWrapper); } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 321c84023..9ba71e449 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -331,8 +331,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182700, "对不起,只有未申报状态下可以刷新数据")); } // 查询税款所属期下的薪资核算人员 - SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder().taxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())).taxCycle(taxDeclareRecord.getTaxCycle()).build(); - List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByParam(salaryAcctEmployeeQueryParam); + SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam + .builder() + .taxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .build(); + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByTaxCycleAndTaxAgentId(salaryAcctEmployeeQueryParam); // 查询薪资核算记录 Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); List salaryAcctRecords = getSalaryAcctRecordService(user).listByIds(salaryAcctRecordIds); @@ -429,7 +433,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List archivedSalaryAcctRecords = salaryAcctRecords.stream().filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue())).collect(Collectors.toList()); // 无已归档的薪资核算记录,不允许生成个税申报表 if (CollectionUtils.isEmpty(archivedSalaryAcctRecords)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177860, "{0}无可申报数据").replace("{0}", saveParam.getSalaryMonth().toString())); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177860, "{0}无可申报数据").replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询已归档的薪资核算记录是否已经生成过个税申报表 Map> taxCycleKeySalaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle); @@ -607,7 +611,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 人员列表 List> employeeDeclareParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); requestParam.put("rylb", employeeDeclareParam); @@ -791,7 +795,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 申报类型 requestParam.put("sblx", "1"); // 作废银联缴款凭证 @@ -896,7 +900,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 申报类型 requestParam.put("sblx", "1"); // 请求 @@ -941,7 +945,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 申报类型 requestParam.put("sblx", "1"); // 请求 @@ -961,7 +965,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 - requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())); + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 报表类型 requestParam.put("reportType", "1"); // 页码 diff --git a/src/com/engine/salary/util/SalaryDateUtil.java b/src/com/engine/salary/util/SalaryDateUtil.java index ba9349296..8d94d5ec1 100644 --- a/src/com/engine/salary/util/SalaryDateUtil.java +++ b/src/com/engine/salary/util/SalaryDateUtil.java @@ -103,6 +103,19 @@ public class SalaryDateUtil { } } + public static String getFormatYYYYMM(Date localDate) { + if (localDate == null) { + return StringUtils.EMPTY; + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(MONTH_FORMATTER_PATTERN); + return simpleDateFormat.format(localDate).replace("-", ""); + } catch (Exception e) { + log.warn("格式化月份错误", e); + return StringUtils.EMPTY; + } + } + public static String getFormatLocalDate(LocalDate localDate) { if (localDate == null) { return StringUtils.EMPTY; diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 8cae00d11..66ed35ebc 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -260,7 +260,7 @@ public class EmployeeDeclareWrapper extends Service { employeeMap.put("_entityType", EmployeeTypeEnum.ORGANIZATION); } else { DataCollectionEmployee extEmployee = getExtEmpService(user).getEmployeeById(employeeDeclare.getEmployeeId()); - employeeMap.put("id",extEmployee.getEmployeeId()); + employeeMap.put("id", extEmployee.getEmployeeId()); employeeMap.put("name", extEmployee.getUsername()); employeeMap.put("_entityType", EmployeeTypeEnum.EXT_EMPLOYEE); } @@ -428,7 +428,7 @@ public class EmployeeDeclareWrapper extends Service { .setFinish(false) .setMsg(""); - Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + "-" + employeeDeclareRate.getIndex(), employeeDeclareRate); + Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); LocalRunnable localRunnable = new LocalRunnable() { @Override public void execute() { @@ -439,7 +439,7 @@ public class EmployeeDeclareWrapper extends Service { log.error("刷新数据失败:{}", e.getMessage(), e); employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); } finally { - Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + "-" + employeeDeclareRate.getIndex(), employeeDeclareRate); + Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); } } }; From fdc1df3dba0ddd3f96080d95920db233d337d6cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 22 Aug 2023 17:48:23 +0800 Subject: [PATCH 025/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5v6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/salary/web/TaxPaymentController.java | 9 + .../param/TaxPaymentQueryParam.java | 2 + .../taxpayment/po/TaxPaymentRequestPO.java | 4 + .../taxdeclaration/TaxDeclareFailMapper.xml | 12 +- .../taxpayment/TaxPaymentRequestMapper.xml | 2 +- .../impl/TaxDeclareFailServiceImpl.java | 1 + .../impl/TaxDeclareRecordServiceImpl.java | 3 +- .../salary/web/TaxPaymentController.java | 194 ++++++++++++++++++ .../salary/wrapper/TaxPaymentWrapper.java | 8 +- 9 files changed, 223 insertions(+), 12 deletions(-) create mode 100644 src/com/api/salary/web/TaxPaymentController.java create mode 100644 src/com/engine/salary/web/TaxPaymentController.java diff --git a/src/com/api/salary/web/TaxPaymentController.java b/src/com/api/salary/web/TaxPaymentController.java new file mode 100644 index 000000000..d29574206 --- /dev/null +++ b/src/com/api/salary/web/TaxPaymentController.java @@ -0,0 +1,9 @@ +package com.api.salary.web; + + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/taxPayment") +public class TaxPaymentController extends com.engine.salary.web.TaxPaymentController{ + +} diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index 7bbc468f0..6338da065 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxpayment.param; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import lombok.AllArgsConstructor; import lombok.Data; @@ -23,6 +24,7 @@ public class TaxPaymentQueryParam { private Long taxAgentId; //税款所属期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date taxYearMonth; //个税申报记录id") diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index dbf3c7094..48c2a0973 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Collection; import java.util.Date; /** @@ -99,4 +100,7 @@ public class TaxPaymentRequestPO implements Serializable { */ //更新时间", ignore = true) private Date updateTime; + + //查询条件 + Collection ids; } diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml index 4ffd5b4e0..78cf33caa 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml @@ -189,7 +189,7 @@ employee_name, card_num, error_msg, - income_category, + income_category ) VALUES ( @@ -204,7 +204,7 @@ #{item.employeeName}, #{item.cardNum}, #{item.errorMsg}, - #{item.incomeCategory}, + #{item.incomeCategory} ) @@ -222,7 +222,7 @@ employee_name, card_num, error_msg, - income_category, + income_category ) @@ -237,7 +237,7 @@ #{item.employeeName,jdbcType=VARCHAR}, #{item.cardNum,jdbcType=VARCHAR}, #{item.errorMsg,jdbcType=VARCHAR}, - #{item.incomeCategory,jdbcType=VARCHAR}, + #{item.incomeCategory,jdbcType=VARCHAR} from dual @@ -256,7 +256,7 @@ employee_name, card_num, error_msg, - income_category, + income_category ) VALUES ( @@ -270,7 +270,7 @@ #{item.employeeName}, #{item.cardNum}, #{item.errorMsg}, - #{item.incomeCategory}, + #{item.incomeCategory} ) diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml index e64c5ec32..226ce23ac 100644 --- a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml @@ -399,7 +399,7 @@ - SELECT FROM hrsa_tax_payment_request t diff --git a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java index 8da65dc33..cbbcf4c0c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java @@ -84,6 +84,7 @@ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFail @Override public void saveBatch(List taxDeclareFails) { if (CollectionUtils.isNotEmpty(taxDeclareFails)) { + getTaxDeclareFailMapper().batchInsert(taxDeclareFails); } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 9ba71e449..97936b74a 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -147,7 +147,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); } - private TaxPaymentServiceFactory taxPaymentServiceFactory; + private TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); + ; // private TaxPaymentRequestMapper taxPaymentRequestMapper; diff --git a/src/com/engine/salary/web/TaxPaymentController.java b/src/com/engine/salary/web/TaxPaymentController.java new file mode 100644 index 000000000..ceffe78ff --- /dev/null +++ b/src/com/engine/salary/web/TaxPaymentController.java @@ -0,0 +1,194 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.TaxPaymentWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 个税辅助缴款 + * + * @author chengliming + * @date: 2022-08-31 11:49:38 + */ +@Slf4j +public class TaxPaymentController { + + private TaxPaymentWrapper getTaxPaymentWrapper(User user) { + return ServiceUtil.getService(TaxPaymentWrapper.class, user); + } + + /** + * 获取企业的三方信息 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/getAgreement") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getAgreement(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getRequestId, param); + } + + /** + * 获取企业的三方信息查询反馈 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/getAgreementFeedback") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getAgreementFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getAgreementFeedback, param); + } + + /** + * 三方协议缴款 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/agreement/pay") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String payAgreement(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getRequestId, param); + } + + /** + * 三方协议缴款反馈 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/agreement/pay/feedback") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String payAgreementFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::payAgreementFeedback, param); + } + + /** + * 缴款凭证打印 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/voucher/print") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String printVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getRequestId, param); + } + + /** + * 缴款凭证打印反馈 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/voucher/print/feedback") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String printVoucherFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::printVoucherFeedback, param); + } + + /** + * 作废缴款凭证 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/voucher/cancel") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String cancelVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::cancelVoucher, param); + } + + /** + * 开具企业缴税完税证明 + * + * @param param 参数 + * @return WeaResult 返回结果 + */ + @Path("/withheldVoucher/get") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getWithheldVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getWithheldVoucher, param); + } + + /** + * 同步缴款状态 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/voucher/status/sync") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getSyncWithholdingFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getSyncWithholdingFeedback, param); + } + + /** + * 应缴税额查询 + * + * @param param 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/tax/amount") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String queryTaxAmount(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::queryTaxAmount, param); + } + +// /** +// * 缴款类型 +// * +// * @return WeaResult 返回结果 +// */ +// @GET +// @Path("/pay/type") +// @Produces(MediaType.APPLICATION_JSON) +// public String payType(@Context HttpServletRequest request, @Context HttpServletResponse response) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxPaymentWrapper(user)::payType, param); +// return WeaResult.success(taxPaymentWrapper.payType()); +// } +} diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java index be75a6efa..431deede8 100644 --- a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -1,5 +1,6 @@ package com.engine.salary.wrapper; +import com.engine.core.impl.Service; import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; @@ -15,8 +16,8 @@ import lombok.extern.slf4j.Slf4j; * @date: 2022-08-31 13:29:14 */ @Slf4j -public class TaxPaymentWrapper { - private TaxPaymentServiceFactory taxPaymentServiceFactory; +public class TaxPaymentWrapper extends Service { + private final TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); public TaxFeedbackResultDTO getAgreementFeedback(TaxPaymentQueryParam param) { return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).getFeedback(param); @@ -35,8 +36,7 @@ public class TaxPaymentWrapper { } public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { - TaxAmountFormDTO formDTO = taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param); - return formDTO; + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param); } public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { From 0040580b51f151436bd3201b52d43c7ae8facce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 23 Aug 2023 15:46:18 +0800 Subject: [PATCH 026/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5v7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxdeclaration/TaxDeclareFailMapper.xml | 6 +++ .../taxpayment/TaxPaymentRequestMapper.xml | 4 +- .../impl/AbstractSalarySobInitService.java | 13 ++--- ...AbstractTaxAgentTaxReturnCheckService.java | 6 ++- .../impl/AbstractTaxPaymentService.java | 3 +- .../impl/SalaryAcctRecordServiceImpl.java | 27 ---------- .../TaxDeclarationApiBillingServiceImpl.java | 2 +- .../impl/TaxDeclareRecordServiceImpl.java | 50 ++++++++++++------- .../impl/TaxPaymentAgreementServiceImpl.java | 2 +- .../TaxPaymentWithheldVoucherServiceImpl.java | 2 +- .../TaxPaymentWithholdingServiceImpl.java | 4 +- ...xPaymentWithholdingVoucherServiceImpl.java | 4 +- 12 files changed, 60 insertions(+), 63 deletions(-) diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml index 78cf33caa..7276a0948 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml @@ -94,6 +94,12 @@ #{id}
+ + AND tax_declare_record_id IN + + #{taxDeclareRecordId} + + ORDER BY id DESC diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml index 226ce23ac..d1ca5dee2 100644 --- a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml @@ -376,8 +376,8 @@ parameterType="com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO"> UPDATE hrsa_tax_payment_request - - request_id=#{requestId} + + request_id=#{requestId}, feedback=#{feedback} diff --git a/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java b/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java index ba22b9329..aacc4a117 100644 --- a/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java +++ b/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java @@ -7,12 +7,13 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.service.SalarySobInitService; /** - * @description: 薪资账套初始化 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/5/18 15:23 - * @version:v1.0 - */ + * 薪资账套初始化 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public abstract class AbstractSalarySobInitService extends Service implements SalarySobInitService { @Override diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java index a1cd19da2..296100b7a 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -32,9 +32,11 @@ import java.util.*; /** * 税友相关公共方法 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-15 5:23 PM + * @author qiantao + * @version 1.0 **/ @Slf4j public abstract class AbstractTaxAgentTaxReturnCheckService extends Service implements TaxAgentTaxReturnCheckService { diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index 38f8fd8c0..20b3a45ba 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -173,7 +173,8 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa } else { paymentRequestPO = TaxPaymentRequestPO.builder() .id(IdGenerator.generate()) - .creator((long) user.getUID()) +// todo .creator((long) user.getUID()) + .creator(1L) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .createTime(new Date()) .updateTime(new Date()) diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 35fcdab05..cc1ffcd5c 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -329,33 +329,6 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 获取个税申报功能状态 TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); - -// if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.CLOSURE.getValue())) { -// // 关闭了个税申报功能 -// // 如果某个月(薪资所属期)还未归档,不可以新建之后月份的薪资核算 -// SalaryAcctRecordPO notArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() -// .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()) -// && e.getSalaryMonth().before(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) -// .findAny() -// .orElse(null); -// if (Objects.nonNull(notArchivedSalaryAcctRecordPO)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98754, "薪资所属期{0}的薪资核算结果还未归档,不能新建薪资所属期{1}的薪资核算") -// .replace("{0}", SalaryDateUtil.localDate2YearMonth(notArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) -// .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); -// } -// // 如果有某个月(薪资所属期)已经归档了,不可以新建之前月份的薪资核算 -// SalaryAcctRecordPO havaSalaryAcctRecordPO = salaryAcctRecords.stream() -// .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) -// && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) -// .findAny() -// .orElse(null); -// if (Objects.nonNull(havaSalaryAcctRecordPO)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98755, "薪资所属期{0}的薪资核算结果已经归档,不能新建薪资所属期{1}的薪资核算") -// .replace("{0}", SalaryDateUtil.localDate2YearMonth(havaSalaryAcctRecordPO.getSalaryMonth()).toString()) -// .replace("{1}", salarySobCycleDTO.getSalaryMonth().toString())); -// } -// -// } if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.OPEN.getValue())) { // 开启了个税申报功能 // 如果某个月(税款所属期)已经归档了,不可以新建之前月份的薪资核算 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index e12dc25a8..4b3d8a9a2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -60,7 +60,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax private void saveApiFlowRecord(ApiFlowUpdateWrapper updateWrapper) { if (!updateWrapper.getApiFlowDetailPOList().isEmpty()) { - List> failPartition = Lists.partition(updateWrapper.getApiFlowDetailPOList(), 1000); + List> failPartition = Lists.partition(updateWrapper.getApiFlowDetailPOList(), 50); failPartition.forEach(list -> getTaxDeclarationApiFlowRecordMapper().batchInsert(list)); } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 97936b74a..fb3662784 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -16,9 +16,9 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; -import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; @@ -63,12 +63,13 @@ import java.util.*; import java.util.stream.Collectors; /** - * @description: 个税申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/2 5:48 PM - * @version:v1.0 - */ + * 个税申报 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRecordService { @@ -147,8 +148,13 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); } + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); - ; + // private TaxPaymentRequestMapper taxPaymentRequestMapper; @@ -201,14 +207,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getEndSalaryMonth())) { build.setSalaryMonthEndDate(queryParam.getEndSalaryMonth()); } - List taxAgentIds = new ArrayList<>(); - if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { - List taxAgents = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build()); - if (CollectionUtils.isEmpty(taxAgents)) { - return pageInfo; - } - taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); - } // 判断是否开启了分权 Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); // 判断是否是总管理员 @@ -221,9 +219,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return pageInfo; } List taxAgentDevolution = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); - taxAgentIds = taxAgentIds.stream().filter(taxAgentDevolution::contains).collect(Collectors.toList()); + build.setTaxAgentIds(taxAgentDevolution); } - build.setTaxAgentIds(taxAgentIds); + List taxDeclareRecordPOS = getTaxDeclareRecordMapper().listSome(build); return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclareRecordPOS, TaxDeclareRecordPO.class); } @@ -551,6 +549,22 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclarationService(user).deleteByTaxDeclareRecordIds(ids); // 删除个税申报表明细 getTaxDeclarationValueService(user).deleteByTaxDeclareRecordIds(ids); + + taxDeclareRecords.forEach(po->{ + // 获取当前个税扣缴义务人下的薪资账套 + List salarySobPOS = getSalarySobService(user).listByTaxAgentId(po.getTaxAgentId()); + List salarySobIds = salarySobPOS.stream().map(SalarySobPO::getId).collect(Collectors.toList()); + // 获取记录 + LocalDateRange dateRange = new LocalDateRange(po.getTaxCycle(), po.getTaxCycle()); + List salaryAcctRecords = getSalaryAcctRecordService(user).listBySalarySobIdsAndTaxCycle(salarySobIds, dateRange); + List salaryAcctRecordIds = salaryAcctRecords.stream().map(SalaryAcctRecordPO::getId).collect(Collectors.toList()); + // 删除个税申报表 + // 修改薪资核算记录状态为已归档 + if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) { + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); + } + }); + // 记录日志 // writeDeleteLog(taxDeclareRecords); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java index eeaf53914..9e738ef1b 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -86,7 +86,7 @@ public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { TaxDeclarationApiConfigPO apiConfig, Class clazz) { String url = apiConfig.getHost() + SzyhApiConstant.QUERY_AGREEMENT; - Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); return postRequest(apiConfig, url, requestParam, clazz); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java index 6d17e266a..4cb11b809 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -35,7 +35,7 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, String taxAgentName, TaxPaymentQueryParam param, TaxDeclarationApiConfigPO apiConfig, Class clazz) { String url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER; - Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); return postRequest(apiConfig, url, requestParam, clazz); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index eb389ee94..401bca567 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -90,7 +90,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService Class clazz) { SalaryAssert.notBlank(param.getProtocolNumber(), SalaryI18nUtil.getI18nLabel(184071, "三方缴费参数错误")); String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING; - Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); requestParam.put("sfxyh", param.getProtocolNumber()); requestParam.put("ynse", param.getTaxAmount()); requestParam.put("sblx", "1"); @@ -100,7 +100,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService @Override protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); - Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); requestParam.put("sblx", 1); cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); return tempWrapper; diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 697fcb52f..d87f61c39 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -96,7 +96,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS boolean syncStatus = clazz == SyncWithholdingFeedbackResponse.class; String api = syncStatus ? SzyhApiConstant.GET_SYNC_WITHHOLDING_FEEDBACK : SzyhApiConstant.WITHHOLDING_VOUCHER; String url = apiConfig.getHost() + api; - Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); if (syncStatus) { requestParam.put("bblx", "1"); } @@ -167,7 +167,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS @Transactional(rollbackFor = Exception.class) public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); - Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYearMonth(param.getTaxYearMonth())); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); requestParam.put("sblx", 1); cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); } From 7e7615bf4abfa4fd6596e13a4fd1ad8c663ce484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 23 Aug 2023 16:20:45 +0800 Subject: [PATCH 027/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308160103.sql | 23 ------------------- resource/sqlupgrade/DM/sql202308230303.sql | 3 +++ resource/sqlupgrade/GS/sql202308160103.sql | 23 ------------------- resource/sqlupgrade/GS/sql202308230303.sql | 3 +++ resource/sqlupgrade/JC/sql202308160103.sql | 23 ------------------- resource/sqlupgrade/JC/sql202308230303.sql | 3 +++ resource/sqlupgrade/Mysql/sql202308160103.sql | 22 ------------------ resource/sqlupgrade/Mysql/sql202308230303.sql | 1 + .../sqlupgrade/Oracle/sql202308160103.sql | 23 ------------------- .../sqlupgrade/Oracle/sql202308230303.sql | 2 ++ resource/sqlupgrade/PG/sql202308160103.sql | 22 ------------------ resource/sqlupgrade/PG/sql202308230303.sql | 1 + .../sqlupgrade/SQLServer/sql202308160103.sql | 22 ------------------ .../sqlupgrade/SQLServer/sql202308230303.sql | 2 ++ resource/sqlupgrade/ST/sql202308160103.sql | 23 ------------------- resource/sqlupgrade/ST/sql202308230303.sql | 3 +++ .../impl/SalarySobItemServiceImpl.java | 4 ++++ 17 files changed, 22 insertions(+), 181 deletions(-) delete mode 100644 resource/sqlupgrade/DM/sql202308160103.sql create mode 100644 resource/sqlupgrade/DM/sql202308230303.sql delete mode 100644 resource/sqlupgrade/GS/sql202308160103.sql create mode 100644 resource/sqlupgrade/GS/sql202308230303.sql delete mode 100644 resource/sqlupgrade/JC/sql202308160103.sql create mode 100644 resource/sqlupgrade/JC/sql202308230303.sql delete mode 100644 resource/sqlupgrade/Mysql/sql202308160103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308230303.sql delete mode 100644 resource/sqlupgrade/Oracle/sql202308160103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308230303.sql delete mode 100644 resource/sqlupgrade/PG/sql202308160103.sql create mode 100644 resource/sqlupgrade/PG/sql202308230303.sql delete mode 100644 resource/sqlupgrade/SQLServer/sql202308160103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308230303.sql delete mode 100644 resource/sqlupgrade/ST/sql202308160103.sql create mode 100644 resource/sqlupgrade/ST/sql202308230303.sql diff --git a/resource/sqlupgrade/DM/sql202308160103.sql b/resource/sqlupgrade/DM/sql202308160103.sql deleted file mode 100644 index 99fd849d7..000000000 --- a/resource/sqlupgrade/DM/sql202308160103.sql +++ /dev/null @@ -1,23 +0,0 @@ -create table hrsa_acct_tax_agent -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - salary_acct_record_id number, - tax_agent_id number, - salary_month date, - tax_cycle date, -income_category varchar2(100) -); -/ - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); -/ - diff --git a/resource/sqlupgrade/DM/sql202308230303.sql b/resource/sqlupgrade/DM/sql202308230303.sql new file mode 100644 index 000000000..311a2bf86 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308230303.sql @@ -0,0 +1,3 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/resource/sqlupgrade/GS/sql202308160103.sql b/resource/sqlupgrade/GS/sql202308160103.sql deleted file mode 100644 index 99fd849d7..000000000 --- a/resource/sqlupgrade/GS/sql202308160103.sql +++ /dev/null @@ -1,23 +0,0 @@ -create table hrsa_acct_tax_agent -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - salary_acct_record_id number, - tax_agent_id number, - salary_month date, - tax_cycle date, -income_category varchar2(100) -); -/ - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); -/ - diff --git a/resource/sqlupgrade/GS/sql202308230303.sql b/resource/sqlupgrade/GS/sql202308230303.sql new file mode 100644 index 000000000..311a2bf86 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308230303.sql @@ -0,0 +1,3 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/resource/sqlupgrade/JC/sql202308160103.sql b/resource/sqlupgrade/JC/sql202308160103.sql deleted file mode 100644 index 99fd849d7..000000000 --- a/resource/sqlupgrade/JC/sql202308160103.sql +++ /dev/null @@ -1,23 +0,0 @@ -create table hrsa_acct_tax_agent -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - salary_acct_record_id number, - tax_agent_id number, - salary_month date, - tax_cycle date, -income_category varchar2(100) -); -/ - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); -/ - diff --git a/resource/sqlupgrade/JC/sql202308230303.sql b/resource/sqlupgrade/JC/sql202308230303.sql new file mode 100644 index 000000000..311a2bf86 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308230303.sql @@ -0,0 +1,3 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308160103.sql b/resource/sqlupgrade/Mysql/sql202308160103.sql deleted file mode 100644 index 877dd233d..000000000 --- a/resource/sqlupgrade/Mysql/sql202308160103.sql +++ /dev/null @@ -1,22 +0,0 @@ -create table hrsa_acct_tax_agent -( - id bigint primary key comment 'ID' , - create_time datetime comment 'ʱ' , - update_time datetime comment '޸ʱ' , - creator bigint comment 'id' , - delete_type int default 0 comment 'Ƿɾ' , - tenant_key varchar(10) comment '⻧KEY' , - salary_acct_record_id bigint comment 'нʺ¼id' , - tax_agent_id bigint comment '˰۽˵id' , - salary_month datetime comment 'н' , - tax_cycle datetime comment '˰' , - income_category varchar(100) -) -; - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, tax_agent_id, tax_cycle) -; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308230303.sql b/resource/sqlupgrade/Mysql/sql202308230303.sql new file mode 100644 index 000000000..ba8b047ae --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308230303.sql @@ -0,0 +1 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308160103.sql b/resource/sqlupgrade/Oracle/sql202308160103.sql deleted file mode 100644 index efcd65cef..000000000 --- a/resource/sqlupgrade/Oracle/sql202308160103.sql +++ /dev/null @@ -1,23 +0,0 @@ -create table hrsa_acct_tax_agent -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - salary_acct_record_id number, - tax_agent_id number, - salary_month date, - tax_cycle date, -income_category varchar2(100) -) -/ - - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle) -/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308230303.sql b/resource/sqlupgrade/Oracle/sql202308230303.sql new file mode 100644 index 000000000..1f5c3dd15 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308230303.sql @@ -0,0 +1,2 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308160103.sql b/resource/sqlupgrade/PG/sql202308160103.sql deleted file mode 100644 index 32f325165..000000000 --- a/resource/sqlupgrade/PG/sql202308160103.sql +++ /dev/null @@ -1,22 +0,0 @@ -create table hrsa_acct_tax_agent -( - id bigint primary key , - create_time timestamp, - update_time timestamp, - creator bigint, - delete_type int default 0, - tenant_key varchar(10), - salary_acct_record_id bigint, - tax_agent_id bigint, - salary_month timestamp, - tax_cycle timestamp, -income_category varchar(100) -); -/ - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); -/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308230303.sql b/resource/sqlupgrade/PG/sql202308230303.sql new file mode 100644 index 000000000..ba8b047ae --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308230303.sql @@ -0,0 +1 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308160103.sql b/resource/sqlupgrade/SQLServer/sql202308160103.sql deleted file mode 100644 index b9219cc81..000000000 --- a/resource/sqlupgrade/SQLServer/sql202308160103.sql +++ /dev/null @@ -1,22 +0,0 @@ -create table hrsa_acct_tax_agent -( - id bigint primary key , - create_time datetime, - update_time datetime, - creator bigint, - delete_type int default 0, - tenant_key nvarchar(10), - salary_acct_record_id bigint, - tax_agent_id bigint, - salary_month datetime, - tax_cycle datetime, -income_category nvarchar(100) -) -GO - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle) -GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308230303.sql b/resource/sqlupgrade/SQLServer/sql202308230303.sql new file mode 100644 index 000000000..61cc33829 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308230303.sql @@ -0,0 +1,2 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308160103.sql b/resource/sqlupgrade/ST/sql202308160103.sql deleted file mode 100644 index 99fd849d7..000000000 --- a/resource/sqlupgrade/ST/sql202308160103.sql +++ /dev/null @@ -1,23 +0,0 @@ -create table hrsa_acct_tax_agent -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - salary_acct_record_id number, - tax_agent_id number, - salary_month date, - tax_cycle date, -income_category varchar2(100) -); -/ - -insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle) -select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle -from hrsa_salary_acct_emp -where delete_type = 0 - and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle); -/ - diff --git a/resource/sqlupgrade/ST/sql202308230303.sql b/resource/sqlupgrade/ST/sql202308230303.sql new file mode 100644 index 000000000..311a2bf86 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308230303.sql @@ -0,0 +1,3 @@ +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 169b54bb8..1dda1ac54 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -398,6 +398,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(salarySobItemGroupId) .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) .sortedIndex(itemParam.getSortedIndex()) @@ -477,6 +478,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(groupId) .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) .canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)) @@ -515,6 +517,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .id(itemParam.getId()) .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(groupId) .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) .sortedIndex(itemParam.getSortedIndex()) @@ -567,6 +570,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(NumberUtils.LONG_ZERO) .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) .sortedIndex(itemParam.getSortedIndex()) From 9e416123dde7021f68f9a5cf8f1043c234de6637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 23 Aug 2023 16:49:45 +0800 Subject: [PATCH 028/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/salary/web/EmployeeDeclareController.java | 13 +++++++------ src/com/engine/salary/cache/SalaryModuleKey.java | 13 +++++++------ src/com/engine/salary/common/YearMonthRange.java | 13 +++++++------ .../common/taxdeclare/AsyncRequestIdDTO.java | 14 +++++++------- .../constant/SalaryDefaultTenantConstant.java | 13 +++++++------ .../constant/SalaryItemDataTypeConstant.java | 13 +++++++------ .../salary/constant/TaxRateDataIndexConstant.java | 13 +++++++------ .../employeedeclare/bo/EmployeeDeclareList.java | 13 +++++++------ .../bo/EmployeeDeclareRefresh.java | 7 ------- .../bo/EmployeeDeclareRequest.java | 13 +++++++------ .../dto/EmployeeDeclareFailListDTO.java | 13 +++++++------ .../dto/EmployeeDeclareFromDTO.java | 13 +++++++------ .../dto/EmployeeDeclareInfoDTO.java | 13 +++++++------ .../dto/EmployeeDeclareListDTO.java | 13 +++++++------ .../dto/EmployeeDeclareRateDTO.java | 13 +++++++------ .../dto/EmployeeDeclareRefreshDTO.java | 13 +++++++------ .../dto/TaxAgentDeclareListDTO.java | 13 +++++++------ .../param/EmployeeDeclareAddListQueryParam.java | 13 +++++++------ .../param/EmployeeDeclareBatchUpdateParam.java | 13 +++++++------ .../param/EmployeeDeclareFailListQueryParam.java | 13 +++++++------ .../param/EmployeeDeclareListQueryParam.java | 13 +++++++------ .../param/EmployeeDeclareParam.java | 13 +++++++------ .../param/EmployeeDeclareRefreshParam.java | 13 +++++++------ .../param/EmployeeDeclareSaveParam.java | 13 +++++++------ .../param/TaxAgentDeclareListQueryParam.java | 13 +++++++------ .../employeedeclare/po/EmployeeDeclarePO.java | 15 +++++++-------- .../po/EmployeeDeclareRecordPO.java | 13 +++++++------ .../response/DeclareEmployeeFeedbackResponse.java | 13 +++++++------ .../response/DeclareEmployeeInfoResponse.java | 13 +++++++------ .../entity/salaryacct/bo/SalaryCalcContext.java | 13 +++++++------ .../salaryacct/bo/SalaryCalcEmployeeContext.java | 7 ------- .../entity/salaryacct/bo/SalaryCalcFormula.java | 13 +++++++------ .../salaryacct/bo/SalaryCalcFormulaContext.java | 13 +++++++------ .../entity/salaryacct/bo/SalaryCalcResult.java | 8 +------- .../salaryacct/dto/SalaryAcctResultDetailDTO.java | 13 +++++++------ .../dto/SalaryAcctResultSearchConditionDTO.java | 13 +++++++------ .../param/SalaryAcctEmployeeAddParam.java | 13 +++++++------ .../salaryacct/po/SalaryAcctResultTempPO.java | 13 +++++++------ .../salaryacct/po/SalaryAcctTaxAgentPO.java | 13 +++++++------ .../po/SalaryCheckResultDetailTempPO.java | 13 +++++++------ .../entity/salaryacct/po/SalaryCheckResultPO.java | 13 +++++++------ .../salaryacct/po/SalaryCheckResultRecordPO.java | 13 +++++++------ .../entity/salarysob/bo/SalarySobInitEnv.java | 13 +++++++------ .../salarysob/dto/SalarySobAddUpRuleDTO.java | 13 +++++++------ .../salarysob/dto/SalarySobTaxReportRuleDTO.java | 13 +++++++------ .../param/SalarySobAddUpRuleSaveParam.java | 13 +++++++------ .../param/SalarySobAdjustRuleQueryParam.java | 13 +++++++------ .../param/SalarySobAdjustRuleSaveParam.java | 13 +++++++------ .../param/SalarySobCheckRuleSaveParam.java | 13 +++++++------ .../salarysob/param/SalarySobItemSaveParam.java | 13 +++++++------ .../salarysob/param/SalarySobListQueryParam.java | 13 +++++++------ .../param/SalarySobRangeEmpQueryParam.java | 13 +++++++------ .../salarysob/param/SalarySobRangeQueryParam.java | 13 +++++++------ .../param/SalarySobTaxReportRuleSaveParam.java | 13 +++++++------ .../param/UpdateCheckRuleFormulaParam.java | 13 +++++++------ .../entity/salarysob/po/SalarySobAddUpRulePO.java | 13 +++++++------ .../salarysob/po/SalarySobTaxReportRulePO.java | 13 +++++++------ .../taxdeclaration/bo/TaxDeclarationCommon.java | 13 +++++++------ .../bo/TaxDeclarationDetailListColumn.java | 13 +++++++------ .../bo/TaxDeclarationGenerateResult.java | 13 +++++++------ .../taxdeclaration/bo/TaxDeclarationRequest.java | 13 +++++++------ .../taxdeclaration/bo/TaxDeclarationResult.java | 13 +++++++------ .../taxdeclaration/bo/TaxDeclarationStrategy.java | 13 +++++++------ .../bo/TaxDeclarationValueList.java | 13 +++++++------ .../taxdeclaration/bo/TaxDeclareContext.java | 13 +++++++------ .../taxdeclaration/bo/TaxDeclareEmployeeBO.java | 13 +++++++------ .../taxdeclaration/bo/TaxDeclareRequest.java | 13 +++++++------ .../dto/AbnormalEmployeeListDTO.java | 13 +++++++------ .../taxdeclaration/dto/FailEmployeeListDTO.java | 13 +++++++------ .../dto/TaxDeclarationDetailListDTO.java | 13 +++++++------ .../taxdeclaration/dto/TaxDeclarationFormDTO.java | 13 +++++++------ .../taxdeclaration/dto/TaxDeclarationInfoDTO.java | 13 +++++++------ .../taxdeclaration/dto/TaxDeclarationRateDTO.java | 8 -------- .../taxdeclaration/dto/TaxDeclarationTabDTO.java | 14 +++++++------- .../dto/TaxDeclarationValueListDTO.java | 13 +++++++------ .../dto/TaxDeclareRecordFormDTO.java | 13 +++++++------ .../dto/TaxDeclareRecordListDTO.java | 13 +++++++------ .../param/AbnormalEmployeeListQueryParam.java | 13 +++++++------ .../param/TaxDeclarationValueListQueryParam.java | 14 +++++++------- .../param/TaxDeclareRecordParam.java | 14 +++++++------- .../taxdeclaration/po/TaxDeclarationValuePO.java | 13 +++++++------ .../taxdeclaration/po/TaxDeclareEmployeePO.java | 13 +++++++------ .../taxdeclaration/po/TaxDeclareFailPO.java | 13 +++++++------ .../taxdeclaration/po/TaxDeclareRecordPO.java | 13 +++++++------ .../taxdeclaration/po/TaxReportColumnPO.java | 13 +++++++------ .../response/CancelDeclareFeedbackResponse.java | 14 +++++++------- .../response/CancelDeclareResponse.java | 14 +++++++------- .../response/DeclareTaxFeedbackResponse.java | 14 +++++++------- .../response/DeclareTaxResponse.java | 14 +++++++------- .../response/UpdateDeclareResponse.java | 14 +++++++------- .../taxrate/param/TaxRateBaseSaveParam.java | 13 +++++++------ .../taxrate/param/TaxRateDetailSaveParam.java | 13 +++++++------ .../entity/taxrate/param/TaxRateSaveParam.java | 13 +++++++------ .../entity/taxrate/vo/TaxDeclarationListVO.java | 13 +++++++------ .../salary/enums/SalaryItemCategoryEnum.java | 13 +++++++------ .../engine/salary/enums/SalaryItemTypeEnum.java | 13 +++++++------ src/com/engine/salary/enums/SalaryOnOffEnum.java | 13 +++++++------ .../engine/salary/enums/SalarySobStatusEnum.java | 13 +++++++------ .../engine/salary/enums/SalarySystemTypeEnum.java | 13 +++++++------ .../enums/employeedeclare/CardTypeEnum.java | 13 +++++++------ .../enums/employeedeclare/DeclareStatusEnum.java | 13 +++++++------ .../employeedeclare/EmploymentStatusEnum.java | 13 +++++++------ .../enums/employeedeclare/EmploymentTypeEnum.java | 13 +++++++------ .../salary/enums/employeedeclare/GenderEnum.java | 13 +++++++------ .../taxdeclaration/CancelDeclareStatusEnum.java | 13 +++++++------ .../taxdeclaration/DeclareFeedBackStatusEnum.java | 13 +++++++------ .../enums/taxdeclaration/TaxAgentRangeEnum.java | 13 +++++++------ .../taxdeclaration/TaxDeclareStatusEnum.java | 13 +++++++------ .../enums/taxdeclaration/TaxDeclareTypeEnum.java | 13 +++++++------ .../service/EmployeeDeclareRecordService.java | 13 +++++++------ .../salary/service/EmployeeDeclareService.java | 13 +++++++------ .../salary/service/SalaryAcctTaxAgentService.java | 13 +++++++------ .../salary/service/SalarySobAddUpRuleService.java | 13 +++++++------ .../service/SalarySobDefaultEmpFieldService.java | 13 +++++++------ .../service/SalarySobDefaultItemGroupService.java | 13 +++++++------ .../salary/service/SalarySobInitService.java | 13 +++++++------ .../salary/service/SalarySobItemService.java | 13 +++++++------ .../service/SalarySobTaxReportRuleService.java | 13 +++++++------ .../service/TaxDeclarationValueService.java | 13 +++++++------ .../salary/service/TaxDeclareEmployeeService.java | 13 +++++++------ .../salary/service/TaxDeclareFailService.java | 13 +++++++------ .../salary/service/TaxDeclareRecordService.java | 13 +++++++------ .../salary/service/TaxReportColumnService.java | 13 +++++++------ .../service/impl/AbstractTaxPaymentService.java | 8 ++++++-- .../impl/EmployeeDeclareRecordServiceImpl.java | 13 +++++++------ .../service/impl/EmployeeDeclareServiceImpl.java | 13 +++++++------ .../impl/SalarySobAddUpRuleServiceImpl.java | 13 +++++++------ .../SalarySobDefaultItemGroupServiceImpl.java | 7 ------- .../service/impl/SalarySobInitServiceImpl.java | 13 +++++++------ .../impl/SalarySobTaxReportRuleServiceImpl.java | 13 +++++++------ .../impl/TaxDeclarationValueServiceImpl.java | 13 +++++++------ .../impl/TaxDeclareEmployeeServiceImpl.java | 13 +++++++------ .../service/impl/TaxDeclareFailServiceImpl.java | 13 +++++++------ .../service/impl/TaxReportColumnServiceImpl.java | 13 +++++++------ src/com/engine/salary/util/SalaryDateUtil.java | 13 +++++++------ .../engine/salary/util/SalaryThreadPoolUtil.java | 15 +++++++-------- .../engine/salary/util/valid/SalaryCardUtil.java | 13 +++++++------ .../salary/web/EmployeeDeclareController.java | 13 +++++++------ .../salary/wrapper/EmployeeDeclareWrapper.java | 13 +++++++------ .../salary/wrapper/SalarySobAddUpRuleWrapper.java | 13 +++++++------ .../wrapper/SalarySobTaxReportRuleWrapper.java | 15 +++++++-------- .../salary/wrapper/TaxDeclareRecordWrapper.java | 13 +++++++------ 142 files changed, 959 insertions(+), 869 deletions(-) diff --git a/src/com/api/salary/web/EmployeeDeclareController.java b/src/com/api/salary/web/EmployeeDeclareController.java index 89158a9ad..a895f531f 100644 --- a/src/com/api/salary/web/EmployeeDeclareController.java +++ b/src/com/api/salary/web/EmployeeDeclareController.java @@ -3,12 +3,13 @@ package com.api.salary.web; import javax.ws.rs.Path; /** - * @description: 人员报送 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 3:37 PM - * @version:v1.0 - */ + * 人员报送 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Path("/bs/hrmsalary/employeedeclare") public class EmployeeDeclareController extends com.engine.salary.web.EmployeeDeclareController { } diff --git a/src/com/engine/salary/cache/SalaryModuleKey.java b/src/com/engine/salary/cache/SalaryModuleKey.java index 9a400744d..2e56259fe 100644 --- a/src/com/engine/salary/cache/SalaryModuleKey.java +++ b/src/com/engine/salary/cache/SalaryModuleKey.java @@ -1,12 +1,13 @@ package com.engine.salary.cache; /** - * @description: 用于拷贝定义所有的模块key,按照模块名规范表进行定义,便于开发引用。要求变量名和变量值必须完全保持一致 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/13/21 11:24 AM - * @version:v1.0 - */ + * 用于拷贝定义所有的模块key,按照模块名规范表进行定义,便于开发引用。要求变量名和变量值必须完全保持一致 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryModuleKey { /** diff --git a/src/com/engine/salary/common/YearMonthRange.java b/src/com/engine/salary/common/YearMonthRange.java index e5d7e82d9..feba6b5e4 100644 --- a/src/com/engine/salary/common/YearMonthRange.java +++ b/src/com/engine/salary/common/YearMonthRange.java @@ -8,12 +8,13 @@ import lombok.experimental.Accessors; import java.util.Date; /** - * @description: 月份范围 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/22 1:53 PM - * @version:v1.0 - */ + * 月份范围 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class YearMonthRange { diff --git a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java index 00cd2948f..d294062b1 100644 --- a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java +++ b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java @@ -1,15 +1,15 @@ package com.engine.salary.common.taxdeclare; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * @description: 异步接口中的requestId - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/10/25 4:50 PM - * @version:v1.0 - */ + * 异步接口中的requestId + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class AsyncRequestIdDTO { diff --git a/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java b/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java index 184ccee40..a185dff62 100644 --- a/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java +++ b/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java @@ -1,12 +1,13 @@ package com.engine.salary.constant; /** - * @description: 默认的租户key - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2/8/22 11:25 AM - * @version:v1.0 - */ + * 默认的租户key + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryDefaultTenantConstant { public static final String DEFAULT_TENANT_KEY = "all_teams"; diff --git a/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java b/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java index c2150c2dc..d438db46d 100644 --- a/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java +++ b/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java @@ -1,12 +1,13 @@ package com.engine.salary.constant; /** - * @description: 薪资项目的值的字段类型 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2/9/22 1:56 PM - * @version:v1.0 - */ + * 薪资项目的值的字段类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryItemDataTypeConstant { /** diff --git a/src/com/engine/salary/constant/TaxRateDataIndexConstant.java b/src/com/engine/salary/constant/TaxRateDataIndexConstant.java index f77d025d6..632b95e5c 100644 --- a/src/com/engine/salary/constant/TaxRateDataIndexConstant.java +++ b/src/com/engine/salary/constant/TaxRateDataIndexConstant.java @@ -1,12 +1,13 @@ package com.engine.salary.constant; /** - * @description: 个税税率表明细表的dataIndex - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 1:58 PM - * @version:v1.0 - */ + * 个税税率表明细表的dataIndex + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxRateDataIndexConstant { /** diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java index 8231332ba..c63a55817 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java @@ -19,12 +19,13 @@ import org.apache.commons.collections4.CollectionUtils; import java.util.*; /** - * @description: 人员报送(人员)列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 4:06 PM - * @version:v1.0 - */ + * 人员报送(人员)列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class EmployeeDeclareList { /** diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index 19a93bf9a..3ef2357b2 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -24,13 +24,6 @@ import org.springframework.beans.BeanUtils; import java.util.*; -/** - * @description: - * @author: xiajun - * @modified By: xiajun - * @date: 2022/11/6 15:47 - * @version:v1.0 - */ public class EmployeeDeclareRefresh { public static Result refresh(EmployeeDeclareRefreshDTO dto, Long employeeId) { diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java index 16b4192bc..c40bcae9d 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -16,12 +16,13 @@ import java.util.List; import java.util.Map; /** - * @description: 个税对接(人员报送) - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/2 11:05 AM - * @version:v1.0 - */ + * 个税对接(人员报送) + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class EmployeeDeclareRequest { diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java index 7bec5e7be..7bf9f9d76 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java @@ -9,12 +9,13 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; /** - * @description: 报送人员失败列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/7 10:42 AM - * @version:v1.0 - */ + * 报送人员失败列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java index a37015af5..21aedf5d9 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -19,12 +19,13 @@ import java.util.List; import java.util.Map; /** - * @description: 人员报送(人员)表单 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 10:14 AM - * @version:v1.0 - */ + * 人员报送(人员)表单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java index 98f2bc4ef..ac7cbc0af 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java @@ -7,12 +7,13 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; /** - * @description: 报送人员信息 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/8 11:38 AM - * @version:v1.0 - */ + * 报送人员信息 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java index 339e7a51f..93a06d3b5 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -14,12 +14,13 @@ import lombok.experimental.Accessors; import java.util.Set; /** - * @description: 人员报送(人员)列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 10:45 AM - * @version:v1.0 - */ + * 人员报送(人员)列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java index fe1c33f95..44924bd74 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java @@ -9,12 +9,13 @@ import lombok.experimental.Accessors; import java.io.Serializable; /** - * @description: 人员进度 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/23 11:38 AM - * @version:v1.0 - */ + * 人员进度 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java index eedeee37f..56f88e0ff 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java @@ -12,12 +12,13 @@ import java.util.Date; import java.util.List; /** - * @description: 人员报送,刷新数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/23 10:52 AM - * @version:v1.0 - */ + * 人员报送,刷新数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class EmployeeDeclareRefreshDTO { diff --git a/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java index 6492210c8..6b1286c03 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java @@ -7,12 +7,13 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; /** - * @description: 人员报送(个税扣缴义务人)列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 10:35 AM - * @version:v1.0 - */ + * 人员报送(个税扣缴义务人)列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java index 7a5a37f8c..116623339 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java @@ -20,12 +20,13 @@ import java.util.Date; import java.util.List; /** - * @description: 人员报送(人员)列表查询参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 3:24 PM - * @version:v1.0 - */ + * 人员报送(人员)列表查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java index 3dc154bfb..df5bf960c 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java @@ -5,12 +5,13 @@ import lombok.Data; import java.util.Collection; /** - * @description: 人员报送-批量编辑保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/16 3:56 PM - * @version:v1.0 - */ + * 人员报送-批量编辑保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class EmployeeDeclareBatchUpdateParam extends EmployeeDeclareListQueryParam { diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java index 7719bdba1..8b9c7c202 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java @@ -12,12 +12,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 报送人员失败查询参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/7 11:14 AM - * @version:v1.0 - */ + * 报送人员失败查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java index 09eae8d9f..e569ecbf1 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java @@ -18,12 +18,13 @@ import java.util.Date; import java.util.List; /** - * @description: 人员报送(人员)列表查询参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 3:24 PM - * @version:v1.0 - */ + * 人员报送(人员)列表查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java index 48d4e6478..8f99c2e98 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java @@ -9,12 +9,13 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * @description: 人员报送 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/10/28 6:06 PM - * @version:v1.0 - */ + * 人员报送 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java index b4fca003e..b70cba7b5 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java @@ -9,12 +9,13 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * @description: 刷新报送人员 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/11/6 15:17 - * @version:v1.0 - */ + * 刷新报送人员 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java index 1fef4f070..b61c2e713 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -12,12 +12,13 @@ import java.time.LocalDate; import java.util.Date; /** - * @description: 人员报送(人员)保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 1:50 PM - * @version:v1.0 - */ + * 人员报送(人员)保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class EmployeeDeclareSaveParam { diff --git a/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java index 0e548120d..6daffceb3 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 人员报送(个税扣缴义务人)查询条件 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 10:59 AM - * @version:v1.0 - */ + * 人员报送(个税扣缴义务人)查询条件 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index 276371c78..a8c23d03b 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -11,14 +11,13 @@ import java.util.Date; /** - * @description: 人员报送(人员) - * @TableName(value = "hrsa_employee_declare") - * @ElogTransform(name = "报送人员") - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 9:22 AM - * @version:v1.0 - */ + * 人员报送(人员) + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java index c7b6bec24..fb31b0a85 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java @@ -10,12 +10,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 员工报送记录 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/11/6 16:50 - * @version:v1.0 - */ + * 员工报送记录 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @Builder diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java index 331090c7b..899a2e394 100644 --- a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java @@ -8,12 +8,13 @@ import java.util.List; import java.util.Map; /** - * @description: 报送人员的反馈 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/10/27 10:41 AM - * @version:v1.0 - */ + * 报送人员的反馈 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class DeclareEmployeeFeedbackResponse { diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java index 73216ff4b..bc99c9df6 100644 --- a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java @@ -6,12 +6,13 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * @description: 报送人员的返回数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/10/25 4:49 PM - * @version:v1.0 - */ + * 报送人员的返回数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class DeclareEmployeeInfoResponse { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java index c1a88ba6a..02e7032b7 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java @@ -10,12 +10,13 @@ import java.util.List; import java.util.Map; /** - * @description: 薪资核算上下文 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/22/22 3:26 PM - * @version:v1.0 - */ + * 薪资核算上下文 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalaryCalcContext { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java index fa07e673e..3295a6b03 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java @@ -8,13 +8,6 @@ import lombok.Data; import java.util.List; import java.util.Map; -/** - * @description: - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/23/22 3:45 PM - * @version:v1.0 - */ @Data public class SalaryCalcEmployeeContext { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java index 937bffdc7..39a04b518 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java @@ -6,12 +6,13 @@ import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 薪资核算计算优先级 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/23/22 11:52 AM - * @version:v1.0 - */ + * 薪资核算计算优先级 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class SalaryCalcFormula { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java index bd8a60387..bfa1be309 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java @@ -8,12 +8,13 @@ import lombok.Data; import java.util.*; /** - * @description: 薪资核算公式 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/22/22 3:33 PM - * @version:v1.0 - */ + * 薪资核算公式 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalaryCalcFormulaContext { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java index 3b658c769..95365eb1b 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java @@ -6,13 +6,7 @@ import lombok.Data; import java.util.List; -/** - * @description: - * @author: xiajun - * @modified By: xiajun - * @date: 2022/8/22 20:45 - * @version:v1.0 - */ + @Data @AllArgsConstructor public class SalaryCalcResult { diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java index 1df7b8a14..5818e087b 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java @@ -8,12 +8,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 薪资核算结果详情 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/9/21 5:13 PM - * @version:v1.0 - */ + * 薪资核算结果详情 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java index 57bbd85ad..89d196545 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java @@ -5,12 +5,13 @@ import com.engine.salary.common.LocalDateRange; import java.util.Collection; /** - * @description: 薪资核算结果高级搜索 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/9/21 5:06 PM - * @version:v1.0 - */ + * 薪资核算结果高级搜索 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryAcctResultSearchConditionDTO { // @SalarySearchCondition( diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java index 15bf4c09c..6821d3cc1 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java @@ -6,12 +6,13 @@ import lombok.Data; import java.util.Collection; /** - * @description: 薪资核算人员-从环比上月减少添加 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/26/22 3:39 PM - * @version:v1.0 - */ + * 薪资核算人员-从环比上月减少添加 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalaryAcctEmployeeAddParam { diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java index 3e985265e..187e38d0e 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java @@ -10,12 +10,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 薪资核算结果临时存储 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/27/21 10:05 AM - * @version:v1.0 - */ + * 薪资核算结果临时存储 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @Accessors(chain = true) diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java index 945482916..4a7dd7da6 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java @@ -7,12 +7,13 @@ import java.time.LocalDateTime; import java.util.Date; /** - * @description: 薪资核算记录对应的个税扣缴义务人 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/7/29 9:40 - * @version:v1.0 - */ + * 薪资核算记录对应的个税扣缴义务人 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) // "hrsa_acct_tax_agent") diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java index 1f03a451d..71e5926d8 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java @@ -9,12 +9,13 @@ import lombok.experimental.Accessors; import java.util.Date; /** - * @description: 核算结果的校验结果明细临时存储 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/27/21 3:41 PM - * @version:v1.0 - */ + * 核算结果的校验结果明细临时存储 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @Accessors(chain = true) diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java index 245f1d9c0..bb0ae78e3 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java @@ -8,12 +8,13 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * @description: 薪资核算校验异常结果 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/7/21 10:44 AM - * @version:v1.0 - */ + * 薪资核算校验异常结果 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java index 9c034ff9c..8120e68ee 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java @@ -8,12 +8,13 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * @description: 薪资核算校验异常结果明细 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/7/21 10:47 AM - * @version:v1.0 - */ + * 薪资核算校验异常结果明细 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java index 8208952d3..bf5708fe5 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java @@ -9,12 +9,13 @@ import weaver.hrm.User; import java.util.List; /** - * @description: 初始化薪资账套 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/5/18 15:36 - * @version:v1.0 - */ + * 初始化薪资账套 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalarySobInitEnv { diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java index c5874501e..a64d9f7a7 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java @@ -8,12 +8,13 @@ import java.util.List; import java.util.Map; /** - * @description: 薪资账套的累计字段对应关系 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/1/4 10:43 AM - * @version:v1.0 - */ + * 薪资账套的累计字段对应关系 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalarySobAddUpRuleDTO { diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java index 342265e28..b1c6e2330 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java @@ -8,12 +8,13 @@ import java.util.List; import java.util.Map; /** - * @description: 薪资账套的个税申报表规则 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/7 4:29 PM - * @version:v1.0 - */ + * 薪资账套的个税申报表规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalarySobTaxReportRuleDTO { diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java index 231fa0c61..7e069c556 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java @@ -5,12 +5,13 @@ import lombok.Data; import java.util.List; /** - * @description: 薪资账套的累计字段对应保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/1/4 10:11 AM - * @version:v1.0 - */ + * 薪资账套的累计字段对应保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalarySobAddUpRuleSaveParam { diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java index 1b77845cc..8b47120d0 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 调薪计薪规则查询参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/31/21 1:52 PM - * @version:v1.0 - */ + * 调薪计薪规则查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java index 58a39981f..3d98644fd 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java @@ -10,12 +10,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 调薪计薪规则保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/31/21 11:03 AM - * @version:v1.0 - */ + * 调薪计薪规则保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java index 76095c62b..9f55e873c 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java @@ -6,12 +6,13 @@ import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 薪资账套的校验规则保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/20/22 10:31 AM - * @version:v1.0 - */ + * 薪资账套的校验规则保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class SalarySobCheckRuleSaveParam { diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java index e19856374..e166991dc 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java @@ -9,12 +9,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 薪资账套薪资项目保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 11/25/21 2:43 PM - * @version:v1.0 - */ + * 薪资账套薪资项目保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java index 4e9e7af0a..bd1a9e75b 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java @@ -5,12 +5,13 @@ import lombok.Data; import lombok.EqualsAndHashCode; /** - * @description: 薪资账套列表查询参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/18/22 3:04 PM - * @version:v1.0 - */ + * 薪资账套列表查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @EqualsAndHashCode(callSuper = true) public class SalarySobListQueryParam extends BaseQueryParam { diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java index cddc8f603..fce9fdd00 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java @@ -8,12 +8,13 @@ import lombok.NoArgsConstructor; import java.util.Collection; /** - * @description: 薪资账套人员范围-直接查询 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/3/21 1:24 PM - * @version:v1.0 - */ + * 薪资账套人员范围-直接查询 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java index 41f66ec6b..1f60695c5 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 薪资账套人员范围查询条件 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 11/22/21 11:10 AM - * @version:v1.0 - */ + * 薪资账套人员范围查询条件 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java index 5c7046538..1b1212d04 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java @@ -5,12 +5,13 @@ import lombok.Data; import java.util.List; /** - * @description: 薪资账套的个税申报表规则 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/29 5:20 PM - * @version:v1.0 - */ + * 薪资账套的个税申报表规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalarySobTaxReportRuleSaveParam { diff --git a/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java b/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java index 16ef28ccd..c358a2776 100644 --- a/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java +++ b/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 更新校验规则的公式校验规则更新参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/8/21 10:35 AM - * @version:v1.0 - */ + * 更新校验规则的公式校验规则更新参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java index 454381960..5ae545bf1 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java @@ -10,12 +10,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 薪资账套的累计字段对应关系 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/1/4 10:03 AM - * @version:v1.0 - */ + * 薪资账套的累计字段对应关系 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @Builder diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java index 33b403f44..927069540 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java @@ -10,12 +10,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 薪资账套的个税申报表规则 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/28 5:48 PM - * @version:v1.0 - */ + * 薪资账套的个税申报表规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @Builder diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index a0879108a..6fc30bf15 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -28,12 +28,13 @@ import java.util.Map; import java.util.Objects; /** - * @description: 通用:一般劳务报酬所得、全年一次性奖金 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/2 3:16 PM - * @version:v1.0 - */ + * 通用:一般劳务报酬所得、全年一次性奖金 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxDeclarationCommon implements TaxDeclarationStrategy { @Override diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java index 0664942dc..d9fe331fe 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java @@ -7,12 +7,13 @@ import com.google.common.collect.Lists; import java.util.List; /** - * @description: 个税申报表明细的表头 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 11:31 AM - * @version:v1.0 - */ + * 个税申报表明细的表头 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxDeclarationDetailListColumn { private static final String COLUMN = " [\n" + diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java index 711a67c48..42ca6ac21 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java @@ -8,12 +8,13 @@ import lombok.experimental.Accessors; import java.util.List; /** - * @description: 个税申报表计算过程中产生的结果 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/2 9:25 AM - * @version:v1.0 - */ + * 个税申报表计算过程中产生的结果 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class TaxDeclarationGenerateResult { diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 0f7386203..4879c1abb 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -18,12 +18,13 @@ import java.math.RoundingMode; import java.util.*; /** - * @description: 个税申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/2 11:18 AM - * @version:v1.0 - */ + * 个税申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxDeclarationRequest { public static Map convert2RequestParam(List taxReportColumns, diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java index db866e484..900ca5fa9 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java @@ -9,12 +9,13 @@ import lombok.experimental.Accessors; import java.util.List; /** - * @description: 生成个税申报表最后要处理的数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/5 6:10 PM - * @version:v1.0 - */ + * 生成个税申报表最后要处理的数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class TaxDeclarationResult { diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java index f743ee91c..74d79ca7d 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java @@ -1,12 +1,13 @@ package com.engine.salary.entity.taxdeclaration.bo; /** - * @description: 生成个税申报表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/1 4:47 PM - * @version:v1.0 - */ + * 生成个税申报表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclarationStrategy { /** diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index e2b6b60f4..8b78d34d8 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -22,12 +22,13 @@ import java.util.Map; import java.util.Objects; /** - * @description: 个税申报表详情 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/3/14 18:31 - * @version:v1.0 - */ + * 个税申报表详情 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class TaxDeclarationValueList { diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java index fb4a0e49d..f5fdc19ad 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java @@ -15,12 +15,13 @@ import java.util.List; import java.util.Map; /** - * @description: 生成个税申报表所需的数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/2 2:29 PM - * @version:v1.0 - */ + * 生成个税申报表所需的数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class TaxDeclareContext { diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java index 22156a38c..2b587f652 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -22,12 +22,13 @@ import java.util.function.Function; import java.util.stream.Collectors; /** - * @description: 个税申报明细表中的人员 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 4:20 PM - * @version:v1.0 - */ + * 个税申报明细表中的人员 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxDeclareEmployeeBO { public static List convert2AbnormalEmployee(List taxDeclareEmployees, diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java index 7df1fe6dd..2b8e7ecf3 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java @@ -9,12 +9,13 @@ import lombok.experimental.Accessors; import java.util.Map; /** - * @description: 个税申报相关接口的请求参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/2/6 5:24 PM - * @version:v1.0 - */ + * 个税申报相关接口的请求参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class TaxDeclareRequest { diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java index a1ea62e89..7970724c7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -8,12 +8,13 @@ import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 个税申报-校验异常的人员列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 2:28 PM - * @version:v1.0 - */ + * 个税申报-校验异常的人员列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class AbnormalEmployeeListDTO { diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index 870fc2c89..7d2ae71d2 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 个税申报-申报失败的人员列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/30 2:22 PM - * @version:v1.0 - */ + * 个税申报-申报失败的人员列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class FailEmployeeListDTO { diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java index 9f690c6c1..11bf92716 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 个税申报表详情列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 10:31 AM - * @version:v1.0 - */ + * 个税申报表详情列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java index b8b120063..d61314504 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java @@ -7,12 +7,13 @@ import lombok.NoArgsConstructor; import java.time.YearMonth; /** - * @description: 个税申报记录表单 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 9:40 AM - * @version:v1.0 - */ + * 个税申报记录表单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java index af74d366e..20a06d05a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java @@ -14,12 +14,13 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * @description: 个税申报表信息 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/16/21 3:22 PM - * @version:v1.0 - */ + * 个税申报表信息 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java index e3a737b0c..2d3f285b7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java @@ -1,18 +1,10 @@ package com.engine.salary.entity.taxdeclaration.dto; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; import java.io.Serializable; -/** - * @description: - * @author: xiajun - * @modified By: xiajun - * @date: 2022/7/12 11:39 - * @version:v1.0 - */ @Data @Accessors(chain = true) public class TaxDeclarationRateDTO implements Serializable { diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java index 508b83537..c30f4cae2 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java @@ -3,17 +3,17 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 个税申报表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 11:40 AM - * @version:v1.0 - */ + * 个税申报表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class TaxDeclarationTabDTO { diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java index 218e91b8a..7090bddfa 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java @@ -8,12 +8,13 @@ import java.util.List; import java.util.Map; /** - * @description: 个税申报表详情列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/6 1:28 PM - * @version:v1.0 - */ + * 个税申报表详情列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class TaxDeclarationValueListDTO { diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java index 37e1acf6c..455e973ea 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -12,12 +12,13 @@ import java.util.List; import java.util.Map; /** - * @description: 个税申报记录表单 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 9:40 AM - * @version:v1.0 - */ + * 个税申报记录表单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java index 2d606a6aa..4af1295f8 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -12,12 +12,13 @@ import lombok.experimental.Accessors; import java.util.Date; /** - * @description: 个税申报记录列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 9:25 AM - * @version:v1.0 - */ + * 个税申报记录列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class TaxDeclareRecordListDTO { diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java index 09b322559..55f552c6d 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -8,12 +8,13 @@ import lombok.experimental.Accessors; import java.util.Date; /** - * @description: 个税申报-异常数据-未报送人员列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 1:54 PM - * @version:v1.0 - */ + * 个税申报-异常数据-未报送人员列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class AbnormalEmployeeListQueryParam extends BaseQueryParam { diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java index 939ca1fc4..f0aa5cf97 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -3,16 +3,16 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.common.BaseQueryParam; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * @description: 个税申报记录详情列表查询参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 3:21 PM - * @version:v1.0 - */ + * 个税申报记录详情列表查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @ApiModel("个税申报表记录列表查询参数") public class TaxDeclarationValueListQueryParam extends BaseQueryParam { diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index 24073b49a..7e94fcc2e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -1,15 +1,15 @@ package com.engine.salary.entity.taxdeclaration.param; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * @description: 个税申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/11 2:56 PM - * @version:v1.0 - */ + * 个税申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class TaxDeclareRecordParam { diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index d6e12c548..11b97036b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -13,12 +13,13 @@ import java.util.Date; import java.util.Map; /** - * @description: 个税申报表的值 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/27/22 5:03 PM - * @version:v1.0 - */ + * 个税申报表的值 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @Builder diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java index f3af4c3de..82aabe994 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java @@ -5,12 +5,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 个税申报中的人员 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 4:03 PM - * @version:v1.0 - */ + * 个税申报中的人员 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @AllArgsConstructor @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java index 6182b83ea..8192b5acd 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java @@ -12,12 +12,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 个税申报失败数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/30 11:38 AM - * @version:v1.0 - */ + * 个税申报失败数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @Builder diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 0a257bf4a..6664f1985 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -11,12 +11,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 个税申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/2 5:40 PM - * @version:v1.0 - */ + * 个税申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @Builder diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index 16c3be741..5e824dc48 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -9,12 +9,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 个税申报表表头 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/28 5:28 PM - * @version:v1.0 - */ + * 个税申报表表头 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @AllArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java index 71e9cfd82..564edd0b7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java @@ -1,18 +1,18 @@ package com.engine.salary.entity.taxdeclaration.response; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Map; /** - * @description: 作废申报的反馈 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/3 11:32 AM - * @version:v1.0 - */ + * 作废申报的反馈 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class CancelDeclareFeedbackResponse { diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java index 743c44d59..3d2e1bbc3 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java @@ -2,16 +2,16 @@ package com.engine.salary.entity.taxdeclaration.response; import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * @description: 作废申报的返回数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/3 11:17 AM - * @version:v1.0 - */ + * 作废申报的返回数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class CancelDeclareResponse { diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java index 01f3ce6cf..c97fb1451 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java @@ -1,18 +1,18 @@ package com.engine.salary.entity.taxdeclaration.response; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Map; /** - * @description: 申报个税的反馈 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/3 11:32 AM - * @version:v1.0 - */ + * 申报个税的反馈 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class DeclareTaxFeedbackResponse { diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java index cb688af2a..9cbb66495 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java @@ -2,16 +2,16 @@ package com.engine.salary.entity.taxdeclaration.response; import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * @description: 个税申报的返回数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/3 11:17 AM - * @version:v1.0 - */ + * 个税申报的返回数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class DeclareTaxResponse { diff --git a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java index a1f58e76f..e2b77f90c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -2,16 +2,16 @@ package com.engine.salary.entity.taxdeclaration.response; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * @description: 更正申报的返回数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/15 2:45 PM - * @version:v1.0 - */ + * 更正申报的返回数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @ApiModel("更正申报的返回数据") public class UpdateDeclareResponse { diff --git a/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java b/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java index 73b3bc6f1..1403f9e4c 100644 --- a/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java +++ b/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java @@ -4,12 +4,13 @@ import lombok.Data; /** - * @description: 个税税率表主表保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 3:19 PM - * @version:v1.0 - */ + * 个税税率表主表保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class TaxRateBaseSaveParam { diff --git a/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java b/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java index 3ac2c6a3b..6bffa9f85 100644 --- a/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java +++ b/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java @@ -5,12 +5,13 @@ import lombok.Data; import java.math.BigDecimal; /** - * @description: 个税税率表明细表保存参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 3:22 PM - * @version:v1.0 - */ + * 个税税率表明细表保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class TaxRateDetailSaveParam { diff --git a/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java b/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java index a9107beee..c0a0c1840 100644 --- a/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java +++ b/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java @@ -7,12 +7,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 税率表保存 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/20/21 1:59 PM - * @version:v1.0 - */ + * 税率表保存 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @NoArgsConstructor @AllArgsConstructor diff --git a/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java b/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java index 6da2aab85..caf333b7e 100644 --- a/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java +++ b/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java @@ -9,12 +9,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 个税申报记录列表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 9:31 AM - * @version:v1.0 - */ + * 个税申报记录列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/enums/SalaryItemCategoryEnum.java b/src/com/engine/salary/enums/SalaryItemCategoryEnum.java index 84585d22a..dc6a5417e 100644 --- a/src/com/engine/salary/enums/SalaryItemCategoryEnum.java +++ b/src/com/engine/salary/enums/SalaryItemCategoryEnum.java @@ -4,12 +4,13 @@ package com.engine.salary.enums; import java.util.Objects; /** - * @description: 薪资项目属性 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/25/21 2:23 PM - * @version:v1.0 - */ + * 薪资项目属性 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalaryItemCategoryEnum implements BaseEnum { PRE_TAX_ADD(1, "税前加项", 84492), diff --git a/src/com/engine/salary/enums/SalaryItemTypeEnum.java b/src/com/engine/salary/enums/SalaryItemTypeEnum.java index ba446b447..1de0dc1d2 100644 --- a/src/com/engine/salary/enums/SalaryItemTypeEnum.java +++ b/src/com/engine/salary/enums/SalaryItemTypeEnum.java @@ -4,12 +4,13 @@ package com.engine.salary.enums; import java.util.Objects; /** - * @description: 薪资项目类型 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/25/21 2:34 PM - * @version:v1.0 - */ + * 薪资项目类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalaryItemTypeEnum implements BaseEnum { SALARY(1, SalaryItemCategoryEnum.PRE_TAX_ADD, "工资薪金", 85818), diff --git a/src/com/engine/salary/enums/SalaryOnOffEnum.java b/src/com/engine/salary/enums/SalaryOnOffEnum.java index 75b2c4184..e16f8721b 100644 --- a/src/com/engine/salary/enums/SalaryOnOffEnum.java +++ b/src/com/engine/salary/enums/SalaryOnOffEnum.java @@ -4,12 +4,13 @@ package com.engine.salary.enums; import java.util.Objects; /** - * @description: 是、否 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/28/21 5:50 PM - * @version:v1.0 - */ + * 是、否 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalaryOnOffEnum implements BaseEnum { ON(1, "是", 84967), diff --git a/src/com/engine/salary/enums/SalarySobStatusEnum.java b/src/com/engine/salary/enums/SalarySobStatusEnum.java index 31557f24f..a6bb40e94 100644 --- a/src/com/engine/salary/enums/SalarySobStatusEnum.java +++ b/src/com/engine/salary/enums/SalarySobStatusEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums; /** - * @description: 薪资账套设置步骤状态 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 11/9/21 3:09 PM - * @version:v1.0 - */ + * 薪资账套设置步骤状态 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalarySobStatusEnum implements BaseEnum { START(0, "开始", 86123), diff --git a/src/com/engine/salary/enums/SalarySystemTypeEnum.java b/src/com/engine/salary/enums/SalarySystemTypeEnum.java index 8ce14a0dc..54abde8a1 100644 --- a/src/com/engine/salary/enums/SalarySystemTypeEnum.java +++ b/src/com/engine/salary/enums/SalarySystemTypeEnum.java @@ -4,12 +4,13 @@ package com.engine.salary.enums; import java.util.Objects; /** - * @description: 税率表表单类型 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/19/21 4:05 PM - * @version:v1.0 - */ + * 税率表表单类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalarySystemTypeEnum implements BaseEnum { CUSTOM(0, "自定义表单", 83993), diff --git a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java index 8d8952931..a7f0de9d3 100644 --- a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; /** - * @description: 证件类型 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 1:56 PM - * @version:v1.0 - */ + * 证件类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum CardTypeEnum implements BaseEnum { RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564); diff --git a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java index d4d1380c4..2a91aafde 100644 --- a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; /** - * @description: 人员报送状态 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/5/22 10:29 AM - * @version:v1.0 - */ + * 人员报送状态 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum DeclareStatusEnum implements BaseEnum { NOT_DECLARE(1, "待报送", 158772), diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java index 7c27bbbdb..75a8901b6 100644 --- a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; /** - * @description: 人员状态 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 10:57 AM - * @version:v1.0 - */ + * 人员状态 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum EmploymentStatusEnum implements BaseEnum { NORMAL(0, "正常", 160477), diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java index a95e36b9c..609e7f8f8 100644 --- a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; /** - * @description: 任职受雇从业类型 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 10:59 AM - * @version:v1.0 - */ + * 任职受雇从业类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum EmploymentTypeEnum implements BaseEnum { EMPLOYEE(0, "雇员", 160479), diff --git a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java index 615698604..805afa7bd 100644 --- a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; /** - * @description: 性别 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 10:33 AM - * @version:v1.0 - */ + * 性别 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum GenderEnum implements BaseEnum { MALE(0, "男", 102440), diff --git a/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java index 9918aca0f..dbc1c2e7f 100644 --- a/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.taxdeclaration; import com.engine.salary.enums.BaseEnum; /** - * @description: 作废申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/11 5:34 PM - * @version:v1.0 - */ + * 作废申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum CancelDeclareStatusEnum implements BaseEnum { CANCEL_SUCCESS(8, "作废成功", 160490), diff --git a/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java index 2396b34a2..cc9c0434d 100644 --- a/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.taxdeclaration; import com.engine.salary.enums.BaseEnum; /** - * @description: 申报反馈状态 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/3 2:13 PM - * @version:v1.0 - */ + * 申报反馈状态 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum DeclareFeedBackStatusEnum implements BaseEnum { DECLARE_SUCCESS_NO_PAY(1, "申报成功,无需缴款", 160492), diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java index 42d758508..9015c3ce8 100644 --- a/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.taxdeclaration; import com.engine.salary.enums.BaseEnum; /** - * @description: 个税扣缴义务人范围 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/17 10:46 AM - * @version:v1.0 - */ + * 个税扣缴义务人范围 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum TaxAgentRangeEnum implements BaseEnum { ALL_TAX_AGENT(1, "所有个税扣缴义务人", 107731), diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java index 6bad22d9a..27db64998 100644 --- a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.taxdeclaration; import com.engine.salary.enums.BaseEnum; /** - * @description: 申报状态 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/3 1:58 PM - * @version:v1.0 - */ + * 申报状态 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum TaxDeclareStatusEnum implements BaseEnum { NOT_DECLARE(1, "未申报", 160495), diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java index c9a39aabe..a0ee77c69 100644 --- a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums.taxdeclaration; import com.engine.salary.enums.BaseEnum; /** - * @description: 申报类型 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/3 1:41 PM - * @version:v1.0 - */ + * 申报类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum TaxDeclareTypeEnum implements BaseEnum { NORMAL_DECLARE(0, "正常申报", 177857), diff --git a/src/com/engine/salary/service/EmployeeDeclareRecordService.java b/src/com/engine/salary/service/EmployeeDeclareRecordService.java index d18e73395..825c5e920 100644 --- a/src/com/engine/salary/service/EmployeeDeclareRecordService.java +++ b/src/com/engine/salary/service/EmployeeDeclareRecordService.java @@ -5,12 +5,13 @@ import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; import java.util.Date; /** - * @description: 员工报送记录 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/11/6 16:54 - * @version:v1.0 - */ + * 员工报送记录 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface EmployeeDeclareRecordService { EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 8dbdbb57b..72e987d3c 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -13,12 +13,13 @@ import java.util.Date; import java.util.List; /** - * @description: 人员报送(人员) - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 3:16 PM - * @version:v1.0 - */ + * 人员报送(人员) + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface EmployeeDeclareService{ /** diff --git a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java index c0121633e..be75f76bf 100644 --- a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java +++ b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java @@ -8,12 +8,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 薪资核算记录对应的个税扣缴义务人 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/7/29 9:45 - * @version:v1.0 - */ + * 薪资核算记录对应的个税扣缴义务人 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalaryAcctTaxAgentService { /** diff --git a/src/com/engine/salary/service/SalarySobAddUpRuleService.java b/src/com/engine/salary/service/SalarySobAddUpRuleService.java index 81a376a23..36dad8bca 100644 --- a/src/com/engine/salary/service/SalarySobAddUpRuleService.java +++ b/src/com/engine/salary/service/SalarySobAddUpRuleService.java @@ -8,12 +8,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 薪资账套的累计字段对应 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/1/4 10:08 AM - * @version:v1.0 - */ + * 薪资账套的累计字段对应 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobAddUpRuleService { /** diff --git a/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java b/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java index 6968b1512..9d928cd39 100644 --- a/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java +++ b/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java @@ -5,12 +5,13 @@ import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO; import java.util.List; /** - * @description: 薪资账套默认的员工信息字段 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/13/22 9:52 AM - * @version:v1.0 - */ + * 薪资账套默认的员工信息字段 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobDefaultEmpFieldService { /** diff --git a/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java b/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java index aaa8aef3e..0ed15c4df 100644 --- a/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java +++ b/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java @@ -7,12 +7,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 薪资账套默认的薪资项目分类 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/3/11 15:05 - * @version:v1.0 - */ + * 薪资账套默认的薪资项目分类 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobDefaultItemGroupService { /** diff --git a/src/com/engine/salary/service/SalarySobInitService.java b/src/com/engine/salary/service/SalarySobInitService.java index 56800617f..7e94a7cf9 100644 --- a/src/com/engine/salary/service/SalarySobInitService.java +++ b/src/com/engine/salary/service/SalarySobInitService.java @@ -4,12 +4,13 @@ import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobPO; /** - * @description: 薪资账套初始化 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/5/18 17:27 - * @version:v1.0 - */ + * 薪资账套初始化 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobInitService { /** diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index 37197e51f..80d112a37 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -10,12 +10,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 薪资账套的薪资项目副本 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 7:26 PM - * @version:v1.0 - */ + * 薪资账套的薪资项目副本 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobItemService { /** diff --git a/src/com/engine/salary/service/SalarySobTaxReportRuleService.java b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java index f39074fa2..5c31c19dd 100644 --- a/src/com/engine/salary/service/SalarySobTaxReportRuleService.java +++ b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java @@ -8,12 +8,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 薪资账套的个税申报表规则 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/29 5:19 PM - * @version:v1.0 - */ + * 薪资账套的个税申报表规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobTaxReportRuleService { /** diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 41cc2182b..8ec154857 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -10,12 +10,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 个税申报表明细 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/28/22 9:41 AM - * @version:v1.0 - */ + * 个税申报表明细 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclarationValueService { /** diff --git a/src/com/engine/salary/service/TaxDeclareEmployeeService.java b/src/com/engine/salary/service/TaxDeclareEmployeeService.java index 7b29555cb..da950b1ad 100644 --- a/src/com/engine/salary/service/TaxDeclareEmployeeService.java +++ b/src/com/engine/salary/service/TaxDeclareEmployeeService.java @@ -9,12 +9,13 @@ import com.engine.salary.util.page.PageInfo; import java.util.List; /** - * @description: 个税申报表明细中的人员 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 4:10 PM - * @version:v1.0 - */ + * 个税申报表明细中的人员 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclareEmployeeService { /** diff --git a/src/com/engine/salary/service/TaxDeclareFailService.java b/src/com/engine/salary/service/TaxDeclareFailService.java index a5b540dc4..c7affede6 100644 --- a/src/com/engine/salary/service/TaxDeclareFailService.java +++ b/src/com/engine/salary/service/TaxDeclareFailService.java @@ -8,12 +8,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 个税申报失败数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/30 1:31 PM - * @version:v1.0 - */ + * 个税申报失败数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclareFailService { /** diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 78b1dff15..c21ad68a7 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -13,12 +13,13 @@ import java.util.Date; import java.util.List; /** - * @description: 个税申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/2 5:48 PM - * @version:v1.0 - */ + * 个税申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclareRecordService { /** diff --git a/src/com/engine/salary/service/TaxReportColumnService.java b/src/com/engine/salary/service/TaxReportColumnService.java index 28ba37b8b..c9f466e14 100644 --- a/src/com/engine/salary/service/TaxReportColumnService.java +++ b/src/com/engine/salary/service/TaxReportColumnService.java @@ -6,12 +6,13 @@ import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import java.util.List; /** - * @description: 个税申报表表头 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/5 6:36 PM - * @version:v1.0 - */ + * 个税申报表表头 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public interface TaxReportColumnService { /** diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index 20b3a45ba..dfb4be9c4 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -39,8 +39,12 @@ import java.math.BigDecimal; import java.util.*; /** - * @author chengliming - * @date 2022-12-09 6:26 PM + * + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 **/ @Slf4j public abstract class AbstractTaxPaymentService extends Service implements TaxPaymentService { diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java index b96c1f775..aacb876e2 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java @@ -11,12 +11,13 @@ import java.util.Date; import java.util.List; /** - * @description: 员工报送记录 - * @author: xiajun - * @modified By: xiajun - * @date: 2022/11/6 16:55 - * @version:v1.0 - */ + * 员工报送记录 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService { private EmployeeDeclareRecordMapper getEmployeeDeclareRecordMapper() { diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index ec666839b..18813dd04 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -61,12 +61,13 @@ import java.util.*; import java.util.stream.Collectors; /** - * @description: 人员报送(人员) - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 3:17 PM - * @version:v1.0 - */ + * 人员报送(人员) + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class EmployeeDeclareServiceImpl extends Service implements EmployeeDeclareService { diff --git a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java index 22dc5be83..b1d74cf3b 100644 --- a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java @@ -30,12 +30,13 @@ import java.lang.reflect.Field; import java.util.*; /** - * @description: 薪资账套的累计字段对应 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/1/4 10:09 AM - * @version:v1.0 - */ + * 薪资账套的累计字段对应 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobAddUpRuleService { private SalarySobAddUpRuleMapper getSalarySobAddUpRuleMapper() { diff --git a/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java index e599b2688..2d41dfbb7 100644 --- a/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java @@ -14,13 +14,6 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -/** - * @description: - * @author: xiajun - * @modified By: xiajun - * @date: 2022/3/11 15:07 - * @version:v1.0 - */ public class SalarySobDefaultItemGroupServiceImpl extends Service implements SalarySobDefaultItemGroupService { private SalarySobDefaultItemGroupMapper getSalarySobDefaultItemGroupMapper() { diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java index 253fb6dc7..d5414a8fe 100644 --- a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -31,12 +31,13 @@ import java.util.*; import java.util.stream.Collectors; /** - * @description: 薪资账套初始化 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/5/18 15:32 - * @version:v1.0 - */ + * 薪资账套初始化 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { private SalarySobMapper getSalarySobMapper() { diff --git a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java index fc49f01fa..27ba515c8 100644 --- a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java @@ -28,12 +28,13 @@ import weaver.hrm.User; import java.util.*; /** - * @description: 薪资账套的个税申报表规则 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/29 5:19 PM - * @version:v1.0 - */ + * 薪资账套的个税申报表规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalarySobTaxReportRuleServiceImpl extends Service implements SalarySobTaxReportRuleService { diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index cc45c6428..c2fe1eabc 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -32,12 +32,13 @@ import java.util.*; import java.util.stream.Collectors; /** - * @description: 个税申报表 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/28/22 9:41 AM - * @version:v1.0 - */ + * 个税申报表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclarationValueService { public EncryptUtil encryptUtil = new EncryptUtil(); diff --git a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java index 6d41daebb..d2ed11f26 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java @@ -30,12 +30,13 @@ import java.util.Set; import java.util.stream.Collectors; /** - * @description: 个税申报表明细中的人员 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 4:12 PM - * @version:v1.0 - */ + * 个税申报表明细中的人员 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclareEmployeeService { diff --git a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java index cbbcf4c0c..1a8b7b508 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java @@ -23,12 +23,13 @@ import java.util.List; import java.util.Map; /** - * @description: 个税申报失败数据 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/30 1:32 PM - * @version:v1.0 - */ + * 个税申报失败数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFailService { private TaxDeclareFailMapper getTaxDeclareFailMapper() { diff --git a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java index 667f2fbd1..1ddd88cdc 100644 --- a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -10,12 +10,13 @@ import com.engine.salary.util.db.MapperProxyFactory; import java.util.List; /** - * @description: 个税申报表表头 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/5 6:36 PM - * @version:v1.0 - */ + * 个税申报表表头 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { private TaxReportColumnMapper getTaxReportColumnMapper() { diff --git a/src/com/engine/salary/util/SalaryDateUtil.java b/src/com/engine/salary/util/SalaryDateUtil.java index 8d94d5ec1..49cb7b2aa 100644 --- a/src/com/engine/salary/util/SalaryDateUtil.java +++ b/src/com/engine/salary/util/SalaryDateUtil.java @@ -20,12 +20,13 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * @description: 时间工具类 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/19/21 4:23 PM - * @version:v1.0 - */ + * 时间工具类 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class SalaryDateUtil { diff --git a/src/com/engine/salary/util/SalaryThreadPoolUtil.java b/src/com/engine/salary/util/SalaryThreadPoolUtil.java index 12818a03f..94b399bb3 100644 --- a/src/com/engine/salary/util/SalaryThreadPoolUtil.java +++ b/src/com/engine/salary/util/SalaryThreadPoolUtil.java @@ -1,15 +1,14 @@ package com.engine.salary.util; -import org.apache.commons.lang3.StringUtils; - /** - * @description: 此线程池类只适用于Runnalbe接口,不适用与Callable接口 + * 此线程池类只适用于Runnalbe接口,不适用与Callable接口 * 如有callable业务需要,请自行使用线程池创建,并确定要关闭 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/25/22 4:23 PM - * @version:v1.0 - */ + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryThreadPoolUtil { // /** diff --git a/src/com/engine/salary/util/valid/SalaryCardUtil.java b/src/com/engine/salary/util/valid/SalaryCardUtil.java index e61e4d2af..d8794ecf4 100644 --- a/src/com/engine/salary/util/valid/SalaryCardUtil.java +++ b/src/com/engine/salary/util/valid/SalaryCardUtil.java @@ -8,12 +8,13 @@ import java.time.LocalDate; import java.util.regex.Pattern; /** - * @description: 身份证 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/10/28 10:10 AM - * @version:v1.0 - */ + * 身份证 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryCardUtil { /** diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 193f25559..75535d32f 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -23,12 +23,13 @@ import java.util.Collection; import java.util.Map; /** - * @description: 人员报送 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/6/22 3:37 PM - * @version:v1.0 - */ + * 人员报送 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class EmployeeDeclareController { private EmployeeDeclareWrapper getEmployeeDeclareWrapper(User user) { diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 66ed35ebc..e42aea3d6 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -39,12 +39,13 @@ import java.util.*; import java.util.stream.Collectors; /** - * @description: 人员报送(人员) - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/2/22 3:49 PM - * @version:v1.0 - */ + * 人员报送(人员) + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class EmployeeDeclareWrapper extends Service { diff --git a/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java index 1c9e2c5c3..63ddc16b5 100644 --- a/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java @@ -11,12 +11,13 @@ import weaver.hrm.User; import java.util.List; /** - * @description: 薪资账套的累计字段对应关系 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/1/4 10:36 AM - * @version:v1.0 - */ + * 薪资账套的累计字段对应关系 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalarySobAddUpRuleWrapper extends Service { private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { diff --git a/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java index ce55fcd45..63e87b5e3 100644 --- a/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java @@ -6,19 +6,18 @@ import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO; import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam; import com.engine.salary.service.SalarySobTaxReportRuleService; import com.engine.salary.service.impl.SalarySobTaxReportRuleServiceImpl; -import org.springframework.stereotype.Component; import weaver.hrm.User; import java.util.List; /** - * @description: 薪资账套的个税申报表规则 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/12/7 4:27 PM - * @version:v1.0 - */ -@Component + * 薪资账套的个税申报表规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalarySobTaxReportRuleWrapper extends Service { private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index dad092eb4..3a1e7a192 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -40,12 +40,13 @@ import java.util.*; import java.util.stream.Collectors; /** - * @description: 个税申报 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2022/11/10 9:24 AM - * @version:v1.0 - */ + * 个税申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j @Component public class TaxDeclareRecordWrapper extends Service { From 2f2727c4b9ffc69541e5042305846fbecbb22c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 23 Aug 2023 18:13:31 +0800 Subject: [PATCH 029/298] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaxDeclarationValueListQueryParam.java | 2 - .../service/TaxDeclarationExcelService.java | 31 +- .../impl/TaxDeclarationExcelServiceImpl.java | 223 ++++++----- .../salary/util/excel/ExcelSheetData.java | 15 + .../engine/salary/util/excel/ExcelUtil.java | 9 +- .../salary/web/TaxDeclarationController.java | 356 +++++++++++------- .../wrapper/TaxDeclareRecordWrapper.java | 126 ++----- 7 files changed, 429 insertions(+), 333 deletions(-) create mode 100644 src/com/engine/salary/util/excel/ExcelSheetData.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java index f0aa5cf97..864c4dac9 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -2,7 +2,6 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.common.BaseQueryParam; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; -import io.swagger.annotations.ApiModel; import lombok.Data; /** @@ -14,7 +13,6 @@ import lombok.Data; * @version 1.0 **/ @Data -@ApiModel("个税申报表记录列表查询参数") public class TaxDeclarationValueListQueryParam extends BaseQueryParam { //个税申报记录id") diff --git a/src/com/engine/salary/service/TaxDeclarationExcelService.java b/src/com/engine/salary/service/TaxDeclarationExcelService.java index fb95a6e5c..15d6c81fd 100644 --- a/src/com/engine/salary/service/TaxDeclarationExcelService.java +++ b/src/com/engine/salary/service/TaxDeclarationExcelService.java @@ -1,5 +1,7 @@ package com.engine.salary.service; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** @@ -15,7 +17,32 @@ public interface TaxDeclarationExcelService { /** * 导出个税申报表 * - * @param taxDeclarationId + * @param queryParam + * @return */ - XSSFWorkbook exportTaxDeclaration(Long taxDeclarationId); + XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam); + + /** + * 导出未报送的人员 + * + * @param queryParam + * @return + */ + XSSFWorkbook exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam); + + /** + * 导出缺少申报数据的人员 + * + * @param queryParam + * @return + */ + XSSFWorkbook exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam); + + /** + * 导出申报失败的人员 + * + * @param queryParam + * @return + */ + XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 957957790..8a7e8a3e3 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -1,32 +1,30 @@ package com.engine.salary.service.impl; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.annotation.SalaryTableColumn; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.engine.salary.enums.salarysob.IncomeCategoryEnum; -import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; -import com.engine.salary.service.TaxDeclarationDetailService; -import com.engine.salary.service.TaxDeclarationExcelService; -import com.engine.salary.service.TaxDeclarationService; +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.ExcelSheetData; import com.engine.salary.util.excel.ExcelUtil; -import com.engine.salary.util.page.PageInfo; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.general.Util; import weaver.hrm.User; import java.lang.reflect.Field; +import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Objects; /** * 个税申报表导出 @@ -39,101 +37,126 @@ import java.util.Objects; @Slf4j public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclarationExcelService { - private TaxDeclarationDetailService getTaxDeclarationDetailService(User user) { - return ServiceUtil.getService(TaxDeclarationDetailServiceImpl.class, user); - } - private TaxDeclarationDetailMapper getTaxDeclarationDetailMapper() { - return MapperProxyFactory.getProxy(TaxDeclarationDetailMapper.class); - } private TaxDeclarationService getTaxDeclarationService(User user) { return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { + return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); + } + + private TaxDeclareFailService getTaxDeclareFailService(User user) { + return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); + } + + @Override + public XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { + // 查询个税申报表 + TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(queryParam.getTaxDeclarationId()); + // 查询个税申报表明细 + List taxDeclarationValues = getTaxDeclarationValueService(user).listByTaxDeclarationIds(Collections.singleton(queryParam.getTaxDeclarationId())); + // 转成个税申报表明细 + TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclarationPO, taxDeclarationValues); + // excel导出的数据 + List> rows = Lists.newArrayList(); + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + + // 解析表头 + for (WeaTableColumn column : taxDeclarationValueListDTO.getColumns()) { + headerList.add(column.getText()); + dataIndexList.add(column.getColumn()); + } + + rows.add(headerList); + // 解析表中数据 + for (Map datum : taxDeclarationValueListDTO.getData()) { + List row = Lists.newArrayList(); + for (String dataIndex : dataIndexList) { + row.add(Util.null2String(datum.get(dataIndex))); + } + rows.add(row); + } + + String sheetName = SalaryI18nUtil.getI18nLabel(100090, "个税申报表"); + + return ExcelUtil.genWorkbook(rows, sheetName); + } @Override - public XSSFWorkbook exportTaxDeclaration(Long taxDeclarationId) { - // 1.工作簿名称 - String sheetName = SalaryI18nUtil.getI18nLabel(85368, "个税申报表"); - - - TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(taxDeclarationId); - // 查询当前个税申报表一共有多少人员 - int count = getTaxDeclarationDetailMapper().countEmployeeId(taxDeclarationId); - // 以1000个人员一页,一共有多少页 - int totalPages = (count % 1000 == 0) ? (count / 1000) : (count / 1000 + 1); //总页数 - // excel导出的数据 - List> rows = Lists.newArrayListWithExpectedSize(count); - List headerList = Lists.newArrayList(); - List dataIndexList = Lists.newArrayList(); - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue())) { - // 解析表头 - parseHeader(TaxDeclarationWageListDTO.class, headerList, dataIndexList); - rows.add(headerList); - for (int i = 0; i < totalPages; i++) { - TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); - queryParam.setTaxDeclarationId(taxDeclarationId); - queryParam.setCurrent(i+1); - queryParam.setPageSize(1000); - PageInfo dtoPage = getTaxDeclarationDetailService(user).listDtoPageByParam4Wage(queryParam); - List list = dtoPage.getList(); - for (TaxDeclarationWageListDTO taxDeclarationWageListDTO : list) { - List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); - Map map = JsonUtil.parseMap(taxDeclarationWageListDTO, Object.class); - for (String dataIndex : dataIndexList) { - row.add(map.get(dataIndex)); - } - rows.add(row); - } - } - } - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_LABOR.getValue())) { - // 解析表头 - parseHeader(TaxDeclarationLaborListDTO.class, headerList, dataIndexList); - rows.add(headerList); - for (int i = 0; i < totalPages; i++) { - TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); - queryParam.setTaxDeclarationId(taxDeclarationId); - queryParam.setCurrent(i); - queryParam.setPageSize(1000); - PageInfo dtoPage = getTaxDeclarationDetailService(user).listDtoPageByParam4Labor(queryParam); - List list = dtoPage.getList(); - for (TaxDeclarationLaborListDTO taxDeclarationLaborListDTO : list) { - List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); - Map map = JsonUtil.parseMap(taxDeclarationLaborListDTO, Object.class); - for (String dataIndex : dataIndexList) { - row.add(map.get(dataIndex)); - } - rows.add(row); - } - } - } - - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) { - // 解析表头 - parseHeader(TaxDeclarationAnnualListDTO.class, headerList, dataIndexList); - rows.add(headerList); - for (int i = 0; i < totalPages; i++) { - TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); - queryParam.setTaxDeclarationId(taxDeclarationId); - queryParam.setCurrent(i); - queryParam.setPageSize(1000); - PageInfo dtoPage = getTaxDeclarationDetailService(user).listDtoPageByParam4Annual(queryParam); - List list = dtoPage.getList(); - for (TaxDeclarationAnnualListDTO taxDeclarationLaborListDTO : list) { - List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); - Map map = JsonUtil.parseMap(taxDeclarationLaborListDTO, Object.class); - for (String dataIndex : dataIndexList) { - row.add(map.get(dataIndex)); - } - rows.add(row); - } - } - } - return ExcelUtil.genWorkbookV2(rows, sheetName); + public XSSFWorkbook exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 查询个税申报表明细中的人员 + List taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); + // 转换成列表dto + List dtoList = getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees); + ExcelSheetData excelSheetData = getExcelSheetData(AbnormalEmployeeListDTO.class, dtoList); + return ExcelUtil.genWorkbook(excelSheetData); } + @Override + public XSSFWorkbook exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam) { + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 查询个税申报表明细中的人员 + List taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); + // 转换成列表dto + List dtoList = getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees); + ExcelSheetData excelSheetData = getExcelSheetData(AbnormalEmployeeListDTO.class, dtoList); + + return ExcelUtil.genWorkbook(excelSheetData); + } + + @Override + public XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam) { + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 查询个税申报表明细中的人员 + List taxDeclareFails = getTaxDeclareFailService(user).listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + // 转换成列表dto + List dtoList = getTaxDeclareFailService(user).convert2FailEmployeeList(taxDeclareRecord, taxDeclareFails); + ExcelSheetData excelSheetData = getExcelSheetData(FailEmployeeListDTO.class, dtoList); + return ExcelUtil.genWorkbook(excelSheetData); + } + + private ExcelSheetData getExcelSheetData(Class clazz, List dtoList) { + // 导出的表头 + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + parseHeader(clazz, headerList, dataIndexList); + // 导出的数据 + List> rows = Lists.newArrayListWithExpectedSize(dtoList.size()); + dtoList.forEach(dto -> { + Map map = JsonUtil.parseMap(dto, Object.class); + List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); + dataIndexList.forEach(dataIndex -> row.add(map.get(dataIndex))); + rows.add(row); + }); + // 组装excel导出数据 + ExcelSheetData excelSheetData = new ExcelSheetData(); + excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel(156423, "个税申报表人员")); + excelSheetData.setHeaders(headerList); + excelSheetData.setRows(rows); + return excelSheetData; + } + /** * 解析表头 * @@ -142,14 +165,14 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar * @param dataIndexList * @param */ - private void parseHeader(Class clazz, List headerList, List dataIndexList) { + private void parseHeader(Class clazz, List headerList, List dataIndexList) { Field[] declaredFields = clazz.getDeclaredFields(); for (Field declaredField : declaredFields) { if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { continue; } SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); - headerList.add(SalaryI18nUtil.getI18nLabel( annotation.labelId(), annotation.text())); + headerList.add(SalaryI18nUtil.getI18nLabel((int) annotation.labelId(), annotation.text())); dataIndexList.add(declaredField.getName()); } } diff --git a/src/com/engine/salary/util/excel/ExcelSheetData.java b/src/com/engine/salary/util/excel/ExcelSheetData.java new file mode 100644 index 000000000..f4cf615ea --- /dev/null +++ b/src/com/engine/salary/util/excel/ExcelSheetData.java @@ -0,0 +1,15 @@ +package com.engine.salary.util.excel; + +import lombok.Data; + +import java.util.List; + +@Data +public class ExcelSheetData { + + private String sheetName; + private List headers; + private List> rows; + + +} diff --git a/src/com/engine/salary/util/excel/ExcelUtil.java b/src/com/engine/salary/util/excel/ExcelUtil.java index c733129fb..140e69bac 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -9,7 +9,7 @@ import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.xssf.usermodel.*; import java.awt.*; -import java.util.Date; +import java.util.*; import java.util.List; public class ExcelUtil { @@ -266,4 +266,11 @@ public class ExcelUtil { } return workbook; } + + public static XSSFWorkbook genWorkbook(ExcelSheetData excelSheetData) { + List> list = new ArrayList<>(); + list.add(Collections.singletonList(excelSheetData.getHeaders())); + list.addAll( excelSheetData.getRows()); + return genWorkbookV2(list, excelSheetData.getSheetName()); + } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index e30cd63e2..c717016f5 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -3,17 +3,22 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.param.*; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationDetailWrapper; import com.engine.salary.wrapper.TaxDeclarationWrapper; import com.engine.salary.wrapper.TaxDeclareRecordWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -22,6 +27,11 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.time.LocalDateTime; import java.util.Collection; import java.util.List; import java.util.Map; @@ -51,93 +61,6 @@ public class TaxDeclarationController { } -// //个税申报表列表 -// @POST -// @Path("/list") -// @Produces(MediaType.APPLICATION_JSON) -// public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException { -// User user = HrmUserVarify.getUser(request, response); -// queryParam.setFromSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr())); -// queryParam.setEndSalaryMonth(SalaryDateUtil.stringToDate(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr())); -// return new ResponseResult>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam); -// } -// -// @POST -// @Path("/withDrawTaxDeclaration") -// @Produces(MediaType.APPLICATION_JSON) -// public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::withDrawTaxDeclaration, param.getTaxDeclarationId()); -// } -// -// -// //个税申报表表单 -// @GET -// @Path("/getForm") -// @Produces(MediaType.APPLICATION_JSON) -// public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getForm, id); -// } -// -// //个税申报表相关信息 -// @GET -// @Path("/getTaxDeclarationInfo") -// @Produces(MediaType.APPLICATION_JSON) -// public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getTaxDeclarationInfoById, taxDeclarationId); -// } -// -// //个税申报表生成 -// @POST -// @Path("/save") -// @Produces(MediaType.APPLICATION_JSON) -// public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { -// User user = HrmUserVarify.getUser(request, response); -// param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr())); -// return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::save, param); -// } -// -// //个税申报表详情列表 -// @POST -// @Path("/detail/list") -// @Produces(MediaType.APPLICATION_JSON) -// public String listTaxDeclarationDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationDetailListQueryParam param) { -// User user = HrmUserVarify.getUser(request, response); -// param.setTaxDeclarationId(Long.parseLong(param.getTaxDeclarationIdStr())); -// return new ResponseResult(user).run(getTaxDeclarationDetailWrapper(user)::listPage, param); -// } -// -// //个税申报表相关信息 -// @GET -// @Path("/export") -// @Produces(MediaType.APPLICATION_OCTET_STREAM) -// public Response exportTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { -// try { -// User user = HrmUserVarify.getUser(request, response); -// XSSFWorkbook workbook = getTaxDeclarationExcelService(user).exportTaxDeclaration(taxDeclarationId); -// -// 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; -// } -// } - - /** * 个税申报表列表 * @@ -377,20 +300,70 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::listValuePage, queryParam); } -// /** -// * 导出个税申报表申报数据 -// * -// * @param queryParam 导出参数 -// * @return -// */ -// @POST -// @Path("/detail/export") -// @Produces(MediaType.APPLICATION_JSON) -// public String exportTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationValueListQueryParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::exportTaxDeclarationValue, queryParam); -// -// } + /** + * 导出个税申报表申报数据 + * + * @return + */ + @GET + @Path("/detail/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportDetail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + + TaxDeclarationValueListQueryParam queryParam = genTaxDeclarationValueListQueryParam(request); + + try { + User user = HrmUserVarify.getUser(request, response); + + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportTaxDeclarationValue(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "个税申报表明细") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.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; + } + } + + private TaxDeclarationValueListQueryParam genTaxDeclarationValueListQueryParam(HttpServletRequest request) { + TaxDeclarationValueListQueryParam param = new TaxDeclarationValueListQueryParam(); + String current = request.getParameter("current"); + if (StringUtils.isNotBlank(current)) { + param.setCurrent(Integer.valueOf(current)); + } + String pageSize = request.getParameter("pageSize"); + if (StringUtils.isNotBlank(pageSize)) { + param.setPageSize(Integer.valueOf(pageSize)); + } + String taxDeclareRecordId = request.getParameter("taxDeclareRecordId"); + if (StringUtils.isNotBlank(taxDeclareRecordId)) { + param.setTaxDeclareRecordId(Long.valueOf(taxDeclareRecordId)); + } + String taxDeclarationId = request.getParameter("taxDeclarationId"); + if (StringUtils.isNotBlank(taxDeclarationId)) { + param.setTaxDeclarationId(Long.valueOf(taxDeclarationId)); + } + String incomeCategory = request.getParameter("incomeCategory"); + if (StringUtils.isNotBlank(incomeCategory)) { + param.setIncomeCategory(IncomeCategoryEnum.valueOf(incomeCategory)); + } + return param; + } + /** * 个税申报表申报数据-人员未报送列表 @@ -434,47 +407,146 @@ public class TaxDeclarationController { return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4Fail, queryParam); } -// /** -// * 个税申报表申报数据-导出人员未报送列表 -// * -// * @param queryParam 查询条件 -// * @return -// */ -// @POST -// @Path("/employee/export4NotDeclare") -// @Produces(MediaType.APPLICATION_JSON) -// public String exportEmployee4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { -// -// Map map = taxDeclareRecordWrapper.exportEmployee4NotDeclare(queryParam, UserContext.getCurrentUser()); -// return WeaResult.success(map); -// } + private AbnormalEmployeeListQueryParam genAbnormalEmployeeListQueryParam(HttpServletRequest request) { + AbnormalEmployeeListQueryParam param = new AbnormalEmployeeListQueryParam(); + String current = request.getParameter("current"); + if (StringUtils.isNotBlank(current)) { + param.setCurrent(Integer.valueOf(current)); + } + String pageSize = request.getParameter("pageSize"); + if (StringUtils.isNotBlank(pageSize)) { + param.setPageSize(Integer.valueOf(pageSize)); + } + String keyword = request.getParameter("keyword"); + if (StringUtils.isNotBlank(keyword)) { + param.setKeyword(keyword); + } + String taxDeclareRecordId = request.getParameter("taxDeclareRecordId"); + if (StringUtils.isNotBlank(taxDeclareRecordId)) { + param.setTaxDeclareRecordId(Long.valueOf(taxDeclareRecordId)); + } -// /** -// * 个税申报表申报数据-导出报送人员无申报数据列表 -// * -// * @param queryParam 查询条件 -// * @return -// */ -// @POST -// @Path("/employee/export4NoValue") -// @Produces(MediaType.APPLICATION_JSON) -// public String exportEmployee4NoValue(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { -// Map map = taxDeclareRecordWrapper.exportEmployee4NoValue(queryParam, UserContext.getCurrentUser()); -// return WeaResult.success(map); -// } -// -// /** -// * 个税申报表申报数据-导出申报失败列表 -// * -// * @param queryParam 导出参数 -// * @return -// */ -// @POST -// @Path("/employee/export4Fail") -// @Produces(MediaType.APPLICATION_JSON) -// public String exportEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { -// Map map = taxDeclareRecordWrapper.exportEmployee4Fail(queryParam, UserContext.getCurrentUser()); -// return WeaResult.success(map); -// } + String taxAgentId = request.getParameter("taxAgentId"); + if (StringUtils.isNotBlank(taxAgentId)) { + param.setTaxAgentId(Long.valueOf(taxAgentId)); + } + + String taxCycle = request.getParameter("taxCycle"); + if (StringUtils.isNotBlank(taxCycle)) { + param.setTaxCycle(SalaryDateUtil.stringToDate(taxCycle)); + } + + return param; + } + + /** + * 个税申报表申报数据-导出人员未报送列表 + * + * @return + */ + @GET + @Path("/employee/export4NotDeclare") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportEmployee4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NotDeclare(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156420, "未报送的人员") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.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; + } + } + + /** + * 个税申报表申报数据-导出报送人员无申报数据列表 + * + * @return + */ + @GET + @Path("/employee/export4NoValue") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportEmployee4NoValue(@Context HttpServletRequest request, @Context HttpServletResponse response) { + + try { + User user = HrmUserVarify.getUser(request, response); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NoValue(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156421, "缺少申报数据的人员") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.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; + } + } + + /** + * 个税申报表申报数据-导出申报失败列表 + * + * @return + */ + @GET + @Path("/employee/export4Fail") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4Fail(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156422, "申报失败人员") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.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; + } + } } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 3a1e7a192..277d1d9d0 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -32,6 +32,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.stereotype.Component; import weaver.general.Util; import weaver.hrm.User; @@ -609,90 +610,43 @@ public class TaxDeclareRecordWrapper extends Service { } } -// /** -// * 导出个税申报明细列表 -// * -// * @param queryParam -// * @return -// */ -// public Map exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { -// ExcelExportParam excelExportParam = new ExcelExportParam() -// .setBiz(String.valueOf(IdGenerator.generate())) -// .setModule(EntityType.hrmsalary.name()) -// .setFunction("exportTaxDeclarationValue"); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// getTaxDeclarationExcelService(user).exportTaxDeclarationValue(excelExportParam, queryParam, simpleEmployee); -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportTaxDeclarationValue", localRunnable); -// return JsonUtil.parseMap(excelExportParam, Object.class); -// } -// -// /** -// * 导出未报送的人员列表 -// * -// * @param queryParam -// * @param simpleEmployee -// * @return -// */ -// public Map exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { -// ExcelExportParam excelExportParam = new ExcelExportParam() -// .setBiz(String.valueOf(IdGenerator.generate())) -// .setModule(EntityType.hrmsalary.name()) -// .setFunction("exportEmployee4NotDeclare"); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// getTaxDeclarationExcelService(user).exportEmployee4NotDeclare(excelExportParam, queryParam, simpleEmployee); -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NotDeclare", localRunnable); -// return JsonUtil.parseMap(excelExportParam, Object.class); -// } -// -// /** -// * 导出没有申报数据的人员列表 -// * -// * @param queryParam -// * @param simpleEmployee -// * @return -// */ -// public Map exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { -// ExcelExportParam excelExportParam = new ExcelExportParam() -// .setBiz(String.valueOf(IdGenerator.generate())) -// .setModule(EntityType.hrmsalary.name()) -// .setFunction("exportEmployee4NoValue"); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// getTaxDeclarationExcelService(user).exportEmployee4NoValue(excelExportParam, queryParam, simpleEmployee); -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4NoValue", localRunnable); -// return JsonUtil.parseMap(excelExportParam, Object.class); -// } -// -// /** -// * 导出申报失败的人员列表 -// * -// * @param queryParam -// * @param simpleEmployee -// * @return -// */ -// public Map exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam, SimpleEmployee simpleEmployee) { -// ExcelExportParam excelExportParam = new ExcelExportParam() -// .setBiz(String.valueOf(IdGenerator.generate())) -// .setModule(EntityType.hrmsalary.name()) -// .setFunction("exportEmployee4Fail"); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// getTaxDeclarationExcelService(user).exportEmployee4Fail(excelExportParam, queryParam, simpleEmployee); -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployee4Fail", localRunnable); -// return JsonUtil.parseMap(excelExportParam, Object.class); -// } + /** + * 导出个税申报明细列表 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportTaxDeclarationValue(queryParam); + } + + /** + * 导出未报送的人员列表 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportEmployee4NotDeclare(queryParam); + } + + /** + * 导出没有申报数据的人员列表 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportEmployee4NoValue(queryParam); + } + + /** + * 导出申报失败的人员列表 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportEmployee4Fail(queryParam); + } } From 45e69cd6c88a5de0011bf3c1f8c5708d41b3acc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 24 Aug 2023 11:36:17 +0800 Subject: [PATCH 030/298] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308230303.sql | 3 + resource/sqlupgrade/GS/sql202308230303.sql | 3 + resource/sqlupgrade/JC/sql202308230303.sql | 3 + resource/sqlupgrade/Mysql/sql202308230303.sql | 3 + .../sqlupgrade/Oracle/sql202308230303.sql | 3 + resource/sqlupgrade/PG/sql202308230303.sql | 6 +- .../sqlupgrade/SQLServer/sql202308230303.sql | 3 + resource/sqlupgrade/ST/sql202308230303.sql | 3 + .../web/TaxDeclarationApiFlowController.java | 8 ++- src/com/engine/salary/common/OptionDTO.java | 9 +-- .../salary/constant/SzyhApiConstant.java | 6 +- .../QuerySpecialAmountFeedbackResponse.java | 6 +- .../response/QuerySpecialAmountResponse.java | 6 +- .../taxagent/bo/TaxAgentTaxReturnBO.java | 62 ++++++++++--------- .../dto/TaxAgentTaxReturnCheckDTO.java | 9 +-- .../dto/TaxAgentTaxReturnCheckFormDTO.java | 9 +-- .../dto/TaxAgentTaxReturnListDTO.java | 8 ++- .../dto/TaxAgentTaxReturnMainFormDTO.java | 12 ++-- .../dto/TaxAgentTaxReturnResultDTO.java | 8 ++- .../param/TaxAgentTaxReturnSaveParam.java | 41 ++++++------ .../taxagent/po/TaxAgentTaxReturnPO.java | 3 +- .../response/CheckPasswordResponse.java | 6 +- .../response/CompanyRegisterInfoResponse.java | 6 +- .../taxagent/response/SzyhResponseHead.java | 6 +- .../WithholdingVoucherFeedbackResponse.java | 6 +- .../taxdeclaration/TaxPaymentTypeEnum.java | 8 ++- .../taxagent/TaxAgentTaxReturnMapper.java | 8 ++- .../taxagent/TaxAgentTaxReturnMapper.xml | 13 ++++ .../TaxDeclarationApiFlowRecordMapper.java | 8 ++- .../TaxDeclarationApiFlowRecordMapper.java | 8 ++- .../service/TaxAgentTaxReturnService.java | 6 +- .../TaxDeclarationApiBillingService.java | 8 ++- .../TaxDeclarationApiConfigService.java | 8 ++- .../TaxDeclarationApiFlowWarnService.java | 8 ++- .../salary/service/TaxPaymentService.java | 6 +- .../TaxAgentTaxReturnCheckServiceFactory.java | 4 -- .../factory/TaxPaymentServiceFactory.java | 4 -- .../impl/TaxAgentTaxReturnServiceImpl.java | 4 -- .../TaxDeclarationApiBillingServiceImpl.java | 4 -- .../TaxDeclarationApiConfigServiceImpl.java | 8 ++- .../impl/TaxPaymentAgreementServiceImpl.java | 6 +- .../TaxPaymentWithheldVoucherServiceImpl.java | 6 +- .../TaxPaymentWithholdingServiceImpl.java | 6 +- ...xPaymentWithholdingVoucherServiceImpl.java | 6 +- .../TaxReturnCheckDepartmentServiceImpl.java | 8 ++- .../impl/TaxReturnCheckMainServiceImpl.java | 14 +++-- ...TaxReturnCheckRegistrationServiceImpl.java | 8 ++- .../web/TaxAgentTaxReturnController.java | 8 ++- .../web/TaxDeclarationApiFlowController.java | 8 ++- .../salary/web/TaxPaymentController.java | 8 ++- .../wrapper/TaxAgentTaxReturnWrapper.java | 9 +-- .../TaxDeclarationApiFlowBillingWrapper.java | 8 ++- .../salary/wrapper/TaxPaymentWrapper.java | 8 ++- 53 files changed, 276 insertions(+), 170 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202308230303.sql b/resource/sqlupgrade/DM/sql202308230303.sql index 311a2bf86..4867c56aa 100644 --- a/resource/sqlupgrade/DM/sql202308230303.sql +++ b/resource/sqlupgrade/DM/sql202308230303.sql @@ -1,3 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; / diff --git a/resource/sqlupgrade/GS/sql202308230303.sql b/resource/sqlupgrade/GS/sql202308230303.sql index 311a2bf86..4867c56aa 100644 --- a/resource/sqlupgrade/GS/sql202308230303.sql +++ b/resource/sqlupgrade/GS/sql202308230303.sql @@ -1,3 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; / diff --git a/resource/sqlupgrade/JC/sql202308230303.sql b/resource/sqlupgrade/JC/sql202308230303.sql index 311a2bf86..4867c56aa 100644 --- a/resource/sqlupgrade/JC/sql202308230303.sql +++ b/resource/sqlupgrade/JC/sql202308230303.sql @@ -1,3 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; / diff --git a/resource/sqlupgrade/Mysql/sql202308230303.sql b/resource/sqlupgrade/Mysql/sql202308230303.sql index ba8b047ae..76f96bf71 100644 --- a/resource/sqlupgrade/Mysql/sql202308230303.sql +++ b/resource/sqlupgrade/Mysql/sql202308230303.sql @@ -1 +1,4 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar(400) +; + update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308230303.sql b/resource/sqlupgrade/Oracle/sql202308230303.sql index 1f5c3dd15..1f61a5c96 100644 --- a/resource/sqlupgrade/Oracle/sql202308230303.sql +++ b/resource/sqlupgrade/Oracle/sql202308230303.sql @@ -1,2 +1,5 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400) +/ + update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416 / \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308230303.sql b/resource/sqlupgrade/PG/sql202308230303.sql index ba8b047ae..9cd12b134 100644 --- a/resource/sqlupgrade/PG/sql202308230303.sql +++ b/resource/sqlupgrade/PG/sql202308230303.sql @@ -1 +1,5 @@ -update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; \ No newline at end of file +alter table hrsa_tax_agent_tax_return add city_name varchar(400); +/ + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308230303.sql b/resource/sqlupgrade/SQLServer/sql202308230303.sql index 61cc33829..6cb8ed60b 100644 --- a/resource/sqlupgrade/SQLServer/sql202308230303.sql +++ b/resource/sqlupgrade/SQLServer/sql202308230303.sql @@ -1,2 +1,5 @@ +alter table hrsa_tax_agent_tax_return add city_name nvarchar(400) +GO + update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416 GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308230303.sql b/resource/sqlupgrade/ST/sql202308230303.sql index 311a2bf86..4867c56aa 100644 --- a/resource/sqlupgrade/ST/sql202308230303.sql +++ b/resource/sqlupgrade/ST/sql202308230303.sql @@ -1,3 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; / diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowController.java b/src/com/api/salary/web/TaxDeclarationApiFlowController.java index 6fcdf10c5..14eff76b5 100644 --- a/src/com/api/salary/web/TaxDeclarationApiFlowController.java +++ b/src/com/api/salary/web/TaxDeclarationApiFlowController.java @@ -4,10 +4,12 @@ import javax.ws.rs.Path; /** * 智能算薪-计费 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-11-15 16:05:40 - */ + * @author qiantao + * @version 1.0 + **/ @Path("/bs/hrmsalary/taxdeclaration/apiflow") public class TaxDeclarationApiFlowController extends com.engine.salary.web.TaxDeclarationApiFlowController{ diff --git a/src/com/engine/salary/common/OptionDTO.java b/src/com/engine/salary/common/OptionDTO.java index 465d4ed3f..b8e126406 100644 --- a/src/com/engine/salary/common/OptionDTO.java +++ b/src/com/engine/salary/common/OptionDTO.java @@ -1,17 +1,18 @@ package com.engine.salary.common; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * 人员选项 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-09-06 16:57:23 - */ + * @author qiantao + * @version 1.0 + **/ @Data @AllArgsConstructor @NoArgsConstructor diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 8dc473191..698f662f8 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -2,9 +2,11 @@ package com.engine.salary.constant; /** * 神州云合api常量 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-10-18 11:05 AM + * @author qiantao + * @version 1.0 **/ public class SzyhApiConstant { diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java index f94fe1cf0..8ac88752e 100644 --- a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java @@ -8,9 +8,11 @@ import java.util.List; /** * 人员专项附加扣除信息查询结果 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-10-27 10:00 AM + * @author qiantao + * @version 1.0 **/ @Data public class QuerySpecialAmountFeedbackResponse extends BaseResponse { diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java index 9dfbc2cec..4562612e1 100644 --- a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java @@ -5,9 +5,11 @@ import lombok.Data; /** * 人员专项附加扣除信息查询结果 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-10-27 10:00 AM + * @author qiantao + * @version 1.0 **/ @Data public class QuerySpecialAmountResponse extends BaseResponse { diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java index 559aced70..fab88eda0 100644 --- a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -18,28 +18,32 @@ import java.util.UUID; /** * 报税信息BO + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-09-02 11:06:41 - */ + * @author qiantao + * @version 1.0 + **/ public class TaxAgentTaxReturnBO { public static TaxAgentTaxReturnMainFormDTO convertPo2FormDto(TaxAgentTaxReturnPO taxReturnPO) { - return new TaxAgentTaxReturnMainFormDTO() - .setId(taxReturnPO.getId()) - .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.parseByValue(taxReturnPO.getPasswordType())) - .setCity(taxReturnPO.getCity()) - .setProvince(taxReturnPO.getProvince()) - .setNation(taxReturnPO.getNation()) - .setAreaCode(taxReturnPO.getAreaCode()) - .setTaxCode(taxReturnPO.getTaxCode()) - .setAccount(taxReturnPO.getRealAccount()) - .setNetPassword(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null) - .setRealNamePassword(TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null) - .setTaxRegistrationNumber(taxReturnPO.getTaxRegistrationNumber()) - .setDepartmentCode(taxReturnPO.getDepartmentCode()) - .setCheckStatus(TaxAgentTaxReturnStatusEnum.parseByValue(taxReturnPO.getCheckStatus())) - .setFailReason(taxReturnPO.getFailReason()); + TaxAgentTaxReturnMainFormDTO dto = new TaxAgentTaxReturnMainFormDTO(); + dto.setId(taxReturnPO.getId()); + dto.setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.parseByValue(taxReturnPO.getPasswordType())); + dto.setCity(taxReturnPO.getCity()); + dto.setCityName(taxReturnPO.getCityName()); + dto.setProvince(taxReturnPO.getProvince()); + dto.setNation(taxReturnPO.getNation()); + dto.setAreaCode(taxReturnPO.getAreaCode()); + dto.setTaxCode(taxReturnPO.getTaxCode()); + dto.setAccount(taxReturnPO.getRealAccount()); + dto.setNetPassword(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null); + dto.setRealNamePassword(TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null); + dto.setTaxRegistrationNumber(taxReturnPO.getTaxRegistrationNumber()); + dto.setDepartmentCode(taxReturnPO.getDepartmentCode()); + dto.setCheckStatus(TaxAgentTaxReturnStatusEnum.parseByValue(taxReturnPO.getCheckStatus())); + dto.setFailReason(taxReturnPO.getFailReason()); + return dto; } public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception { @@ -49,6 +53,7 @@ public class TaxAgentTaxReturnBO { .taxCode(saveParam.getTaxCode()) .nation(saveParam.getNation()) .city(saveParam.getCity()) + .cityName(saveParam.getCityName()) .province(saveParam.getProvince()) .areaCode(saveParam.getAreaCode()) .realAccount(saveParam.getAccount()) @@ -65,16 +70,17 @@ public class TaxAgentTaxReturnBO { public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { Date now = new Date(); - po.setTaxCode(saveParam.getTaxCode()) - .setNation(saveParam.getNation()) - .setCity(saveParam.getCity()) - .setProvince(saveParam.getProvince()) - .setAreaCode(saveParam.getAreaCode()) - .setRealAccount(saveParam.getAccount()) - .setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) - .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) - .setTaxAgentId(saveParam.getTaxAgentId()) - .setUpdateTime(now); + po.setTaxCode(saveParam.getTaxCode()); + po.setNation(saveParam.getNation()); + po.setCity(saveParam.getCity()); + po.setCityName(saveParam.getCityName()); + po.setProvince(saveParam.getProvince()); + po.setAreaCode(saveParam.getAreaCode()); + po.setRealAccount(saveParam.getAccount()); + po.setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())); + po.setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()); + po.setTaxAgentId(saveParam.getTaxAgentId()); + po.setUpdateTime(now); } public static Map convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) { diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java index 8b3a6717a..eba6c9768 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java @@ -3,7 +3,6 @@ package com.engine.salary.entity.taxagent.dto; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.util.SalaryI18nUtil; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; @@ -12,10 +11,12 @@ import java.util.List; /** * 税友验证成功信息 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 15:25:44 - */ + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @ApiModel("税友验证成功信息") diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java index 5430733d3..cf6ca11da 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java @@ -4,7 +4,6 @@ import com.engine.salary.enums.SalaryOnOffEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -13,10 +12,12 @@ import lombok.NoArgsConstructor; /** * 税友验证信息表单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 15:25:44 - */ + * @author qiantao + * @version 1.0 + **/ @Data @AllArgsConstructor @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java index 3d38a1772..67f1c5360 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java @@ -9,10 +9,12 @@ import lombok.NoArgsConstructor; /** * 税友报税信息列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-09-02 15:31:10 - */ + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java index dae97d778..0438e01b5 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java @@ -5,18 +5,19 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; /** - * 报税信息表单 + * 报税信息表单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-09-02 09:39:05 - */ + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @NoArgsConstructor @@ -36,6 +37,7 @@ public class TaxAgentTaxReturnMainFormDTO { //报税所属区域") private String city; + private String cityName; //省份") private String province; diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java index 24b12c7d6..76b51acf5 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java @@ -9,10 +9,12 @@ import lombok.experimental.Accessors; /** * 税友验证成功信息 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 15:25:44 - */ + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) @Builder diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java index a28a0b349..9cd0f2c01 100644 --- a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java @@ -5,59 +5,64 @@ import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryI18nUtil; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** - * @author chengliming - * @desc: 个税扣缴义务人-报税信息-保存参数 - * @date: 2022-08-31 10:23:29 - */ + * 个税扣缴义务人-报税信息-保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @NoArgsConstructor @AllArgsConstructor @ApiModel("个税扣缴义务人-报税信息-保存参数") public class TaxAgentTaxReturnSaveParam { - //个税扣缴义务人id") + //个税扣缴义务人id private Long taxAgentId; - //税号") + //税号 private String taxCode; - //登记序号") + //登记序号 private String taxRegistrationNumber; - //省级") + //省级 private String province; - //市级") + //市级 private String city; - //国家") + //浏览按钮显示 + private String cityName; + + //国家 private String nation; - //密码校验类型") + //密码校验类型 private String passwordType; - //密码") + //密码 private String password; - //实名账号") + //实名账号 private String account; - //部门编码,分部门备案时填入") + //部门编码,分部门备案时填入 private String departmentCode; - //部门名称,分部门备案时填入") + //部门名称,分部门备案时填入 private String departmentName; - //请求类型 1.保存并验证 2.仅保存") + //请求类型 1.保存并验证 2.仅保存 private Integer requestType = 1; - //验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码") + //验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码 @JsonIgnore private Integer type; diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java index 98bafb451..b338e53b6 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -6,7 +6,6 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import java.io.Serializable; import java.util.Collection; @@ -22,7 +21,6 @@ import java.util.Date; **/ @Data @Builder -@Accessors(chain = true) @NoArgsConstructor @AllArgsConstructor //hrsa_tax_agent_tax_return @@ -79,6 +77,7 @@ public class TaxAgentTaxReturnPO implements Serializable { * 市级 */ private String city; + private String cityName; /** * 市级 diff --git a/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java index 2078bfa08..c4a21e6f6 100644 --- a/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java +++ b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java @@ -4,9 +4,11 @@ import lombok.Data; /** * 神州云合接口返回状态实体 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-10-18 10:39 AM + * @author qiantao + * @version 1.0 **/ @Data public class CheckPasswordResponse { diff --git a/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java index b3a2557e3..f0ff1c84f 100644 --- a/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java +++ b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java @@ -6,9 +6,11 @@ import java.util.List; /** * 神州云合接口返回状态实体 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-10-18 10:39 AM + * @author qiantao + * @version 1.0 **/ @Data public class CompanyRegisterInfoResponse { diff --git a/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java index 11b1185a0..90ba9fc96 100644 --- a/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java +++ b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java @@ -4,9 +4,11 @@ import lombok.Data; /** * 神州云合接口返回状态实体 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-10-18 10:39 AM + * @author qiantao + * @version 1.0 **/ @Data public class SzyhResponseHead { diff --git a/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java index e49c10f80..abb5e585d 100644 --- a/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java @@ -6,9 +6,11 @@ import java.util.List; /** * 缴款凭证反馈 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-12-06 17:25:32 + * @author qiantao + * @version 1.0 **/ @Data public class WithholdingVoucherFeedbackResponse extends BaseResponse { diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java index b3aeeed48..2ffa4958f 100644 --- a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java @@ -6,10 +6,12 @@ import java.util.Objects; /** * 个税辅助缴款-请求类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-12-08 19:08:17 - */ + * @author qiantao + * @version 1.0 + **/ public enum TaxPaymentTypeEnum implements BaseEnum { /** * 三方协议缴款反馈 diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java index c6cf9f5f0..ec4492aae 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java @@ -6,10 +6,12 @@ import java.util.List; /** * 个税扣缴义务人报税信息 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 11:20:32 - */ + * @author qiantao + * @version 1.0 + **/ public interface TaxAgentTaxReturnMapper { /** * 查询所有记录 diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml index 6468afdac..e5a86e57f 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -5,6 +5,7 @@ + @@ -48,6 +49,7 @@ , t.tax_registration_number , t.tenant_key , t.update_time + , t.city_name @@ -219,6 +221,9 @@ update_time, + + city_name, + @@ -281,6 +286,9 @@ #{updateTime}, + + #{cityName}, + @@ -291,6 +299,7 @@ area_code=#{areaCode}, check_status=#{checkStatus}, city=#{city}, + city_name=#{cityName}, create_time=#{createTime}, creator=#{creator}, delete_type=#{deleteType}, @@ -325,6 +334,9 @@ city=#{city}, + + city_name=#{cityName}, + create_time=#{createTime}, @@ -399,6 +411,7 @@ area_code=#{areaCode}, check_status=#{checkStatus}, city=#{city}, + city_name=#{cityName}, create_time=#{createTime}, creator=#{creator}, delete_type=#{deleteType}, diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java index 5161e3ad9..46df17a51 100644 --- a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java @@ -7,10 +7,12 @@ import java.util.Collection; /** * 个税申报-接口流量使用记录 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-08-31 11:20:32 - */ + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclarationApiFlowRecordMapper { /** * 批量插入 diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java index 8d3d174c8..0f6194282 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java @@ -8,10 +8,12 @@ import java.util.Collection; /** * 个税申报-接口流量使用记录 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-08-31 11:20:32 - */ + * @author qiantao + * @version 1.0 + **/ @Mapper public interface TaxDeclarationApiFlowRecordMapper { /** diff --git a/src/com/engine/salary/service/TaxAgentTaxReturnService.java b/src/com/engine/salary/service/TaxAgentTaxReturnService.java index 6009b455a..c87b48267 100644 --- a/src/com/engine/salary/service/TaxAgentTaxReturnService.java +++ b/src/com/engine/salary/service/TaxAgentTaxReturnService.java @@ -9,9 +9,11 @@ import java.util.List; /** * 个税扣缴义务人-报税信息service接口 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-02 9:26 AM + * @author qiantao + * @version 1.0 **/ public interface TaxAgentTaxReturnService { /** diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java index 3917b494e..7c7801cdb 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -4,10 +4,12 @@ import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; /** * 个税申报计费service + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-11-11 14:54:14 - */ + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclarationApiBillingService { /** diff --git a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java index 69de5ffd3..c43db36c9 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java @@ -5,10 +5,12 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; /** * 个税申报api配置service + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-11-09 10:09:22 - */ + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclarationApiConfigService { /** diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java index de75cf036..ae981ddd3 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -12,10 +12,12 @@ import java.util.List; /** * 流量不足提醒 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-11-11 14:54:14 - */ + * @author qiantao + * @version 1.0 + **/ public interface TaxDeclarationApiFlowWarnService { /** diff --git a/src/com/engine/salary/service/TaxPaymentService.java b/src/com/engine/salary/service/TaxPaymentService.java index 72c740132..6f8ae318f 100644 --- a/src/com/engine/salary/service/TaxPaymentService.java +++ b/src/com/engine/salary/service/TaxPaymentService.java @@ -11,9 +11,11 @@ import java.util.Map; /** * 个税辅助缴款 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-12-06 17:27:59 + * @author qiantao + * @version 1.0 **/ public interface TaxPaymentService { /** diff --git a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java index 31b50a2a7..14b08ed4e 100644 --- a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java +++ b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java @@ -8,10 +8,6 @@ import com.engine.salary.service.impl.TaxReturnCheckMainServiceImpl; import com.engine.salary.service.impl.TaxReturnCheckRegistrationServiceImpl; import weaver.hrm.User; -/** - * @author chengliming - * @date 2022-09-09 2:09 PM - **/ public class TaxAgentTaxReturnCheckServiceFactory { private User user; diff --git a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java index 90fbb0cc4..f778ff2df 100644 --- a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java +++ b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java @@ -5,10 +5,6 @@ import com.engine.salary.service.TaxPaymentService; import com.engine.salary.service.impl.*; import weaver.hrm.User; -/** - * @author chengliming - * @date 2022-12-08 19:05:16 - **/ public class TaxPaymentServiceFactory { private User user; diff --git a/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java index 7b36f358d..a39f2a941 100644 --- a/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java @@ -12,10 +12,6 @@ import com.engine.salary.util.db.MapperProxyFactory; import java.util.Collection; import java.util.List; -/** - * @author chengliming - * @date 2022-09-02 9:27 AM - **/ public class TaxAgentTaxReturnServiceImpl extends Service implements TaxAgentTaxReturnService { private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index 4b3d8a9a2..8288c1565 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -24,10 +24,6 @@ import java.util.Date; import java.util.List; import java.util.Map; -/** - * @author chengliming - * @date 2022-11-11 2:57 PM - **/ @Slf4j public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService { diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java index e716e6daa..f307a95c8 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -22,8 +22,12 @@ import org.apache.commons.lang3.StringUtils; import java.util.*; /** - * @author chengliming - * @date 2022-11-09 10:09 AM + * chengliming + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 **/ @Slf4j public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService { diff --git a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java index 9e738ef1b..5b140dd83 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -23,9 +23,11 @@ import java.util.*; /** * 三方信息查询 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-02 9:27 AM + * @author qiantao + * @version 1.0 **/ @Slf4j public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java index 4cb11b809..eb977a7b7 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -22,9 +22,11 @@ import java.util.*; /** * 完税证明 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-02 9:27 AM + * @author qiantao + * @version 1.0 **/ @Slf4j public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentService { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 401bca567..4e6c5180e 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -28,9 +28,11 @@ import java.util.Optional; /** * 三方缴款 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-02 9:27 AM + * @author qiantao + * @version 1.0 **/ @Slf4j public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index d87f61c39..048f286ab 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -34,9 +34,11 @@ import java.util.stream.Collectors; /** * 缴款凭证 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-02 9:27 AM + * @author qiantao + * @version 1.0 **/ @Slf4j public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentService { diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java index dd2c2af07..087105b17 100644 --- a/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java @@ -10,10 +10,12 @@ import lombok.extern.slf4j.Slf4j; /** * 验证部门编码相关方法 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-15 17:21:41 - */ + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxReturnCheckDepartmentServiceImpl extends AbstractTaxAgentTaxReturnCheckService { diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java index 0d304779c..12feb8d16 100644 --- a/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java @@ -18,11 +18,13 @@ import java.util.List; import java.util.Objects; /** - * 验证主题报税信息相关方法 + * 验证主体报税信息相关方法 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-15 17:21:23 - */ + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxReturnCheckMainServiceImpl extends AbstractTaxAgentTaxReturnCheckService { @@ -78,7 +80,9 @@ public class TaxReturnCheckMainServiceImpl extends AbstractTaxAgentTaxReturnChec TaxAgentTaxReturnBO.convertParam2Po4Update(apiConfig, po, saveParam); getTaxAgentTaxReturnMapper().updateByTaxAgentId(po); } else { - po = TaxAgentTaxReturnBO.convertParam2Po4Insert(apiConfig, saveParam).setCreator((long) user.getUID()).setTenantKey(""); + po = TaxAgentTaxReturnBO.convertParam2Po4Insert(apiConfig, saveParam); + po.setCreator((long) user.getUID()); + po.setTenantKey(""); getTaxAgentTaxReturnMapper().insertIgnoreNull(po); } return po; diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java index aabb3e2f9..4ac507c1b 100644 --- a/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java @@ -12,10 +12,12 @@ import java.util.List; /** * 验证税号+序号相关方法 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-09-15 17:22:14 - */ + * @author qiantao + * @version 1.0 + **/ public class TaxReturnCheckRegistrationServiceImpl extends AbstractTaxAgentTaxReturnCheckService { @Override diff --git a/src/com/engine/salary/web/TaxAgentTaxReturnController.java b/src/com/engine/salary/web/TaxAgentTaxReturnController.java index c7bacf57a..e0bb24202 100644 --- a/src/com/engine/salary/web/TaxAgentTaxReturnController.java +++ b/src/com/engine/salary/web/TaxAgentTaxReturnController.java @@ -18,10 +18,12 @@ import javax.ws.rs.core.MediaType; /** * 个税扣缴义务人-报税信息 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 11:49:38 - */ + * @author qiantao + * @version 1.0 + **/ public class TaxAgentTaxReturnController { private TaxAgentTaxReturnWrapper getTaxAgentTaxReturnWrapper(User user) { diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java index 0a6bf2a36..0fdcad304 100644 --- a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java @@ -23,10 +23,12 @@ import javax.ws.rs.core.MediaType; /** * 智能算薪-计费 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-11-15 16:05:40 - */ + * @author qiantao + * @version 1.0 + **/ public class TaxDeclarationApiFlowController { private TaxDeclarationApiFlowBillingWrapper getTaxDeclarationApiFlowBillingWrapper(User user) { diff --git a/src/com/engine/salary/web/TaxPaymentController.java b/src/com/engine/salary/web/TaxPaymentController.java index ceffe78ff..07e5203ca 100644 --- a/src/com/engine/salary/web/TaxPaymentController.java +++ b/src/com/engine/salary/web/TaxPaymentController.java @@ -23,10 +23,12 @@ import javax.ws.rs.core.MediaType; /** * 个税辅助缴款 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 11:49:38 - */ + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxPaymentController { diff --git a/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java index 08674beb1..79d2fe07a 100644 --- a/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java @@ -30,11 +30,12 @@ import java.util.stream.Collectors; /** * 个税扣缴义务人-报税信息包装类 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 13:29:14 - */ - + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxAgentTaxReturnWrapper extends Service { diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java index 7be89079d..ac6db24f7 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -18,10 +18,12 @@ import weaver.hrm.User; /** * 个税申报计费 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-11-11 15:16:22 - */ + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxDeclarationApiFlowBillingWrapper extends Service { diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java index 431deede8..f90f62713 100644 --- a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -11,10 +11,12 @@ import lombok.extern.slf4j.Slf4j; /** * 个税辅助缴款 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-08-31 13:29:14 - */ + * @author qiantao + * @version 1.0 + **/ @Slf4j public class TaxPaymentWrapper extends Service { private final TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); From 4ea735a73149b30778d003e0256ac6e3b3037e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 24 Aug 2023 16:29:13 +0800 Subject: [PATCH 031/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=92=8C=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308240201.sql | 47 +++++++++++++++++++ resource/sqlupgrade/DM/sql202308240302.sql | 29 ++++++++++++ resource/sqlupgrade/GS/sql202308240201.sql | 47 +++++++++++++++++++ resource/sqlupgrade/GS/sql202308240302.sql | 29 ++++++++++++ resource/sqlupgrade/JC/sql202308240201.sql | 47 +++++++++++++++++++ resource/sqlupgrade/JC/sql202308240302.sql | 29 ++++++++++++ resource/sqlupgrade/Mysql/sql202308240201.sql | 34 ++++++++++++++ resource/sqlupgrade/Mysql/sql202308240302.sql | 21 +++++++++ .../sqlupgrade/Oracle/sql202308240201.sql | 34 ++++++++++++++ .../sqlupgrade/Oracle/sql202308240302.sql | 21 +++++++++ resource/sqlupgrade/PG/sql202308240201.sql | 34 ++++++++++++++ resource/sqlupgrade/PG/sql202308240302.sql | 21 +++++++++ .../sqlupgrade/SQLServer/sql202308240201.sql | 34 ++++++++++++++ .../sqlupgrade/SQLServer/sql202308240302.sql | 21 +++++++++ resource/sqlupgrade/ST/sql202308240201.sql | 47 +++++++++++++++++++ resource/sqlupgrade/ST/sql202308240302.sql | 29 ++++++++++++ 16 files changed, 524 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202308240201.sql create mode 100644 resource/sqlupgrade/DM/sql202308240302.sql create mode 100644 resource/sqlupgrade/GS/sql202308240201.sql create mode 100644 resource/sqlupgrade/GS/sql202308240302.sql create mode 100644 resource/sqlupgrade/JC/sql202308240201.sql create mode 100644 resource/sqlupgrade/JC/sql202308240302.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308240201.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308240302.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308240201.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308240302.sql create mode 100644 resource/sqlupgrade/PG/sql202308240201.sql create mode 100644 resource/sqlupgrade/PG/sql202308240302.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308240201.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308240302.sql create mode 100644 resource/sqlupgrade/ST/sql202308240201.sql create mode 100644 resource/sqlupgrade/ST/sql202308240302.sql diff --git a/resource/sqlupgrade/DM/sql202308240201.sql b/resource/sqlupgrade/DM/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/DM/sql202308240302.sql b/resource/sqlupgrade/DM/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202308240201.sql b/resource/sqlupgrade/GS/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202308240302.sql b/resource/sqlupgrade/GS/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/JC/sql202308240201.sql b/resource/sqlupgrade/JC/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/JC/sql202308240302.sql b/resource/sqlupgrade/JC/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308240201.sql b/resource/sqlupgrade/Mysql/sql202308240201.sql new file mode 100644 index 000000000..990d9534d --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( indexdesc is null or indexdesc = '' ) +; +insert into HtmlLabelIndex(id,indexdesc) select 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( indexdesc is not null and indexdesc <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=char_length(labelname) ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=char_length(labelname) )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 +; + + +delete from HtmlLabelIndex where id = 544826 and ( indexdesc is null or indexdesc = '' ) +; +insert into HtmlLabelIndex(id,indexdesc) select 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( indexdesc is not null and indexdesc <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=char_length(labelname) ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=char_length(labelname) )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308240302.sql b/resource/sqlupgrade/Mysql/sql202308240302.sql new file mode 100644 index 000000000..1164be8d3 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191 +; +Delete from LeftMenuConfig where infoid=100191 +; +call LMConfig_U_ByInfoInsert (2,100181,1) +; +call LMInfo_Insert (100191,544827,'','',2,100181,1,18) +; +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191 +; + +Delete from LeftMenuInfo where id=100192 +; +Delete from LeftMenuConfig where infoid=100192 +; +call LMConfig_U_ByInfoInsert (2,100118,7) +; +call LMInfo_Insert (100192,544826,'','',2,100118,7,18) +; +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192 +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308240201.sql b/resource/sqlupgrade/Oracle/sql202308240201.sql new file mode 100644 index 000000000..a0cf95fa0 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) +/ +insert into HtmlLabelIndex(id,indexdesc) select 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 +/ + + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) +/ +insert into HtmlLabelIndex(id,indexdesc) select 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308240302.sql b/resource/sqlupgrade/Oracle/sql202308240302.sql new file mode 100644 index 000000000..e2bb43cae --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191 +/ +Delete from LeftMenuConfig where infoid=100191 +/ +call LMConfig_U_ByInfoInsert (2,100181,1) +/ +call LMInfo_Insert (100191,544827,'','',2,100181,1,18) +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191 +/ + +Delete from LeftMenuInfo where id=100192 +/ +Delete from LeftMenuConfig where infoid=100192 +/ +call LMConfig_U_ByInfoInsert (2,100118,7) +/ +call LMInfo_Insert (100192,544826,'','',2,100118,7,18) +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308240201.sql b/resource/sqlupgrade/PG/sql202308240201.sql new file mode 100644 index 000000000..ed35e8a71 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( indexdesc is null or indexdesc = '' ) ; +/ +insert into HtmlLabelIndex(id,indexdesc) select 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( indexdesc is not null and indexdesc <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=octet_length(labelname) ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=octet_length(labelname) )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ + + +delete from HtmlLabelIndex where id = 544826 and ( indexdesc is null or indexdesc = '' ) ; +/ +insert into HtmlLabelIndex(id,indexdesc) select 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( indexdesc is not null and indexdesc <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=octet_length(labelname) ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=octet_length(labelname) )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308240302.sql b/resource/sqlupgrade/PG/sql202308240302.sql new file mode 100644 index 000000000..ed458429b --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191; +/ +Delete from LeftMenuConfig where infoid=100191; +/ +call LMConfig_U_ByInfoInsert (2,100181,1); +/ +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ +Delete from LeftMenuConfig where infoid=100192; +/ +call LMConfig_U_ByInfoInsert (2,100118,7); +/ +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308240201.sql b/resource/sqlupgrade/SQLServer/sql202308240201.sql new file mode 100644 index 000000000..e1d0137c2 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( indexdesc is null or indexdesc = '' ) +GO +insert into HtmlLabelIndex(id,indexdesc) select top 1 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( indexdesc is not null and indexdesc <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is not null and labelname <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is null or labelname = '' or labelname like '%[߹-]%' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is not null and labelname <> '' and labelname not like '%[߹-]%' )) +GO +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is not null and labelname <> '' )) +GO + + +delete from HtmlLabelIndex where id = 544826 and ( indexdesc is null or indexdesc = '' ) +GO +insert into HtmlLabelIndex(id,indexdesc) select top 1 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( indexdesc is not null and indexdesc <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is not null and labelname <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is null or labelname = '' or labelname like '%[߹-]%' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is not null and labelname <> '' and labelname not like '%[߹-]%' )) +GO +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is not null and labelname <> '' )) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308240302.sql b/resource/sqlupgrade/SQLServer/sql202308240302.sql new file mode 100644 index 000000000..00621bbb7 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191 +GO +Delete from LeftMenuConfig where infoid=100191 +GO +EXECUTE LMConfig_U_ByInfoInsert 2,100181,1 +GO +EXECUTE LMInfo_Insert 100191,544827,'','',2,100181,1,18 +GO +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191 +GO + +Delete from LeftMenuInfo where id=100192 +GO +Delete from LeftMenuConfig where infoid=100192 +GO +EXECUTE LMConfig_U_ByInfoInsert 2,100118,7 +GO +EXECUTE LMInfo_Insert 100192,544826,'','',2,100118,7,18 +GO +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308240201.sql b/resource/sqlupgrade/ST/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'ԱϢ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ԱϢ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'ˆTϢ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308240302.sql b/resource/sqlupgrade/ST/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file From 1cd07d7986cdec70286ef58d16066c02d26faba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 24 Aug 2023 16:49:53 +0800 Subject: [PATCH 032/298] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202307180403.sql | 2 +- resource/sqlupgrade/JC/sql202307180403.sql | 2 +- resource/sqlupgrade/Mysql/sql202307180403.sql | 38 +++++++++---------- .../sqlupgrade/Oracle/sql202307180403.sql | 2 +- resource/sqlupgrade/PG/sql202307180403.sql | 2 +- .../sqlupgrade/SQLServer/sql202307180403.sql | 2 +- resource/sqlupgrade/ST/sql202307180403.sql | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202307180403.sql b/resource/sqlupgrade/DM/sql202307180403.sql index 3a72f6ecc..fb5e8e455 100644 --- a/resource/sqlupgrade/DM/sql202307180403.sql +++ b/resource/sqlupgrade/DM/sql202307180403.sql @@ -8,7 +8,7 @@ create table hrsa_tax_agent_tax_return tenant_key varchar2(10), tax_agent_id number not null, tax_code varchar2(50) not null, - tax_registration_number varchar2(50) not null, + tax_registration_number varchar2(50) , department_code varchar2(50), department_name varchar2(50), nation varchar2(50), diff --git a/resource/sqlupgrade/JC/sql202307180403.sql b/resource/sqlupgrade/JC/sql202307180403.sql index 3a72f6ecc..fb5e8e455 100644 --- a/resource/sqlupgrade/JC/sql202307180403.sql +++ b/resource/sqlupgrade/JC/sql202307180403.sql @@ -8,7 +8,7 @@ create table hrsa_tax_agent_tax_return tenant_key varchar2(10), tax_agent_id number not null, tax_code varchar2(50) not null, - tax_registration_number varchar2(50) not null, + tax_registration_number varchar2(50) , department_code varchar2(50), department_name varchar2(50), nation varchar2(50), diff --git a/resource/sqlupgrade/Mysql/sql202307180403.sql b/resource/sqlupgrade/Mysql/sql202307180403.sql index a063f8f8d..63e7d6274 100644 --- a/resource/sqlupgrade/Mysql/sql202307180403.sql +++ b/resource/sqlupgrade/Mysql/sql202307180403.sql @@ -1,25 +1,25 @@ create table hrsa_tax_agent_tax_return ( id bigint primary key comment 'ID' , - create_time datetime comment 'ʱ' , - update_time datetime comment '޸ʱ' , - creator bigint comment 'id' , - delete_type int default 0 comment 'Ƿɾ' , - tenant_key varchar(10) comment '⻧KEY' , - tax_agent_id bigint not null comment '˰۽ID' , - tax_code varchar(50) not null comment '˰' , - tax_registration_number varchar(50) not null comment 'Ǽ' , - department_code varchar(50) comment 'ű' , - department_name varchar(50) comment '' , - nation varchar(50) comment '' , - province varchar(50) comment 'ʡ' , - city varchar(50) comment 'м' , - area_code varchar(50) not null comment '' , - password_type int(2) not null comment 'У' , - real_account varchar(50) comment 'ʵ˺' , - pwd varchar(50) not null comment '' , - check_status int(2) not null comment '˰֤״̬' , - fail_reason varchar(255) comment 'һ֤ʧԭ' + create_time datetime comment '����ʱ��' , + update_time datetime comment '�޸�ʱ��' , + creator bigint comment '������id' , + delete_type int default 0 comment '�Ƿ�ɾ��' , + tenant_key varchar(10) comment '�⻧KEY' , + tax_agent_id bigint not null comment '��˰�۽�������ID' , + tax_code varchar(50) not null comment '˰��' , + tax_registration_number varchar(50) comment '�Ǽ����' , + department_code varchar(50) comment '���ű��' , + department_name varchar(50) comment '��������' , + nation varchar(50) comment '����' , + province varchar(50) comment 'ʡ��' , + city varchar(50) comment '�м�' , + area_code varchar(50) not null comment '��������' , + password_type int(2) not null comment '����У������' , + real_account varchar(50) comment 'ʵ���˺�' , + pwd varchar(50) not null comment '����' , + check_status int(2) not null comment '��˰��֤״̬' , + fail_reason varchar(255) comment '���һ����֤ʧ��ԭ��' ) ; diff --git a/resource/sqlupgrade/Oracle/sql202307180403.sql b/resource/sqlupgrade/Oracle/sql202307180403.sql index b713207b6..c34456078 100644 --- a/resource/sqlupgrade/Oracle/sql202307180403.sql +++ b/resource/sqlupgrade/Oracle/sql202307180403.sql @@ -8,7 +8,7 @@ create table hrsa_tax_agent_tax_return tenant_key varchar2(10), tax_agent_id number not null, tax_code varchar2(50) not null, - tax_registration_number varchar2(50) not null, + tax_registration_number varchar2(50) , department_code varchar2(50), department_name varchar2(50), nation varchar2(50), diff --git a/resource/sqlupgrade/PG/sql202307180403.sql b/resource/sqlupgrade/PG/sql202307180403.sql index bc4ebcfa6..d224c62a8 100644 --- a/resource/sqlupgrade/PG/sql202307180403.sql +++ b/resource/sqlupgrade/PG/sql202307180403.sql @@ -8,7 +8,7 @@ create table hrsa_tax_agent_tax_return tenant_key varchar(10), tax_agent_id bigint not null, tax_code varchar(50) not null, - tax_registration_number varchar(50) not null, + tax_registration_number varchar(50) , department_code varchar(50), department_name varchar(50), nation varchar(50), diff --git a/resource/sqlupgrade/SQLServer/sql202307180403.sql b/resource/sqlupgrade/SQLServer/sql202307180403.sql index 8d807cf33..5a9e63cb3 100644 --- a/resource/sqlupgrade/SQLServer/sql202307180403.sql +++ b/resource/sqlupgrade/SQLServer/sql202307180403.sql @@ -8,7 +8,7 @@ create table hrsa_tax_agent_tax_return tenant_key nvarchar(10), tax_agent_id bigint not null, tax_code nvarchar(50) not null, - tax_registration_number nvarchar(50) not null, + tax_registration_number nvarchar(50), department_code nvarchar(50), department_name nvarchar(50), nation nvarchar(50), diff --git a/resource/sqlupgrade/ST/sql202307180403.sql b/resource/sqlupgrade/ST/sql202307180403.sql index 3a72f6ecc..fb5e8e455 100644 --- a/resource/sqlupgrade/ST/sql202307180403.sql +++ b/resource/sqlupgrade/ST/sql202307180403.sql @@ -8,7 +8,7 @@ create table hrsa_tax_agent_tax_return tenant_key varchar2(10), tax_agent_id number not null, tax_code varchar2(50) not null, - tax_registration_number varchar2(50) not null, + tax_registration_number varchar2(50) , department_code varchar2(50), department_name varchar2(50), nation varchar2(50), From 3bc0f59d0ae3ebd006e364e74f3f9978bdd20c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 24 Aug 2023 18:20:17 +0800 Subject: [PATCH 033/298] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/salaryitem/bo/SysSalaryItemBO.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java index 494338449..d22e3fcc7 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java @@ -9,7 +9,6 @@ import com.engine.salary.enums.SalaryRoundingModeEnum; import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; -import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.util.SalaryI18nUtil; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; @@ -178,13 +177,22 @@ public class SysSalaryItemBO { .name(sysSalaryItemPO.getName()) .systemType(SalarySystemTypeEnum.SYSTEM.getValue()) .sysSalaryItemId(sysSalaryItemPO.getId()) + .useDefault(sysSalaryItemPO.getUseDefault()) + .useInEmployeeSalary(sysSalaryItemPO.getUseInEmployeeSalary()) + .roundingMode(sysSalaryItemPO.getRoundingMode()) + .pattern(sysSalaryItemPO.getPattern()) + .valueType(sysSalaryItemPO.getValueType()) .dataType(sysSalaryItemPO.getDataType()) + .formulaId(sysSalaryItemPO.getFormulaId()) .description(sysSalaryItemPO.getDescription()) + .canEdit(sysSalaryItemPO.getCanEdit()) .creator(employeeId) - .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .deleteType(NumberUtils.INTEGER_ZERO) .createTime(now) .updateTime(now) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .taxAgentIds(sysSalaryItemPO.getTaxAgentIds()) + .sharedType(sysSalaryItemPO.getSharedType()) .build(); } } From 9caf8126f2da7657f7087c6e07fa54599c000f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 25 Aug 2023 17:17:51 +0800 Subject: [PATCH 034/298] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryAcctRecordServiceImpl.java | 48 ++++++++++++------- .../impl/TaxDeclareFailServiceImpl.java | 4 +- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index cc1ffcd5c..9b4b123f6 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -103,6 +103,15 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user); } + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + @Override public SalaryAcctRecordPO getById(Long id) { @@ -634,31 +643,34 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // salaryAcctRecordPO.setRootId(Objects.equals(salaryAcctRecordPO.getRootId(), 0L) ? salaryAcctRecordPO.getId() : salaryAcctRecordPO.getRootId()); } - // 保存回算前的薪资核算结果 + // 查询本次薪资核算记录关联的个税扣缴义务人 + List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordPO.getId())); + // 如果已经存在税款所属期为8月份的薪资核算记录,就不能再重新核算1-7月份的薪资核算记录了 + // 更新个税申报记录的标记(重新核算会影响个税申报表) + Map> taxCycleKeyTaxAgentIdMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle, SalaryAcctTaxAgentPO::getTaxAgentId); + for (Map.Entry> entry : taxCycleKeyTaxAgentIdMap.entrySet()) { + getTaxDeclareRecordService(user).updateByTaxCycleAndTaxAgentIds(entry.getKey(), entry.getValue()); + } + salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); + salaryAcctRecordPO.setUpdateTime(new Date()); if (!isReCalc) { - getSalaryAcctResultService(user).reCalc(salaryAcctRecordPO.getId()); + salaryAcctRecordPO.setBackCalcStatus(1); + salaryAcctRecordPO.setSuperId(salaryAcctRecordPO.getId()); + salaryAcctRecordPO.setRootId(Objects.equals(salaryAcctRecordPO.getRootId(), 0L) ? salaryAcctRecordPO.getId() : salaryAcctRecordPO.getRootId()); } - // 撤回工资单 - getSalarySendService(user).revokeSalaryBill(salaryAcctRecordPO); - - // 重新核算或者回算时,若本次薪资核算记录已经申报了,则本次薪资核算记录下的所有个税扣缴义务人在相同税款所属期内的所有薪资核算记录的状态都应该从已申报变更为已归档 - // 过滤获取所在税款所属期内该个税扣缴义务人所有的薪资核算记录ID - List needUpdateSalaryAcctRecordIds = selfSalaryAcctRecordPOS.stream().filter(po -> po.getTaxCycle().equals(salaryAcctRecordPO.getTaxCycle())) - .map(SalaryAcctRecordPO::getId).collect(Collectors.toList()); - if (Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue())) { - if (needUpdateSalaryAcctRecordIds != null && needUpdateSalaryAcctRecordIds.size() > 0) { - // 更新薪资核算记录的状态 - updateStatusByIds(needUpdateSalaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); - } - // 删除个税申报表及往期累计情况 - getTaxDeclarationService(user).delete(salaryAcctRecordPO); - } - // 更新薪资核算记录的状态 salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); salaryAcctRecordPO.setUpdateTime(new Date()); getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO); + // 保存回算前的薪资核算结果 + if (!isReCalc) { + getSalaryAcctResultService(user).reCalc(salaryAcctRecordPO.getId()); + } + + // 撤回工资单 + getSalarySendService(user).revokeSalaryBill(salaryAcctRecordPO); + //删除报表缓存 getSalaryStatisticsReportService(user).removeReportCache(); } diff --git a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java index 1a8b7b508..d1d219c2d 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java @@ -85,8 +85,8 @@ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFail @Override public void saveBatch(List taxDeclareFails) { if (CollectionUtils.isNotEmpty(taxDeclareFails)) { - - getTaxDeclareFailMapper().batchInsert(taxDeclareFails); + taxDeclareFails.forEach(getTaxDeclareFailMapper()::insertIgnoreNull); +// getTaxDeclareFailMapper().batchInsert(taxDeclareFails); } } } From c29c032ef5e8d778eb7c480742f17165aca8f63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 25 Aug 2023 17:37:39 +0800 Subject: [PATCH 035/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E5=8A=A0?= =?UTF-8?q?=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalarySysConfServiceImpl.java | 46 ++++++++++++++++--- .../web/SalarySystemConfigController.java | 2 +- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 2a141497f..b61775290 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -19,6 +19,7 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.archive.SalaryArchiveItemMapper; import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; @@ -35,6 +36,7 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.sys.constant.SalarySysConstant; import com.engine.salary.sys.entity.param.AppSettingSaveParam; import com.engine.salary.sys.entity.param.OrderRuleParam; @@ -138,6 +140,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return MapperProxyFactory.getProxy(SpecialAddDeductionMapper.class); } + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } + /** * 操作是否需要申报功能 @@ -447,7 +453,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe @Override public List getListByCodes(List codes) { - if(CollectionUtils.isEmpty(codes)){ + if (CollectionUtils.isEmpty(codes)) { return Collections.emptyList(); } return getSalarySysConfMapper().getListByCodes(codes); @@ -519,11 +525,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } SalarySysConfPO salaryAcctEmployeeRule = salarySysConfMap.get(SALARY_ACCT_EMPLOYEE_RULE); - if (salaryAcctEmployeeRule == null ) { + if (salaryAcctEmployeeRule == null) { // 薪资核算人员匹配规则 appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue()); } else { - appSettingVO.setSalaryAcctEmployeeRule( SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue() ); + appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue()); } SalarySysConfPO withDrawRule = salarySysConfMap.get(WITHDRAW_TAX_DECLARATION); @@ -544,7 +550,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe SalarySysConfPO salarySendFeedbackPO = salarySysConfMap.get(SALARY_SEND_FEEDBACK); - if (salarySendFeedbackPO == null ) { + if (salarySendFeedbackPO == null) { // 是否开启工资单反馈,默认不开启 appSettingVO.setSalarySendFeedback("0"); } else { @@ -1045,14 +1051,40 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } return 1; }); - int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get(); - if (flag == 14) { + Future submit14 = fixedThreadPool.submit(() -> { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + List taxDeclarationValuePO = getTaxDeclarationValueMapper().listAll(); + if (CollectionUtils.isNotEmpty(taxDeclarationValuePO)) { + taxDeclarationValuePO.forEach(po -> { + if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { + encryptUtil.decrypt(po, TaxDeclarationValuePO.class); + } else { + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + } + }); + TaxDeclarationValueMapper mapper = sqlSession.getMapper(TaxDeclarationValueMapper.class); + taxDeclarationValuePO.forEach(mapper::updateIgnoreNull); + sqlSession.commit(); + log.info("finish hrsa_tax_declaration_detail"); + } + } catch (Exception e) { + sqlSession.rollback(); + log.error("fail hrsa_tax_declaration_detail", e); + return 0; + } finally { + sqlSession.close(); + } + return 1; + }); + int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get(); + if (flag == 15) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "success", 30); } else { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); } Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS); - return flag == 14; + return flag == 15; } catch (Exception e) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS); diff --git a/src/com/engine/salary/web/SalarySystemConfigController.java b/src/com/engine/salary/web/SalarySystemConfigController.java index ae1b52d67..1d07bd7d3 100644 --- a/src/com/engine/salary/web/SalarySystemConfigController.java +++ b/src/com/engine/salary/web/SalarySystemConfigController.java @@ -274,7 +274,7 @@ public class SalarySystemConfigController { } /** - * 应用设置 + * 保存加密设置 * * @param request * @param response From b5f9477c90641d60f6b2bae26fd81fe6f752902f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 28 Aug 2023 13:31:11 +0800 Subject: [PATCH 036/298] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308280203.sql | 47 ++ resource/sqlupgrade/GS/sql202308280203.sql | 47 ++ resource/sqlupgrade/JC/sql202308280203.sql | 47 ++ resource/sqlupgrade/Mysql/sql202308280203.sql | 46 ++ .../sqlupgrade/Oracle/sql202308280203.sql | 48 ++ resource/sqlupgrade/PG/sql202308280203.sql | 46 ++ .../sqlupgrade/SQLServer/sql202308280203.sql | 46 ++ resource/sqlupgrade/ST/sql202308280203.sql | 47 ++ ...TaxDeclarationApiFlowRecordQueryParam.java | 6 +- .../po/TaxDeclarationApiFlowRecordPO.java | 6 + .../TaxDeclarationApiFlowWarnReceiverPO.java | 5 + .../mapper/taxagent/TaxAgentMapper.java | 6 + .../salary/mapper/taxagent/TaxAgentMapper.xml | 12 + ...TaxDeclarationApiFlowWarnConfigMapper.java | 81 ++++ .../TaxDeclarationApiFlowWarnConfigMapper.xml | 321 +++++++++++++ ...xDeclarationApiFlowWarnReceiverMapper.java | 82 ++++ ...axDeclarationApiFlowWarnReceiverMapper.xml | 347 ++++++++++++++ .../TaxDeclarationApiFlowRecordMapper.java | 64 +++ .../TaxDeclarationApiFlowRecordMapper.xml | 293 +++++++++++- ...TaxDeclarationApiFlowWarnConfigMapper.java | 13 - .../engine/salary/service/ExtEmpService.java | 2 + .../salary/service/SalaryEmployeeService.java | 14 +- .../salary/service/TaxAgentService.java | 8 + .../TaxDeclarationApiBillingService.java | 35 +- ...TaxDeclarationApiFlowStatisticService.java | 85 ++++ .../TaxDeclarationApiFlowWarnService.java | 14 +- .../service/impl/ExtEmpServiceImpl.java | 5 + .../impl/SalaryEmployeeServiceImpl.java | 10 + .../service/impl/TaxAgentServiceImpl.java | 5 + .../TaxDeclarationApiBillingServiceImpl.java | 162 ++++--- ...eclarationApiFlowStatisticServiceImpl.java | 232 +++++++++ .../TaxDeclarationApiFlowWarnServiceImpl.java | 449 +++++++++--------- 32 files changed, 2270 insertions(+), 361 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202308280203.sql create mode 100644 resource/sqlupgrade/GS/sql202308280203.sql create mode 100644 resource/sqlupgrade/JC/sql202308280203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308280203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308280203.sql create mode 100644 resource/sqlupgrade/PG/sql202308280203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308280203.sql create mode 100644 resource/sqlupgrade/ST/sql202308280203.sql create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.java create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.xml create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.java create mode 100644 src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.xml delete mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java create mode 100644 src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java diff --git a/resource/sqlupgrade/DM/sql202308280203.sql b/resource/sqlupgrade/DM/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308280203.sql b/resource/sqlupgrade/GS/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308280203.sql b/resource/sqlupgrade/JC/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308280203.sql b/resource/sqlupgrade/Mysql/sql202308280203.sql new file mode 100644 index 000000000..ef5d03136 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308280203.sql @@ -0,0 +1,46 @@ +create table hrsa_tax_api_flow_receiver +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + warn_config_id bigint not null comment 'õid' , + employee_id bigint not null comment 'id' , + email varchar(100) comment '' , + mobile varchar(50) comment 'ֻ' +) +; + +create table hrsa_tax_api_flow_record +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + tax_agent_id bigint not null comment '˰۽˵id' , + tax_month datetime not null comment '˰' , + use_time datetime not null comment 'ʹʱ' , + deduct int comment 'Ƿʱûã' , + employee_id bigint not null comment 'ԱID' , + business_type int not null comment 'ӿҵ' , + result_status int not null comment '' +) +; + +create table hrsa_tax_api_flow_warn_config +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + enable_warn int default 0 not null comment 'Ƿ' , + threshold int default 0 not null comment 'ֵ' , + business_id bigint default '0' not null comment 'ϢҵID' +) +; diff --git a/resource/sqlupgrade/Oracle/sql202308280203.sql b/resource/sqlupgrade/Oracle/sql202308280203.sql new file mode 100644 index 000000000..20bac3295 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308280203.sql @@ -0,0 +1,48 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +) +/ + + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +) +/ + + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308280203.sql b/resource/sqlupgrade/PG/sql202308280203.sql new file mode 100644 index 000000000..0f9b2c00b --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308280203.sql @@ -0,0 +1,46 @@ +create table hrsa_tax_api_flow_receiver +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + warn_config_id bigint not null, + employee_id bigint not null, + email varchar(100), + mobile varchar(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_month timestamp not null, + use_time timestamp not null, + deduct int, + employee_id bigint not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id bigint default '0' not null +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308280203.sql b/resource/sqlupgrade/SQLServer/sql202308280203.sql new file mode 100644 index 000000000..d5a06b580 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308280203.sql @@ -0,0 +1,46 @@ +create table hrsa_tax_api_flow_receiver +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + warn_config_id bigint not null, + employee_id bigint not null, + email nvarchar(100), + mobile nvarchar(50) +) +GO + +create table hrsa_tax_api_flow_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_month datetime not null, + use_time datetime not null, + deduct int, + employee_id bigint not null, + business_type int not null, + result_status int not null +) +GO + +create table hrsa_tax_api_flow_warn_config +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id bigint default '0' not null +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308280203.sql b/resource/sqlupgrade/ST/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java index d0a508a08..ef66fa4f4 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java @@ -2,13 +2,13 @@ package com.engine.salary.entity.taxapiflow.param; import com.engine.salary.common.BaseQueryParam; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDate; +import java.util.Date; /** * 流量月度详情查询参数 @@ -27,10 +27,10 @@ public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam { private Long taxAgentId; //开始时间") - private LocalDate startDate; + private Date startDate; //结束时间") - private LocalDate endDate; + private Date endDate; //业务接口类型") private Integer businessType; diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java index ef1c9ba5b..a4fd29999 100644 --- a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java @@ -9,6 +9,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Collection; import java.util.Date; /** @@ -97,4 +98,9 @@ public class TaxDeclarationApiFlowRecordPO implements Serializable { */ private String tenantKey; + + private Collection ids; + private Date useTimeStartDate; + private Date useTimeEndDate; + } diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java index 5ac94d180..350a88160 100644 --- a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Collection; import java.util.Date; /** @@ -29,6 +30,7 @@ public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable { */ private Long id; + /** * 提醒配置的id */ @@ -73,4 +75,7 @@ public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable { * 租户ID */ private String tenantKey; + + + private Collection ids; } diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java index 8a2155271..cae7bcb7e 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java @@ -69,4 +69,10 @@ public interface TaxAgentMapper { List listEmployee(); + /** + * 查询包含删除状态的数据 + * @param taxAgentIds + * @return + */ + List listByIdsIncludeDel(@Param("taxAgentIds") Collection taxAgentIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml index 84e424805..2d9d361d5 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml @@ -238,5 +238,17 @@ where e.status not in (7) + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.java new file mode 100644 index 000000000..c72078fe6 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.java @@ -0,0 +1,81 @@ +package com.engine.salary.mapper.taxapiflow; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclarationApiFlowWarnConfigMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationApiFlowWarnConfigPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxApiFlowWarnConfig 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 批量插入 + * + * @param taxApiFlowWarnConfig + */ + void batchInsert(@Param("collection") List taxApiFlowWarnConfig); + + /** + * 修改,修改所有字段 + * + * @param taxApiFlowWarnConfig 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 修改,忽略null字段 + * + * @param taxApiFlowWarnConfig 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 删除记录 + * + * @param taxApiFlowWarnConfig 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + TaxDeclarationApiFlowWarnConfigPO getOne(); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.xml b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.xml new file mode 100644 index 000000000..190783ccb --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.xml @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + t + . + business_id + , t.create_time + , t.creator + , t.delete_type + , t.enable_warn + , t.id + , t.tenant_key + , t.threshold + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_api_flow_warn_config + + + + business_id, + + + create_time, + + + creator, + + + delete_type, + + + enable_warn, + + + id, + + + tenant_key, + + + threshold, + + + update_time, + + + + + #{businessId}, + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{enableWarn}, + + + #{id}, + + + #{tenantKey}, + + + #{threshold}, + + + #{updateTime}, + + + + + + + + INSERT INTO hrsa_tax_api_flow_warn_config + ( + business_id, + create_time, + creator, + delete_type, + enable_warn, + id, + tenant_key, + threshold, + update_time + ) + VALUES + ( + + #{item.businessId}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.enableWarn}, + #{item.id}, + #{item.tenantKey}, + #{item.threshold}, + #{item.updateTime} + + ) + + + + + INSERT INTO hrsa_tax_api_flow_warn_config ( + business_id, + create_time, + creator, + delete_type, + enable_warn, + id, + tenant_key, + threshold, + update_time + ) + + + select + #{item.businessId,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.enableWarn,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.threshold,jdbcType=DOUBLE}, + #{item.updateTime,jdbcType=DATE} + from dual + + + + + + + INSERT INTO hrsa_tax_api_flow_warn_config ( + business_id, + create_time, + creator, + delete_type, + enable_warn, + id, + tenant_key, + threshold, + update_time + ) + VALUES + ( + #{item.businessId}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.enableWarn}, + #{item.id}, + #{item.tenantKey}, + #{item.threshold}, + #{item.updateTime} + ) + + + + + + UPDATE hrsa_tax_api_flow_warn_config + + business_id=#{businessId}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + enable_warn=#{enableWarn}, + tenant_key=#{tenantKey}, + threshold=#{threshold}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_warn_config + + + business_id=#{businessId}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + enable_warn=#{enableWarn}, + + + tenant_key=#{tenantKey}, + + + threshold=#{threshold}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_warn_config + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_api_flow_warn_config + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.java new file mode 100644 index 000000000..26384e3b4 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.java @@ -0,0 +1,82 @@ +package com.engine.salary.mapper.taxapiflow; + +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclarationApiFlowWarnReceiverMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationApiFlowWarnReceiverPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxApiFlowReceiver 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 批量插入 + * + * @param taxApiFlowReceiver + */ + void batchInsert(@Param("collection") List taxApiFlowReceiver); + + /** + * 修改,修改所有字段 + * + * @param taxApiFlowReceiver 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 修改,忽略null字段 + * + * @param taxApiFlowReceiver 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 删除记录 + * + * @param taxApiFlowReceiver 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + List filterByEmpId(TaxDeclarationApiFlowWarnReceiverSaveParam param); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.xml b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.xml new file mode 100644 index 000000000..5c9942e40 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.xml @@ -0,0 +1,347 @@ + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.email + , t.employee_id + , t.id + , t.mobile + , t.tenant_key + , t.update_time + , t.warn_config_id + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_api_flow_receiver + + + + create_time, + + + creator, + + + delete_type, + + + email, + + + employee_id, + + + id, + + + mobile, + + + tenant_key, + + + update_time, + + + warn_config_id, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{email}, + + + #{employeeId}, + + + #{id}, + + + #{mobile}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{warnConfigId}, + + + + + + + + INSERT INTO hrsa_tax_api_flow_receiver + ( + create_time, + creator, + delete_type, + email, + employee_id, + id, + mobile, + tenant_key, + update_time, + warn_config_id + ) + VALUES + ( + + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.email}, + #{item.employeeId}, + #{item.id}, + #{item.mobile}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.warnConfigId} + + ) + + + + + INSERT INTO hrsa_tax_api_flow_receiver ( + create_time, + creator, + delete_type, + email, + employee_id, + id, + mobile, + tenant_key, + update_time, + warn_config_id + ) + + + select + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.email,jdbcType=VARCHAR}, + #{item.employeeId,jdbcType=DOUBLE}, + #{item.id,jdbcType=DOUBLE}, + #{item.mobile,jdbcType=VARCHAR}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE}, + #{item.warnConfigId,jdbcType=DOUBLE} + from dual + + + + + + + INSERT INTO hrsa_tax_api_flow_receiver ( + create_time, + creator, + delete_type, + email, + employee_id, + id, + mobile, + tenant_key, + update_time, + warn_config_id + ) + VALUES + ( + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.email}, + #{item.employeeId}, + #{item.id}, + #{item.mobile}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.warnConfigId} + ) + + + + + + UPDATE hrsa_tax_api_flow_receiver + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + email=#{email}, + employee_id=#{employeeId}, + mobile=#{mobile}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + warn_config_id=#{warnConfigId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_receiver + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + email=#{email}, + + + employee_id=#{employeeId}, + + + mobile=#{mobile}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + warn_config_id=#{warnConfigId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_receiver + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_api_flow_receiver + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java index 0f6194282..f430e1eb2 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java @@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Collection; +import java.util.List; /** * 个税申报-接口流量使用记录 @@ -16,6 +17,69 @@ import java.util.Collection; **/ @Mapper public interface TaxDeclarationApiFlowRecordMapper { + + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationApiFlowRecordPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxApiFlowRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 修改,修改所有字段 + * + * @param taxApiFlowRecord 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 修改,忽略null字段 + * + * @param taxApiFlowRecord 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 删除记录 + * + * @param taxApiFlowRecord 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + /** * 批量插入 * diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml index 3db4b36b3..6dbe947bb 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml @@ -2,8 +2,290 @@ + + + + + + + + + + + + + + + + + + + t + . + business_type + , t.create_time + , t.creator + , t.deduct + , t.delete_type + , t.employee_id + , t.id + , t.result_status + , t.tax_agent_id + , t.tax_month + , t.tenant_key + , t.update_time + , t.use_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_api_flow_record + + + + business_type, + + + create_time, + + + creator, + + + deduct, + + + delete_type, + + + employee_id, + + + id, + + + result_status, + + + tax_agent_id, + + + tax_month, + + + tenant_key, + + + update_time, + + + use_time, + + + + + #{businessType}, + + + #{createTime}, + + + #{creator}, + + + #{deduct}, + + + #{deleteType}, + + + #{employeeId}, + + + #{id}, + + + #{resultStatus}, + + + #{taxAgentId}, + + + #{taxMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{useTime}, + + + + + + + + UPDATE hrsa_tax_api_flow_record + + business_type=#{businessType}, + create_time=#{createTime}, + creator=#{creator}, + deduct=#{deduct}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + result_status=#{resultStatus}, + tax_agent_id=#{taxAgentId}, + tax_month=#{taxMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + use_time=#{useTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_record + + + business_type=#{businessType}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + deduct=#{deduct}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + result_status=#{resultStatus}, + + + tax_agent_id=#{taxAgentId}, + + + tax_month=#{taxMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + use_time=#{useTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_api_flow_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + - INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, tax_month, use_time, deduct, employee_id, business_type, result_status) VALUES @@ -24,7 +306,8 @@ - INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, tax_month, use_time, deduct, employee_id, business_type, result_status) VALUES @@ -46,7 +329,8 @@ - INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, tax_month, use_time, deduct, employee_id, business_type, result_status) @@ -68,7 +352,8 @@ - INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, tax_month, use_time, deduct, employee_id, business_type, result_status) VALUES diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java deleted file mode 100644 index 93cde6c3b..000000000 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowWarnConfigMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.engine.salary.mapper.taxdeclaration; - -import org.apache.ibatis.annotations.Mapper; - -/** - * 流量不足提醒配置 - * - * @author chengliming - * @date 2022-11-21 16:39:10 - */ -@Mapper -public interface TaxDeclarationApiFlowWarnConfigMapper { -} diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 63c9729e6..8eef60d3e 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -15,6 +15,8 @@ import java.util.Map; public interface ExtEmpService { + List listAll(); + List list(ExtEmpQueryParam param); PageInfo listPage (ExtEmpQueryParam param); diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 297b455c5..aeb1020ed 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -6,12 +6,10 @@ import com.engine.salary.entity.hrm.PositionInfo; import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; -import com.engine.salary.entity.hrm.DeptInfo; -import com.engine.salary.entity.hrm.PositionInfo; -import com.engine.salary.entity.hrm.SubCompanyInfo; -import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; +import java.util.Collection; import java.util.List; +import java.util.Map; /** * 人员信息 @@ -97,4 +95,12 @@ public interface SalaryEmployeeService { List listByParams(List includeQueryParams); + /** + * 根据人员id查询身份证 + * + * @param employeeIds + * @return + */ + Map mapByEmployeeIds(Collection employeeIds); + } diff --git a/src/com/engine/salary/service/TaxAgentService.java b/src/com/engine/salary/service/TaxAgentService.java index 2890f94b8..8dd73f1c4 100644 --- a/src/com/engine/salary/service/TaxAgentService.java +++ b/src/com/engine/salary/service/TaxAgentService.java @@ -250,4 +250,12 @@ public interface TaxAgentService { * @return */ Collection listEmployeeIdsInTaxAgent(Long taxAgentId); + + /** + * 查询包含删除状态的数据 + * + * @param taxAgentIds + * @return + */ + List listByIdsIncludeDel(Collection taxAgentIds); } diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java index 7c7801cdb..409b99903 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -1,6 +1,11 @@ package com.engine.salary.service; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.page.PageInfo; + +import java.util.List; /** * 个税申报计费service @@ -19,21 +24,21 @@ public interface TaxDeclarationApiBillingService { */ void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); -// /** -// * 获取流量使用记录(分页) -// * -// * @param queryParam -// * @return -// */ -// PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); -// -// /** -// * 获取流量使用记录(不分页) -// * -// * @param queryParam -// * @return -// */ -// List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + /** + * 获取流量使用记录(分页) + * + * @param queryParam + * @return + */ + PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + + /** + * 获取流量使用记录(不分页) + * + * @param queryParam + * @return + */ + List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); /** * 导出流量使用记录 diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java new file mode 100644 index 000000000..960bcd23c --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java @@ -0,0 +1,85 @@ +package com.engine.salary.service; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.util.page.PageInfo; + +import java.util.List; + +/** + * 个税申报计费service + * + * @author chengliming + * @date 2022-11-11 14:54:14 + */ +public interface TaxDeclarationApiFlowStatisticService { + + /** + * 获取当前租户的流量统计情况 + * + * @return + */ + TaxDeclarationApiFlowTotalDTO getFlowStatistics(); + + /** + * 获取各主体的流量使用明细(分页) + * + * @param queryParam + * @return + */ + PageInfo pageFlowStatistics(BaseQueryParam queryParam); + + /** + * 获取各主体的流量使用明细(不分页) + * + * @return + */ + List listFlowStatistic(); + + /** + * 获取单个主体的流量月度使用明细(分页) + * + * @param queryParam + * @return + */ + PageInfo pageFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam); + + /** + * 获取单个主体的流量月度使用明细(不分页) + * + * @param queryParam + * @return + */ + List listFlowStatisticDetail(TaxDeclarationApiFlowMonthQueryParam queryParam); + +// /** +// * 导出流量统计 +// * +// * @param map +// * @param dtoList +// */ +// void exportFlowStatistics(Map map, List dtoList); +// +// /** +// * 导出流量月度统计 +// * +// * @param queryParam +// * @param map +// * @param dtoList +// */ +// void exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam, Map map, List dtoList); + + /** + * 查询流量统计数据 + * + * @param apiConfig + * @return + */ + QueryAccountBalanceResponse getQueryAccountBalanceResponse(TaxDeclarationApiConfigPO apiConfig); + +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java index ae981ddd3..c530bdd1a 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -32,25 +32,21 @@ public interface TaxDeclarationApiFlowWarnService { * 获取流量不足提醒对象列表 * * @param warnConfigId - * @param currentTenantKey * @return */ - List getWarnReceiverList(Long warnConfigId, String currentTenantKey); + List getWarnReceiverList(Long warnConfigId); /** * 删除流量不足提醒对象 * * @param id - * @param currentTenantKey */ - void deleteReceiver(Long id, String currentTenantKey); + void deleteReceiver(Long id); /** * 获取提醒对象 * * @param id - * @param currentEmployeeId - * @param currentTenantKey * @return */ TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id); @@ -59,8 +55,6 @@ public interface TaxDeclarationApiFlowWarnService { * 保存或编辑提醒对象 * * @param param - * @param currentEmployeeId - * @param currentTenantKey */ void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param); @@ -68,8 +62,6 @@ public interface TaxDeclarationApiFlowWarnService { * 创建提醒规则 * * @param param - * @param currentEmployeeId - * @param currentTenantKey */ void createMessageRule(CreateMessageRuleParam param); @@ -77,8 +69,6 @@ public interface TaxDeclarationApiFlowWarnService { * 保存流量不足提醒配置 * * @param param - * @param currentEmployeeId - * @param currentTenantKey * @return */ String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param); diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index c311d6086..fe7671522 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -68,6 +68,11 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { return MapperProxyFactory.getProxy(EmployMapper.class); } + @Override + public List listAll() { + return getExternalEmployeeMapper().listAll(); + } + @Override public List list(ExtEmpQueryParam param) { return getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index fb2567f0c..5fda44b47 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -269,4 +269,14 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } return result; } + + @Override + public Map mapByEmployeeIds(Collection employeeIds) { + List simpleUserInfos = getEmployeeByIdsAll((List) employeeIds); + Map result = new HashMap<>(); + simpleUserInfos.forEach(e -> { + result.put(e.getEmployeeId(), e.getIdNo()); + }); + return result; + } } diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index d3cbc3999..ea7fb6fbb 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -798,5 +798,10 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId); } + @Override + public List listByIdsIncludeDel(Collection taxAgentIds) { + return getTaxAgentMapper().listByIdsIncludeDel(taxAgentIds); + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index 8288c1565..ce9dc1efa 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -2,16 +2,21 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.TaxDeclarationApiBillingService; -import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import lombok.Data; @@ -19,39 +24,40 @@ import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import weaver.hrm.User; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; @Slf4j -public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService { - +public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService { + private TaxDeclarationApiFlowRecordMapper getTaxDeclarationApiFlowRecordMapper() { return MapperProxyFactory.getProxy(TaxDeclarationApiFlowRecordMapper.class); } + public TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + public SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } // private SalaryBatchService salaryBatchService; - - private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService; -// public TaxDeclarationApiFlowWarnService getTaxDeclarationApiFlowWarnService(User user) { -// return ServiceUtil.getService(TaxDeclarationApiFlowWarnServiceImpl.class, user); -// } -// private ComInfoCache comInfoCache; - -// private ExtEmployeeService extEmployeeService; + + public TaxDeclarationApiFlowWarnService getTaxDeclarationApiFlowWarnService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowWarnServiceImpl.class, user); + } + + + + private ExtEmpService extEmployeeService; @Override public void updateApiFlowInfo(ApiFlowUpdateWrapper updateWrapper) { // 保存流量使用详情 -// saveApiFlowRecord(updateWrapper); + saveApiFlowRecord(updateWrapper); // 流量不足提醒 -// taxDeclarationApiFlowWarnService.sendFlowWarnMessage(updateWrapper); + getTaxDeclarationApiFlowWarnService(user).sendFlowWarnMessage(updateWrapper); } private void saveApiFlowRecord(ApiFlowUpdateWrapper updateWrapper) { @@ -61,63 +67,62 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax } } -// @Override -// public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { -// LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); -// Page flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); -// List records = flowRecordPOPage.getRecords(); -// if (records.isEmpty()) { -// return new PageInfo<>(); -// } -// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); -// // 转换数据 -// AtomicInteger indexNum = new AtomicInteger(1); -// List listDTOS = records.stream().map(e -> -// TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) -// ).collect(Collectors.toList()); -// return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS); -// } -// -// @Override -// public List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { -// LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); -// List list = queryChainWrapper.list(); -// if (list.isEmpty()) { -// return new ArrayList<>(); -// } -// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); -// // 转换数据 -// AtomicInteger indexNum = new AtomicInteger(1); -// return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); -// } -// -// private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list, String currentTenantKey) { -// Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); -// // 获取人员信息 -// List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); -// Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); -// Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); -// List extEmployeePOS = extEmployeeService.listAll(currentTenantKey); -// Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); -// // 获取个税扣缴义务人信息 -// List taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values())); -// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); -// return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); -// } -// -// private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { -// LambdaQueryChainWrapper chainWrapper = new LambdaQueryChainWrapper<>(getTaxDeclarationApiFlowRecordMapper()) -// .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .eq(TaxDeclarationApiFlowRecordPO::getTenantKey) -// .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId()) -// .eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType()) -// .eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult()); -// if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) { -// chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate()) -// .le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate()); -// } -// return chainWrapper; -// } + @Override + public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + TaxDeclarationApiFlowRecordPO queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + List records = getTaxDeclarationApiFlowRecordMapper().listSome(queryChainWrapper); + + if (records.isEmpty()) { + return new PageInfo<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); + // 转换数据 + AtomicInteger indexNum = new AtomicInteger(1); + List listDTOS = records.stream().map(e -> + TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) + ).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listDTOS, TaxDeclarationApiFlowRecordListDTO.class); + } + + @Override + public List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + TaxDeclarationApiFlowRecordPO queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + List list = getTaxDeclarationApiFlowRecordMapper().listSome(queryChainWrapper); + if (list.isEmpty()) { + return new ArrayList<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); + // 转换数据 + AtomicInteger indexNum = new AtomicInteger(1); + return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); + } + + private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list) { + Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); + // 获取人员信息 + List employeeComInfos =getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(employeeTaxAgentMap.keySet())); + Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); + List extEmployeePOS = extEmployeeService.listAll(); + Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId); + // 获取个税扣缴义务人信息 + List taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values())); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); + return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); + } + + private TaxDeclarationApiFlowRecordPO getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam) { + TaxDeclarationApiFlowRecordPO build = TaxDeclarationApiFlowRecordPO.builder() + .taxAgentId(queryParam.getTaxAgentId()) + .businessType(queryParam.getBusinessType()) + .resultStatus(queryParam.getResult()) + .build(); + if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) { + build.setUseTimeStartDate(queryParam.getStartDate()); + build.setUseTimeEndDate(queryParam.getEndDate()); + } + return build; + } // @Override // public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map) { @@ -161,6 +166,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax // salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); // } // + /** * 封装一些临时的集合类,便于方法复用 */ @@ -191,7 +197,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements Tax // 接口类型 private EnumDeclareApiBusinessType businessType; - public ApiFlowUpdateWrapper( Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { + public ApiFlowUpdateWrapper(Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { this.taxYearMonth = taxYearMonth; this.apiFlowDetailPOList = new ArrayList<>(); this.apiConfig = apiConfig; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java new file mode 100644 index 000000000..26bb2777f --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java @@ -0,0 +1,232 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +import com.engine.salary.entity.taxapiflow.response.QueryDetailsByTaxNumberResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; +import com.engine.salary.util.*; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author chengliming + * @date 2022-11-11 2:57 PM + **/ +@Slf4j +public class TaxDeclarationApiFlowStatisticServiceImpl extends Service implements TaxDeclarationApiFlowStatisticService { + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } +// private SalaryBatchService salaryBatchService; + + @Override + public TaxDeclarationApiFlowTotalDTO getFlowStatistics() { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + QueryAccountBalanceResponse response = getQueryAccountBalanceResponse(apiConfigPO); + apiConfigPO.setTotality(Long.parseLong(response.getBody().getTotal())); + apiConfigPO.setRemain(Long.parseLong(response.getBody().getSurplus())); + apiConfigPO.setLastUpdateTime(new Date()); + getTaxDeclarationApiConfigService(user).update(apiConfigPO); + return TaxDeclarationApiFlowTotalDTO.builder() + .total(apiConfigPO.getTotality()) + .remain(apiConfigPO.getRemain()) + .used(apiConfigPO.getTotality() - apiConfigPO.getRemain()) + .lastUpdateTime(SalaryDateUtil.getFormatLocalDateTime(apiConfigPO.getLastUpdateTime())) + .build(); + } + + @Override + public PageInfo pageFlowStatistics(BaseQueryParam queryParam) { + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listFlowStatistic()); + } + + @Override + public List listFlowStatistic() { + TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(true); + QueryAccountBalanceResponse response = getQueryAccountBalanceResponse(config); + List details = Optional.of(response).map(e -> e.getBody().getTaxList()).orElse(new ArrayList<>()); + if (details.isEmpty()) { + log.info("details is empty"); + return new ArrayList<>(); + } + Set taxCodes = details.stream().map(QueryAccountBalanceResponse.Detail::getTaxNumber).collect(Collectors.toSet()); + List returnPOList = getTaxAgentTaxReturnService(user).getByTaxCodes(taxCodes); + if (returnPOList.isEmpty()) { + log.info("TaxAgentTaxReturnPO is empty"); + return new ArrayList<>(); + } + Set taxAgentIds = returnPOList.stream().map(TaxAgentTaxReturnPO::getTaxAgentId).collect(Collectors.toSet()); + List taxAgentPOList = getTaxAgentService(user).listByIdsIncludeDel(taxAgentIds); + if (taxAgentPOList.isEmpty()) { + log.info("TaxAgentPO is empty"); + return new ArrayList<>(); + } + + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOList, TaxAgentPO::getId, TaxAgentPO::getName); + Map> taxCodeMap = returnPOList.stream().collect(Collectors.groupingBy(TaxAgentTaxReturnPO::getTaxCode)); + List flowStatisticDTOS = new ArrayList<>(); + for (QueryAccountBalanceResponse.Detail detail : details) { + List list = taxCodeMap.getOrDefault(detail.getTaxNumber(), new ArrayList<>()); + for (TaxAgentTaxReturnPO returnPO : list) { + TaxDeclarationApiFlowStatisticListDTO statisticDTO = new TaxDeclarationApiFlowStatisticListDTO(); + statisticDTO.setId(IdGenerator.generate()); + statisticDTO.setUsed(Integer.parseInt(detail.getUsed())); + statisticDTO.setTaxAgentId(returnPO.getTaxAgentId()); + statisticDTO.setTaxAgentName(taxAgentMap.get(returnPO.getTaxAgentId())); + flowStatisticDTOS.add(statisticDTO); + } + } + flowStatisticDTOS.sort((o1, o2) -> o2.getTaxAgentId().compareTo(o1.getTaxAgentId())); + for (int i = 0; i < flowStatisticDTOS.size(); i++) { + flowStatisticDTOS.get(i).setIndexNum(i + 1); + } + return flowStatisticDTOS; + } + + @Override + public PageInfo pageFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + List dtoList = listFlowStatisticDetail(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, TaxDeclarationApiFlowStatisticDetailListDTO.class); + } + + @Override + public List listFlowStatisticDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnService(user).getByTaxAgentId(queryParam.getTaxAgentId()); + SalaryAssert.notNull(taxReturnPO, SalaryI18nUtil.getI18nLabel(184065, "个税扣缴义务人暂无报税信息")); + List taxAgentPOS = getTaxAgentService(user).listByIdsIncludeDel(Collections.singleton(taxReturnPO.getTaxAgentId())); + SalaryAssert.notEmpty(taxAgentPOS, SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + QueryDetailsByTaxNumberResponse response = getQueryDetailsByTaxNumberResponse(apiConfigPO, taxReturnPO.getTaxCode()); + List details = Optional.of(response) + .map(QueryDetailsByTaxNumberResponse::getBody) + .map(QueryDetailsByTaxNumberResponse.Body::getDetail) + .orElse(new ArrayList<>()); + if (details.isEmpty()) { + return new ArrayList<>(); + } + details.sort((o1, o2) -> Integer.valueOf(o2.getMonth()).compareTo(Integer.valueOf(o1.getMonth()))); + details = details.stream().filter(detail -> detail.getMonthValue() >= queryParam.getStartTaxMonth() + && detail.getMonthValue() <= queryParam.getEndTaxMonth()).collect(Collectors.toList()); + + return details.stream().map(e -> TaxDeclarationApiFlowStatisticDetailListDTO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentPOS.get(0).getId()) + .taxAgentName(taxAgentPOS.get(0).getName()) + .taxMonth(LocalDate.parse(e.getMonth() + "01", DateTimeFormatter.ofPattern("yyyyMMdd")).format(SalaryDateUtil.MONTH_FORMATTER)) + .used(Integer.valueOf(e.getUsed())) + .build()).collect(Collectors.toList()); + } + +// @Override +// public void exportFlowStatistics(Map map, List dtoList) { +// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); +// // 表头 +// List headers = exportWrapper.getHeaders(); +// headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); +// headers.add(SalaryI18nUtil.getI18nLabel( 159084, "已使用流量")); +// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); +// // 组装数据 +// for (TaxDeclarationApiFlowStatisticListDTO dto : dtoList) { +// List row = new ArrayList<>(); +// row.add(dto.getTaxAgentName()); +// row.add(dto.getUsed()); +// exportWrapper.getRows().add(row); +// } +// // 生成表格 +// buildExcelData(exportWrapper); +// } + +// @Override +// public void exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam, Map map, List dtoList) { +// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); +// // 表头 +// List headers = exportWrapper.getHeaders(); +// headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); +// headers.add(SalaryI18nUtil.getI18nLabel( 86176, "税款所属期")); +// headers.add(SalaryI18nUtil.getI18nLabel( 159087, "月使用流量数")); +// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); +// // 组装数据 +// for (TaxDeclarationApiFlowStatisticDetailListDTO dto : dtoList) { +// List row = new ArrayList<>(); +// row.add(dto.getTaxAgentName()); +// row.add(dto.getTaxMonth()); +// row.add(dto.getUsed()); +// exportWrapper.getRows().add(row); +// } +// // 生成表格 +// /** +// wrapper.getExcelSheetData().setRows(wrapper.getRows()); +// wrapper.getSheetList().add(wrapper.getExcelSheetData()); +// salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); +// }} + + + public QueryAccountBalanceResponse getQueryAccountBalanceResponse(TaxDeclarationApiConfigPO apiConfig) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_ACCOUNT_BALANCE; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("getQueryAccountBalanceResponse response : {}", res); + QueryAccountBalanceResponse response = JsonUtil.parseObject(res, QueryAccountBalanceResponse.class); + QueryAccountBalanceResponse.Body body = Optional.ofNullable(response).map(QueryAccountBalanceResponse::getBody).orElse(null); + String code = Optional.ofNullable(response) + .map(QueryAccountBalanceResponse::getHead) + .map(SzyhResponseHead::getCode).orElse("error"); + String msg = Optional.ofNullable(response) + .map(QueryAccountBalanceResponse::getHead) + .map(SzyhResponseHead::getMsg).orElse(SalaryI18nUtil.getI18nLabel(184014, "税局接口异常,请稍后再试")); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(code), msg); + SalaryAssert.notNull(body, SalaryI18nUtil.getI18nLabel(184014, "税局接口异常,请稍后再试")); + return response; + } + + public QueryDetailsByTaxNumberResponse getQueryDetailsByTaxNumberResponse(TaxDeclarationApiConfigPO apiConfig, String taxCode) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_DETAILS_BY_TAX_NUMBER; + Map params = new HashMap<>(1); + params.put("taxNumber", taxCode); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("getQueryDetailsByTaxNumberResponse response : {}", res); + QueryDetailsByTaxNumberResponse response = JsonUtil.parseObject(res, QueryDetailsByTaxNumberResponse.class); + QueryDetailsByTaxNumberResponse.Body body = Optional.ofNullable(response).map(QueryDetailsByTaxNumberResponse::getBody).orElse(null); + String code = Optional.ofNullable(response) + .map(QueryDetailsByTaxNumberResponse::getHead) + .map(SzyhResponseHead::getCode).orElse("error"); + String msg = Optional.ofNullable(response) + .map(QueryDetailsByTaxNumberResponse::getHead) + .map(SzyhResponseHead::getMsg).orElse(SalaryI18nUtil.getI18nLabel(184014, "税局接口异常,请稍后再试")); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(code), msg); + SalaryAssert.notNull(body, SalaryI18nUtil.getI18nLabel(184014, "税局接口异常,请稍后再试")); + return response; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 8eeeabbd2..5ecd2e175 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -1,176 +1,159 @@ -//package com.engine.salary.service.impl; -// -//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; -//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; -//import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO; -//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; -//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; -//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; -//import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowWarnConfigMapper; -//import com.engine.salary.service.SalaryEmployeeService; -//import com.engine.salary.service.TaxDeclarationApiFlowWarnService; -//import com.engine.salary.util.SalaryEntityUtil; -//import com.weaver.common.base.entity.result.WeaResult; -//import com.weaver.common.distribution.genid.IdGenerator; -//import com.weaver.framework.spring.annotation.AopClass; -//import com.weaver.hrm.salary.common.OptionDTO; -//import com.weaver.hrm.salary.dao.TaxDeclarationApiFlowWarnReceiverMapper; -//import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO; -//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; -//import com.weaver.hrm.salary.entity.taxapiflow.param.CreateMessageRuleParam; -//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; -//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; -//import com.weaver.hrm.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; -//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum; -//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; -//import com.weaver.hrm.salary.service.TaxAgentService; -//import com.weaver.hrm.salary.service.TaxDeclarationApiFlowStatisticService; -//import com.weaver.hrm.salary.util.SalaryAssert; -//import com.weaver.hrm.salary.util.SalaryI18nUtil; -//import com.weaver.mc.api.async.AsyncSystemMessageRest; -//import com.weaver.mc.api.entity.*; -//import com.weaver.mc.api.rest.RuleRest; -//import com.weaver.teams.domain.user.SimpleEmployee; -//import lombok.extern.slf4j.Slf4j; -//import org.apache.commons.lang3.StringUtils; -//import org.springframework.stereotype.Service; -//import org.springframework.transaction.annotation.Transactional; -// -//import java.time.LocalDateTime; -//import java.util.Collections; -//import java.util.List; -//import java.util.Map; -//import java.util.Objects; -//import java.util.stream.Collectors; -// -///** -// * @author chengliming -// * @date 2022-11-11 2:57 PM -// **/ -//@Service -//@Slf4j -//@AopClass -//public class TaxDeclarationApiFlowWarnServiceImpl implements TaxDeclarationApiFlowWarnService { -// private TaxDeclarationApiFlowWarnConfigMapper taxDeclarationApiFlowWarnConfigMapper; -// private TaxDeclarationApiFlowWarnReceiverMapper taxDeclarationApiFlowWarnReceiverMapper; -// private SalaryEmployeeService salaryEmployeeService; -// private RuleRest ruleRest; -// private AsyncSystemMessageRest asyncSystemMessageRest; -// private TaxAgentService taxAgentService; -// private TaxDeclarationApiFlowStatisticService taxDeclarationApiFlowStatisticService; -// -// @Override -// public TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey) { -// return new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnConfigMapper) -// .eq(TaxDeclarationApiFlowWarnConfigPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .eq(TaxDeclarationApiFlowWarnConfigPO::getTenantKey, currentTenantKey) -// .one(); -// } -// -// @Override -// public List getWarnReceiverList(Long warnConfigId, String currentTenantKey) { -// List receiverPOList = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getWarnConfigId, warnConfigId) -// .list(); -// -// List salaryEmployees = taxAgentService.listEmployees(currentTenantKey); -// Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, TaxAgentEmployeePO::getEmployeeId, TaxAgentEmployeePO::getUsername); -// -// return receiverPOList.stream().map(e -> TaxDeclarationApiFlowWarnReceiverListDTO.builder() -// .employeeName(salaryEmployeeMap.get(e.getEmployeeId())) -// .employeeId(e.getEmployeeId()) -// .mobile(e.getMobile()) -// .email(e.getEmail()) -// .id(e.getId()) -// .build()).collect(Collectors.toList()); -// } -// -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void deleteReceiver(Long id, String currentTenantKey) { -// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id, currentTenantKey); -// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); -// new LambdaUpdateChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) -// .set(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getId, id) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .update(); -// } -// -// @Override -// public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id) { -// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id, currentTenantKey); -// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); -// // 查找人员信息 -// List simpleEmployees = salaryEmployeeService.listAll(currentTenantKey); -// Map empMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); -// SimpleEmployee simpleEmployee = empMap.get(receiverPO.getEmployeeId()); -// SalaryAssert.notNull(simpleEmployee, SalaryI18nUtil.getI18nLabel( 139811, "人员不存在")); -// -// return TaxDeclarationApiFlowWarnReceiverFormDTO.builder() -// .id(receiverPO.getId()) -// .employee(Collections.singletonList(new OptionDTO(receiverPO.getEmployeeId().toString(), simpleEmployee.getUsername()))) -// .email(receiverPO.getEmail()) -// .mobile(receiverPO.getMobile()) -// .emailOptions(StringUtils.isNotEmpty(simpleEmployee.getEmail()) ? Collections.singletonList(simpleEmployee.getEmail()) : null) -// .build(); -// } -// -// private TaxDeclarationApiFlowWarnReceiverPO getWarnReceiverPOById(Long id, String currentTenantKey) { -// return new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getId, id) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) -// .one(); -// } -// -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param) { -// if (param.getId() != null) { -// TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(param.getId(), currentTenantKey); -// SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); -// if (param.getEmployeeId() != null && !receiverPO.getEmployeeId().equals(param.getEmployeeId())) { -// filterByEmpId(param, currentTenantKey); -// receiverPO.setEmployeeId(param.getEmployeeId()); -// } -// receiverPO.setUpdateTime(LocalDateTime.now()); -// receiverPO.setEmail(param.getEmail()); -// receiverPO.setMobile(param.getMobile()); -// taxDeclarationApiFlowWarnReceiverMapper.updateById(receiverPO); -// } else { -// filterByEmpId(param, currentTenantKey); -// TaxDeclarationApiFlowWarnReceiverPO receiverPO = TaxDeclarationApiFlowWarnReceiverPO.builder() -// .id(IdGenerator.generate()) -// .email(param.getEmail()) -// .mobile(param.getMobile()) -// .employeeId(param.getEmployeeId()) -// .warnConfigId(param.getWarnConfigId()) -// .createTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .tenantKey(currentTenantKey) -// .creator(currentEmployeeId) -// .build(); -// taxDeclarationApiFlowWarnReceiverMapper.insert(receiverPO); -// } -// } -// -// private void filterByEmpId(TaxDeclarationApiFlowWarnReceiverSaveParam param, String currentTenantKey) { -// List another = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowWarnReceiverMapper) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getWarnConfigId, param.getWarnConfigId()) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getEmployeeId, param.getEmployeeId()) -// .eq(TaxDeclarationApiFlowWarnReceiverPO::getTenantKey, currentTenantKey) -// .list(); -// SalaryAssert.isEmpty(another, SalaryI18nUtil.getI18nLabel(184007, "当前人员对应的提醒对象已存在,请更换人员后尝试")); -// } -// -// @Override -// public void createMessageRule(CreateMessageRuleParam param) { +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.OptionDTO; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; +import com.engine.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.taxapiflow.TaxDeclarationApiFlowWarnConfigMapper; +import com.engine.salary.mapper.taxapiflow.TaxDeclarationApiFlowWarnReceiverMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author chengliming + * @date 2022-11-11 2:57 PM + **/ +@Slf4j +public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements TaxDeclarationApiFlowWarnService { + + private TaxDeclarationApiFlowWarnConfigMapper getTaxDeclarationApiFlowWarnConfigMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiFlowWarnConfigMapper.class); + } + + private TaxDeclarationApiFlowWarnReceiverMapper getTaxDeclarationApiFlowWarnReceiverMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiFlowWarnReceiverMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private TaxDeclarationApiFlowStatisticService getTaxDeclarationApiFlowStatisticService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowStatisticServiceImpl.class, user); + } + + @Override + public TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey) { + return getTaxDeclarationApiFlowWarnConfigMapper().getOne(); + } + + @Override + public List getWarnReceiverList(Long warnConfigId) { + List receiverPOList = getTaxDeclarationApiFlowWarnReceiverMapper().listSome(TaxDeclarationApiFlowWarnReceiverPO + .builder() + .warnConfigId(warnConfigId) + .build()); + + List salaryEmployees = getTaxAgentService(user).listEmployees(); + Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, TaxAgentEmployeePO::getEmployeeId, TaxAgentEmployeePO::getUsername); + + return receiverPOList.stream().map(e -> TaxDeclarationApiFlowWarnReceiverListDTO.builder() + .employeeName(salaryEmployeeMap.get(e.getEmployeeId())) + .employeeId(e.getEmployeeId()) + .mobile(e.getMobile()) + .email(e.getEmail()) + .id(e.getId()) + .build()).collect(Collectors.toList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteReceiver(Long id) { + TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id); + SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); + getTaxDeclarationApiFlowWarnReceiverMapper().delete(TaxDeclarationApiFlowWarnReceiverPO.builder().id(id).build()); + } + + @Override + public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id) { + TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id); + SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); + // 查找人员信息 + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); + Map empMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + DataCollectionEmployee simpleEmployee = empMap.get(receiverPO.getEmployeeId()); + SalaryAssert.notNull(simpleEmployee, SalaryI18nUtil.getI18nLabel(139811, "人员不存在")); + + return TaxDeclarationApiFlowWarnReceiverFormDTO.builder() + .id(receiverPO.getId()) + .employee(Collections.singletonList(new OptionDTO(receiverPO.getEmployeeId().toString(), simpleEmployee.getUsername()))) + .email(receiverPO.getEmail()) + .mobile(receiverPO.getMobile()) + .emailOptions(StringUtils.isNotEmpty(simpleEmployee.getEmail()) ? Collections.singletonList(simpleEmployee.getEmail()) : null) + .build(); + } + + private TaxDeclarationApiFlowWarnReceiverPO getWarnReceiverPOById(Long id) { + return getTaxDeclarationApiFlowWarnReceiverMapper().getById(id); + } + + @Override + public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + Date now = new Date(); + if (param.getId() != null) { + TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(param.getId()); + SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); + if (param.getEmployeeId() != null && !receiverPO.getEmployeeId().equals(param.getEmployeeId())) { + filterByEmpId(param); + receiverPO.setEmployeeId(param.getEmployeeId()); + } + receiverPO.setUpdateTime(now); + receiverPO.setEmail(param.getEmail()); + receiverPO.setMobile(param.getMobile()); + getTaxDeclarationApiFlowWarnReceiverMapper().updateIgnoreNull(receiverPO); + } else { + filterByEmpId(param); + TaxDeclarationApiFlowWarnReceiverPO receiverPO = TaxDeclarationApiFlowWarnReceiverPO.builder() + .id(IdGenerator.generate()) + .email(param.getEmail()) + .mobile(param.getMobile()) + .employeeId(param.getEmployeeId()) + .warnConfigId(param.getWarnConfigId()) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .build(); + getTaxDeclarationApiFlowWarnReceiverMapper().insertIgnoreNull(receiverPO); + } + } + + private void filterByEmpId(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + List another = getTaxDeclarationApiFlowWarnReceiverMapper().filterByEmpId(param); + SalaryAssert.isEmpty(another, SalaryI18nUtil.getI18nLabel(184007, "当前人员对应的提醒对象已存在,请更换人员后尝试")); + } + + @Override + public void createMessageRule(CreateMessageRuleParam param) { // CreateRuleEntity createRule = new CreateRuleEntity() // .setBusinessId(param.getBusinessId()) // .setEvent(MessageEvent.PAYROLL) @@ -179,37 +162,38 @@ // log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); // WeaResult weaResult = ruleRest.createRuleV2(createRule); // SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC接口创建规则失败")); -// } -// -// @Override -// @Transactional(rollbackFor = Exception.class) -// public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param) { -// TaxDeclarationApiFlowWarnConfigPO warnConfigPO; -// if (param.getId() != null) { -// warnConfigPO = taxDeclarationApiFlowWarnConfigMapper.selectById(param.getId()); -// SalaryAssert.notNull(warnConfigPO, "提醒规则不存在,请先保存"); -// warnConfigPO.setThreshold(param.getThreshold()); -// warnConfigPO.setEnableWarn(param.getEnable() ? 1 : 0); -// warnConfigPO.setUpdateTime(LocalDateTime.now()); -// taxDeclarationApiFlowWarnConfigMapper.updateById(warnConfigPO); -// } else { -// warnConfigPO = TaxDeclarationApiFlowWarnConfigPO.builder() -// .id(IdGenerator.generate()) -// .businessId(param.getBusinessId()) -// .threshold(param.getThreshold()) -// .enableWarn(param.getEnable() ? 1 : 0) -// .createTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .creator(currentEmployeeId) -// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .tenantKey(currentTenantKey) -// .build(); -// taxDeclarationApiFlowWarnConfigMapper.insert(warnConfigPO); -// } -// if (StringUtils.isNotEmpty(param.getConfig())) { + } + + @Override + public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param) { + Date now = new Date(); + TaxDeclarationApiFlowWarnConfigPO warnConfigPO; + if (param.getId() != null) { + warnConfigPO = getTaxDeclarationApiFlowWarnConfigMapper().getById(param.getId()); + SalaryAssert.notNull(warnConfigPO, "提醒规则不存在,请先保存"); + warnConfigPO.setThreshold(param.getThreshold()); + warnConfigPO.setEnableWarn(param.getEnable() ? 1 : 0); + warnConfigPO.setUpdateTime(now); + getTaxDeclarationApiFlowWarnConfigMapper().updateIgnoreNull(warnConfigPO); + } else { + warnConfigPO = TaxDeclarationApiFlowWarnConfigPO.builder() + .id(IdGenerator.generate()) + .businessId(param.getBusinessId()) + .threshold(param.getThreshold()) + .enableWarn(param.getEnable() ? 1 : 0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getTaxDeclarationApiFlowWarnConfigMapper().insertIgnoreNull(warnConfigPO); + } + if (StringUtils.isNotEmpty(param.getConfig())) { + //todo 消息 // CreateRuleEntity createRule = new CreateRuleEntity() -// .setName(SalaryI18nUtil.getI18nLabel( 159146, "流量不足提醒")) -// .setUser(new UserEntity(currentEmployeeId, currentTenantKey)) +// .setName(SalaryI18nUtil.getI18nLabel(159146, "流量不足提醒")) +// .setUser(new UserEntity(currentEmployeeId)) // .setModule(MessageModule.HRSA) // .setEvent(MessageEvent.PAYROLL) // .setBusinessId(param.getBusinessId().toString()) @@ -217,33 +201,34 @@ // log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); // WeaResult weaResult = ruleRest.createRuleV2(createRule); // SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC接口创建规则失败")); -// } -// return warnConfigPO.getId().toString(); -// } -// -// @Override -// public Long getRuleBusinessId(String currentTenantKey) { -// TaxDeclarationApiFlowWarnConfigPO warnConfig = this.getWarnConfig(currentTenantKey); -// return warnConfig == null ? IdGenerator.generate() : warnConfig.getBusinessId(); -// } -// -// @Override -// public void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { -// TaxDeclarationApiFlowWarnConfigPO warnConfig = getWarnConfig(updateWrapper.getTenantKey()); -// // 未配置或开关关闭 -// if (Objects.isNull(warnConfig) || SalaryOnOffEnum.OFF.getValue().equals(warnConfig.getEnableWarn())) { -// return; -// } -// QueryAccountBalanceResponse response = taxDeclarationApiFlowStatisticService.getQueryAccountBalanceResponse(updateWrapper.getApiConfig()); -// // 剩余流量大于阈值无需提醒 -// if (StringUtils.isNotEmpty(response.getBody().getSurplus()) && Long.parseLong(response.getBody().getSurplus()) > warnConfig.getThreshold()) { -// return; -// } -// List warnReceiverList = getWarnReceiverList(warnConfig.getId(), updateWrapper.getTenantKey()); -// if (warnReceiverList.isEmpty()) { -// log.info("warnReceiverList is empty, send msg fail"); -// return; -// } + } + return warnConfigPO.getId().toString(); + } + + @Override + public Long getRuleBusinessId(String currentTenantKey) { + TaxDeclarationApiFlowWarnConfigPO warnConfig = this.getWarnConfig(currentTenantKey); + return warnConfig == null ? IdGenerator.generate() : warnConfig.getBusinessId(); + } + + @Override + public void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { + TaxDeclarationApiFlowWarnConfigPO warnConfig = getWarnConfig(updateWrapper.getTenantKey()); + // 未配置或开关关闭 + if (Objects.isNull(warnConfig) || SalaryOnOffEnum.OFF.getValue().equals(warnConfig.getEnableWarn())) { + return; + } + QueryAccountBalanceResponse response = getTaxDeclarationApiFlowStatisticService(user).getQueryAccountBalanceResponse(updateWrapper.getApiConfig()); + // 剩余流量大于阈值无需提醒 + if (StringUtils.isNotEmpty(response.getBody().getSurplus()) && Long.parseLong(response.getBody().getSurplus()) > warnConfig.getThreshold()) { + return; + } + List warnReceiverList = getWarnReceiverList(warnConfig.getId()); + if (warnReceiverList.isEmpty()) { + log.info("warnReceiverList is empty, send msg fail"); + return; + } + //todo 消息 // List receivers = warnReceiverList.stream().map(e -> // new UserEntity(e.getEmployeeId(), updateWrapper.getTenantKey()) // .setEmail(e.getEmail()).setPhone(e.getMobile()).setLanguage(6) @@ -253,5 +238,5 @@ // // 发送消息 // WeaResult weaResult = asyncSystemMessageRest.sendMsg(smg); // SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184009, "流量不足提醒发送失败")); -// } -//} + } +} From 1b4c9ce7a70bb9530132fdda504685b8a93e7533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 28 Aug 2023 15:19:57 +0800 Subject: [PATCH 037/298] =?UTF-8?q?=E6=B5=81=E9=87=8F=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DeclarationApiFlowStatisticController.java | 13 ++ .../TaxDeclarationApiFlowWarnController.java | 13 ++ .../TaxDeclarationApiFlowWarnService.java | 6 +- .../TaxDeclarationApiFlowWarnServiceImpl.java | 8 +- ...DeclarationApiFlowStatisticController.java | 101 ++++++++++++ .../TaxDeclarationApiFlowWarnController.java | 146 ++++++++++++++++++ .../TaxDeclarationApiFlowBillingWrapper.java | 5 +- ...TaxDeclarationApiFlowStatisticWrapper.java | 85 ++++++++++ .../TaxDeclarationApiFlowWarnWrapper.java | 86 +++++++++++ 9 files changed, 452 insertions(+), 11 deletions(-) create mode 100644 src/com/api/salary/web/TaxDeclarationApiFlowStatisticController.java create mode 100644 src/com/api/salary/web/TaxDeclarationApiFlowWarnController.java create mode 100644 src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java create mode 100644 src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java create mode 100644 src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java create mode 100644 src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowStatisticController.java b/src/com/api/salary/web/TaxDeclarationApiFlowStatisticController.java new file mode 100644 index 000000000..9b28c4f32 --- /dev/null +++ b/src/com/api/salary/web/TaxDeclarationApiFlowStatisticController.java @@ -0,0 +1,13 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 智能算薪-计费 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +@Path("/bs/hrmsalary/taxdeclaration/apiflow/statistics") +public class TaxDeclarationApiFlowStatisticController extends com.engine.salary.web.TaxDeclarationApiFlowStatisticController { +} diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowWarnController.java b/src/com/api/salary/web/TaxDeclarationApiFlowWarnController.java new file mode 100644 index 000000000..a873eaaa4 --- /dev/null +++ b/src/com/api/salary/web/TaxDeclarationApiFlowWarnController.java @@ -0,0 +1,13 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 智能算薪-流量不足提醒 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +@Path("/bs/hrmsalary/taxdeclaration/apiflow/warn") +public class TaxDeclarationApiFlowWarnController extends com.engine.salary.web.TaxDeclarationApiFlowWarnController { +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java index c530bdd1a..6b3458a33 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -23,10 +23,9 @@ public interface TaxDeclarationApiFlowWarnService { /** * 获取流量不足提醒设置 * - * @param currentTenantKey * @return */ - TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey); + TaxDeclarationApiFlowWarnConfigPO getWarnConfig(); /** * 获取流量不足提醒对象列表 @@ -76,10 +75,9 @@ public interface TaxDeclarationApiFlowWarnService { /** * 获取推送规则的业务ID * - * @param currentTenantKey * @return */ - Long getRuleBusinessId(String currentTenantKey); + Long getRuleBusinessId(); /** * 发送提醒 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 5ecd2e175..35ead9111 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -61,7 +61,7 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax } @Override - public TaxDeclarationApiFlowWarnConfigPO getWarnConfig(String currentTenantKey) { + public TaxDeclarationApiFlowWarnConfigPO getWarnConfig() { return getTaxDeclarationApiFlowWarnConfigMapper().getOne(); } @@ -206,14 +206,14 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax } @Override - public Long getRuleBusinessId(String currentTenantKey) { - TaxDeclarationApiFlowWarnConfigPO warnConfig = this.getWarnConfig(currentTenantKey); + public Long getRuleBusinessId() { + TaxDeclarationApiFlowWarnConfigPO warnConfig = this.getWarnConfig(); return warnConfig == null ? IdGenerator.generate() : warnConfig.getBusinessId(); } @Override public void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { - TaxDeclarationApiFlowWarnConfigPO warnConfig = getWarnConfig(updateWrapper.getTenantKey()); + TaxDeclarationApiFlowWarnConfigPO warnConfig = getWarnConfig(); // 未配置或开关关闭 if (Objects.isNull(warnConfig) || SalaryOnOffEnum.OFF.getValue().equals(warnConfig.getEnableWarn())) { return; diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java new file mode 100644 index 000000000..d9591b2e9 --- /dev/null +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java @@ -0,0 +1,101 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.TaxDeclarationApiFlowStatisticWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 智能算薪-计费 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +public class TaxDeclarationApiFlowStatisticController { + + private TaxDeclarationApiFlowStatisticWrapper getTaxDeclarationApiFlowStatisticWrapper(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowStatisticWrapper.class, user); + } + +// /** +// * 接口流量统计 +// * +// * @return WeaResult 返回结果 +// */ +// @Path +// @POST +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult getFlowStatistics() { +// return WeaResult.success(taxDeclarationApiFlowStatisticWrapper.getFlowStatistics(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId())); +// } + + /** + * 接口流量使用明细 + * + * @param queryParam 查询条件 + * @return WeaResult 返回结果 + */ + @POST + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowStatisticsList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody BaseQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsList, queryParam); + } + +// /** +// * 导出接口流量使用明细 +// * +// * @return WeaResult 返回结果 +// */ +// @Path("/export") +// @GET +// @Produces(MediaType.APPLICATION_JSON) +// public String exportFlowStatistics(@Context HttpServletRequest request, @Context HttpServletResponse response) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsList, queryParam); +// return WeaResult.success(taxDeclarationApiFlowStatisticWrapper.exportFlowStatistics(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); +// } + + /** + * 接口流量月度使用明细 + * + * @param queryParam 查询条件 + * @return WeaResult 返回结果 + */ + @POST + @Path("/detail/list") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowMonthQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsDetail, queryParam); + } + +// /** +// * 导出接口流量使用明细 +// * +// * @param queryParam 查询条件 +// * @return WeaResult 返回结果 +// */ +// @Path("/detail/export") +// @ApiOperation("导出接口流量使用明细") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult exportFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowMonthQueryParam queryParam) { +// return WeaResult.success(taxDeclarationApiFlowStatisticWrapper.exportFlowStatisticsDetail(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); +// } +} diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java new file mode 100644 index 000000000..c651e0413 --- /dev/null +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java @@ -0,0 +1,146 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnConfigFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.TaxDeclarationApiFlowWarnWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.List; + +/** + * 智能算薪-流量不足提醒 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxDeclarationApiFlowWarnController { + private TaxDeclarationApiFlowWarnWrapper getTaxDeclarationApiFlowWarnWrapper(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowWarnWrapper.class, user); + } + + /** + * 流量不足提醒表单 + * + * @return WeaResult 返回结果 + */ + @GET + @Path("/config/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getWarnConfigForm(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnConfigForm); + } + + /** + * 流量不足提醒编辑或保存 + * + * @param param 保存参数 + * @return WeaResult 返回结果 + */ + @POST + @Path("/config/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveWarnConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowWarnConfigSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::saveWarnConfig, param); + } + + /** + * 流量不足提醒对象编辑表单 + * + * @param param 前端参数 + * @return WeaResult 返回结果 + */ + @POST + @Path("/receiver/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getWarnReceiverForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowWarnReceiverSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverForm, param); + } + + /** + * 编辑保存流量不足提醒对象 + * + * @param param 保存参数 + * @return WeaResult 返回结果 + */ + @POST + @Path("/receiver/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveWarnReceiver(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowWarnReceiverSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::saveWarnReceiver, param); + } + + /** + * 流量不足提醒对象列表 + * + * @param warnConfigId 主键id + * @return WeaResult 返回结果 + */ + @GET + @Path("/receiver/list") + @Produces(MediaType.APPLICATION_JSON) + public String getWarnReceiverList(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "warnConfigId") Long warnConfigId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverList, warnConfigId); + } + + /** + * 流量不足提醒对象-删除 + * + * @param id 主键id + * @return WeaResult 返回结果 + */ + @GET + @Path("/receiver/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteReceiver(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::deleteReceiver, id); + } + + /** + * 获取创建规则参数 + * @param request + * @param response + * @return + */ + @GET + @Path("/rule/params") + @Produces(MediaType.APPLICATION_JSON) + public String getMessageRuleParams(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getRuleBusinessId); + } + + /** + * 创建规则 + * + * @param param 前端参数 + * @return WeaResult 返回结果 + */ + @POST + @Path("/rule/create") + @Produces(MediaType.APPLICATION_JSON) + public String createMessageRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CreateMessageRuleParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::createMessageRule, param); + } +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java index ac6db24f7..e5c8d3ceb 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -53,9 +53,8 @@ public class TaxDeclarationApiFlowBillingWrapper extends Service { } public PageInfo getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { -// PageInfo page = getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam); -// return page; - return null; + PageInfo page = getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam); + return page; } // public Map exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) { diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java new file mode 100644 index 000000000..380686a03 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java @@ -0,0 +1,85 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; +import com.engine.salary.service.impl.TaxDeclarationApiFlowStatisticServiceImpl; +import com.engine.salary.util.page.PageInfo; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +/** + * 个税申报计费 + * + * @author chengliming + * @date 2022-11-11 15:16:22 + */ +@Slf4j +public class TaxDeclarationApiFlowStatisticWrapper extends Service { + + public TaxDeclarationApiFlowStatisticService getTaxDeclarationApiFlowStatisticService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowStatisticServiceImpl.class, user); + } + + public TaxDeclarationApiFlowTotalDTO getFlowStatistics() { + return getTaxDeclarationApiFlowStatisticService(user).getFlowStatistics(); + } + + public PageInfo getFlowStatisticsList(BaseQueryParam queryParam) { + PageInfo page = getTaxDeclarationApiFlowStatisticService(user).pageFlowStatistics(queryParam); + return page; + } + + public PageInfo getFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + PageInfo page = getTaxDeclarationApiFlowStatisticService(user).pageFlowStatisticsDetail(queryParam); + return page; + } + +// public Map exportFlowStatistics(Long employeeId, String tenantKey) { +// List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatistic(tenantKey, employeeId); +// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95795, "数据不存在")); +// // 构建异步导出参数 +// Map map = salaryBatchService.buildeExportParam("exportFlowStatistics"); +// map.put("sheetName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 184066, "接口流量统计数据")); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// try { +// DSTenantKeyThreadVar.tenantKey.set(tenantKey); +// getTaxDeclarationApiFlowStatisticService(user).exportFlowStatistics(map, dtoList, employeeId, tenantKey); +// } finally { +// DSTenantKeyThreadVar.tenantKey.remove(); +// } +// } +// }; +// ThreadPoolUtil.execute(localRunnable); +// return map; +// } +// +// public Map exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam, Long employeeId, String tenantKey) { +// List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatisticDetail(queryParam, employeeId, tenantKey); +// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95795, "数据不存在")); +// // 构建异步导出参数 +// Map map = salaryBatchService.buildeExportParam("exportFlowStatisticsDetail"); +// map.put("sheetName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 184067, "接口流量月统计数据")); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// try { +// DSTenantKeyThreadVar.tenantKey.set(tenantKey); +// getTaxDeclarationApiFlowStatisticService(user).exportFlowStatisticsDetail(queryParam, map, dtoList, employeeId, tenantKey); +// } finally { +// DSTenantKeyThreadVar.tenantKey.remove(); +// } +// } +// }; +// ThreadPoolUtil.execute(localRunnable); +// return map; +// } + +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java new file mode 100644 index 000000000..b41bd56c6 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java @@ -0,0 +1,86 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnConfigFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.service.impl.TaxDeclarationApiFlowWarnServiceImpl; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +import java.util.List; + +/** + * 流量不足提醒 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclarationApiFlowWarnWrapper extends Service { + + public TaxDeclarationApiFlowWarnService getTaxDeclarationApiFlowWarnService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowWarnServiceImpl.class, user); + } + + public TaxDeclarationApiFlowWarnConfigFormDTO getWarnConfigForm() { + Long businessId = getTaxDeclarationApiFlowWarnService(user).getRuleBusinessId(); + TaxDeclarationApiFlowWarnConfigFormDTO warnFormDTO = TaxDeclarationApiFlowWarnConfigFormDTO.builder() + .enable(false) + .moduleId("hrsa") + .businessId(businessId) + .build(); + TaxDeclarationApiFlowWarnConfigPO warnConfigPO = getTaxDeclarationApiFlowWarnService(user).getWarnConfig(); + if (warnConfigPO != null) { + warnFormDTO.setId(warnConfigPO.getId()); + warnFormDTO.setEnable(SalaryOnOffEnum.ON.getValue().equals(warnConfigPO.getEnableWarn())); + warnFormDTO.setThreshold(warnConfigPO.getThreshold().intValue()); + warnFormDTO.setBusinessId(warnConfigPO.getBusinessId()); + warnFormDTO.setConfig(null); + } + return warnFormDTO; + } + + public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param) { + return getTaxDeclarationApiFlowWarnService(user).saveWarnConfig(param); + } + + public List getWarnReceiverList(Long warnConfigId) { + List receiverListDTOS = getTaxDeclarationApiFlowWarnService(user).getWarnReceiverList(warnConfigId); + return receiverListDTOS; + } + + public void deleteReceiver(Long id) { + getTaxDeclarationApiFlowWarnService(user).deleteReceiver(id); + } + + public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverForm(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + TaxDeclarationApiFlowWarnReceiverFormDTO formDTO = TaxDeclarationApiFlowWarnReceiverFormDTO.builder().build(); + if (param.getId() != null) { + formDTO = getTaxDeclarationApiFlowWarnService(user).getWarnReceiverFormById(param.getId()); + } + + return formDTO; + } + + public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + getTaxDeclarationApiFlowWarnService(user).saveWarnReceiver(param); + } + + public void createMessageRule(CreateMessageRuleParam param) { + getTaxDeclarationApiFlowWarnService(user).createMessageRule(param); + } + + public Long getRuleBusinessId() { + return getTaxDeclarationApiFlowWarnService(user).getRuleBusinessId(); + } +} From d633386bbf5f3b8fdc4c35a276107fa22671a4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 28 Aug 2023 15:46:56 +0800 Subject: [PATCH 038/298] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TaxDeclarationApiBillingServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index ce9dc1efa..bf64c6e18 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -42,15 +42,14 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD public SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } -// private SalaryBatchService salaryBatchService; public TaxDeclarationApiFlowWarnService getTaxDeclarationApiFlowWarnService(User user) { return ServiceUtil.getService(TaxDeclarationApiFlowWarnServiceImpl.class, user); } - - - private ExtEmpService extEmployeeService; + public ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } @Override public void updateApiFlowInfo(ApiFlowUpdateWrapper updateWrapper) { @@ -103,7 +102,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD List employeeComInfos =getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(employeeTaxAgentMap.keySet())); Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); - List extEmployeePOS = extEmployeeService.listAll(); + List extEmployeePOS = getExtEmpService(user).listAll(); Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId); // 获取个税扣缴义务人信息 List taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values())); From 4644f34bbb5ac30c4f6baa9b281f6bf8e95f8575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 28 Aug 2023 16:48:52 +0800 Subject: [PATCH 039/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=92=8C=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=94=B3=E6=8A=A5=E6=B5=81=E9=87=8F=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/EmployeeDeclareServiceImpl.java | 3 +-- .../service/impl/TaxDeclarationApiBillingServiceImpl.java | 3 ++- .../salary/service/impl/TaxDeclareRecordServiceImpl.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 18813dd04..f50a2d337 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -640,7 +640,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla + "-" + e.getOrDefault("zzlx", "") + "-" + e.getOrDefault("zzhm", "")); // 流量使用情况 - TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(param.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION); + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(param.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION, (long) user.getUID()); // 查询申报的人员列表 Date now = new Date(); List needUpdateEmployeeDeclares = Lists.newArrayList(); @@ -689,7 +689,6 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈")); // employeeDeclareLoggerTemplate.write(loggerContext); // 更新流量统计 - //todo getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); // 报送失败的 int declareFailSize = (int) needUpdateEmployeeDeclares.stream() diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index bf64c6e18..e09f4cb69 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -196,11 +196,12 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD // 接口类型 private EnumDeclareApiBusinessType businessType; - public ApiFlowUpdateWrapper(Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) { + public ApiFlowUpdateWrapper(Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType,Long currentEmployeeId) { this.taxYearMonth = taxYearMonth; this.apiFlowDetailPOList = new ArrayList<>(); this.apiConfig = apiConfig; this.businessType = businessType; + this.currentEmployeeId = currentEmployeeId; } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index fb3662784..6991bdeea 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -550,7 +550,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 删除个税申报表明细 getTaxDeclarationValueService(user).deleteByTaxDeclareRecordIds(ids); - taxDeclareRecords.forEach(po->{ + taxDeclareRecords.forEach(po -> { // 获取当前个税扣缴义务人下的薪资账套 List salarySobPOS = getSalarySobService(user).listByTaxAgentId(po.getTaxAgentId()); List salarySobIds = salarySobPOS.stream().map(SalarySobPO::getId).collect(Collectors.toList()); @@ -699,7 +699,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); Map employeeInfoMap = SalaryEntityUtil.convert2Map(employeeDeclares, e -> e.getEmployeeName() + "-" + e.getCardNum()); // 流量统计 - TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(taxDeclareRecord.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION); + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(taxDeclareRecord.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION, (long) user.getUID()); Date now = new Date(); List errorMsg = Lists.newArrayList(); From 1c9cc632d3e8d3e8e8a90c5d4889bf4a8909f341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 29 Aug 2023 13:55:36 +0800 Subject: [PATCH 040/298] =?UTF-8?q?=E6=99=BA=E8=83=BD=E7=AE=97=E8=96=AA?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaxDeclarationApiFlowRecordListDTO.java | 33 ++-- ...larationApiFlowStatisticDetailListDTO.java | 10 +- ...TaxDeclarationApiFlowStatisticListDTO.java | 22 +-- .../TaxDeclarationApiFlowMonthQueryParam.java | 12 +- .../TaxDeclarationApiBillingService.java | 4 +- ...TaxDeclarationApiFlowStatisticService.java | 30 ++-- .../impl/SalaryEmployeeServiceImpl.java | 2 +- .../TaxDeclarationApiBillingServiceImpl.java | 77 +++++----- ...eclarationApiFlowStatisticServiceImpl.java | 83 +++++----- .../web/TaxDeclarationApiFlowController.java | 83 ++++++++-- ...DeclarationApiFlowStatisticController.java | 143 +++++++++++++----- .../TaxDeclarationApiFlowBillingWrapper.java | 28 ++-- ...TaxDeclarationApiFlowStatisticWrapper.java | 57 ++----- 13 files changed, 338 insertions(+), 246 deletions(-) diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java index 5b6ef90cb..33b2a72f4 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java @@ -1,9 +1,9 @@ package com.engine.salary.entity.taxapiflow.dto; +import com.engine.salary.annotation.TableTitle; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -21,42 +21,49 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("智能算税-流量使用记录") public class TaxDeclarationApiFlowRecordListDTO { - //id") + //id @JsonSerialize(using = ToStringSerializer.class) private Long id; - //序号") + //序号 + @TableTitle(title = "序号", key = "indexNum", dataIndex = "indexNum") private Integer indexNum; - //使用时间") + //使用时间 private String createTime; - //个税扣缴义务人") + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", key = "taxAgentName", dataIndex = "taxAgentName") private String taxAgentName; - //人员") + //人员 + @TableTitle(title = "人员", key = "employeeName", dataIndex = "employeeName") private String employeeName; - //人员类型") + //人员类型 private String employeeType; - //人员id") + //人员id @JsonSerialize(using = ToStringSerializer.class) private Long employeeId; - //创建人id") + //创建人id @JsonSerialize(using = ToStringSerializer.class) private Long creatorId; - //身份证号码") + //身份证号码 + @TableTitle(title = "身份证号码", key = "idCardNo", dataIndex = "idCardNo") private String idCardNo; - //接口业务") + //接口业务 + @TableTitle(title = "接口业务", key = "businessTypeName", dataIndex = "businessTypeName") private String businessTypeName; - //操作人") + //操作人 + @TableTitle(title = "操作人", key = "creator", dataIndex = "creator") private String creator; - //结果") + //结果 + @TableTitle(title = "结果", key = "result", dataIndex = "result") private String result; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java index 9d658b6d9..cf4d4ee9f 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java @@ -1,10 +1,10 @@ package com.engine.salary.entity.taxapiflow.dto; +import com.engine.salary.annotation.TableTitle; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,7 +22,6 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @ApiModel("智能算税-流量统计-月度详情") public class TaxDeclarationApiFlowStatisticDetailListDTO { - //id") @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -30,12 +29,15 @@ public class TaxDeclarationApiFlowStatisticDetailListDTO { private Long taxAgentId; @JsonIgnore + @TableTitle(title = "个税扣缴义务人",key = "taxAgentName",dataIndex = "taxAgentName") private String taxAgentName; - //税款所属期") + //税款所属期 + @TableTitle(title = "",key = "",dataIndex = "") private String taxMonth; - //月使用流量数") + //月使用流量数 + @TableTitle(title = "月使用流量数",key = "used",dataIndex = "used") private Integer used; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java index ecfa10f57..ac37af2c3 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java @@ -1,9 +1,9 @@ package com.engine.salary.entity.taxapiflow.dto; +import com.engine.salary.annotation.TableTitle; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -11,30 +11,34 @@ import lombok.NoArgsConstructor; /** * 智能算税-流量统计 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

* - * @author chengliming - * @date 2022-11-11 17:01:25 - */ + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor @AllArgsConstructor @ApiModel("智能算税-流量统计") public class TaxDeclarationApiFlowStatisticListDTO { - //id") @JsonSerialize(using = ToStringSerializer.class) private Long id; - //序号") + //序号 + @TableTitle(title = "序号",key = "indexNum",dataIndex = "indexNum") private Integer indexNum; - //个税扣缴义务人") + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人",key = "taxAgentName",dataIndex = "taxAgentName") private String taxAgentName; - //个税扣缴义务人ID") + //个税扣缴义务人ID @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - //已使用") + //已使用 + @TableTitle(title = "已使用",key = "used",dataIndex = "used") private Integer used; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java index 2ae0cbb43..69fa8b8fa 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java @@ -1,15 +1,15 @@ package com.engine.salary.entity.taxapiflow.param; import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.SalaryDateUtil; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.validation.constraints.NotNull; -import java.time.YearMonth; +import java.util.Date; /** * 流量月度详情查询参数 @@ -29,22 +29,22 @@ public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam { private Long taxAgentId; //税款所属期开始时间") - private YearMonth startTaxMonth; + private Date startTaxMonth; //税款所属期结束时间") - private YearMonth endTaxMonth; + private Date endTaxMonth; public Integer getStartTaxMonth() { if (startTaxMonth == null) { return 0; } - return Integer.parseInt(startTaxMonth.toString().replace("-", "")); + return Integer.parseInt(SalaryDateUtil.getFormatYYYYMM(startTaxMonth).replace("-", "")); } public Integer getEndTaxMonth() { if (endTaxMonth == null) { return Integer.MAX_VALUE; } - return Integer.parseInt(endTaxMonth.toString().replace("-", "")); + return Integer.parseInt(SalaryDateUtil.getFormatYYYYMM(endTaxMonth).replace("-", "")); } } diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java index 409b99903..574076008 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -4,6 +4,7 @@ import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDT import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; import com.engine.salary.util.page.PageInfo; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.util.List; @@ -44,8 +45,7 @@ public interface TaxDeclarationApiBillingService { * 导出流量使用记录 * * @param queryParam - * @param map */ -// void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map); + XSSFWorkbook exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); } diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java index 960bcd23c..a8e0cb4dc 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQuery import com.engine.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.util.page.PageInfo; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.util.List; @@ -57,22 +58,19 @@ public interface TaxDeclarationApiFlowStatisticService { */ List listFlowStatisticDetail(TaxDeclarationApiFlowMonthQueryParam queryParam); -// /** -// * 导出流量统计 -// * -// * @param map -// * @param dtoList -// */ -// void exportFlowStatistics(Map map, List dtoList); -// -// /** -// * 导出流量月度统计 -// * -// * @param queryParam -// * @param map -// * @param dtoList -// */ -// void exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam, Map map, List dtoList); + /** + * 导出流量统计 + * + * @param dtoList + */ + XSSFWorkbook exportFlowStatistics(List dtoList); + + /** + * 导出流量月度统计 + * + * @param dtoList + */ + XSSFWorkbook exportFlowStatisticsDetail( List dtoList); /** * 查询流量统计数据 diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 5fda44b47..3d37e414f 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -272,7 +272,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public Map mapByEmployeeIds(Collection employeeIds) { - List simpleUserInfos = getEmployeeByIdsAll((List) employeeIds); + List simpleUserInfos = getEmployeeByIdsAll(new ArrayList<>(employeeIds)); Map result = new HashMap<>(); simpleUserInfos.forEach(e -> { result.put(e.getEmployeeId(), e.getIdNo()); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index e09f4cb69..f8177facf 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -14,7 +14,9 @@ import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; 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.google.common.collect.Lists; @@ -22,6 +24,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; import java.util.*; @@ -99,7 +102,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list) { Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); // 获取人员信息 - List employeeComInfos =getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(employeeTaxAgentMap.keySet())); + List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(employeeTaxAgentMap.keySet())); Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); List extEmployeePOS = getExtEmpService(user).listAll(); @@ -123,48 +126,36 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD return build; } -// @Override -// public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map) { -// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); -// // 表头 -// List headers = exportWrapper.getHeaders(); -// headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间")); -// headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); -// headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员")); -// headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号")); -// headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务")); -// headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人")); -// headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果")); -// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); -// // 获取数据 -// List dtoList = listFlowRecord(queryParam, employeeId, tenantKey); -// // 组装数据 -// for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { -// List row = new ArrayList<>(); -// row.add(dto.getCreateTime()); -// row.add(dto.getTaxAgentName()); -// row.add(dto.getEmployeeName()); -// row.add(dto.getIdCardNo()); -// row.add(dto.getBusinessTypeName()); -// row.add(dto.getCreator()); -// row.add(dto.getResult()); -// exportWrapper.getRows().add(row); -// } -// // 生成表格 -// buildExcelData(exportWrapper); -// } + @Override + public XSSFWorkbook exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + List> rows = new ArrayList<>(); + // 表头 + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(159083, "时间")); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人")); + headers.add(SalaryI18nUtil.getI18nLabel(100133, "人员")); + headers.add(SalaryI18nUtil.getI18nLabel(106277, "身份证号")); + headers.add(SalaryI18nUtil.getI18nLabel(159085, "接口服务")); + headers.add(SalaryI18nUtil.getI18nLabel(85435, "操作人")); + headers.add(SalaryI18nUtil.getI18nLabel(159086, "结果")); + // 获取数据 + List dtoList = listFlowRecord(queryParam); + // 组装数据 + for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getCreateTime()); + row.add(dto.getTaxAgentName()); + row.add(dto.getEmployeeName()); + row.add(dto.getIdCardNo()); + row.add(dto.getBusinessTypeName()); + row.add(dto.getCreator()); + row.add(dto.getResult()); + rows.add(row); + } + // 生成表格 + return ExcelUtil.genWorkbookV2(rows, "接口使用记录数据"); + } -// /** -// * 构建excel数据 -// * -// * @param wrapper -// */ -// private void buildExcelData(ExportWrapper wrapper) { -// wrapper.getExcelSheetData().setRows(wrapper.getRows()); -// wrapper.getSheetList().add(wrapper.getExcelSheetData()); -// salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); -// } -// /** * 封装一些临时的集合类,便于方法复用 @@ -196,7 +187,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD // 接口类型 private EnumDeclareApiBusinessType businessType; - public ApiFlowUpdateWrapper(Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType,Long currentEmployeeId) { + public ApiFlowUpdateWrapper(Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType, Long currentEmployeeId) { this.taxYearMonth = taxYearMonth; this.apiFlowDetailPOList = new ArrayList<>(); this.apiConfig = apiConfig; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java index 26bb2777f..2a2e51fed 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java @@ -19,10 +19,12 @@ import com.engine.salary.service.TaxAgentTaxReturnService; import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; import com.engine.salary.util.*; +import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; import java.time.LocalDate; @@ -67,7 +69,7 @@ public class TaxDeclarationApiFlowStatisticServiceImpl extends Service implement @Override public PageInfo pageFlowStatistics(BaseQueryParam queryParam) { - return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listFlowStatistic()); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listFlowStatistic(),TaxDeclarationApiFlowStatisticListDTO.class); } @Override @@ -147,48 +149,45 @@ public class TaxDeclarationApiFlowStatisticServiceImpl extends Service implement .build()).collect(Collectors.toList()); } -// @Override -// public void exportFlowStatistics(Map map, List dtoList) { -// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); -// // 表头 -// List headers = exportWrapper.getHeaders(); -// headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); -// headers.add(SalaryI18nUtil.getI18nLabel( 159084, "已使用流量")); -// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); -// // 组装数据 -// for (TaxDeclarationApiFlowStatisticListDTO dto : dtoList) { -// List row = new ArrayList<>(); -// row.add(dto.getTaxAgentName()); -// row.add(dto.getUsed()); -// exportWrapper.getRows().add(row); -// } -// // 生成表格 -// buildExcelData(exportWrapper); -// } + @Override + public XSSFWorkbook exportFlowStatistics(List dtoList) { -// @Override -// public void exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam, Map map, List dtoList) { -// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); -// // 表头 -// List headers = exportWrapper.getHeaders(); -// headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); -// headers.add(SalaryI18nUtil.getI18nLabel( 86176, "税款所属期")); -// headers.add(SalaryI18nUtil.getI18nLabel( 159087, "月使用流量数")); -// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{}))); -// // 组装数据 -// for (TaxDeclarationApiFlowStatisticDetailListDTO dto : dtoList) { -// List row = new ArrayList<>(); -// row.add(dto.getTaxAgentName()); -// row.add(dto.getTaxMonth()); -// row.add(dto.getUsed()); -// exportWrapper.getRows().add(row); -// } -// // 生成表格 -// /** -// wrapper.getExcelSheetData().setRows(wrapper.getRows()); -// wrapper.getSheetList().add(wrapper.getExcelSheetData()); -// salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList()); -// }} + List> rows = new ArrayList<>(); + // 表头 + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人")); + headers.add(SalaryI18nUtil.getI18nLabel(159084, "已使用流量")); + rows.add(headers); + // 组装数据 + for (TaxDeclarationApiFlowStatisticListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getTaxAgentName()); + row.add(dto.getUsed()); + rows.add(row); + } + // 生成表格 + return ExcelUtil.genWorkbookV2(rows, "接口流量统计数据"); + } + + @Override + public XSSFWorkbook exportFlowStatisticsDetail(List dtoList) { + List> rows = new ArrayList<>(); + // 表头 + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人")); + headers.add(SalaryI18nUtil.getI18nLabel(86176, "税款所属期")); + headers.add(SalaryI18nUtil.getI18nLabel(159087, "月使用流量数")); + // 组装数据 + for (TaxDeclarationApiFlowStatisticDetailListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getTaxAgentName()); + row.add(dto.getTaxMonth()); + row.add(dto.getUsed()); + rows.add(row); + } + // 生成表格 + return ExcelUtil.genWorkbookV2(rows, "接口流量月统计数据"); + } public QueryAccountBalanceResponse getQueryAccountBalanceResponse(TaxDeclarationApiConfigPO apiConfig) { diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java index 0fdcad304..b4f543da0 100644 --- a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java @@ -6,9 +6,14 @@ import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDT import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationApiFlowBillingWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -20,6 +25,11 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.time.LocalDateTime; /** * 智能算薪-计费 @@ -29,6 +39,7 @@ import javax.ws.rs.core.MediaType; * @author qiantao * @version 1.0 **/ +@Slf4j public class TaxDeclarationApiFlowController { private TaxDeclarationApiFlowBillingWrapper getTaxDeclarationApiFlowBillingWrapper(User user) { @@ -103,19 +114,61 @@ public class TaxDeclarationApiFlowController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord, queryParam); } -// -// /** -// * 导出接口流量使用记录 -// * -// * @param queryParam 查询条件 -// * @return WeaResult 返回结果 -// */ -// @POST -// @Path("/record/export") -// @Produces(MediaType.APPLICATION_JSON) -// public String exportFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord,queryParam); -// return WeaResult.success(getTaxDeclarationApiFlowBillingWrapper.exportFlowRecord(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); -// } + + /** + * 导出接口流量使用记录 + * + * @return WeaResult 返回结果 + */ + @GET + @Path("/record/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + TaxDeclarationApiFlowRecordQueryParam queryParam = TaxDeclarationApiFlowRecordQueryParam.builder().build(); + String taxAgentId = request.getParameter("taxAgentId"); + if(StringUtils.isNotBlank(taxAgentId)){ + queryParam.setTaxAgentId(Long.valueOf(taxAgentId)); + } + String startDate = request.getParameter("startDate"); + if(StringUtils.isNotBlank(startDate)){ + queryParam.setStartDate(SalaryDateUtil.stringToDate(startDate)); + } + String endDate = request.getParameter("endDate"); + if(StringUtils.isNotBlank(endDate)){ + queryParam.setEndDate(SalaryDateUtil.stringToDate(endDate)); + } + String businessType = request.getParameter("businessType"); + if(StringUtils.isNotBlank(businessType)){ + queryParam.setBusinessType(Integer.valueOf(businessType)); + } + String result = request.getParameter("result"); + if(StringUtils.isNotBlank(result)){ + queryParam.setBusinessType(Integer.valueOf(result)); + } + + + XSSFWorkbook workbook = getTaxDeclarationApiFlowBillingWrapper(user).exportFlowRecord(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "接口流量月统计数据") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.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; + } + } + } diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java index d9591b2e9..184920487 100644 --- a/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java @@ -4,21 +4,33 @@ import com.engine.common.util.ServiceUtil; import com.engine.salary.common.BaseQueryParam; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationApiFlowStatisticWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.time.LocalDateTime; /** * 智能算薪-计费 @@ -26,23 +38,25 @@ import javax.ws.rs.core.MediaType; * @author chengliming * @date 2022-11-15 16:05:40 */ +@Slf4j public class TaxDeclarationApiFlowStatisticController { private TaxDeclarationApiFlowStatisticWrapper getTaxDeclarationApiFlowStatisticWrapper(User user) { return ServiceUtil.getService(TaxDeclarationApiFlowStatisticWrapper.class, user); } -// /** -// * 接口流量统计 -// * -// * @return WeaResult 返回结果 -// */ -// @Path -// @POST -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult getFlowStatistics() { -// return WeaResult.success(taxDeclarationApiFlowStatisticWrapper.getFlowStatistics(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId())); -// } + /** + * 接口流量统计 + * + * @return WeaResult 返回结果 + */ + @POST + @Path("/info") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowStatistics(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatistics); + } /** * 接口流量使用明细 @@ -58,19 +72,40 @@ public class TaxDeclarationApiFlowStatisticController { return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsList, queryParam); } -// /** -// * 导出接口流量使用明细 -// * -// * @return WeaResult 返回结果 -// */ -// @Path("/export") -// @GET -// @Produces(MediaType.APPLICATION_JSON) -// public String exportFlowStatistics(@Context HttpServletRequest request, @Context HttpServletResponse response) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsList, queryParam); -// return WeaResult.success(taxDeclarationApiFlowStatisticWrapper.exportFlowStatistics(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); -// } + + /** + * 导出接口流量使用明细 + * + * @return WeaResult 返回结果 + */ + @GET + @Path("/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportFlowStatistics(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + + XSSFWorkbook workbook = getTaxDeclarationApiFlowStatisticWrapper(user).exportFlowStatistics(); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "接口流量统计数据") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.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; + } + } /** * 接口流量月度使用明细 @@ -86,16 +121,52 @@ public class TaxDeclarationApiFlowStatisticController { return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsDetail, queryParam); } -// /** -// * 导出接口流量使用明细 -// * -// * @param queryParam 查询条件 -// * @return WeaResult 返回结果 -// */ -// @Path("/detail/export") -// @ApiOperation("导出接口流量使用明细") -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult exportFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowMonthQueryParam queryParam) { -// return WeaResult.success(taxDeclarationApiFlowStatisticWrapper.exportFlowStatisticsDetail(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); -// } + /** + * 导出接口流量月度使用明细 + * + * @return WeaResult 返回结果 + */ + @GET + @Path("/detail/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + + TaxDeclarationApiFlowMonthQueryParam queryParam = TaxDeclarationApiFlowMonthQueryParam.builder().build(); + String taxAgentId = request.getParameter("taxAgentId"); + if(StringUtils.isNotBlank(taxAgentId)){ + queryParam.setTaxAgentId(Long.valueOf(taxAgentId)); + } + String startTaxMonth = request.getParameter("startTaxMonth"); + if(StringUtils.isNotBlank(startTaxMonth)){ + queryParam.setStartTaxMonth(SalaryDateUtil.stringToDate(startTaxMonth)); + } + String endTaxMonth = request.getParameter("endTaxMonth"); + if(StringUtils.isNotBlank(endTaxMonth)){ + queryParam.setEndTaxMonth(SalaryDateUtil.stringToDate(endTaxMonth)); + } + + + XSSFWorkbook workbook = getTaxDeclarationApiFlowStatisticWrapper(user).exportFlowStatisticsDetail(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "接口流量月统计数据") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.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; + } + } } diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java index e5c8d3ceb..81685df79 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -12,10 +12,15 @@ import com.engine.salary.service.TaxDeclarationApiBillingService; import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; +import java.util.List; + /** * 个税申报计费 *

Copyright: Copyright (c) 2023

@@ -57,24 +62,11 @@ public class TaxDeclarationApiFlowBillingWrapper extends Service { return page; } -// public Map exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) { -// List dtoList = taxDeclarationApiBillingService.listFlowRecord(queryParam, employeeId, tenantKey); -// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel( 95795, "数据不存在")); -// // 构建异步导出参数 -// Map map = salaryBatchService.buildeExportParam("exportFlowRecord"); -// map.put("sheetName", SalaryI18nUtil.getI18nLabel( 183779, "接口使用记录数据")); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// try { -// taxDeclarationApiBillingService.exportFlowRecord(queryParam, map, employeeId, tenantKey); -// } finally { -// } -// } -// }; -// ThreadPoolUtil.execute(localRunnable); -// return map; -// } + public XSSFWorkbook exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + List dtoList = getTaxDeclarationApiBillingService(user).listFlowRecord(queryParam); + SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel( 95795, "数据不存在")); + return getTaxDeclarationApiBillingService(user).exportFlowRecord(queryParam); + } public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { getTaxDeclarationApiConfigService(user).enableConfig(saveParam); diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java index 380686a03..4129ea15e 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java @@ -9,10 +9,15 @@ import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; import com.engine.salary.service.impl.TaxDeclarationApiFlowStatisticServiceImpl; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; +import java.util.List; + /** * 个税申报计费 * @@ -40,46 +45,16 @@ public class TaxDeclarationApiFlowStatisticWrapper extends Service { return page; } -// public Map exportFlowStatistics(Long employeeId, String tenantKey) { -// List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatistic(tenantKey, employeeId); -// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95795, "数据不存在")); -// // 构建异步导出参数 -// Map map = salaryBatchService.buildeExportParam("exportFlowStatistics"); -// map.put("sheetName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 184066, "接口流量统计数据")); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// try { -// DSTenantKeyThreadVar.tenantKey.set(tenantKey); -// getTaxDeclarationApiFlowStatisticService(user).exportFlowStatistics(map, dtoList, employeeId, tenantKey); -// } finally { -// DSTenantKeyThreadVar.tenantKey.remove(); -// } -// } -// }; -// ThreadPoolUtil.execute(localRunnable); -// return map; -// } -// -// public Map exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam, Long employeeId, String tenantKey) { -// List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatisticDetail(queryParam, employeeId, tenantKey); -// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95795, "数据不存在")); -// // 构建异步导出参数 -// Map map = salaryBatchService.buildeExportParam("exportFlowStatisticsDetail"); -// map.put("sheetName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 184067, "接口流量月统计数据")); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// try { -// DSTenantKeyThreadVar.tenantKey.set(tenantKey); -// getTaxDeclarationApiFlowStatisticService(user).exportFlowStatisticsDetail(queryParam, map, dtoList, employeeId, tenantKey); -// } finally { -// DSTenantKeyThreadVar.tenantKey.remove(); -// } -// } -// }; -// ThreadPoolUtil.execute(localRunnable); -// return map; -// } + public XSSFWorkbook exportFlowStatistics() { + List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatistic(); + SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "数据不存在")); + return getTaxDeclarationApiFlowStatisticService(user).exportFlowStatistics(dtoList); + } + + public XSSFWorkbook exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatisticDetail(queryParam); + SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "数据不存在")); + return getTaxDeclarationApiFlowStatisticService(user).exportFlowStatisticsDetail(dtoList); + } } From cbafca9aab0b24d2829d92f77927e1852cbe2553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 29 Aug 2023 19:24:56 +0800 Subject: [PATCH 041/298] =?UTF-8?q?1=E3=80=81=E9=82=AE=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E9=86=92=202=E3=80=81em=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DeclarationApiFlowWarnReceiverListDTO.java | 13 ++-- .../TaxDeclarationApiFlowWarnServiceImpl.java | 60 +++++++++++++++---- 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java index c8689ef66..c00fcc7a8 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java @@ -1,9 +1,9 @@ package com.engine.salary.entity.taxapiflow.dto; +import com.engine.salary.annotation.TableTitle; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -23,20 +23,23 @@ import net.minidev.json.annotate.JsonIgnore; @ApiModel("智能算税-流量提醒对象") public class TaxDeclarationApiFlowWarnReceiverListDTO { - //id") + //id @JsonSerialize(using = ToStringSerializer.class) private Long id; - //提醒对象") + //提醒对象 + @TableTitle(title = "提醒对象",key = "employeeName",dataIndex = "employeeName") private String employeeName; @JsonIgnore @JsonSerialize(using = ToStringSerializer.class) private Long employeeId; - //手机号") + //手机号 + @TableTitle(title = "手机号",key = "mobile",dataIndex = "mobile") private String mobile; - //邮箱") + //邮箱 + @TableTitle(title = "邮箱",key = "email",dataIndex = "email") private String email; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 35ead9111..184c0dd96 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -1,5 +1,8 @@ package com.engine.salary.service.impl; +import com.cloudstore.dev.api.bean.MessageBean; +import com.cloudstore.dev.api.bean.MessageType; +import com.cloudstore.dev.api.util.Util_Message; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.OptionDTO; @@ -19,7 +22,10 @@ import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.mapper.taxapiflow.TaxDeclarationApiFlowWarnConfigMapper; import com.engine.salary.mapper.taxapiflow.TaxDeclarationApiFlowWarnReceiverMapper; -import com.engine.salary.service.*; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; +import com.engine.salary.service.TaxDeclarationApiFlowWarnService; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -28,8 +34,10 @@ import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; +import weaver.email.EmailWorkRunnable; import weaver.hrm.User; +import java.io.IOException; import java.util.*; import java.util.stream.Collectors; @@ -228,15 +236,45 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax log.info("warnReceiverList is empty, send msg fail"); return; } - //todo 消息 -// List receivers = warnReceiverList.stream().map(e -> -// new UserEntity(e.getEmployeeId(), updateWrapper.getTenantKey()) -// .setEmail(e.getEmail()).setPhone(e.getMobile()).setLanguage(6) -// ).collect(Collectors.toList()); -// // 组装消息对象 -// SendMessageEntity smg = TaxApiFlowBO.buildSendMessageEntity(warnConfig, receivers, updateWrapper); -// // 发送消息 -// WeaResult weaResult = asyncSystemMessageRest.sendMsg(smg); -// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184009, "流量不足提醒发送失败")); + String title = "流量不足提醒"; + String context = String.format(SalaryI18nUtil.getI18nLabel(111, "智能算薪流量已不足%s,请及时采购续费,避免次月无法使用。"), warnConfig.getThreshold()); + warnReceiverList.forEach(e -> { + Long receiver = e.getEmployeeId(); + sendEmail(receiver, title, context); + sendMsg(receiver, title, context, warnConfig.getBusinessId()); + } + ); + } + + /** + * 发送邮件 + * @param receiver + * @param title + * @param context + */ + private void sendEmail(Long receiver, String title, String context) { + EmailWorkRunnable.threadModeReminder(receiver.toString(), title, context); + } + + /** + * 发送Em消息 + * @param receiver + * @param title + * @param context + * @param businessId + */ + public static void sendMsg(Long receiver, String title, String context, Long businessId) { + MessageType messageType = MessageType.newInstance(499); // 消息来源(见文档第四点补充 必填) + Set userIdList = new HashSet<>(); // 接收人id 必填 + userIdList.add(receiver.toString()); + try { + MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, "", ""); + messageBean.setCreater(1);// 创建人id + messageBean.setBizState("0");// 需要修改消息为已处理等状态时传入,表示消息最初状态为待处理 + messageBean.setTargetId("499|" + businessId); //消息来源code +“|”+业务id需要修改消息为已处理等状态时传入 + Util_Message.store(messageBean); + } catch (IOException e) { + e.printStackTrace(); + } } } From 7a06fc73f478c9c89b909135003bd87473584c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 30 Aug 2023 10:47:41 +0800 Subject: [PATCH 042/298] =?UTF-8?q?fix=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/taxapiflow/bo/TaxApiFlowBO.java | 2 +- .../service/TaxDeclarationApiFlowWarnService.java | 4 ++++ .../impl/TaxDeclarationApiBillingServiceImpl.java | 15 ++++++++++++++- .../TaxDeclarationApiFlowWarnServiceImpl.java | 10 ++++++++++ .../web/TaxDeclarationApiFlowController.java | 2 +- .../web/TaxDeclarationApiFlowWarnController.java | 7 ++++--- .../TaxDeclarationApiFlowBillingWrapper.java | 5 ++--- .../wrapper/TaxDeclarationApiFlowWarnWrapper.java | 8 +++----- 8 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java index 44b42447c..8ee8ba3e6 100644 --- a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java +++ b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java @@ -60,7 +60,7 @@ public class TaxApiFlowBO { String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId()); String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getUsername(); String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getIdNo(); - String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator()); + String creator = propertiesWrapper.getCreatorNameMap().get(e.getCreator()); String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId()); boolean isInternal = StringUtils.isNotEmpty(internalUsername); diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java index 6b3458a33..2b5992ea2 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -7,6 +7,7 @@ import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfig import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.page.PageInfo; import java.util.List; @@ -35,6 +36,9 @@ public interface TaxDeclarationApiFlowWarnService { */ List getWarnReceiverList(Long warnConfigId); + + PageInfo getWarnReceiverPageList(Long warnConfigId); + /** * 删除流量不足提醒对象 * diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index f8177facf..9652dcb29 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -105,12 +105,22 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(employeeTaxAgentMap.keySet())); Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); + + //非系统人员信息 List extEmployeePOS = getExtEmpService(user).listAll(); Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId); + // 获取个税扣缴义务人信息 List taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values())); Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); - return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); + + //创建人信息 + List creators = SalaryEntityUtil.properties(list, TaxDeclarationApiFlowRecordPO::getCreator, Collectors.toList()); + List creatorInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(creators)); + Map creatorNameMap = SalaryEntityUtil.convert2Map(creatorInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + + return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap, creatorNameMap); + } private TaxDeclarationApiFlowRecordPO getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam) { @@ -138,6 +148,7 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD headers.add(SalaryI18nUtil.getI18nLabel(159085, "接口服务")); headers.add(SalaryI18nUtil.getI18nLabel(85435, "操作人")); headers.add(SalaryI18nUtil.getI18nLabel(159086, "结果")); + rows.add(headers); // 获取数据 List dtoList = listFlowRecord(queryParam); // 组装数据 @@ -172,6 +183,8 @@ public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxD private Map taxAgentNameMap; // 获取非系统人员 private Map extEmployeeMap; + //创建人 + private Map creatorNameMap; } @Data diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 184c0dd96..37b7c3594 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -30,6 +30,8 @@ import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -92,6 +94,12 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax .build()).collect(Collectors.toList()); } + @Override + public PageInfo getWarnReceiverPageList(Long warnConfigId) { + List dtos = getWarnReceiverList(warnConfigId); + return SalaryPageUtil.buildPage(1, 10000, dtos, TaxDeclarationApiFlowWarnReceiverListDTO.class); + } + @Override @Transactional(rollbackFor = Exception.class) public void deleteReceiver(Long id) { @@ -248,6 +256,7 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax /** * 发送邮件 + * * @param receiver * @param title * @param context @@ -258,6 +267,7 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax /** * 发送Em消息 + * * @param receiver * @param title * @param context diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java index b4f543da0..c4d9cd8db 100644 --- a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java @@ -145,7 +145,7 @@ public class TaxDeclarationApiFlowController { } String result = request.getParameter("result"); if(StringUtils.isNotBlank(result)){ - queryParam.setBusinessType(Integer.valueOf(result)); + queryParam.setResult(Integer.valueOf(result)); } diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java index c651e0413..c209be628 100644 --- a/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java @@ -3,11 +3,13 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.common.BaseQueryParam; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnConfigFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationApiFlowWarnWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import weaver.hrm.HrmUserVarify; @@ -18,7 +20,6 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; -import java.util.List; /** * 智能算薪-流量不足提醒 @@ -71,7 +72,7 @@ public class TaxDeclarationApiFlowWarnController { @Produces(MediaType.APPLICATION_JSON) public String getWarnReceiverForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowWarnReceiverSaveParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverForm, param); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverForm, param); } /** @@ -99,7 +100,7 @@ public class TaxDeclarationApiFlowWarnController { @Produces(MediaType.APPLICATION_JSON) public String getWarnReceiverList(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "warnConfigId") Long warnConfigId) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverList, warnConfigId); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverList, warnConfigId); } /** diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java index 81685df79..d63af20e7 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -58,13 +58,12 @@ public class TaxDeclarationApiFlowBillingWrapper extends Service { } public PageInfo getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { - PageInfo page = getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam); - return page; + return getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam); } public XSSFWorkbook exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { List dtoList = getTaxDeclarationApiBillingService(user).listFlowRecord(queryParam); - SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel( 95795, "数据不存在")); + SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "数据不存在")); return getTaxDeclarationApiBillingService(user).exportFlowRecord(queryParam); } diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java index b41bd56c6..dad7ed25c 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java @@ -12,11 +12,10 @@ import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.service.TaxDeclarationApiFlowWarnService; import com.engine.salary.service.impl.TaxDeclarationApiFlowWarnServiceImpl; +import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; import weaver.hrm.User; -import java.util.List; - /** * 流量不足提醒 *

Copyright: Copyright (c) 2023

@@ -54,9 +53,8 @@ public class TaxDeclarationApiFlowWarnWrapper extends Service { return getTaxDeclarationApiFlowWarnService(user).saveWarnConfig(param); } - public List getWarnReceiverList(Long warnConfigId) { - List receiverListDTOS = getTaxDeclarationApiFlowWarnService(user).getWarnReceiverList(warnConfigId); - return receiverListDTOS; + public PageInfo getWarnReceiverList(Long warnConfigId) { + return getTaxDeclarationApiFlowWarnService(user).getWarnReceiverPageList(warnConfigId); } public void deleteReceiver(Long id) { From 8564f2e6d6c90b97b6e9f97314bd2f7a12a2ee00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 30 Aug 2023 15:21:17 +0800 Subject: [PATCH 043/298] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=8F=90=E9=86=92?= =?UTF-8?q?=E4=BA=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaxDeclarationApiFlowWarnServiceImpl.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 37b7c3594..13717760d 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -8,7 +8,6 @@ import com.engine.core.impl.Service; import com.engine.salary.common.OptionDTO; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; @@ -77,21 +76,22 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax @Override public List getWarnReceiverList(Long warnConfigId) { - List receiverPOList = getTaxDeclarationApiFlowWarnReceiverMapper().listSome(TaxDeclarationApiFlowWarnReceiverPO - .builder() - .warnConfigId(warnConfigId) - .build()); + List receiverPOList = getTaxDeclarationApiFlowWarnReceiverMapper().listSome(TaxDeclarationApiFlowWarnReceiverPO.builder().warnConfigId(warnConfigId).build()); - List salaryEmployees = getTaxAgentService(user).listEmployees(); - Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, TaxAgentEmployeePO::getEmployeeId, TaxAgentEmployeePO::getUsername); + List empIds = SalaryEntityUtil.properties(receiverPOList, TaxDeclarationApiFlowWarnReceiverPO::getEmployeeId, Collectors.toList()); + List empInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds); + Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(empInfos, DataCollectionEmployee::getEmployeeId); - return receiverPOList.stream().map(e -> TaxDeclarationApiFlowWarnReceiverListDTO.builder() - .employeeName(salaryEmployeeMap.get(e.getEmployeeId())) - .employeeId(e.getEmployeeId()) - .mobile(e.getMobile()) - .email(e.getEmail()) - .id(e.getId()) - .build()).collect(Collectors.toList()); + return receiverPOList.stream().map(e -> { + DataCollectionEmployee employee = salaryEmployeeMap.get(e.getEmployeeId()); + return TaxDeclarationApiFlowWarnReceiverListDTO.builder() + .employeeName(employee.getUsername()) + .employeeId(e.getEmployeeId()) + .mobile(employee.getMobile()) + .email(employee.getEmail()) + .id(e.getId()) + .build(); + }).collect(Collectors.toList()); } @Override From f7f1a85441ccbfc8721863c4e4ca2a3c2516b07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 31 Aug 2023 10:34:26 +0800 Subject: [PATCH 044/298] =?UTF-8?q?=E6=B5=81=E9=87=8F=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/prop/hrmSalaryCustom.properties | 1 + .../TaxDeclarationApiFlowWarnServiceImpl.java | 56 ++++++++++++++----- 2 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 resource/WEB-INF/prop/hrmSalaryCustom.properties diff --git a/resource/WEB-INF/prop/hrmSalaryCustom.properties b/resource/WEB-INF/prop/hrmSalaryCustom.properties new file mode 100644 index 000000000..a4f1cdeaa --- /dev/null +++ b/resource/WEB-INF/prop/hrmSalaryCustom.properties @@ -0,0 +1 @@ +flowNoticeMessageType=2022060951 \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 13717760d..0dd420668 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -35,7 +35,9 @@ import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; +import weaver.common.MessageUtil; import weaver.email.EmailWorkRunnable; +import weaver.general.BaseBean; import weaver.hrm.User; import java.io.IOException; @@ -248,22 +250,16 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax String context = String.format(SalaryI18nUtil.getI18nLabel(111, "智能算薪流量已不足%s,请及时采购续费,避免次月无法使用。"), warnConfig.getThreshold()); warnReceiverList.forEach(e -> { Long receiver = e.getEmployeeId(); - sendEmail(receiver, title, context); sendMsg(receiver, title, context, warnConfig.getBusinessId()); + sendEmail(e.getEmail(), title, context); + sendSMS(e.getMobile(), context); } ); } - /** - * 发送邮件 - * - * @param receiver - * @param title - * @param context - */ - private void sendEmail(Long receiver, String title, String context) { - EmailWorkRunnable.threadModeReminder(receiver.toString(), title, context); - } + //提醒的消息类型 + BaseBean bb = new BaseBean(); + private final String flowNoticeMessageType = bb.getPropValue("hrmSalaryCustom", "flowNoticeMessageType"); /** * 发送Em消息 @@ -273,18 +269,48 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax * @param context * @param businessId */ - public static void sendMsg(Long receiver, String title, String context, Long businessId) { - MessageType messageType = MessageType.newInstance(499); // 消息来源(见文档第四点补充 必填) - Set userIdList = new HashSet<>(); // 接收人id 必填 + public void sendMsg(Long receiver, String title, String context, Long businessId) { + if (StringUtils.isBlank(flowNoticeMessageType)) { + return; + } + MessageType messageType = MessageType.newInstance(Integer.parseInt(flowNoticeMessageType)); + Set userIdList = new HashSet<>(); userIdList.add(receiver.toString()); try { MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, "", ""); messageBean.setCreater(1);// 创建人id messageBean.setBizState("0");// 需要修改消息为已处理等状态时传入,表示消息最初状态为待处理 - messageBean.setTargetId("499|" + businessId); //消息来源code +“|”+业务id需要修改消息为已处理等状态时传入 + messageBean.setTargetId(flowNoticeMessageType + "|" + businessId); //消息来源code +“|”+业务id需要修改消息为已处理等状态时传入 Util_Message.store(messageBean); } catch (IOException e) { e.printStackTrace(); } } + + /** + * 发送邮件 + * + * @param email + * @param title + * @param context + */ + private void sendEmail(String email, String title, String context) { + if (MessageUtil.checkSendEmail()) { + EmailWorkRunnable.threadModeReminder(email, title, context); + } + } + + /** + * 发送短信 + * + * @param mobile + * @param context + */ + private void sendSMS(String mobile, String context) { + if (MessageUtil.checkSendSMS()) { + MessageUtil.sendSMS(mobile, context); + } + } + + } From 7c5e373b0129bcb6d4374446f5914198dd883001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 1 Sep 2023 09:23:43 +0800 Subject: [PATCH 045/298] 2 --- .../dto/AddUpDeductionRequestResultDTO.java | 34 +++++++ .../AddUpDeductionMonthTaxAgentParam.java | 25 +++++ .../salary/service/AddUpDeductionService.java | 47 ++++++++- .../salary/web/AddUpDeductionController.java | 98 +++++++++++++++++-- .../salary/wrapper/AddUpDeductionWrapper.java | 47 +++++++++ 5 files changed, 238 insertions(+), 13 deletions(-) create mode 100644 src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestResultDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestResultDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestResultDTO.java new file mode 100644 index 000000000..5ef39f2e0 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestResultDTO.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.datacollection.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * 数据采集-累计专项附加扣除-在线获取结果 + * + * @author chengliming + * @date 2022-11-01 09:47:27 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ApiModel("数据采集-累计专项附加扣除-在线获取结果") +public class AddUpDeductionRequestResultDTO { + @ApiModelProperty("请求id") + private String requestId; + + @ApiModelProperty("提示语") + private String msg; + + @ApiModelProperty("处理结果") + private String result; + + @ApiModelProperty("是否结束轮询") + private Boolean finish; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java new file mode 100644 index 000000000..843ecd238 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.datacollection.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 数据采集-累计专项附加月份+扣缴主体参数 + * + * @author : chengliming + * @Date: 2022-09-29 10:38:25 + */ +@Data +@ApiModel("数据采集-累计专项附加月份+扣缴主体参数") +public class AddUpDeductionMonthTaxAgentParam { + + @ApiModelProperty("税款所属期") + private Date declareMonth; + + @ApiModelProperty("个税扣缴义务人的主键id") + private Long taxAgentId; + +} diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 51498f653..6f7a5f372 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -3,10 +3,8 @@ package com.engine.salary.service; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; +import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -157,4 +155,45 @@ public interface AddUpDeductionService { * @author lfc */ String autoAddAll(Date yearMonth, Boolean isAdmin); + + /** + * 在线获取数据 + * + * @param param + * @return + */ + Map onlineRequest(AddUpDeductionMonthTaxAgentParam param); + + /** + * 在线获取结果查询 + * + * @return + */ + AddUpDeductionRequestResultDTO onlineFeedback(); + + /** + * 在线获取失败记录 + * + * @param queryParam + * @return + */ + PageInfo onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam); + + /** + * 获取反馈失败记录 + * + * @param requestId + * @param tenantKey + * @return + */ + List getAddUpDeductionRequestFailPOList(Long requestId); + + /** + * 导出反馈失败记录 + * + * @param map + * @param requestId + */ + void exportOnlineFeedbackFail(Map map, Long requestId); + } diff --git a/src/com/engine/salary/web/AddUpDeductionController.java b/src/com/engine/salary/web/AddUpDeductionController.java index b153fd475..ef2754c5e 100644 --- a/src/com/engine/salary/web/AddUpDeductionController.java +++ b/src/com/engine/salary/web/AddUpDeductionController.java @@ -12,11 +12,13 @@ import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.AddUpDeductionWrapper; +import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.jetbrains.annotations.Nullable; +import org.springframework.web.bind.annotation.RequestParam; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -35,10 +37,7 @@ import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -271,8 +270,8 @@ public class AddUpDeductionController { } /** - * @description 新建累计专项附加扣除 * @return String + * @description 新建累计专项附加扣除 * @author Harryxzy * @date 2022/10/26 14:23 */ @@ -285,8 +284,8 @@ public class AddUpDeductionController { } /** - * @description 获取累计专项附加扣除信息 * @return String + * @description 获取累计专项附加扣除信息 * @author Harryxzy * @date 2022/10/31 11:23 */ @@ -300,8 +299,8 @@ public class AddUpDeductionController { /** - * @description 编辑累计专项附加扣除 * @return String + * @description 编辑累计专项附加扣除 * @author Harryxzy * @date 2022/10/25 14:08 */ @@ -314,8 +313,8 @@ public class AddUpDeductionController { } /** - * @description 累计专项附加扣除-删除所选 * @return String + * @description 累计专项附加扣除-删除所选 * @author Harryxzy * @date 2022/10/27 14:08 */ @@ -328,8 +327,8 @@ public class AddUpDeductionController { } /** - * @description 累计专项附加扣除-一键清空 * @return String + * @description 累计专项附加扣除-一键清空 * @author Harryxzy * @date 2022/10/27 14:08 */ @@ -353,6 +352,7 @@ public class AddUpDeductionController { /** * 一键自动累计 + * * @return */ @POST @@ -374,4 +374,84 @@ public class AddUpDeductionController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getAddUpDeductionWrapper(user)::autoAddAll, date); } + + + /** + * 在线获取 + * + * @param param 前端请求参数 + * @return WeaResult 接口返回信息 + */ + @Path("/online/request") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionMonthTaxAgentParam param) { + Map result = addUpDeductionWrapper.onlineRequest(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + if (Objects.nonNull(result.get("msg"))) { + return WeaResult.fail(result.get("msg").toString()); + } + return WeaResult.success(null); + } + + /** + * 在线获取结果查询 + * + * @return WeaResult 接口返回信息 + */ + @Path("/online/feedback") + @GET + @Produces(MediaType.APPLICATION_JSON) + public String onlineFeedback() { + return WeaResult.success(addUpDeductionWrapper.onlineFeedback(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); + } + + /** + * 在线获取失败结果查询 + * + * @return WeaResult 接口返回信息 + */ + @Path("/online/feedback/fail") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String onlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionRequestFailQueryParam queryParam) { + return WeaResult.success(addUpDeductionWrapper.onlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), queryParam)); + } + + /** + * 在线获取结果导出 + * + * @return WeaResult 接口返回信息 + */ + @Path("/online/feedback/fail/export") + @GET + @Produces(MediaType.APPLICATION_JSON) + public String exportOnlineFeedbackFail(@RequestParam Long requestId) { + return WeaResult.success(addUpDeductionWrapper.exportOnlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), requestId)); + } + + /** + * 在线获取表单 + * + * @return WeaResult 返回结果 + */ + @Path("/online/request/form") + @GET + @Produces(MediaType.APPLICATION_JSON) + public String getForm() { + return WeaResult.success(addUpDeductionWrapper.getRequestForm()); + } + + /** + * 自动计算次月 + * + * @param queryParam 查询条件 + * @return WeaResult 返回结果 + */ + @Path("/autoCalculate") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String autoCalculate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionQueryParam queryParam) { + addUpDeductionWrapper.autoCalculate(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); + return WeaResult.success(null); + } } diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index aa89c3c58..3ac0dfe17 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -179,4 +179,51 @@ public class AddUpDeductionWrapper extends Service { } return getAddUpDeductionService(user).autoAddAll(yearMonth, null); } + + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param, Long currentEmployeeId, String currentTenantKey) { + return addUpDeductionService.onlineRequest(param, currentEmployeeId, currentTenantKey); + } + + public AddUpDeductionRequestResultDTO onlineFeedback(Long currentEmployeeId, String currentTenantKey) { + return addUpDeductionService.onlineFeedback(currentEmployeeId, currentTenantKey); + } + + public WeaTable onlineFeedbackFail(Long currentEmployeeId, String currentTenantKey, AddUpDeductionRequestFailQueryParam queryParam) { + if (queryParam.getRequestId() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 153345, "在线获取的请求ID不可为空")); + } + Page page = addUpDeductionService.onlineFeedbackFail(currentEmployeeId, currentTenantKey, queryParam); + return SalaryFormatUtil.getInstance().buildTable(AddUpDeductionRequestFailListDTO.class, page); + } + + public Map exportOnlineFeedbackFail(Long employeeId, String tenantKey, Long requestId) { + List poList = addUpDeductionService.getAddUpDeductionRequestFailPOList(requestId, tenantKey); + if (CollectionUtils.isEmpty(poList)) { + throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95795, "数据不存在") + "[id:%s]", requestId)); + } + // 构建异步导出参数 + Map map = salaryBatchService.buildeExportParam("exportOnlineFeedbackFail"); + map.put("sheetName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 183778, "在线获取专项附加扣除失败数据")); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + DSTenantKeyThreadVar.tenantKey.set(tenantKey); + addUpDeductionService.exportOnlineFeedbackFail(map, requestId, employeeId, tenantKey); + } finally { + DSTenantKeyThreadVar.tenantKey.remove(); + } + } + }; + ThreadPoolUtil.execute(localRunnable); + return map; + } + + public WeaForm getRequestForm() { + WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(AddUpDeductionRequestFormDTO.class, new AddUpDeductionRequestFormDTO()); + WeaFormSalaryItem item = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER, "month", "YYYY-MM", "YYYY-MM"); + item.setRequired(true); + weaForm.getItems().put("declareMonth", item); + return weaForm; + } } From c0c29b74728eb12c07b2af8a3f5cee8a44c8488f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 4 Sep 2023 09:29:00 +0800 Subject: [PATCH 046/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0=E6=89=A3?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacollection/bo/DataCollectionBO.java | 91 +-- .../dto/AddUpDeductionRequestFailListDTO.java | 57 ++ .../AddUpDeductionRequestFailQueryParam.java | 25 + .../po/AddUpDeductionRequestFailPO.java | 72 +++ .../po/AddUpDeductionRequestPO.java | 67 ++ .../po/DataCollectionBaseInfo.java | 51 ++ .../response/QuerySpecialAmountResponse.java | 8 +- .../employeedeclare/po/EmployeeDeclarePO.java | 1 + .../EnumAddUpDeductionRequestStatus.java | 52 ++ .../employeedeclare/EmployeeDeclareMapper.xml | 6 + .../salary/service/AddUpDeductionService.java | 3 +- .../impl/AbstractTaxPaymentService.java | 2 +- .../impl/AddUpDeductionServiceImpl.java | 587 +++++++++++++++++- 13 files changed, 960 insertions(+), 62 deletions(-) create mode 100644 src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestFailListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AddUpDeductionRequestFailQueryParam.java create mode 100644 src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/DataCollectionBaseInfo.java create mode 100644 src/com/engine/salary/enums/datacollection/EnumAddUpDeductionRequestStatus.java diff --git a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java index db9a2241d..ad132635e 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -1,14 +1,25 @@ package com.engine.salary.entity.datacollection.bo; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.employeedeclare.GenderEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.service.impl.AddUpDeductionServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; import dm.jdbc.util.IdGenerator; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -318,34 +329,34 @@ public class DataCollectionBO { return requestParam; } -// public static List> getEmployeeList(List declarePOList) { -// List> employeeList = new ArrayList<>(); -// for (EmployeeDeclarePO employeeDeclarePO : declarePOList) { -// Map employeeMap = new HashMap<>(32); -// employeeMap.put("xm", employeeDeclarePO.getEmployeeName()); -// employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); -// employeeMap.put("zzhm", employeeDeclarePO.getCardNum()); -// employeeMap.put("lxdh", employeeDeclarePO.getMobile()); -// employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel()); -// employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel()); -// employeeMap.put("rzsgrq", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getEmploymentDate())); -// employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel()); -// employeeMap.put("csny", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getBirthday())); -// employeeMap.put("gj", "中国"); -// employeeMap.put("rydq", "境内"); -// boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability()); -// boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents()); -// employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel()); -// employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null); -// employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); -// employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); -// employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel()); -// employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel()); -// employeeList.add(employeeMap); -// } -// return employeeList; -// } -// + public static List> getEmployeeList(List declarePOList) { + List> employeeList = new ArrayList<>(); + for (EmployeeDeclarePO employeeDeclarePO : declarePOList) { + Map employeeMap = new HashMap<>(32); + employeeMap.put("xm", employeeDeclarePO.getEmployeeName()); + employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + employeeMap.put("zzhm", employeeDeclarePO.getCardNum()); + employeeMap.put("lxdh", employeeDeclarePO.getMobile()); + employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel()); + employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel()); + employeeMap.put("rzsgrq", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getEmploymentDate())); + employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel()); + employeeMap.put("csny", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getBirthday())); + employeeMap.put("gj", "中国"); + employeeMap.put("rydq", "境内"); + boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability()); + boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents()); + employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel()); + employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null); + employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); + employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); + employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel()); + employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel()); + employeeList.add(employeeMap); + } + return employeeList; + } + // public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) { // return AddUpDeduction.builder() // .id(IdGenerator.generate()) @@ -379,18 +390,18 @@ public class DataCollectionBO { // .tenantKey(requestPO.getTenantKey()) // .build(); // } -// -// public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) { -// return AddUpDeductionRequestResultDTO.builder() -// .requestId(requestId.toString()) -// .msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "共成功获取数据%s条,失败%s条"), -// requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(), -// requestWrapper.getFailPOList().size())) -// .result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success") -// .finish(true) -// .build(); -// } -// + + public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) { + return AddUpDeductionRequestResultDTO.builder() + .requestId(requestId.toString()) + .msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "共成功获取数据%s条,失败%s条"), + requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(), + requestWrapper.getFailPOList().size())) + .result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success") + .finish(true) + .build(); + } + // public static AddUpDeduction buildAddUpDeductionPO(AddUpDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { // return AddUpDeduction.builder() // .id(IdGenerator.generate()) diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestFailListDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestFailListDTO.java new file mode 100644 index 000000000..df82a8178 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestFailListDTO.java @@ -0,0 +1,57 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.SalaryTableColumn; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * 数据采集-累计专项附加扣除-在线获取失败列表 + * + * @author chengliming + * @date 2022-11-07 15:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("数据采集-累计专项附加扣除-在线获取失败列表") +public class AddUpDeductionRequestFailListDTO { + + @SalaryTableColumn(text = "姓名", labelId = 85429, width = "100") + @ApiModelProperty("姓名") + private String employeeName; + + @ApiModelProperty("员工id") + private Long employeeId; + + @ApiModelProperty("id主键") + private String id; + + @ApiModelProperty("人员类型") + private String employeeType; + + @SalaryTableColumn(text = "个税扣缴义务人", labelId = 86184, width = "150") + @ApiModelProperty("个税扣缴义务人") + private String taxAgentName; + + @SalaryTableColumn(text = "工号", labelId = 86317, width = "100") + @ApiModelProperty("工号") + private String jobNum; + + @SalaryTableColumn(text = "部门", labelId = 86185, width = "100") + @ApiModelProperty("部门") + private String departmentName; + + @SalaryTableColumn(text = "身份证件号码", labelId = 102782, width = "150") + @ApiModelProperty("证件号码") + private String idNo; + + @SalaryTableColumn(text = "失败原因", labelId = 144832, width = "600") + @ApiModelProperty("失败原因") + private String failReason; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionRequestFailQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionRequestFailQueryParam.java new file mode 100644 index 000000000..2be0f746d --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionRequestFailQueryParam.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; + +/** + * 数据采集-累计专项附加扣除-在线获取失败记录查询参数 + * + * @author chengliming + * @date 2022-11-01 14:40:36 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("数据采集-累计专项附加扣除-在线获取失败记录查询参数") +public class AddUpDeductionRequestFailQueryParam extends BaseQueryParam { + + @ApiModelProperty("请求ID") + private Long requestId; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java new file mode 100644 index 000000000..8ef9bc47d --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java @@ -0,0 +1,72 @@ +package com.engine.salary.entity.datacollection.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 数据采集-累计专项附加扣除在线查询失败表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_add_up_deduction_req_fail") +//数据采集-累计专项附加扣除在线查询失败表") +public class AddUpDeductionRequestFailPO implements Serializable { + + private static final long serialVersionUID = -4950145856639514995L; + + //ID") + private Long id; + + //创建时间", ignore = true) + private LocalDateTime createTime; + + //修改时间", ignore = true) + private LocalDateTime updateTime; + + //创建人id", ignore = true) + private long creator; + + //是否删除", ignore = true) + private int deleteType; + + //租户KEY", ignore = true) + private String tenantKey; + + //查询请求ID") + private Long requestId; + + //外部查询请求ID") + private String outerRequestId; + + //员工Id") + private Long employeeId; + + //个税扣缴义务人ID") + private Long taxAgentId; + + //失败原因") + private String reason; + + //税款所属期") + private LocalDate taxYearMonth; + + /** + * @see com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum + */ + //人员类型") + private Integer employeeType; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java new file mode 100644 index 000000000..90a993052 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java @@ -0,0 +1,67 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.salary.enums.datacollection.EnumAddUpDeductionRequestStatus; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据采集-累计专项附加扣除在线查询表 + * + * @author chengliming + * @date: 2022-10-26 16:07:04 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_add_up_deduction_request") +//数据采集-累计专项附加扣除在线查询表") +public class AddUpDeductionRequestPO implements Serializable { + + private static final long serialVersionUID = 1452863635879051515L; + + //ID") + private long id; + + //创建时间", ignore = true) + private Date createTime; + + //修改时间", ignore = true) + private Date updateTime; + + //创建人id", ignore = true) + private long creator; + + //是否删除", ignore = true) + private int deleteType; + + //租户KEY", ignore = true) + private String tenantKey; + + //乐观锁版本", ignore = true) + private int lockVersion; + + //查询请求ID") + private Long requestId; + + //外部接口查询请求ID") + private String outerRequestId; + + /** + * @see EnumAddUpDeductionRequestStatus + */ + //请求处理状态") + private int requestStatus; + + //税款所属期") + private Date taxYearMonth; + + //个税扣缴义务人ID") + private Long taxAgentId; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/DataCollectionBaseInfo.java b/src/com/engine/salary/entity/datacollection/po/DataCollectionBaseInfo.java new file mode 100644 index 000000000..c9ab8ac5a --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/DataCollectionBaseInfo.java @@ -0,0 +1,51 @@ +package com.engine.salary.entity.datacollection.po; + +import java.time.LocalDateTime; + +/** + * 数据采集-抽象接口-方便使用泛型封装方法(po继承类会导致加密aop报错,原因不知,所以这里使用接口抽象) + * + * @author chengliming + * @date: 2022-09-30 10:55:40 + */ +public interface DataCollectionBaseInfo { + + /** + * 获取id + * + * @return + */ + Long getId(); + + Long getModifier(); + + Long getEmployeeId(); + + Long getTaxAgentId(); + + Integer getDeleteType(); + + String getTenantKey(); + + LocalDateTime getCreateTime(); + + LocalDateTime getUpdateTime(); + + void setId(Long id); + + void setModifier(Long modifier); + + void setEmployeeId(Long employeeId); + + void setTaxAgentId(Long taxAgentId); + + void setDeleteType(Integer deleteType); + + void setTenantKey(String tenantKey); + + void setCreateTime(LocalDateTime createTime); + + void setUpdateTime(LocalDateTime updateTime); + + void setCreator(Long creator); +} diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java index 4562612e1..fc5503724 100644 --- a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java @@ -2,28 +2,28 @@ package com.engine.salary.entity.datacollection.response; import com.engine.salary.entity.taxpayment.response.BaseResponse; import lombok.Data; +import lombok.EqualsAndHashCode; /** * 人员专项附加扣除信息查询结果 - *

Copyright: Copyright (c) 2023

- *

Company: 泛微软件

* * @author qiantao * @version 1.0 **/ @Data +@EqualsAndHashCode(callSuper = true) public class QuerySpecialAmountResponse extends BaseResponse { /** * 返回数据 */ - private QuerySpecialAmountBody body; + private Body body; /** * 人员专项附加扣除信息查询结果body **/ @Data - public static class QuerySpecialAmountBody { + public static class Body { /** * 请求查询ID */ diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index a8c23d03b..b589d29c5 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -219,4 +219,5 @@ public class EmployeeDeclarePO { private Collection ids; private Collection employeeIds; + private Collection taxAgentIds; } diff --git a/src/com/engine/salary/enums/datacollection/EnumAddUpDeductionRequestStatus.java b/src/com/engine/salary/enums/datacollection/EnumAddUpDeductionRequestStatus.java new file mode 100644 index 000000000..49cda3f90 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/EnumAddUpDeductionRequestStatus.java @@ -0,0 +1,52 @@ +package com.engine.salary.enums.datacollection; + +import java.util.HashMap; +import java.util.Map; + +/** + * 累计附加扣除请求外部接口处理状态 + * + * @author chengliming + * @date 2021-10-26 16:50:52 + */ +@SuppressWarnings("squid:S00115") +public enum EnumAddUpDeductionRequestStatus { + + /** + * 待处理(废弃) + */ + READY(10), + /** + * 处理中 + */ + RUNNING(20), + /** + * 已完成 + */ + COMPLETED(99), + ; + + private final Integer value; + + private static final Map VALUE_NAME_MAP; + + static { + final EnumAddUpDeductionRequestStatus[] values = EnumAddUpDeductionRequestStatus.values(); + VALUE_NAME_MAP = new HashMap<>(values.length); + for (EnumAddUpDeductionRequestStatus value : values) { + VALUE_NAME_MAP.put(value.getValue(), value.name()); + } + } + + EnumAddUpDeductionRequestStatus(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + public static String getName(int index) { + return VALUE_NAME_MAP.get(index); + } +} diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index e137ec1ab..5f8eab4af 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -202,6 +202,12 @@ #{id} + + AND tax_agent_id IN + + #{taxAgentId} + + ORDER BY id DESC diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 6f7a5f372..9e9e69876 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -3,8 +3,10 @@ package com.engine.salary.service; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; import com.engine.salary.entity.datacollection.param.*; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -183,7 +185,6 @@ public interface AddUpDeductionService { * 获取反馈失败记录 * * @param requestId - * @param tenantKey * @return */ List getAddUpDeductionRequestFailPOList(Long requestId); diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index dfb4be9c4..2b001a10c 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -155,7 +155,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .orElse(null); String requestId = Optional.ofNullable(queryResponse) .map(QuerySpecialAmountResponse::getBody) - .map(QuerySpecialAmountResponse.QuerySpecialAmountBody::getRequestId) + .map(QuerySpecialAmountResponse.Body::getRequestId) .orElse(null); if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(requestId)) { log.info("getAsyncQueryResponse4Payment code error:{}", JSON.toJSONString(queryResponse)); diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index bb0242cf4..c8aeee357 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.api.browser.util.ConditionFactory; @@ -11,35 +12,55 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.AddUpDeductionBiz; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; +import com.engine.salary.entity.datacollection.param.*; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO; import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.EnumAddUpDeductionRequestStatus; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.report.enums.EmployeeTypeEnum; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; @@ -48,9 +69,13 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; +import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -61,6 +86,9 @@ import java.io.InputStream; import java.text.SimpleDateFormat; import java.time.*; import java.util.*; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; @@ -73,6 +101,7 @@ import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TEN * @author qiantao * @version 1.0 **/ +@Slf4j public class AddUpDeductionServiceImpl extends Service implements AddUpDeductionService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -108,6 +137,30 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction return ServiceUtil.getService(SpecialAddDeductionServiceImpl.class, user); } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + + public TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + @Override public Map getSearchCondition(Map params) { Map apidatas = new HashMap(); @@ -410,7 +463,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction throw new SalaryRunTimeException("该数据不存在!"); } Long taxAgentId = byId.getTaxAgentId(); - boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId)); + boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId)); if (!canEdit) { //没有编辑权限 throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!"); @@ -440,7 +493,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //税款所属期 String declareMonthStr = addUpDeductionRecordParam.getDeclareMonth(); - if (declareMonthStr .equals("")) { + if (declareMonthStr.equals("")) { throw new SalaryRunTimeException("税款所属期不能为空!"); } // 获取所有个税扣缴义务人 @@ -468,7 +521,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .updateTime(now) .creator((long) user.getUID()) .declareMonth(declareMonth).build(); - boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpDeductionRecordParam.getEmployeeId())); + boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpDeductionRecordParam.getEmployeeId())); if (!employeeSameId) { throw new SalaryRunTimeException("员工信息不存在"); } @@ -552,7 +605,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction throw new SalaryRunTimeException("数据不存在或已被删除!"); } // 判断是否在个税扣缴义务人范围内 - Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst(); + Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst(); if (!first.isPresent()) { throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内"); } @@ -587,7 +640,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction if (deleteParam.getTaxAgentId() != null && (!deleteParam.getTaxAgentId().equals(""))) { // 设置了个税扣缴义务人 Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId()); - boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId)); + boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId)); if (!canDelete) { throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!"); } @@ -636,12 +689,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override public String autoAddAll(Date yearMonth, Boolean isAdmin) { String cacheKey = "addUpDeduction_autoAddAll_processing"; - Object objVal = Util_DataCache.getObjVal( cacheKey); - if(objVal != null){ + Object objVal = Util_DataCache.getObjVal(cacheKey); + if (objVal != null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "一键累计过于频繁,请稍后再试")); } try { - Util_DataCache.setObjVal(cacheKey,true ); + Util_DataCache.setObjVal(cacheKey, true); //如果是定时任务直接查询所有,isAdmin传true boolean isChief = Boolean.TRUE.equals(isAdmin) || getTaxAgentService(user).isChief((long) user.getUID()); @@ -969,7 +1022,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction if (getTaxAgentService(user).isOpenDevolution() && !isChief) { List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); -// List lastList = getLastListByModifier(employeeId, tenantKey); +// List lastList = getLastListByModifier(employeeId); list = list.stream().filter(f -> // 作为管理员 taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) @@ -1200,4 +1253,506 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction return list; } + @Override + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + SalaryAssert.notNull(param.getDeclareMonth(), SalaryI18nUtil.getI18nLabel(100586, "税款所属期必传")); + // 获取接口配置 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 获取包装类 + AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, apiConfig); + // 获取报税信息 + List taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(requestWrapper.getTaxAgentMap().keySet()); + List failReturnPOList = taxReturnPOList.stream().filter(e -> !TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(e.getCheckStatus())).collect(Collectors.toList()); + SalaryAssert.isFalse(taxReturnPOList.size() == failReturnPOList.size(), SalaryI18nUtil.getI18nLabel(183781, "企业未通过验证,暂时无法获取累计专项附加扣除数据,请先在【个税扣缴义务人】菜单验证企业报税信息")); + Map result = new HashMap<>(1); + if (!failReturnPOList.isEmpty()) { + String failTaxAgentNames = failReturnPOList.stream().map(e -> requestWrapper.getTaxAgentMap().get(e.getTaxAgentId())).collect(Collectors.joining("、")); + result.put("msg", String.format(SalaryI18nUtil.getI18nLabel(183782, "%s未通过登记验证,无法在线获取数据"), failTaxAgentNames)); + } + // 获取请求 + List requestPOList = getAddUpDeductionRequestPOS(); + SalaryAssert.isEmpty(requestPOList, SalaryI18nUtil.getI18nLabel(153341, "获取中,稍后请点击【获取结果下载】")); + // 获取报送成功的人员名单 + Map> taxAgentEmpDeclareMap = getEmpDeclareMap(requestWrapper.getTaxAgentMap().keySet(), param.getDeclareMonth()); + // 开始请求接口获取数据 + List querySpecialAmountBodies = getQuerySpecialAmountBodies(param, requestWrapper, taxAgentEmpDeclareMap, taxReturnPOList); + // 持久化数据 + persistFeedbackData(param, querySpecialAmountBodies); + return result; + } + + private AddUpDeductionOnlineRequestWrapper getAddUpDeductionOnlineRequestWrapper(List requestPOList, TaxDeclarationApiConfigPO apiConfig) { + boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution(); + long employeeId = (long) user.getUID(); + boolean isChief = getTaxAgentService(user).isChief(employeeId); + List taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAsChief(isOpenDevolution, isChief) : getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); + Set taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); + // 获取薪资档案 + List salaryArchiveList = getSalaryArchiveService(user).listByRunStatus(Arrays.asList( + SalaryArchiveStatusEnum.FIXED.getValue(), + SalaryArchiveStatusEnum.SUSPEND.getValue(), + SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue(), + SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + ); + salaryArchiveList = salaryArchiveList.stream().filter(e -> taxAgentIdSet.contains(e.getTaxAgentId())).collect(Collectors.toList()); + AddUpDeductionOnlineRequestWrapper requestWrapper = new AddUpDeductionOnlineRequestWrapper(requestPOList, salaryArchiveList, taxAgents); + requestWrapper.setApiConfig(apiConfig); + return requestWrapper; + } + + private Map> getEmpDeclareMap(Collection taxAgentIds, Date declareMonth) { + List employeeDeclarePOS = getEmployeeDeclarePOList(taxAgentIds, declareMonth); + SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "暂无人员报送状态为正常的数据,请先报送再获取累计专项附加扣除数据。")); + return employeeDeclarePOS.stream().collect(Collectors.groupingBy(EmployeeDeclarePO::getTaxAgentId)); + } + + private List getEmployeeDeclarePOList(Collection taxAgentIds, Date declareMonth) { + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().declareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()).taxCycle(declareMonth).taxAgentIds(taxAgentIds).build()); + } + + private List getQuerySpecialAmountBodies(AddUpDeductionMonthTaxAgentParam param, + AddUpDeductionOnlineRequestWrapper requestWrapper, + Map> taxAgentEmployeeDeclareMap, + List taxReturnPOList) { + List queryResponseList = new ArrayList<>(); + for (TaxAgentTaxReturnPO returnPO : taxReturnPOList) { + if (!TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(returnPO.getCheckStatus())) { + continue; + } + // 发起请求 + String taxAgentName = requestWrapper.getTaxAgentMap().get(returnPO.getTaxAgentId()); + List declarePOList = taxAgentEmployeeDeclareMap.getOrDefault(returnPO.getTaxAgentId(), new ArrayList<>()); + if (declarePOList.isEmpty()) { + log.info("该主体下没有报送成功的人员,主体名称:{}", taxAgentName); + continue; + } + QuerySpecialAmountResponse queryResponse = getQuerySpecialAmountResponse(returnPO, taxAgentName, declarePOList, param, requestWrapper.getApiConfig()); + // 校验请求结果 + String responseCode = Optional.ofNullable(queryResponse) + .map(QuerySpecialAmountResponse::getHead) + .map(SzyhResponseHead::getCode) + .orElse(null); + String outerRequestId = Optional.ofNullable(queryResponse) + .map(QuerySpecialAmountResponse::getBody) + .map(QuerySpecialAmountResponse.Body::getRequestId) + .orElse(null); + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(outerRequestId)) { + log.info("getQuerySpecialAmountBodies error:{}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + queryResponse.getBody().setTaxAgentId(returnPO.getTaxAgentId()); + queryResponseList.add(queryResponse.getBody()); + } + return queryResponseList; + } + + private void persistFeedbackData(AddUpDeductionMonthTaxAgentParam param, List queryResponseList) { + long requestId = IdGenerator.generate(); + for (QuerySpecialAmountResponse.Body body : queryResponseList) { + AddUpDeductionRequestPO po = AddUpDeductionRequestPO.builder() + .id(IdGenerator.generate()) + .requestId(requestId) + .taxAgentId(body.getTaxAgentId()) + .requestStatus(EnumAddUpDeductionRequestStatus.RUNNING.getValue()) + .outerRequestId(body.getRequestId()) + .taxYearMonth(param.getDeclareMonth()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .createTime(new Date()) + .updateTime(new Date()) + .creator(user.getUID()) + .lockVersion(0) + .build(); + addUpDeductionRequestMapper.insert(po); + } + } + + private QuerySpecialAmountResponse getQuerySpecialAmountResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + List declarePOList, + AddUpDeductionMonthTaxAgentParam param, + TaxDeclarationApiConfigPO apiConfig) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_SPECIAL_AMOUNT; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getDeclareMonth())); + requestParam.put("rylb", DataCollectionBO.getEmployeeList(declarePOList)); + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("getQuerySpecialAmountResponse params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("getQuerySpecialAmountResponse res --- {}", res); + return JsonUtil.parseObject(res, QuerySpecialAmountResponse.class); + } + + @Override + public AddUpDeductionRequestResultDTO onlineFeedback() { + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + List requestPOList = getAddUpDeductionRequestPOS(); + // 校验请求是否合法 + Long requestId = checkRequestPOList(requestPOList); + // 前置数据封装为包装类 + AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(requestPOList, apiConfig); + // 开始请求反馈数据 + AddUpDeductionRequestResultDTO resultDTO = getQuerySpecialAmountFeedback(requestWrapper); + // 判断是否需要继续轮询或者异常退出 + if (!resultDTO.getFinish()) { + return resultDTO; + } + // 更新请求状态为已完成 + updateRequestStatus(requestPOList, EnumAddUpDeductionRequestStatus.RUNNING.getValue(), EnumAddUpDeductionRequestStatus.COMPLETED.getValue()); + // 获取员工信息 + setEmployeeInfoMap(requestWrapper); + // 获取已存在的累计附加扣除数据 + setExistedDataMap(requestWrapper); + // 开始处理反馈结果 + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper + = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(requestPOList.get(0).getTaxYearMonth(), requestWrapper.getApiConfig(), EnumDeclareApiBusinessType.ADD_UP_DEDUCTION); + handleFeedbackData(requestWrapper, apiFlowUpdateWrapper); + // 持久化数据 + persistFeedbackData(requestWrapper); + // 更新流量统计数据 + getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); + // 返回结果 + return DataCollectionBO.buildRequestResultDTO(requestId, requestWrapper); + } + + @Override + public PageInfo onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) { + Page page = new LambdaQueryChainWrapper<>(addUpDeductionRequestFailMapper) + .eq(AddUpDeductionRequestFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(AddUpDeductionRequestFailPO::getTenantKey) + .eq(AddUpDeductionRequestFailPO::getRequestId, queryParam.getRequestId()) + .page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), queryParam.getTotal(), true)); + + // 获取薪资档案 + AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null); + this.getEmployeeInfoMap(requestWrapper); + + List listDTOList = page.getRecords().stream() + .map(requestWrapper::buildAddUpDeductionRequestFailListDTO).collect(Collectors.toList()); + PageInfo listDTOPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), false); + listDTOPage.setRecords(listDTOList); + return listDTOPage; + } + + @Override + public List getAddUpDeductionRequestFailPOList(Long requestId) { + return new LambdaQueryChainWrapper<>(addUpDeductionRequestFailMapper) + .eq(AddUpDeductionRequestFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(AddUpDeductionRequestFailPO::getTenantKey) + .eq(AddUpDeductionRequestFailPO::getRequestId, requestId) + .list(); + } + + @Override + public void exportOnlineFeedbackFail(Map map, Long requestId) { + List> rows = new ArrayList<>(); + // 表头 + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(85429, "姓名")); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人")); + headers.add(SalaryI18nUtil.getI18nLabel(86317, "工号")); + headers.add(SalaryI18nUtil.getI18nLabel(86185, "部门")); + headers.add(SalaryI18nUtil.getI18nLabel(106277, "身份证号码")); + headers.add(SalaryI18nUtil.getI18nLabel(144832, "失败原因")); + rows.add(headers); + // 获取薪资档案 + AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null); + // 获取身份信息map + this.getEmployeeInfoMap(requestWrapper); + // 获取数据 + List pos = getAddUpDeductionRequestFailPOList(requestId); + // 组装数据 + for (AddUpDeductionRequestFailPO po : pos) { + AddUpDeductionRequestFailListDTO failListDTO = requestWrapper.buildAddUpDeductionRequestFailListDTO(po); + List row = new ArrayList<>(); + row.add(failListDTO.getEmployeeName()); + row.add(failListDTO.getTaxAgentName()); + row.add(failListDTO.getJobNum()); + row.add(failListDTO.getDepartmentName()); + row.add(failListDTO.getIdNo()); + row.add(failListDTO.getFailReason()); + rows.add(row); + } + // 生成表格 + ExcelUtil.genWorkbookV2(rows,""); + } + + + + private void getEmployeeInfoMap(AddUpDeductionOnlineRequestWrapper wrapper) { + // 身份证号 + List employeeIds = SalaryEntityUtil.properties(wrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId,Collectors.toList()); + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getEmployeeId); + wrapper.setUserInfoUserIdMap(simpleUserInfoMap); + // 人员信息 + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + wrapper.setSimpleEmployeeMap(simpleEmployeeMap); + // 外部人员信息 + List extEmployeePOS = getExtEmpService(user).listCanUse(wrapper.getCurrentEmployeeId()); + Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId, e -> e); + wrapper.setExtEmployeePOMap(extEmployeePOMap); + } + + private List getAddUpDeductionRequestPOS() { + return new LambdaQueryChainWrapper<>(addUpDeductionRequestMapper) + .eq(AddUpDeductionRequestPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(AddUpDeductionRequestPO::getTenantKey) + .in(AddUpDeductionRequestPO::getRequestStatus, EnumAddUpDeductionRequestStatus.RUNNING.getValue()) + .list(); + } + + private void handleFeedbackData(AddUpDeductionOnlineRequestWrapper requestWrapper, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper) { + requestWrapper.getRequestFeedBackMap().forEach((outerRequestId, feedbacks) -> feedbacks.forEach(feedback -> { + DataCollectionEmployee simpleUserInfo = requestWrapper.getUserInfoIdNoMap().get(feedback.getZzhm()); + Long extEmpId = requestWrapper.getExtEmployeeIdCardMap().get(feedback.getZzhm()); + Long employeeId = Optional.ofNullable(simpleUserInfo) + .map(DataCollectionEmployee::getUser) + .map(IdEntity::getId) + .orElse(extEmpId); + AddUpDeductionRequestPO requestPO = requestWrapper.getRequestPoMap().get(outerRequestId); + + // 流量使用情况 + TaxDeclarationApiFlowRecordPO flowRecordPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, requestPO.getTaxAgentId(), employeeId); + + if (employeeId == null || StringUtils.isNotEmpty(feedback.getSbyy())) { + // 处理失败数据 + AddUpDeductionRequestFailPO failPO = DataCollectionBO.buildAddUpDeductionRequestFailPO(requestWrapper, requestPO, employeeId); + failPO.setReason(employeeId == null + ? String.format("该人员报送成功的身份证号与人事档案下的身份证号不一致,报送人员信息:[%s]|[%s]", feedback.getXm(), feedback.getZzhm()) + : feedback.getSbyy()); + failPO.setEmployeeType(simpleUserInfo != null ? EmployeeTypeEnum.ORGANIZATION.getValue() : + extEmpId != null ? EmployeeTypeEnum.EXT_EMPLOYEE.getValue() : 2); + requestWrapper.getFailPOList().add(failPO); + flowRecordPO.setEmployeeId(Optional.ofNullable(employeeId).orElse(0L)); + flowRecordPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + } else { + // 处理成功数据 + AddUpDeduction po = DataCollectionBO.buildAddUpDeductionPO(feedback); + Long poId = requestWrapper.getExistedDataMap().get(requestPO.getTaxAgentId() + "-" + employeeId); + if (Objects.nonNull(poId)) { + po.setId(poId); + requestWrapper.getUpdateList().add(po); + } else { + setBaseInfo2PO(requestWrapper, employeeId, requestPO, po); + requestWrapper.getInsertList().add(po); + } + } + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowRecordPO); + })); + } + + private Long checkRequestPOList(List requestPOList) { + Map> statusRequestMap = SalaryEntityUtil.group2Map(requestPOList, AddUpDeductionRequestPO::getRequestStatus); + if (CollectionUtils.isEmpty(statusRequestMap.get(EnumAddUpDeductionRequestStatus.RUNNING.getValue()))) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153343, "请先点击【在线获取】按钮,选择税款所属期进行获取数据。")); + } + Set requestIds = SalaryEntityUtil.properties(requestPOList, AddUpDeductionRequestPO::getRequestId); + if (requestIds.size() != 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153344, "当前同时存在多个任务,请联系管理员进行处理。")); + } + return requestPOList.get(0).getRequestId(); + } + + private void setEmployeeInfoMap(AddUpDeductionOnlineRequestWrapper requestWrapper) { + // 内部员工(详细信息) + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + requestWrapper.setSimpleEmployeeMap(simpleEmployeeMap); + // 内部员工(身份证信息) + List employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId,Collectors.toList()); + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getIdNo); + requestWrapper.setUserInfoIdNoMap(simpleUserInfoMap); + // 外部员工信息 + List extEmployeePOS = getExtEmpService(user).listCanUse(requestWrapper.getCurrentEmployeeId(), requestWrapper.getTenantKey()); + Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getCardNum, ExtEmpPO::getId); + requestWrapper.setExtEmployeeIdCardMap(extEmployeePOMap); + } + + private void setExistedDataMap(AddUpDeductionOnlineRequestWrapper requestWrapper) { + Set taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId); + List poList = new LambdaQueryChainWrapper<>(addUpDeductionMapper) + .select(AddUpDeduction::getId, AddUpDeduction::getTaxAgentId, AddUpDeduction::getEmployeeId) + .eq(AddUpDeduction::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(AddUpDeduction::getTenantKey, requestWrapper.getTenantKey()) + .eq(AddUpDeduction::getDeclareMonth, requestWrapper.getRequestPOList().get(0).getTaxYearMonth()) + .in(AddUpDeduction::getTaxAgentId, taxAgentIds) + .list(); + requestWrapper.setExistedDataMap(SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId(), AddUpDeduction::getId)); + } + + private AddUpDeductionRequestResultDTO getQuerySpecialAmountFeedback(AddUpDeductionOnlineRequestWrapper requestWrapper) { + for (AddUpDeductionRequestPO requestPO : requestWrapper.getRequestPOList()) { + QuerySpecialAmountFeedbackResponse response = getQuerySpecialAmountFeedbackResponse(requestWrapper.getApiConfig(), requestPO); + // 校验请求结果 + String responseCode = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + String msg = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + // 如果接口仍在处理中,则继续轮询 + return AddUpDeductionRequestResultDTO.builder().finish(false).build(); + } + // 获取返回的人员信息列表 + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.info("getQuerySpecialAmountFeedback not success error:{}", JSON.toJSONString(response)); + throw new SalaryRunTimeException(msg); + } + List feedbacks = Optional.of(response) + .map(QuerySpecialAmountFeedbackResponse::getBody) + .map(QuerySpecialAmountFeedbackResponse.Body::getRyxxlb) + .orElse(new ArrayList<>()); + if (feedbacks.isEmpty()) { + log.info("getQuerySpecialAmountFeedback empty data error:{}", JSON.toJSONString(response)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); + } + requestWrapper.getRequestFeedBackMap().put(requestPO.getOuterRequestId(), feedbacks); + requestWrapper.getRequestPoMap().put(requestPO.getOuterRequestId(), requestPO); + } + return AddUpDeductionRequestResultDTO.builder().finish(true).build(); + } + + private void persistFeedbackData(AddUpDeductionOnlineRequestWrapper requestWrapper) { + if (!requestWrapper.getInsertList().isEmpty()) { + List> insertPartition = Lists.partition(requestWrapper.getInsertList(), 1000); + insertPartition.forEach(list -> { + list = dataSecurityService.encryptBatch(list, AddUpDeduction.class, requestWrapper.getTenantKey()); + addUpDeductionMapper.insertData(list); + }); + } + if (!requestWrapper.getUpdateList().isEmpty()) { + List> updatePartition = Lists.partition(requestWrapper.getUpdateList(), 1000); + updatePartition.forEach(list -> { + list = dataSecurityService.encryptBatch(list, AddUpDeduction.class, requestWrapper.getTenantKey()); + addUpDeductionMapper.updateData(list); + }); + } + if (!requestWrapper.getFailPOList().isEmpty()) { + List> failPartition = Lists.partition(requestWrapper.getFailPOList(), 1000); + failPartition.forEach(list -> addUpDeductionRequestFailMapper.batchInsert(list)); + } + } + + private void setBaseInfo2PO(AddUpDeductionOnlineRequestWrapper wrapper, Long employeeId, AddUpDeductionRequestPO requestPO, AddUpDeduction po) { + po.setId(IdGenerator.generate()); + po.setDeclareMonth(wrapper.getRequestPOList().get(0).getTaxYearMonth()); + po.setTaxAgentId(requestPO.getTaxAgentId()); + po.setEmployeeId(employeeId); + po.setCreateTime(new Date()); + po.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); +// po.setModifier(wrapper.getCurrentEmployeeId()); + po.setTenantKey(wrapper.getTenantKey()); + po.setCreator(wrapper.getCurrentEmployeeId()); + } + + public void updateRequestStatus(List requestPOList, Integer oldStatus, Integer newStatus) { + for (AddUpDeductionRequestPO requestPO : requestPOList) { + boolean update = new LambdaUpdateChainWrapper<>(addUpDeductionRequestMapper) + .set(AddUpDeductionRequestPO::getRequestStatus, newStatus) + .set(AddUpDeductionRequestPO::getUpdateTime, LocalDateTime.now()) + .set(AddUpDeductionRequestPO::getLockVersion, requestPO.getLockVersion() + 1) + .eq(AddUpDeductionRequestPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) + .eq(AddUpDeductionRequestPO::getRequestStatus, oldStatus) + .eq(AddUpDeductionRequestPO::getId, requestPO.getId()) + .eq(AddUpDeductionRequestPO::getLockVersion, requestPO.getLockVersion()) + .update(); + SalaryAssert.isTrue(update, SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + } + + public QuerySpecialAmountFeedbackResponse getQuerySpecialAmountFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, AddUpDeductionRequestPO requestPO) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_QUERY_SPECIAL_AMOUNT_FEEDBACK; + Map params = new HashMap<>(1); + params.put("requestId", requestPO.getOuterRequestId()); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("GET_QUERY_SPECIAL_AMOUNT_FEEDBACK res = {}", res); + return JsonUtil.parseObject(res, QuerySpecialAmountFeedbackResponse.class); + } + + @Data + public static class AddUpDeductionOnlineRequestWrapper { + private String tenantKey; + private Long currentEmployeeId; + // 单次请求对应的反馈数据map + private Map> requestFeedBackMap; + private Map requestPoMap; + // 查询薪资档案(定薪、待停薪、停薪) + private List salaryArchiveList; + private Map taxAgentMap; + // 员工信息map(身份证号 -> 员工ID) + private Map userInfoIdNoMap; + // 员工信息map(员工ID -> 身份证) + private Map userInfoUserIdMap; + // 员工详细信息map(key = 员工ID) + private Map simpleEmployeeMap; + // 获取当前库中累计附加扣除的数据 + private Map existedDataMap; + // 需要新增的数据 + private List insertList; + // 需要更新的数据 + private List updateList; + // 失败数据(分页) + private List failDTOList; + // 失败数据(持久化) + private List failPOList; + // 请求详细信息列表 + private List requestPOList; + // 外部人员(身份证 -> id) + private Map extEmployeeIdCardMap; + // 外部人员(id -> 实体) + private Map extEmployeePOMap; + // api配置 + private TaxDeclarationApiConfigPO apiConfig; + + public AddUpDeductionOnlineRequestWrapper(List requestPOList, + List salaryArchiveList, + List taxAgents) { + this.requestFeedBackMap = new HashMap<>(); + this.requestPoMap = new HashMap<>(); + this.insertList = new ArrayList<>(); + this.updateList = new ArrayList<>(); + this.failDTOList = new ArrayList<>(); + this.failPOList = new ArrayList<>(); + this.salaryArchiveList = salaryArchiveList; + this.requestPOList = requestPOList; + this.tenantKey = tenantKey; + this.currentEmployeeId = currentEmployeeId; + this.taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + } + + public AddUpDeductionRequestFailListDTO buildAddUpDeductionRequestFailListDTO(AddUpDeductionRequestFailPO failPO) { + DataCollectionEmployee userInfo = this.userInfoUserIdMap.get(failPO.getEmployeeId()); + ExtEmpPO extEmployeePO = this.extEmployeePOMap.get(failPO.getEmployeeId()); + DataCollectionEmployee simpleEmployee = this.simpleEmployeeMap.get(failPO.getEmployeeId()); + String departmentName = Optional.ofNullable(simpleEmployee).map(DataCollectionEmployee::getDepartmentName).orElse(""); + + AddUpDeductionRequestFailListDTO listDTO = AddUpDeductionRequestFailListDTO.builder() + .id(failPO.getId().toString()) + .employeeId(failPO.getEmployeeId()) + .employeeType(EmployeeTypeEnum.parseByValue(failPO.getEmployeeType()).toString()) + .employeeName(Optional.ofNullable(simpleEmployee).map(DataCollectionEmployee::getUsername) + .orElse(Optional.ofNullable(extEmployeePO).map(ExtEmpPO::getUsername) + .orElse(""))) + .jobNum(Optional.ofNullable(simpleEmployee).map(DataCollectionEmployee::getWorkcode).orElse("")) + .idNo(Optional.ofNullable(userInfo).map(DataCollectionEmployee::getIdNo) + .orElse(Optional.ofNullable(extEmployeePO).map(ExtEmpPO::getIdNo) + .orElse(""))) + .departmentName(Optional.ofNullable(departmentName).orElse("")) + .failReason(failPO.getReason()) + .taxAgentName(this.taxAgentMap.get(failPO.getTaxAgentId())) + .build(); + Pattern pattern = Pattern.compile("\\[+[\\u4e00-\\u9fa5]*+]+\\|+\\[+[0-9]*+]"); + Matcher matcher = pattern.matcher(Optional.ofNullable(failPO.getReason()).orElse("")); + if (matcher.find()) { + String[] split = failPO.getReason().split("\\|"); + listDTO.setEmployeeName(split[0].substring(split[0].indexOf('[') + 1, split[0].indexOf(']'))); + listDTO.setIdNo(split[1].substring(split[1].indexOf('[') + 1, split[1].indexOf(']'))); + } + return listDTO; + } + } + } From 96bfdf05ed56c30a58e3558b00a6871147259561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 4 Sep 2023 14:20:42 +0800 Subject: [PATCH 047/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0=E6=89=A3?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202309040303.sql | 40 ++ resource/sqlupgrade/GS/sql202309040303.sql | 40 ++ resource/sqlupgrade/JC/sql202309040303.sql | 40 ++ resource/sqlupgrade/Mysql/sql202309040303.sql | 39 ++ .../sqlupgrade/Oracle/sql202309040303.sql | 39 ++ resource/sqlupgrade/PG/sql202309040303.sql | 40 ++ .../sqlupgrade/SQLServer/sql202309040303.sql | 39 ++ resource/sqlupgrade/ST/sql202309040303.sql | 40 ++ .../datacollection/bo/DataCollectionBO.java | 73 ++-- .../po/AddUpDeductionRequestFailPO.java | 16 +- .../po/AddUpDeductionRequestPO.java | 36 +- .../AddUpDeductionRequestFailMapper.java | 80 ++++ .../AddUpDeductionRequestFailMapper.xml | 384 +++++++++++++++++ .../AddUpDeductionRequestMapper.java | 80 ++++ .../AddUpDeductionRequestMapper.xml | 388 ++++++++++++++++++ .../salary/service/SalaryArchiveService.java | 2 + .../impl/AddUpDeductionServiceImpl.java | 106 +++-- .../impl/SalaryArchiveServiceImpl.java | 5 + .../salary/web/AddUpDeductionController.java | 100 ++--- .../salary/wrapper/AddUpDeductionWrapper.java | 83 ++-- 20 files changed, 1466 insertions(+), 204 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202309040303.sql create mode 100644 resource/sqlupgrade/GS/sql202309040303.sql create mode 100644 resource/sqlupgrade/JC/sql202309040303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202309040303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202309040303.sql create mode 100644 resource/sqlupgrade/PG/sql202309040303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202309040303.sql create mode 100644 resource/sqlupgrade/ST/sql202309040303.sql create mode 100644 src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.xml create mode 100644 src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.xml diff --git a/resource/sqlupgrade/DM/sql202309040303.sql b/resource/sqlupgrade/DM/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/DM/sql202309040303.sql @@ -0,0 +1,40 @@ +create table hrsa_add_up_deduction_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + request_status number default 1 not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null, + tax_agent_id number not null +); +/ + +alter table hrsa_add_up_deduction_request add lock_version int; +/ + +alter table hrsa_add_up_deduction_request modify lock_version default 0; +/ + +create table hrsa_add_up_deduction_req_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + employee_id number not null, + employee_type int not null, + tax_agent_id number not null, + reason varchar2(255) not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null +); +/ + diff --git a/resource/sqlupgrade/GS/sql202309040303.sql b/resource/sqlupgrade/GS/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/GS/sql202309040303.sql @@ -0,0 +1,40 @@ +create table hrsa_add_up_deduction_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + request_status number default 1 not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null, + tax_agent_id number not null +); +/ + +alter table hrsa_add_up_deduction_request add lock_version int; +/ + +alter table hrsa_add_up_deduction_request modify lock_version default 0; +/ + +create table hrsa_add_up_deduction_req_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + employee_id number not null, + employee_type int not null, + tax_agent_id number not null, + reason varchar2(255) not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null +); +/ + diff --git a/resource/sqlupgrade/JC/sql202309040303.sql b/resource/sqlupgrade/JC/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/JC/sql202309040303.sql @@ -0,0 +1,40 @@ +create table hrsa_add_up_deduction_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + request_status number default 1 not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null, + tax_agent_id number not null +); +/ + +alter table hrsa_add_up_deduction_request add lock_version int; +/ + +alter table hrsa_add_up_deduction_request modify lock_version default 0; +/ + +create table hrsa_add_up_deduction_req_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + employee_id number not null, + employee_type int not null, + tax_agent_id number not null, + reason varchar2(255) not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202309040303.sql b/resource/sqlupgrade/Mysql/sql202309040303.sql new file mode 100644 index 000000000..09de22bfa --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202309040303.sql @@ -0,0 +1,39 @@ +create table hrsa_add_up_deduction_request +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + request_id bigint not null comment 'ѯID' , + request_status tinyint(1) default 1 not null comment '״̬10 20 99' , + tax_year_month datetime not null comment '˰' , + outer_request_id varchar(50) not null comment 'ⲿӿڲѯID' , + tax_agent_id bigint not null comment '˰۽Id' +) +; + +alter table hrsa_add_up_deduction_request add lock_version int +; + +alter table hrsa_add_up_deduction_request modify column lock_version int default 0 +; + +create table hrsa_add_up_deduction_req_fail +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + request_id bigint not null comment 'ѯID' , + employee_id bigint not null comment 'ԱID' , + employee_type int not null comment 'Ա' , + tax_agent_id bigint not null comment '˰۽ID' , + reason varchar(255) not null comment 'ʧԭ' , + tax_year_month datetime not null comment '˰' , + outer_request_id varchar(50) not null comment 'ⲿӿڲѯid' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309040303.sql b/resource/sqlupgrade/Oracle/sql202309040303.sql new file mode 100644 index 000000000..1e666275e --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202309040303.sql @@ -0,0 +1,39 @@ +create table hrsa_add_up_deduction_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + request_status number default 1 not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null, + tax_agent_id number not null +) +/ + +alter table hrsa_add_up_deduction_request add lock_version int +/ + +alter table hrsa_add_up_deduction_request modify lock_version default 0 +/ + +create table hrsa_add_up_deduction_req_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + employee_id number not null, + employee_type int not null, + tax_agent_id number not null, + reason varchar2(255) not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309040303.sql b/resource/sqlupgrade/PG/sql202309040303.sql new file mode 100644 index 000000000..eefe81ecd --- /dev/null +++ b/resource/sqlupgrade/PG/sql202309040303.sql @@ -0,0 +1,40 @@ +create table hrsa_add_up_deduction_request +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + request_id bigint not null, + request_status smallint default 1 not null, + tax_year_month timestamp not null, + outer_request_id varchar(50) not null, + tax_agent_id bigint not null +); +/ + +alter table hrsa_add_up_deduction_request add lock_version int; +/ + +alter table hrsa_add_up_deduction_request alter column lock_version set default 0; +/ + + +create table hrsa_add_up_deduction_req_fail +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + request_id bigint not null, + employee_id bigint not null, + employee_type int not null, + tax_agent_id bigint not null, + reason varchar(255) not null, + tax_year_month timestamp not null, + outer_request_id varchar(50) not null +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309040303.sql b/resource/sqlupgrade/SQLServer/sql202309040303.sql new file mode 100644 index 000000000..bdfa19c5f --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202309040303.sql @@ -0,0 +1,39 @@ +create table hrsa_add_up_deduction_request +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + request_id bigint not null, + request_status tinyint default 1 not null, + tax_year_month datetime not null, + outer_request_id nvarchar(50) not null, + tax_agent_id bigint not null +) +GO + +alter table hrsa_add_up_deduction_request add lock_version int +GO + +alter table hrsa_add_up_deduction_request add constraint df_lock_version_71db6820 default 0 for lock_version +GO + +create table hrsa_add_up_deduction_req_fail +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + request_id bigint not null, + employee_id bigint not null, + employee_type int not null, + tax_agent_id bigint not null, + reason nvarchar(255) not null, + tax_year_month datetime not null, + outer_request_id nvarchar(50) not null +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202309040303.sql b/resource/sqlupgrade/ST/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/ST/sql202309040303.sql @@ -0,0 +1,40 @@ +create table hrsa_add_up_deduction_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + request_status number default 1 not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null, + tax_agent_id number not null +); +/ + +alter table hrsa_add_up_deduction_request add lock_version int; +/ + +alter table hrsa_add_up_deduction_request modify lock_version default 0; +/ + +create table hrsa_add_up_deduction_req_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + request_id number not null, + employee_id number not null, + employee_type int not null, + tax_agent_id number not null, + reason varchar2(255) not null, + tax_year_month date not null, + outer_request_id varchar2(50) not null +); +/ + diff --git a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java index ad132635e..ace90158f 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -1,6 +1,10 @@ package com.engine.salary.entity.datacollection.bo; +import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.enums.SalaryOnOffEnum; @@ -8,6 +12,7 @@ import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; import com.engine.salary.enums.employeedeclare.GenderEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; import com.engine.salary.service.impl.AddUpDeductionServiceImpl; import com.engine.salary.util.SalaryDateUtil; @@ -17,10 +22,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @Description: 数据采集 @@ -357,39 +359,40 @@ public class DataCollectionBO { return employeeList; } -// public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) { -// return AddUpDeduction.builder() -// .id(IdGenerator.generate()) -// .addUpChildEducation(feedback.getLjznjyzc().toString()) -// .addUpContinuingEducation(feedback.getLjjxjyzc().toString()) -// .addUpHousingRent(feedback.getLjzfzjzc().toString()) -// .addUpInfantCare(feedback.getLjyyezhzc().toString()) -// .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString()) -// .addUpSupportElderly(feedback.getLjsylrzc().toString()) -// .addUpIllnessMedical("0") + public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) { + return AddUpDeduction.builder() + .id(IdGenerator.generate()) + .addUpChildEducation(feedback.getLjznjyzc().toString()) + .addUpContinuingEducation(feedback.getLjjxjyzc().toString()) + .addUpHousingRent(feedback.getLjzfzjzc().toString()) + .addUpInfantCare(feedback.getLjyyezhzc().toString()) + .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString()) + .addUpSupportElderly(feedback.getLjsylrzc().toString()) + .addUpIllnessMedical("0") // .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue()) // .lastUpdateTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .build(); -// } -// -// public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, -// AddUpDeductionRequestPO requestPO, -// Long employeeId) { -// return AddUpDeductionRequestFailPO.builder() -// .id(IdGenerator.generate()) -// .requestId(requestPO.getRequestId()) -// .outerRequestId(requestPO.getOuterRequestId()) -// .taxYearMonth(requestPO.getTaxYearMonth()) -// .taxAgentId(requestPO.getTaxAgentId()) -// .employeeId(Optional.ofNullable(employeeId).orElse(0L)) -// .createTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .creator(requestWrapper.getCurrentEmployeeId()) -// .tenantKey(requestPO.getTenantKey()) -// .build(); -// } + .updateTime(new Date()) + .build(); + } + + public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, + AddUpDeductionRequestPO requestPO, + Long employeeId) { + Date now = new Date(); + return AddUpDeductionRequestFailPO.builder() + .id(IdGenerator.generate()) + .requestId(requestPO.getRequestId()) + .outerRequestId(requestPO.getOuterRequestId()) + .taxYearMonth(requestPO.getTaxYearMonth()) + .taxAgentId(requestPO.getTaxAgentId()) + .employeeId(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .creator(requestWrapper.getCurrentEmployeeId()) + .tenantKey(requestPO.getTenantKey()) + .build(); + } public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) { return AddUpDeductionRequestResultDTO.builder() diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java index 8ef9bc47d..7b0883452 100644 --- a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java @@ -1,13 +1,14 @@ package com.engine.salary.entity.datacollection.po; +import com.engine.salary.report.enums.EmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; -import java.time.LocalDate; -import java.time.LocalDateTime; +import java.util.Collection; +import java.util.Date; /** * 数据采集-累计专项附加扣除在线查询失败表 @@ -31,10 +32,10 @@ public class AddUpDeductionRequestFailPO implements Serializable { private Long id; //创建时间", ignore = true) - private LocalDateTime createTime; + private Date createTime; //修改时间", ignore = true) - private LocalDateTime updateTime; + private Date updateTime; //创建人id", ignore = true) private long creator; @@ -61,12 +62,15 @@ public class AddUpDeductionRequestFailPO implements Serializable { private String reason; //税款所属期") - private LocalDate taxYearMonth; + private Date taxYearMonth; /** - * @see com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum + * @see EmployeeTypeEnum */ //人员类型") private Integer employeeType; + + private Collection ids; + } diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java index 90a993052..6768edf3f 100644 --- a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java @@ -7,6 +7,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Collection; import java.util.Date; /** @@ -19,49 +20,56 @@ import java.util.Date; @Builder @NoArgsConstructor @AllArgsConstructor -//hrsa_add_up_deduction_request") -//数据采集-累计专项附加扣除在线查询表") +//hrsa_add_up_deduction_request +//数据采集-累计专项附加扣除在线查询表 public class AddUpDeductionRequestPO implements Serializable { private static final long serialVersionUID = 1452863635879051515L; - //ID") + //ID private long id; - //创建时间", ignore = true) + //创建时间" private Date createTime; - //修改时间", ignore = true) + //修改时间" private Date updateTime; - //创建人id", ignore = true) + //创建人id" private long creator; - //是否删除", ignore = true) + //是否删除" private int deleteType; - //租户KEY", ignore = true) + //租户KEY" private String tenantKey; - //乐观锁版本", ignore = true) + //乐观锁版本" private int lockVersion; - //查询请求ID") + //查询请求ID private Long requestId; - //外部接口查询请求ID") + //外部接口查询请求ID private String outerRequestId; /** * @see EnumAddUpDeductionRequestStatus */ - //请求处理状态") + //请求处理状态 private int requestStatus; - //税款所属期") + //税款所属期 private Date taxYearMonth; - //个税扣缴义务人ID") + //个税扣缴义务人ID private Long taxAgentId; + + + private Collection ids; + private Collection requestStatuss; + private Integer oldStatus; + private Integer oldLockVersion; + } diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.java b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.java new file mode 100644 index 000000000..1a2287833 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface AddUpDeductionRequestFailMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + AddUpDeductionRequestFailPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param addUpDeductionReqFail 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 批量插入 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); + + /** + * 修改,修改所有字段 + * + * @param addUpDeductionReqFail 修改的记录 + * @return 返回影响行数 + */ + int update(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 修改,忽略null字段 + * + * @param addUpDeductionReqFail 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 删除记录 + * + * @param addUpDeductionReqFail 待删除的记录 + * @return 返回影响行数 + */ + int delete(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.xml b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.xml new file mode 100644 index 000000000..e0e740698 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.xml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.employee_id + , t.employee_type + , t.id + , t.outer_request_id + , t.reason + , t.request_id + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_add_up_deduction_req_fail + + + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + employee_type, + + + id, + + + outer_request_id, + + + reason, + + + request_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{id}, + + + #{outerRequestId}, + + + #{reason}, + + + #{requestId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key, + request_id, + employee_id, employee_type, tax_agent_id, reason, tax_year_month, + outer_request_id) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.requestId}, + #{item.employeeId}, + #{item.employeeType}, + #{item.taxAgentId}, + #{item.reason}, + #{item.taxYearMonth}, + #{item.outerRequestId} + ) + + + + INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key, + request_id, + employee_id, employee_type, tax_agent_id, reason, tax_year_month, + outer_request_id) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.requestId}, + #{item.employeeId}, + #{item.employeeType}, + #{item.taxAgentId}, + #{item.reason}, + #{item.taxYearMonth}, + #{item.outerRequestId} + ) + + + + INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key, + request_id, + employee_id, employee_type, tax_agent_id, reason, tax_year_month, + outer_request_id) + + + select + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.requestId}, + #{item.employeeId}, + #{item.employeeType}, + #{item.taxAgentId}, + #{item.reason}, + #{item.taxYearMonth}, + #{item.outerRequestId} + from dual + + + + INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key, + request_id, + employee_id, employee_type, tax_agent_id, reason, tax_year_month, + outer_request_id) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.requestId}, + #{item.employeeId}, + #{item.employeeType}, + #{item.taxAgentId}, + #{item.reason}, + #{item.taxYearMonth}, + #{item.outerRequestId} + ) + + + + + + UPDATE hrsa_add_up_deduction_req_fail + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + outer_request_id=#{outerRequestId}, + reason=#{reason}, + request_id=#{requestId}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_req_fail + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + outer_request_id=#{outerRequestId}, + + + reason=#{reason}, + + + request_id=#{requestId}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_req_fail + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_add_up_deduction_req_fail + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.java b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.java new file mode 100644 index 000000000..5df335a15 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface AddUpDeductionRequestMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(AddUpDeductionRequestPO addUpDeductionRequest); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + AddUpDeductionRequestPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param addUpDeductionRequest 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 批量插入 + * + * @param addUpDeductionRequest + */ + void batchInsert(@Param("collection") List addUpDeductionRequest); + + /** + * 修改,修改所有字段 + * + * @param addUpDeductionRequest 修改的记录 + * @return 返回影响行数 + */ + int update(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 修改,忽略null字段 + * + * @param addUpDeductionRequest 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 删除记录 + * + * @param addUpDeductionRequest 待删除的记录 + * @return 返回影响行数 + */ + int delete(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + int updateRequestStatusLockVersion(AddUpDeductionRequestPO build); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.xml b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.xml new file mode 100644 index 000000000..b25dca50d --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.xml @@ -0,0 +1,388 @@ + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.id + , t.lock_version + , t.outer_request_id + , t.request_id + , t.request_status + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_add_up_deduction_request + + + + create_time, + + + creator, + + + delete_type, + + + id, + + + lock_version, + + + outer_request_id, + + + request_id, + + + request_status, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{lockVersion}, + + + #{outerRequestId}, + + + #{requestId}, + + + #{requestStatus}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + INSERT INTO hrsa_add_up_deduction_request + ( + create_time, + creator, + delete_type, + id, + lock_version, + outer_request_id, + request_id, + request_status, + tax_agent_id, + tax_year_month, + tenant_key, + update_time + ) + VALUES + ( + + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.id}, + #{item.lockVersion}, + #{item.outerRequestId}, + #{item.requestId}, + #{item.requestStatus}, + #{item.taxAgentId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime} + + ) + + + + + INSERT INTO hrsa_add_up_deduction_request ( + create_time, + creator, + delete_type, + id, + lock_version, + outer_request_id, + request_id, + request_status, + tax_agent_id, + tax_year_month, + tenant_key, + update_time + ) + + select + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.lockVersion,jdbcType=INTEGER}, + #{item.outerRequestId,jdbcType=DOUBLE}, + #{item.requestId,jdbcType=DOUBLE}, + #{item.requestStatus,jdbcType=INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.taxYearMonth,jdbcType=DATE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE} + from dual + + + + + + + INSERT INTO hrsa_add_up_deduction_request ( + create_time, + creator, + delete_type, + id, + lock_version, + outer_request_id, + request_id, + request_status, + tax_agent_id, + tax_year_month, + tenant_key, + update_time + ) + VALUES + ( + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.id}, + #{item.lockVersion}, + #{item.outerRequestId}, + #{item.requestId}, + #{item.requestStatus}, + #{item.taxAgentId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime} + ) + + + + + + UPDATE hrsa_add_up_deduction_request + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + lock_version=#{lockVersion}, + outer_request_id=#{outerRequestId}, + request_id=#{requestId}, + request_status=#{requestStatus}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_request + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + lock_version=#{lockVersion}, + + + outer_request_id=#{outerRequestId}, + + + request_id=#{requestId}, + + + request_status=#{requestStatus}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_request + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_add_up_deduction_request + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_add_up_deduction_request + + request_status=#{requestStatus}, + lock_version=#{lockVersion}, + update_time=#{updateTime}, + + WHERE delete_type = 0 + AND request_status=#{oldStatus} + AND lock_version=#{oldLockVersion} + AND id = #{id} + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/SalaryArchiveService.java b/src/com/engine/salary/service/SalaryArchiveService.java index c240adcf3..dbeb2d865 100644 --- a/src/com/engine/salary/service/SalaryArchiveService.java +++ b/src/com/engine/salary/service/SalaryArchiveService.java @@ -240,4 +240,6 @@ public interface SalaryArchiveService { * @return */ List listPayEndDateIsNull(List employeeIds); + + List listByRunStatus(List asList); } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index c8aeee357..70157b459 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -52,6 +52,8 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; +import com.engine.salary.mapper.datacollection.AddUpDeductionRequestFailMapper; +import com.engine.salary.mapper.datacollection.AddUpDeductionRequestMapper; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.report.enums.EmployeeTypeEnum; @@ -75,7 +77,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; -import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -86,7 +87,6 @@ import java.io.InputStream; import java.text.SimpleDateFormat; import java.time.*; import java.util.*; -import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -157,6 +157,14 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); } + private AddUpDeductionRequestMapper getAddUpDeductionRequestMapper() { + return MapperProxyFactory.getProxy(AddUpDeductionRequestMapper.class); + } + + private AddUpDeductionRequestFailMapper getAddUpDeductionRequestFailMapper() { + return MapperProxyFactory.getProxy(AddUpDeductionRequestFailMapper.class); + } + private ExtEmpService getExtEmpService(User user) { return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } @@ -1285,8 +1293,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution(); long employeeId = (long) user.getUID(); boolean isChief = getTaxAgentService(user).isChief(employeeId); - List taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAsChief(isOpenDevolution, isChief) : getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); - Set taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); + List taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAll() : (List) getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); + List taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); // 获取薪资档案 List salaryArchiveList = getSalaryArchiveService(user).listByRunStatus(Arrays.asList( SalaryArchiveStatusEnum.FIXED.getValue(), @@ -1363,7 +1371,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .creator(user.getUID()) .lockVersion(0) .build(); - addUpDeductionRequestMapper.insert(po); + getAddUpDeductionRequestMapper().insertIgnoreNull(po); } } @@ -1407,7 +1415,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction setExistedDataMap(requestWrapper); // 开始处理反馈结果 TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper - = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(requestPOList.get(0).getTaxYearMonth(), requestWrapper.getApiConfig(), EnumDeclareApiBusinessType.ADD_UP_DEDUCTION); + = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(requestPOList.get(0).getTaxYearMonth(), requestWrapper.getApiConfig(), EnumDeclareApiBusinessType.ADD_UP_DEDUCTION, (long) user.getUID()); handleFeedbackData(requestWrapper, apiFlowUpdateWrapper); // 持久化数据 persistFeedbackData(requestWrapper); @@ -1419,30 +1427,22 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override public PageInfo onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) { - Page page = new LambdaQueryChainWrapper<>(addUpDeductionRequestFailMapper) - .eq(AddUpDeductionRequestFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(AddUpDeductionRequestFailPO::getTenantKey) - .eq(AddUpDeductionRequestFailPO::getRequestId, queryParam.getRequestId()) - .page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), queryParam.getTotal(), true)); - + List addUpDeductionRequestFailPOS = getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(queryParam.getRequestId()).build()); + List list = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), addUpDeductionRequestFailPOS); // 获取薪资档案 AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null); this.getEmployeeInfoMap(requestWrapper); - List listDTOList = page.getRecords().stream() - .map(requestWrapper::buildAddUpDeductionRequestFailListDTO).collect(Collectors.toList()); - PageInfo listDTOPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), false); - listDTOPage.setRecords(listDTOList); - return listDTOPage; + List listDTOList = list.stream().map(requestWrapper::buildAddUpDeductionRequestFailListDTO).collect(Collectors.toList()); + + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listDTOList, AddUpDeductionRequestFailListDTO.class); + page.setTotal(addUpDeductionRequestFailPOS.size()); + return page; } @Override public List getAddUpDeductionRequestFailPOList(Long requestId) { - return new LambdaQueryChainWrapper<>(addUpDeductionRequestFailMapper) - .eq(AddUpDeductionRequestFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(AddUpDeductionRequestFailPO::getTenantKey) - .eq(AddUpDeductionRequestFailPO::getRequestId, requestId) - .list(); + return getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(requestId).build()); } @Override @@ -1476,14 +1476,13 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction rows.add(row); } // 生成表格 - ExcelUtil.genWorkbookV2(rows,""); + ExcelUtil.genWorkbookV2(rows, ""); } - private void getEmployeeInfoMap(AddUpDeductionOnlineRequestWrapper wrapper) { // 身份证号 - List employeeIds = SalaryEntityUtil.properties(wrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId,Collectors.toList()); + List employeeIds = SalaryEntityUtil.properties(wrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList()); List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getEmployeeId); wrapper.setUserInfoUserIdMap(simpleUserInfoMap); @@ -1492,17 +1491,13 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); wrapper.setSimpleEmployeeMap(simpleEmployeeMap); // 外部人员信息 - List extEmployeePOS = getExtEmpService(user).listCanUse(wrapper.getCurrentEmployeeId()); + List extEmployeePOS = getExtEmpService(user).listAll(); Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId, e -> e); wrapper.setExtEmployeePOMap(extEmployeePOMap); } private List getAddUpDeductionRequestPOS() { - return new LambdaQueryChainWrapper<>(addUpDeductionRequestMapper) - .eq(AddUpDeductionRequestPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(AddUpDeductionRequestPO::getTenantKey) - .in(AddUpDeductionRequestPO::getRequestStatus, EnumAddUpDeductionRequestStatus.RUNNING.getValue()) - .list(); + return getAddUpDeductionRequestMapper().listSome(AddUpDeductionRequestPO.builder().requestStatus(EnumAddUpDeductionRequestStatus.RUNNING.getValue()).build()); } private void handleFeedbackData(AddUpDeductionOnlineRequestWrapper requestWrapper, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper) { @@ -1510,8 +1505,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction DataCollectionEmployee simpleUserInfo = requestWrapper.getUserInfoIdNoMap().get(feedback.getZzhm()); Long extEmpId = requestWrapper.getExtEmployeeIdCardMap().get(feedback.getZzhm()); Long employeeId = Optional.ofNullable(simpleUserInfo) - .map(DataCollectionEmployee::getUser) - .map(IdEntity::getId) + .map(DataCollectionEmployee::getEmployeeId) .orElse(extEmpId); AddUpDeductionRequestPO requestPO = requestWrapper.getRequestPoMap().get(outerRequestId); @@ -1563,25 +1557,19 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); requestWrapper.setSimpleEmployeeMap(simpleEmployeeMap); // 内部员工(身份证信息) - List employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId,Collectors.toList()); + List employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList()); List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getIdNo); requestWrapper.setUserInfoIdNoMap(simpleUserInfoMap); // 外部员工信息 - List extEmployeePOS = getExtEmpService(user).listCanUse(requestWrapper.getCurrentEmployeeId(), requestWrapper.getTenantKey()); - Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getCardNum, ExtEmpPO::getId); + List extEmployeePOS = getExtEmpService(user).listAll(); + Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getIdNo, ExtEmpPO::getId); requestWrapper.setExtEmployeeIdCardMap(extEmployeePOMap); } private void setExistedDataMap(AddUpDeductionOnlineRequestWrapper requestWrapper) { - Set taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId); - List poList = new LambdaQueryChainWrapper<>(addUpDeductionMapper) - .select(AddUpDeduction::getId, AddUpDeduction::getTaxAgentId, AddUpDeduction::getEmployeeId) - .eq(AddUpDeduction::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(AddUpDeduction::getTenantKey, requestWrapper.getTenantKey()) - .eq(AddUpDeduction::getDeclareMonth, requestWrapper.getRequestPOList().get(0).getTaxYearMonth()) - .in(AddUpDeduction::getTaxAgentId, taxAgentIds) - .list(); + List taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId, Collectors.toList()); + List poList = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(requestWrapper.getRequestPOList().get(0).getTaxYearMonth()).taxAgentIds(taxAgentIds).build()); requestWrapper.setExistedDataMap(SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId(), AddUpDeduction::getId)); } @@ -1618,20 +1606,20 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction if (!requestWrapper.getInsertList().isEmpty()) { List> insertPartition = Lists.partition(requestWrapper.getInsertList(), 1000); insertPartition.forEach(list -> { - list = dataSecurityService.encryptBatch(list, AddUpDeduction.class, requestWrapper.getTenantKey()); - addUpDeductionMapper.insertData(list); + list = encryptUtil.encryptList(list, AddUpDeduction.class); + getAddUpDeductionMapper().insertData(list); }); } if (!requestWrapper.getUpdateList().isEmpty()) { List> updatePartition = Lists.partition(requestWrapper.getUpdateList(), 1000); updatePartition.forEach(list -> { - list = dataSecurityService.encryptBatch(list, AddUpDeduction.class, requestWrapper.getTenantKey()); - addUpDeductionMapper.updateData(list); + list = encryptUtil.encryptList(list, AddUpDeduction.class); + getAddUpDeductionMapper().updateData(list); }); } if (!requestWrapper.getFailPOList().isEmpty()) { List> failPartition = Lists.partition(requestWrapper.getFailPOList(), 1000); - failPartition.forEach(list -> addUpDeductionRequestFailMapper.batchInsert(list)); + failPartition.forEach(list -> getAddUpDeductionRequestFailMapper().batchInsert(list)); } } @@ -1649,16 +1637,16 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction public void updateRequestStatus(List requestPOList, Integer oldStatus, Integer newStatus) { for (AddUpDeductionRequestPO requestPO : requestPOList) { - boolean update = new LambdaUpdateChainWrapper<>(addUpDeductionRequestMapper) - .set(AddUpDeductionRequestPO::getRequestStatus, newStatus) - .set(AddUpDeductionRequestPO::getUpdateTime, LocalDateTime.now()) - .set(AddUpDeductionRequestPO::getLockVersion, requestPO.getLockVersion() + 1) - .eq(AddUpDeductionRequestPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) - .eq(AddUpDeductionRequestPO::getRequestStatus, oldStatus) - .eq(AddUpDeductionRequestPO::getId, requestPO.getId()) - .eq(AddUpDeductionRequestPO::getLockVersion, requestPO.getLockVersion()) - .update(); - SalaryAssert.isTrue(update, SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + int i = getAddUpDeductionRequestMapper().updateRequestStatusLockVersion(AddUpDeductionRequestPO.builder() + .requestStatus(newStatus) + .lockVersion(requestPO.getLockVersion() + 1) + .updateTime(new Date()) + .oldStatus(oldStatus) + .id(requestPO.getId()) + .oldLockVersion(oldStatus) + .build() + ); +// SalaryAssert.isTrue(update, SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); } } diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 29530bfb3..d055ca9b2 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -1292,4 +1292,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds); } + + @Override + public List listByRunStatus(List list) { + return getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().runStatusList(list).build()); + } } diff --git a/src/com/engine/salary/web/AddUpDeductionController.java b/src/com/engine/salary/web/AddUpDeductionController.java index ef2754c5e..3cec335d0 100644 --- a/src/com/engine/salary/web/AddUpDeductionController.java +++ b/src/com/engine/salary/web/AddUpDeductionController.java @@ -7,18 +7,18 @@ import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.AddUpDeductionWrapper; -import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.jetbrains.annotations.Nullable; -import org.springframework.web.bind.annotation.RequestParam; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -37,7 +37,10 @@ import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; -import java.util.*; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -385,12 +388,9 @@ public class AddUpDeductionController { @Path("/online/request") @POST @Produces(MediaType.APPLICATION_JSON) - public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionMonthTaxAgentParam param) { - Map result = addUpDeductionWrapper.onlineRequest(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - if (Objects.nonNull(result.get("msg"))) { - return WeaResult.fail(result.get("msg").toString()); - } - return WeaResult.success(null); + public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionMonthTaxAgentParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getAddUpDeductionWrapper(user)::onlineRequest, param); } /** @@ -401,8 +401,9 @@ public class AddUpDeductionController { @Path("/online/feedback") @GET @Produces(MediaType.APPLICATION_JSON) - public String onlineFeedback() { - return WeaResult.success(addUpDeductionWrapper.onlineFeedback(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); + public String onlineFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getAddUpDeductionWrapper(user)::onlineFeedback); } /** @@ -413,45 +414,48 @@ public class AddUpDeductionController { @Path("/online/feedback/fail") @POST @Produces(MediaType.APPLICATION_JSON) - public String onlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionRequestFailQueryParam queryParam) { - return WeaResult.success(addUpDeductionWrapper.onlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), queryParam)); + public String onlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionRequestFailQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getAddUpDeductionWrapper(user)::onlineFeedbackFail, queryParam); } - /** - * 在线获取结果导出 - * - * @return WeaResult 接口返回信息 - */ - @Path("/online/feedback/fail/export") - @GET - @Produces(MediaType.APPLICATION_JSON) - public String exportOnlineFeedbackFail(@RequestParam Long requestId) { - return WeaResult.success(addUpDeductionWrapper.exportOnlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), requestId)); - } +// /** +// * 在线获取结果导出 +// * +// * @return WeaResult 接口返回信息 +// */ +// @Path("/online/feedback/fail/export") +// @GET +// @Produces(MediaType.APPLICATION_JSON) +// public String exportOnlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestParam Long requestId) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getAddUpDeductionWrapper(user)::exportOnlineFeedbackFail, queryParam); +// return WeaResult.success(addUpDeductionWrapper.exportOnlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), requestId)); +// } - /** - * 在线获取表单 - * - * @return WeaResult 返回结果 - */ - @Path("/online/request/form") - @GET - @Produces(MediaType.APPLICATION_JSON) - public String getForm() { - return WeaResult.success(addUpDeductionWrapper.getRequestForm()); - } +// /** +// * 在线获取表单 +// * +// * @return WeaResult 返回结果 +// */ +// @Path("/online/request/form") +// @GET +// @Produces(MediaType.APPLICATION_JSON) +// public String getForm() { +// return WeaResult.success(addUpDeductionWrapper.getRequestForm()); +// } - /** - * 自动计算次月 - * - * @param queryParam 查询条件 - * @return WeaResult 返回结果 - */ - @Path("/autoCalculate") - @POST - @Produces(MediaType.APPLICATION_JSON) - public String autoCalculate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionQueryParam queryParam) { - addUpDeductionWrapper.autoCalculate(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); - return WeaResult.success(null); - } +// /** +// * 自动计算次月 +// * +// * @param queryParam 查询条件 +// * @return WeaResult 返回结果 +// */ +// @Path("/autoCalculate") +// @POST +// @Produces(MediaType.APPLICATION_JSON) +// public String autoCalculate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionQueryParam queryParam) { +// addUpDeductionWrapper.autoCalculate(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } } diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index 3ac0dfe17..dbd0abf80 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -5,10 +5,9 @@ import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; +import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.AddUpDeductionService; import com.engine.salary.service.SalaryEmployeeService; @@ -180,50 +179,50 @@ public class AddUpDeductionWrapper extends Service { return getAddUpDeductionService(user).autoAddAll(yearMonth, null); } - public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param, Long currentEmployeeId, String currentTenantKey) { - return addUpDeductionService.onlineRequest(param, currentEmployeeId, currentTenantKey); + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + return getAddUpDeductionService(user).onlineRequest(param); } - public AddUpDeductionRequestResultDTO onlineFeedback(Long currentEmployeeId, String currentTenantKey) { - return addUpDeductionService.onlineFeedback(currentEmployeeId, currentTenantKey); + public AddUpDeductionRequestResultDTO onlineFeedback() { + return getAddUpDeductionService(user).onlineFeedback(); } - public WeaTable onlineFeedbackFail(Long currentEmployeeId, String currentTenantKey, AddUpDeductionRequestFailQueryParam queryParam) { + public PageInfo onlineFeedbackFail( AddUpDeductionRequestFailQueryParam queryParam) { if (queryParam.getRequestId() == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 153345, "在线获取的请求ID不可为空")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153345, "在线获取的请求ID不可为空")); } - Page page = addUpDeductionService.onlineFeedbackFail(currentEmployeeId, currentTenantKey, queryParam); - return SalaryFormatUtil.getInstance().buildTable(AddUpDeductionRequestFailListDTO.class, page); + PageInfo page = getAddUpDeductionService(user).onlineFeedbackFail( queryParam); + return page; } - public Map exportOnlineFeedbackFail(Long employeeId, String tenantKey, Long requestId) { - List poList = addUpDeductionService.getAddUpDeductionRequestFailPOList(requestId, tenantKey); - if (CollectionUtils.isEmpty(poList)) { - throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95795, "数据不存在") + "[id:%s]", requestId)); - } - // 构建异步导出参数 - Map map = salaryBatchService.buildeExportParam("exportOnlineFeedbackFail"); - map.put("sheetName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 183778, "在线获取专项附加扣除失败数据")); - LocalRunnable localRunnable = new LocalRunnable() { - @Override - public void execute() { - try { - DSTenantKeyThreadVar.tenantKey.set(tenantKey); - addUpDeductionService.exportOnlineFeedbackFail(map, requestId, employeeId, tenantKey); - } finally { - DSTenantKeyThreadVar.tenantKey.remove(); - } - } - }; - ThreadPoolUtil.execute(localRunnable); - return map; - } - - public WeaForm getRequestForm() { - WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(AddUpDeductionRequestFormDTO.class, new AddUpDeductionRequestFormDTO()); - WeaFormSalaryItem item = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER, "month", "YYYY-MM", "YYYY-MM"); - item.setRequired(true); - weaForm.getItems().put("declareMonth", item); - return weaForm; - } +// public Map exportOnlineFeedbackFail( Long requestId) { +// List poList = getAddUpDeductionService(user).getAddUpDeductionRequestFailPOList(requestId); +// if (CollectionUtils.isEmpty(poList)) { +// throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel( 95795, "数据不存在") + "[id:%s]", requestId)); +// } +// // 构建异步导出参数 +// Map map = salaryBatchService.buildeExportParam("exportOnlineFeedbackFail"); +// map.put("sheetName", SalaryI18nUtil.getI18nLabel( 183778, "在线获取专项附加扣除失败数据")); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// try { +// DSTenantKeyThreadVar.tenantKey.set(tenantKey); +// getAddUpDeductionService(user).exportOnlineFeedbackFail(map, requestId); +// } finally { +// DSTenantKeyThreadVar.tenantKey.remove(); +// } +// } +// }; +// ThreadPoolUtil.execute(localRunnable); +// return map; +// } +// +// public WeaForm getRequestForm() { +// WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(AddUpDeductionRequestFormDTO.class, new AddUpDeductionRequestFormDTO()); +// WeaFormSalaryItem item = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER, "month", "YYYY-MM", "YYYY-MM"); +// item.setRequired(true); +// weaForm.getItems().put("declareMonth", item); +// return weaForm; +// } } From 9867728d2ed52c7be9e9d477ee6946a31838a016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 4 Sep 2023 16:18:02 +0800 Subject: [PATCH 048/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0=E6=89=A3?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacollection/bo/DataCollectionBO.java | 4 ++-- .../param/AddUpDeductionMonthTaxAgentParam.java | 2 ++ .../po/AddUpDeductionRequestFailPO.java | 4 ++-- .../po/AddUpDeductionRequestPO.java | 10 +++++----- .../entity/taxagent/po/TaxAgentTaxReturnPO.java | 1 + .../service/impl/AddUpDeductionServiceImpl.java | 17 +++++++++-------- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java index ace90158f..46cd04e6d 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -350,8 +350,8 @@ public class DataCollectionBO { boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents()); employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel()); employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null); - employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); - employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); + employeeMap.computeIfAbsent("sfls", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); + employeeMap.computeIfAbsent("lszh", e -> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel()); employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel()); employeeList.add(employeeMap); diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java index 843ecd238..b22d0fd84 100644 --- a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.param; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -17,6 +18,7 @@ import java.util.Date; public class AddUpDeductionMonthTaxAgentParam { @ApiModelProperty("税款所属期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date declareMonth; @ApiModelProperty("个税扣缴义务人的主键id") diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java index 7b0883452..a5baf15ca 100644 --- a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java @@ -38,10 +38,10 @@ public class AddUpDeductionRequestFailPO implements Serializable { private Date updateTime; //创建人id", ignore = true) - private long creator; + private Long creator; //是否删除", ignore = true) - private int deleteType; + private Integer deleteType; //租户KEY", ignore = true) private String tenantKey; diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java index 6768edf3f..6894a68ed 100644 --- a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java @@ -27,7 +27,7 @@ public class AddUpDeductionRequestPO implements Serializable { private static final long serialVersionUID = 1452863635879051515L; //ID - private long id; + private Long id; //创建时间" private Date createTime; @@ -36,16 +36,16 @@ public class AddUpDeductionRequestPO implements Serializable { private Date updateTime; //创建人id" - private long creator; + private Long creator; //是否删除" - private int deleteType; + private Integer deleteType; //租户KEY" private String tenantKey; //乐观锁版本" - private int lockVersion; + private Integer lockVersion; //查询请求ID private Long requestId; @@ -57,7 +57,7 @@ public class AddUpDeductionRequestPO implements Serializable { * @see EnumAddUpDeductionRequestStatus */ //请求处理状态 - private int requestStatus; + private Integer requestStatus; //税款所属期 private Date taxYearMonth; diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java index b338e53b6..717a5e960 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -145,6 +145,7 @@ public class TaxAgentTaxReturnPO implements Serializable { //查询条件 + private Collection ids; private Collection taxAgentIds; private Collection taxCodes; } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 70157b459..e89b31d36 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1303,7 +1303,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) ); salaryArchiveList = salaryArchiveList.stream().filter(e -> taxAgentIdSet.contains(e.getTaxAgentId())).collect(Collectors.toList()); - AddUpDeductionOnlineRequestWrapper requestWrapper = new AddUpDeductionOnlineRequestWrapper(requestPOList, salaryArchiveList, taxAgents); + AddUpDeductionOnlineRequestWrapper requestWrapper = new AddUpDeductionOnlineRequestWrapper(requestPOList, salaryArchiveList, taxAgents, (long) user.getUID()); requestWrapper.setApiConfig(apiConfig); return requestWrapper; } @@ -1368,7 +1368,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .tenantKey(DEFAULT_TENANT_KEY) .createTime(new Date()) .updateTime(new Date()) - .creator(user.getUID()) + .creator((long) user.getUID()) .lockVersion(0) .build(); getAddUpDeductionRequestMapper().insertIgnoreNull(po); @@ -1604,21 +1604,21 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction private void persistFeedbackData(AddUpDeductionOnlineRequestWrapper requestWrapper) { if (!requestWrapper.getInsertList().isEmpty()) { - List> insertPartition = Lists.partition(requestWrapper.getInsertList(), 1000); + List> insertPartition = Lists.partition(requestWrapper.getInsertList(), 100); insertPartition.forEach(list -> { list = encryptUtil.encryptList(list, AddUpDeduction.class); getAddUpDeductionMapper().insertData(list); }); } if (!requestWrapper.getUpdateList().isEmpty()) { - List> updatePartition = Lists.partition(requestWrapper.getUpdateList(), 1000); + List> updatePartition = Lists.partition(requestWrapper.getUpdateList(), 100); updatePartition.forEach(list -> { list = encryptUtil.encryptList(list, AddUpDeduction.class); getAddUpDeductionMapper().updateData(list); }); } if (!requestWrapper.getFailPOList().isEmpty()) { - List> failPartition = Lists.partition(requestWrapper.getFailPOList(), 1000); + List> failPartition = Lists.partition(requestWrapper.getFailPOList(), 100); failPartition.forEach(list -> getAddUpDeductionRequestFailMapper().batchInsert(list)); } } @@ -1643,7 +1643,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .updateTime(new Date()) .oldStatus(oldStatus) .id(requestPO.getId()) - .oldLockVersion(oldStatus) + .oldLockVersion(requestPO.getLockVersion()) .build() ); // SalaryAssert.isTrue(update, SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); @@ -1697,7 +1697,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction public AddUpDeductionOnlineRequestWrapper(List requestPOList, List salaryArchiveList, - List taxAgents) { + List taxAgents, + Long currentEmployeeId) { this.requestFeedBackMap = new HashMap<>(); this.requestPoMap = new HashMap<>(); this.insertList = new ArrayList<>(); @@ -1706,7 +1707,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction this.failPOList = new ArrayList<>(); this.salaryArchiveList = salaryArchiveList; this.requestPOList = requestPOList; - this.tenantKey = tenantKey; + this.tenantKey = DEFAULT_TENANT_KEY; this.currentEmployeeId = currentEmployeeId; this.taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); } From f245bd2f49c8715cd42c9a2a2425464c2329ab85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 5 Sep 2023 11:04:53 +0800 Subject: [PATCH 049/298] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=80=E6=9C=9F?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202309050103.sql | 3 + resource/sqlupgrade/DM/sql202309050203.sql | 9 + resource/sqlupgrade/GS/sql202309050103.sql | 3 + resource/sqlupgrade/GS/sql202309050203.sql | 9 + resource/sqlupgrade/JC/sql202309050103.sql | 3 + resource/sqlupgrade/JC/sql202309050203.sql | 9 + resource/sqlupgrade/Mysql/sql202309050103.sql | 1 + resource/sqlupgrade/Mysql/sql202309050203.sql | 6 + .../sqlupgrade/Oracle/sql202309050103.sql | 2 + .../sqlupgrade/Oracle/sql202309050203.sql | 6 + resource/sqlupgrade/PG/sql202309050103.sql | 2 + resource/sqlupgrade/PG/sql202309050203.sql | 6 + .../sqlupgrade/SQLServer/sql202309050103.sql | 2 + .../sqlupgrade/SQLServer/sql202309050203.sql | 6 + resource/sqlupgrade/ST/sql202309050103.sql | 3 + resource/sqlupgrade/ST/sql202309050203.sql | 9 + .../salary/constant/SzyhApiConstant.java | 4 + .../entity/datacollection/AddUpSituation.java | 36 ++ .../po/SpecialAddDeductionPO.java | 1 + .../response/GetCompanyIncomesResponse.java | 395 ++++++++++++++++++ .../salary/service/AddUpDeductionService.java | 3 +- .../salary/service/AddUpSituationService.java | 8 + .../impl/AddUpDeductionServiceImpl.java | 4 +- .../impl/AddUpSituationServiceImpl.java | 279 +++++++++++-- .../salary/web/AddUpDeductionController.java | 53 ++- .../salary/web/AddUpSituationController.java | 13 + .../salary/wrapper/AddUpDeductionWrapper.java | 36 +- .../salary/wrapper/AddUpSituationWrapper.java | 9 +- 28 files changed, 829 insertions(+), 91 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202309050103.sql create mode 100644 resource/sqlupgrade/DM/sql202309050203.sql create mode 100644 resource/sqlupgrade/GS/sql202309050103.sql create mode 100644 resource/sqlupgrade/GS/sql202309050203.sql create mode 100644 resource/sqlupgrade/JC/sql202309050103.sql create mode 100644 resource/sqlupgrade/JC/sql202309050203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202309050103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202309050203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202309050103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202309050203.sql create mode 100644 resource/sqlupgrade/PG/sql202309050103.sql create mode 100644 resource/sqlupgrade/PG/sql202309050203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202309050103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202309050203.sql create mode 100644 resource/sqlupgrade/ST/sql202309050103.sql create mode 100644 resource/sqlupgrade/ST/sql202309050203.sql create mode 100644 src/com/engine/salary/entity/datacollection/response/GetCompanyIncomesResponse.java diff --git a/resource/sqlupgrade/DM/sql202309050103.sql b/resource/sqlupgrade/DM/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/DM/sql202309050103.sql @@ -0,0 +1,3 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); +/ + diff --git a/resource/sqlupgrade/DM/sql202309050203.sql b/resource/sqlupgrade/DM/sql202309050203.sql new file mode 100644 index 000000000..77982e200 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202309050203.sql @@ -0,0 +1,9 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255); +/ + +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); +/ + +alter table hrsa_add_up_situation add tax_adjustment varchar2(255); +/ + diff --git a/resource/sqlupgrade/GS/sql202309050103.sql b/resource/sqlupgrade/GS/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/GS/sql202309050103.sql @@ -0,0 +1,3 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); +/ + diff --git a/resource/sqlupgrade/GS/sql202309050203.sql b/resource/sqlupgrade/GS/sql202309050203.sql new file mode 100644 index 000000000..77982e200 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202309050203.sql @@ -0,0 +1,9 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255); +/ + +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); +/ + +alter table hrsa_add_up_situation add tax_adjustment varchar2(255); +/ + diff --git a/resource/sqlupgrade/JC/sql202309050103.sql b/resource/sqlupgrade/JC/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/JC/sql202309050103.sql @@ -0,0 +1,3 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); +/ + diff --git a/resource/sqlupgrade/JC/sql202309050203.sql b/resource/sqlupgrade/JC/sql202309050203.sql new file mode 100644 index 000000000..77982e200 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202309050203.sql @@ -0,0 +1,9 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255); +/ + +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); +/ + +alter table hrsa_add_up_situation add tax_adjustment varchar2(255); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202309050103.sql b/resource/sqlupgrade/Mysql/sql202309050103.sql new file mode 100644 index 000000000..67dd54d95 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202309050103.sql @@ -0,0 +1 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202309050203.sql b/resource/sqlupgrade/Mysql/sql202309050203.sql new file mode 100644 index 000000000..449c25f07 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202309050203.sql @@ -0,0 +1,6 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar(255) +; +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar(255) +; +alter table hrsa_add_up_situation add tax_adjustment varchar(255) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050103.sql b/resource/sqlupgrade/Oracle/sql202309050103.sql new file mode 100644 index 000000000..c010cb4ef --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202309050103.sql @@ -0,0 +1,2 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql new file mode 100644 index 000000000..14347cd8b --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202309050203.sql @@ -0,0 +1,6 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255) +/ +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255) +/ +alter table hrsa_add_up_situation add tax_adjustment varchar2(255) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309050103.sql b/resource/sqlupgrade/PG/sql202309050103.sql new file mode 100644 index 000000000..442635f18 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202309050103.sql @@ -0,0 +1,2 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309050203.sql b/resource/sqlupgrade/PG/sql202309050203.sql new file mode 100644 index 000000000..4b9085caa --- /dev/null +++ b/resource/sqlupgrade/PG/sql202309050203.sql @@ -0,0 +1,6 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar(255); +/ +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar(255); +/ +alter table hrsa_add_up_situation add tax_adjustment varchar(255); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309050103.sql b/resource/sqlupgrade/SQLServer/sql202309050103.sql new file mode 100644 index 000000000..362f2654c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202309050103.sql @@ -0,0 +1,2 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309050203.sql b/resource/sqlupgrade/SQLServer/sql202309050203.sql new file mode 100644 index 000000000..ea69e5604 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202309050203.sql @@ -0,0 +1,6 @@ +alter table hrsa_add_up_situation add add_up_taxable_income nvarchar(255) +GO +alter table hrsa_add_up_situation add actual_add_up_advance_tax nvarchar(255) +GO +alter table hrsa_add_up_situation add tax_adjustment nvarchar(255) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202309050103.sql b/resource/sqlupgrade/ST/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/ST/sql202309050103.sql @@ -0,0 +1,3 @@ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); +/ + diff --git a/resource/sqlupgrade/ST/sql202309050203.sql b/resource/sqlupgrade/ST/sql202309050203.sql new file mode 100644 index 000000000..77982e200 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202309050203.sql @@ -0,0 +1,9 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255); +/ + +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); +/ + +alter table hrsa_add_up_situation add tax_adjustment varchar2(255); +/ + diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 698f662f8..b4e04552a 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -137,6 +137,10 @@ public class SzyhApiConstant { * 刷新缴款状态 */ public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; + /** + * 企业申报数据明细查询 + */ + public static final String GET_COMPANY_INCOMES = "gateway/iit/report/getCompanyIncomes"; /** diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index eeae5d130..aefe36a4d 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -4,6 +4,7 @@ import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableOperate; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -49,6 +50,12 @@ public class AddUpSituation { */ private Integer year; + /** + * 人员类型 + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 累计收入额 */ @@ -82,6 +89,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number") @Encrypt + @Deprecated private String addUpChildEducation; /** @@ -89,6 +97,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number") @Encrypt + @Deprecated private String addUpContinuingEducation; /** @@ -96,6 +105,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number") @Encrypt + @Deprecated private String addUpHousingLoanInterest; /** @@ -103,6 +113,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number") @Encrypt + @Deprecated private String addUpHousingRent; /** @@ -110,6 +121,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number") @Encrypt + @Deprecated private String addUpSupportElderly; /** @@ -117,6 +129,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number") @Encrypt + @Deprecated private String addUpIllnessMedical; /** @@ -124,6 +137,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number") @Encrypt + @Deprecated private String addUpInfantCare; /** @@ -131,6 +145,7 @@ public class AddUpSituation { */ @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number") @Encrypt + @Deprecated private String addUpPrivatePension; /** @@ -175,6 +190,27 @@ public class AddUpSituation { @Encrypt private String addUpAdvanceTax; + /** + * 累计已预扣预缴税额 + */ + @SalaryFormulaVar(defaultLabel = "实际累计已预扣预缴税额", labelId = 233557, dataType = "number") + @Encrypt + private String actualAddUpAdvanceTax; + + /** + * 累计已预扣预缴税额 + */ + @SalaryFormulaVar(defaultLabel = "个税调差", labelId = 233559, dataType = "number") + @Encrypt + private String taxAdjustment; + + /** + * 累计应纳税所得额 + */ + @SalaryFormulaVar(defaultLabel = "累计应纳税所得额", labelId = 85371, dataType = "number") + @Encrypt + private String addUpTaxableIncome; + /** * 创建时间 */ diff --git a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java index 9aaaa7363..01c11be8e 100644 --- a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java @@ -17,6 +17,7 @@ import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) +//hrsa_special_add_deduction public class SpecialAddDeductionPO { private Long id; diff --git a/src/com/engine/salary/entity/datacollection/response/GetCompanyIncomesResponse.java b/src/com/engine/salary/entity/datacollection/response/GetCompanyIncomesResponse.java new file mode 100644 index 000000000..0e71b0da8 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/GetCompanyIncomesResponse.java @@ -0,0 +1,395 @@ +package com.engine.salary.entity.datacollection.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 人员专项附加扣除信息查询结果 + * + * @author chengliming + * @date 2022-10-27 10:00 AM + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class GetCompanyIncomesResponse extends BaseResponse { + + /** + * 返回数据 + */ + private Body body; + + /** + * 人员专项附加扣除信息查询结果body + **/ + @Data + public static class Body { + /** + * 明细 + */ + private List sfmx; + + /** + * 合计 + */ + private Sum sfhj; + } + + @Data + public static class Detail { + /** + * 是否明细申报 + **/ + private String sfmxsb; + /** + * 纳税人姓名 + **/ + private String xm; + /** + * 纳税识别号 + **/ + private String nsrsbh; + /** + * 证件类型 + **/ + private String zjlx; + /** + * 证件号码 + **/ + private String zjhm; + /** + * 非居民个人 + **/ + private String sffjm; + /** + * 所得项目名称 + **/ + private String sdxmmc; + /** + * 收入额 + **/ + private String sre; + /** + * 费用 + **/ + private String fy; + /** + * 免税收入 + **/ + private String mssr; + /** + * 财产原值 + **/ + private String ccyz; + /** + * 投资抵扣 + **/ + private String tzdk; + /** + * 允许扣除的费用 + **/ + private String yxkcsf; + /** + * 减计比例 + **/ + private String jjbl; + /** + * 减除费用 + **/ + private String jcfy; + /** + * 基本养老保险 + **/ + private String jbylaobxf; + /** + * 基本医疗保险费 + **/ + private String jbylbxf; + /** + * 失业保险费 + **/ + private String sybxf; + /** + * 住房公积金 + **/ + private String zfgjj; + /** + * 年金 + **/ + private String nj; + /** + * 商业健康保险 + **/ + private String syjkbx; + /** + * 税延养老保险 + **/ + private String syylbx; + /** + * 其它扣除 + **/ + private String qt; + /** + * 准予扣除的捐赠额 + **/ + private String zykcjze; + /** + * 累计收入额 + **/ + private String ljsre; + /** + * 累计减除费用 + **/ + private String ljjcfy; + /** + * 累计专项扣除 + **/ + private String ljzxkc; + /** + * 累计子女教育 + **/ + private String ljznjy; + /** + * 累计赡养老人 + **/ + private String ljsylr; + /** + * 累计住房贷款利息 + **/ + private String ljzfdklx; + /** + * 累计住房租金 + **/ + private String ljzfzj; + /** + * 累计继续教育 + **/ + private String ljjxjy; + /** + * 累计3岁以下婴幼儿照护支出 + **/ + private String ljyyezhzc; + /** + * 累计其它扣除 + **/ + private String ljqtkc; + /** + * 累计准予扣除的捐赠额 + **/ + private String ljzykcjze; + /** + * 累计个人养老金 + **/ + private String ljgrylj; + /** + * 应纳税所得额 + **/ + private String ynssde; + /** + * 税率 + **/ + private String sl; + /** + * 协定税率 + **/ + private String xdsl; + /** + * 速算扣除数 + **/ + private String sskcs; + /** + * 应纳税额 + **/ + private String ynse; + /** + * 减免税额 + **/ + private String jmse; + /** + * 已扣缴税额 + **/ + private String ykjse; + /** + * 应补退税额 + **/ + private String ybtse; + /** + * 备注 + **/ + private String bz; + /** + * 分摊年度数 + **/ + private String ftnds; + /** + * 年减除费用 + **/ + private String njcfy; + /** + * 应扣缴税额 + **/ + private String kjse; + /** + * 证券账户号 + **/ + private String zqzhh; + /** + * 股票代码 + **/ + private String gpdm; + /** + * 股票名称 + **/ + private String gpmc; + /** + * 每股计税价格 + **/ + private String mgjsjg; + /** + * 转让股数 + **/ + private String zrgs; + /** + * 限售股原值 + **/ + private String xsgyz; + /** + * 合理税费 + **/ + private String hlsf; + /** + * 扣除及减除项目合计 + **/ + private String kcjjcxmhj; + } + + /** + * 合计 + */ + @Data + public static class Sum { + /** + * 收入额合计 + */ + private String srehj; + /** + * 免税收入合计 + */ + private String mssrhj; + /** + * 财产原值合计 + */ + private String ccyzhj; + /** + * 投资抵扣合计 + */ + private String tzdkhj; + /** + * 允许扣除的税费合计 + */ + private String yxkcsfhj; + /** + * 基本养老保险费合计 + */ + private String jbylaobxfhj; + /** + * 基本医疗保险费合计 + */ + private String jbylbxfhj; + /** + * 失业保险费合计 + */ + private String sybxfhj; + /** + * 住房公积金合计 + */ + private String zfgjjhj; + /** + * 年金合计 + */ + private String njhj; + /** + * 商业健康保险合计 + */ + private String syjkbxhj; + /** + * 税延养老保险合计 + */ + private String syylbxhj; + /** + * 其他扣除合计 + */ + private String qthj; + /** + * 准予扣除的捐赠额合计 + */ + private String zykcjzehj; + /** + * 累计收入额合计 + */ + private String ljsrehj; + /** + * 累计专项扣除合计 + */ + private String ljzxkchj; + /** + * 累计子女教育合计 + */ + private String ljznjyhj; + /** + * 累计赡养老人合计 + */ + private String ljsylrhj; + /** + * 累计住房贷款利息合计 + */ + private String ljzfdklxhj; + /** + * 累计住房租金合计 + */ + private String ljzfzjhj; + /** + * 累计继续教育合计 + */ + private String ljjxjyhj; + /** + * 累计3岁以下婴幼儿照护支出合计 + */ + private String ljyyezhzchj; + /** + * 累计其他扣除合计 + */ + private String ljqtkchj; + /** + * 累计准予扣除的捐赠额合计 + */ + private String ljzykcjzehj; + /** + * 累计个人养老金合计 + */ + private String ljgryljhj; + /** + * 应纳税所得额合计 + */ + private String ynssdehj; + /** + * 应纳税额合计 + */ + private String ynsehj; + /** + * 减免税额合计 + */ + private String jmsehj; + /** + * 已扣缴税额合计 + */ + private String ykjsehj; + /** + * 应补退税额合计 + */ + private String ybtsehj; + } + +} diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 9e9e69876..126002890 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -192,9 +192,8 @@ public interface AddUpDeductionService { /** * 导出反馈失败记录 * - * @param map * @param requestId */ - void exportOnlineFeedbackFail(Map map, Long requestId); + XSSFWorkbook exportOnlineFeedbackFail(Long requestId); } diff --git a/src/com/engine/salary/service/AddUpSituationService.java b/src/com/engine/salary/service/AddUpSituationService.java index 2406e16be..ccfc26231 100644 --- a/src/com/engine/salary/service/AddUpSituationService.java +++ b/src/com/engine/salary/service/AddUpSituationService.java @@ -112,4 +112,12 @@ public interface AddUpSituationService { * @date 2022/10/31 14:00 */ AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam); + + /** + * 在线获取实际累计已预扣预缴税额 + * + * @param param + * @return + */ + Map onlineRequest(AddUpDeductionMonthTaxAgentParam param); } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index e89b31d36..d25f8f864 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1446,7 +1446,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } @Override - public void exportOnlineFeedbackFail(Map map, Long requestId) { + public XSSFWorkbook exportOnlineFeedbackFail( Long requestId) { List> rows = new ArrayList<>(); // 表头 List headers = new ArrayList<>(); @@ -1476,7 +1476,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction rows.add(row); } // 生成表格 - ExcelUtil.genWorkbookV2(rows, ""); + return ExcelUtil.genWorkbookV2(rows, "在线获取专项附加扣除失败数据"); } diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index 5a81ad857..c0e108de2 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import com.alibaba.fastjson.JSON; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.api.browser.util.ConditionFactory; @@ -8,33 +9,38 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.AddUpSituationBiz; +import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO; import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpSituationDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpSituationImportParam; -import com.engine.salary.entity.datacollection.param.AddUpSituationParam; -import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam; +import com.engine.salary.entity.datacollection.param.*; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO; +import com.engine.salary.entity.datacollection.response.GetCompanyIncomesResponse; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; -import com.engine.salary.service.AddUpDeductionService; -import com.engine.salary.service.AddUpSituationService; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; @@ -43,8 +49,10 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -61,6 +69,7 @@ import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; +@Slf4j public class AddUpSituationServiceImpl extends Service implements AddUpSituationService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -84,12 +93,28 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + AddUpSituationBiz biz = new AddUpSituationBiz(); private SalarySysConfMapper getSalarySysConfMapper() { return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + @Override public Map getSearchCondition() { Map apidatas = new HashMap(); @@ -274,7 +299,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // excel标题 final List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用", "累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", - "累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护","累计个人养老金"); + "累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金"); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -340,7 +365,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation //excel标题 List title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", "累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计企业(职业)年金及其他福利", - "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护","累计个人养老金"); + "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 @@ -609,7 +634,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取已经核算的数据(获取税款所属期下一个月的数据) YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); String nextTaxYearMonthStr = taxYearMonthStr; - if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){ + if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) { nextTaxYearMonth = nextTaxYearMonth.plusMonths(1); nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER); } @@ -693,7 +718,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); errorData.add(errorMessageMap); errorSum += 1; - }else { + } else { Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; po.setEmployeeId(employeeId); } @@ -744,7 +769,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // } // 判断是否有核算过 - if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12") ) { + if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) { Optional optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())).findFirst(); boolean isExist = list.stream().anyMatch(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())); if (optionalAcctEmp.isPresent() && isExist) { @@ -846,8 +871,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } /** - * @description 编辑数据 * @return void + * @description 编辑数据 * @author Harryxzy * @date 2022/10/27 21:32 */ @@ -860,12 +885,12 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); AddUpSituation byId = biz.getById(addUpSituationParam.getId()); - if(byId == null){ + if (byId == null) { throw new SalaryRunTimeException("该数据不存在!"); } Long taxAgentId = byId.getTaxAgentId(); - boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId)); - if(!canEdit){ + boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId)); + if (!canEdit) { //没有编辑权限 throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!"); } @@ -873,14 +898,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取已经核算的数据(获取税款所属期下一个月的数据) YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); String nextTaxYearMonthStr = taxYearMonthStr; - if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){ + if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) { nextTaxYearMonth = nextTaxYearMonth.plusMonths(1); nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER); } List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(nextTaxYearMonthStr); // 判断是否有核算过 - if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) { + if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) { Optional optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpSituationParam.getEmployeeId()) && f.getTaxAgentId().equals(addUpSituationParam.getTaxAgentId())).findFirst(); if (optionalAcctEmp.isPresent()) { throw new SalaryRunTimeException("该年月这条数据已经核算过,不可进行编辑!"); @@ -903,8 +928,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } /** - * @description 新建数据 * @return void + * @description 新建数据 * @author Harryxzy * @date 2022/10/27 22:04 */ @@ -947,8 +972,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpSituationParam.getEmployeeId())); - if(!employeeSameId){ + boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpSituationParam.getEmployeeId())); + if (!employeeSameId) { throw new SalaryRunTimeException("员工信息不存在"); } po.setEmployeeId(addUpSituationParam.getEmployeeId()); @@ -967,7 +992,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } } - // fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常 + // fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常 // if (openDevolution) { // Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst(); // if (!optionalTaxAgentEmp.isPresent()) { @@ -1055,15 +1080,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format); // 判断是否有核算过 List deleteList = new ArrayList<>(); - for(int i=0; i first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst(); - if(!first.isPresent()){ + Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst(); + if (!first.isPresent()) { throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内"); } // 判断用户是否存在 @@ -1089,23 +1114,23 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation AddUpSituationBiz biz = new AddUpSituationBiz(); Date declareMonthDate = new Date(); try { - declareMonthDate = (sdf.parse(declareMonthStr+"-01")); - }catch (Exception e){ + declareMonthDate = (sdf.parse(declareMonthStr + "-01")); + } catch (Exception e) { throw new SalaryRunTimeException("日期异常"); } AddUpSituation queryParam = null; - if(deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()){ + if (deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()) { // 设置了个税扣缴义务人 Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId()); - boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId)); - if(!canDelete){ + boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId)); + if (!canDelete) { throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!"); } ArrayList tai = new ArrayList<>(); tai.add(taxAgentId); - queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build(); - }else { + queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build(); + } else { queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(taxAgentIds).build(); } @@ -1115,7 +1140,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM")); // 获取已经核算的数据 List employees = getAddUpDeductionService(user).getAccountedEmployeeData(format); - for(AddUpSituation item : list){ + for (AddUpSituation item : list) { if (CollectionUtils.isNotEmpty(employees)) { Optional optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst(); if (optionalAcctEmp.isPresent()) { @@ -1137,11 +1162,11 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation ids.add(addUpSituationParam.getId()); AddUpSituationQueryParam build = AddUpSituationQueryParam.builder().ids(ids).build(); List list = biz.recordList(build); - if(list == null || list.size()==0){ + if (list == null || list.size() == 0) { throw new SalaryRunTimeException("该数据不存在!"); } String taxAgentName = list.get(0).getTaxAgentName(); - if(!taxAgentNames.contains(taxAgentName)){ + if (!taxAgentNames.contains(taxAgentName)) { throw new SalaryRunTimeException("您无权查看该数据!"); } return list.get(0); @@ -1150,10 +1175,182 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public void batchSave(List list) { if (CollectionUtils.isNotEmpty(list)) { - list = encryptUtil.encryptList(list,AddUpSituation.class); + list = encryptUtil.encryptList(list, AddUpSituation.class); List> partition = Lists.partition(list, 50); partition.forEach(getAddUpSituationMapper()::insertData); } } + + @Override + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + SalaryAssert.notNull(param.getDeclareMonth(), SalaryI18nUtil.getI18nLabel(100586, "税款所属期必传")); + // 获取接口配置 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 获取包装类 + AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, apiConfig); + // 获取报税信息 + List taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(requestWrapper.getTaxAgentMap().keySet()); + List failReturnPOList = taxReturnPOList.stream().filter(e -> !TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(e.getCheckStatus())).collect(Collectors.toList()); + SalaryAssert.isFalse(taxReturnPOList.size() == failReturnPOList.size(), SalaryI18nUtil.getI18nLabel(183781, "企业未通过验证,暂时无法获取累计专项附加扣除数据,请先在【个税扣缴义务人】菜单验证企业报税信息")); + Map result = new HashMap<>(1); + if (!failReturnPOList.isEmpty()) { + String failTaxAgentNames = failReturnPOList.stream().map(e -> requestWrapper.getTaxAgentMap().get(e.getTaxAgentId())).collect(Collectors.joining("、")); + result.put("msg", String.format(SalaryI18nUtil.getI18nLabel(183782, "%s未通过登记验证,无法在线获取数据"), failTaxAgentNames)); + } + // 获取报送成功的人员名单 + Map> taxAgentEmpDeclareMap = getEmpDeclareMap(requestWrapper.getTaxAgentMap().keySet(), param.getDeclareMonth()); + // 开始请求接口获取数据 + getQuerySpecialAmountBodies(param, requestWrapper, taxAgentEmpDeclareMap, taxReturnPOList); + return result; + } + + private void getQuerySpecialAmountBodies(AddUpDeductionMonthTaxAgentParam param, + AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, + Map> taxAgentEmployeeDeclareMap, + List taxReturnPOList) { + List updateList = new ArrayList<>(); + List insertList = new ArrayList<>(); + for (TaxAgentTaxReturnPO returnPO : taxReturnPOList) { + if (!TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(returnPO.getCheckStatus())) { + continue; + } + // 发起请求 + String taxAgentName = requestWrapper.getTaxAgentMap().get(returnPO.getTaxAgentId()); + List declarePOList = taxAgentEmployeeDeclareMap.getOrDefault(returnPO.getTaxAgentId(), new ArrayList<>()); + if (declarePOList.isEmpty()) { + log.info("该主体下没有报送成功的人员,主体名称:{}", taxAgentName); + continue; + } + List poList = getAddUpSituationMapper().listSome((AddUpSituation.builder().taxYearMonth(param.getDeclareMonth()).taxAgentId(returnPO.getTaxAgentId()).build())); + Map poMap = SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + + // 内部员工(身份证信息) + List employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList()); + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getIdNo); + + for (int i = 1; true; i++) { + GetCompanyIncomesResponse queryResponse = getCompanyIncomes(returnPO, taxAgentName, param, requestWrapper.getApiConfig(), i); + // 校验请求结果 + String responseCode = Optional.ofNullable(queryResponse) + .map(GetCompanyIncomesResponse::getHead) + .map(SzyhResponseHead::getCode) + .orElse(null); + List details = Optional.ofNullable(queryResponse) + .map(GetCompanyIncomesResponse::getBody) + .map(GetCompanyIncomesResponse.Body::getSfmx) + .orElse(null); + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.info("getCompanyIncomes error:{}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + if (CollectionUtils.isEmpty(details)) { + break; + } + Date now = new Date(); + for (GetCompanyIncomesResponse.Detail detail : details) { + DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(detail.getZjhm()); + Long employeeId = Optional.ofNullable(simpleUserInfo) + .map(DataCollectionEmployee::getEmployeeId) + .orElse(0L); + if (poMap.containsKey(returnPO.getTaxAgentId() + "-" + employeeId)) { + AddUpSituation po = poMap.get(returnPO.getTaxAgentId() + "-" + employeeId); + po.setUpdateTime(now); + po.setActualAddUpAdvanceTax(detail.getKjse()); + po.setTaxAdjustment(SalaryEntityUtil.string2BigDecimalDefault0(detail.getKjse()).subtract(SalaryEntityUtil.string2BigDecimalDefault0(po.getAddUpAdvanceTax())).toString()); + updateList.add(po); + } else { + AddUpSituation po = new AddUpSituation(); +// po.setId(IdGenerator.generate()); + po.setCreateTime(now); + po.setUpdateTime(now); + po.setCreator(requestWrapper.getCurrentEmployeeId()); + po.setDeleteType(NumberUtils.INTEGER_ZERO); + po.setTenantKey(requestWrapper.getTenantKey()); + po.setYear(param.getDeclareMonth().getYear()); + po.setTaxYearMonth(param.getDeclareMonth()); + po.setEmployeeType(0); + po.setTaxAgentId(returnPO.getTaxAgentId()); + po.setEmployeeId(employeeId); + po.setAddUpIncome("0"); + po.setAddUpSubtraction("0"); + po.setAddUpSocialSecurityTotal("0"); + po.setAddUpAccumulationFundTotal("0"); + po.setAddUpEnterpriseAndOther("0"); + po.setAddUpOtherDeduction("0"); + po.setAddUpTaxExemptIncome("0"); + po.setAddUpAllowedDonation("0"); + po.setAddUpTaxSavings("0"); + po.setAddUpAdvanceTax("0"); + po.setAddUpTaxableIncome("0"); + po.setActualAddUpAdvanceTax(detail.getKjse()); + po.setTaxAdjustment(detail.getKjse()); + insertList.add(po); + } + } + } + } + if (!insertList.isEmpty()) { + List> insertPartition = Lists.partition(insertList, 50); + insertPartition.forEach(list -> { + list = encryptUtil.encryptList(list, AddUpSituation.class); + getAddUpSituationMapper().insertData(list); + }); + } + if (!updateList.isEmpty()) { + List> updatePartition = Lists.partition(updateList, 50); + updatePartition.forEach(list -> { + list = encryptUtil.encryptList(list, AddUpSituation.class); + getAddUpSituationMapper().updateData(list); + }); + } + } + + private GetCompanyIncomesResponse getCompanyIncomes(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + AddUpDeductionMonthTaxAgentParam param, + TaxDeclarationApiConfigPO apiConfig, + Integer pageNo) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_COMPANY_INCOMES; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getDeclareMonth())); + requestParam.put("pageSize", 1000); + requestParam.put("pageNo", pageNo); + requestParam.put("reportType", 1); + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("getCompanyIncomes params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("getCompanyIncomes res --- {}", res); + return JsonUtil.parseObject(res, GetCompanyIncomesResponse.class); + } + + private AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper getAddUpDeductionOnlineRequestWrapper(List requestPOList, TaxDeclarationApiConfigPO apiConfig) { + boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution(); + boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); + List taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAll() : (List) getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + Set taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); + // 获取薪资档案 + List salaryArchiveList = getSalaryArchiveService(user).listByRunStatus(Arrays.asList( + SalaryArchiveStatusEnum.FIXED.getValue(), + SalaryArchiveStatusEnum.SUSPEND.getValue(), + SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue(), + SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())); + salaryArchiveList = salaryArchiveList.stream().filter(e -> taxAgentIdSet.contains(e.getTaxAgentId())).collect(Collectors.toList()); + AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper = new AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper(requestPOList, salaryArchiveList, taxAgents, (long) user.getUID()); + requestWrapper.setApiConfig(apiConfig); + return requestWrapper; + } + + private Map> getEmpDeclareMap(Collection taxAgentIds, Date declareMonth) { + List employeeDeclarePOS = getEmployeeDeclarePOList(taxAgentIds, declareMonth); + SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "暂无人员报送状态为正常的数据,请先报送再获取累计专项附加扣除数据。")); + return employeeDeclarePOS.stream().collect(Collectors.groupingBy(EmployeeDeclarePO::getTaxAgentId)); + } + + private List getEmployeeDeclarePOList(Collection taxAgentIds, Date declareMonth) { + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().declareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()).taxCycle(declareMonth).taxAgentIds(taxAgentIds).build()); + } } diff --git a/src/com/engine/salary/web/AddUpDeductionController.java b/src/com/engine/salary/web/AddUpDeductionController.java index 3cec335d0..821d24e59 100644 --- a/src/com/engine/salary/web/AddUpDeductionController.java +++ b/src/com/engine/salary/web/AddUpDeductionController.java @@ -24,10 +24,7 @@ import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -419,19 +416,41 @@ public class AddUpDeductionController { return new ResponseResult>(user).run(getAddUpDeductionWrapper(user)::onlineFeedbackFail, queryParam); } -// /** -// * 在线获取结果导出 -// * -// * @return WeaResult 接口返回信息 -// */ -// @Path("/online/feedback/fail/export") -// @GET -// @Produces(MediaType.APPLICATION_JSON) -// public String exportOnlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestParam Long requestId) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getAddUpDeductionWrapper(user)::exportOnlineFeedbackFail, queryParam); -// return WeaResult.success(addUpDeductionWrapper.exportOnlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), requestId)); -// } + /** + * 在线获取结果导出 + * + * @return WeaResult 接口返回信息 + */ + @GET + @Path("/online/feedback/fail/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportOnlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "requestId") Long requestId) { + try { + User user = HrmUserVarify.getUser(request, response); + + + XSSFWorkbook workbook = getAddUpDeductionWrapper(user).exportOnlineFeedbackFail(requestId); + + String fileName = "在线获取专项附加扣除失败数据" + LocalDate.now(); + + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + log.error(e.getMessage(), e); + } + + 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; + } + } // /** // * 在线获取表单 diff --git a/src/com/engine/salary/web/AddUpSituationController.java b/src/com/engine/salary/web/AddUpSituationController.java index 0c31aa578..1823c81b3 100644 --- a/src/com/engine/salary/web/AddUpSituationController.java +++ b/src/com/engine/salary/web/AddUpSituationController.java @@ -354,4 +354,17 @@ public class AddUpSituationController { } + /** + * 在线获取实际累计已预扣预缴税额 + * + * @param param 前端请求参数 + * @return WeaResult 接口返回信息 + */ + @POST + @Path("/online/actualAddUpAdvanceTax") + @Produces(MediaType.APPLICATION_JSON) + public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionMonthTaxAgentParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getAddUpSituationWrapper(user)::onlineRequest, param); + } } diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index dbd0abf80..614763634 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO; import com.engine.salary.entity.datacollection.param.*; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.AddUpDeductionService; import com.engine.salary.service.SalaryEmployeeService; @@ -187,37 +188,22 @@ public class AddUpDeductionWrapper extends Service { return getAddUpDeductionService(user).onlineFeedback(); } - public PageInfo onlineFeedbackFail( AddUpDeductionRequestFailQueryParam queryParam) { + public PageInfo onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) { if (queryParam.getRequestId() == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153345, "在线获取的请求ID不可为空")); } - PageInfo page = getAddUpDeductionService(user).onlineFeedbackFail( queryParam); + PageInfo page = getAddUpDeductionService(user).onlineFeedbackFail(queryParam); return page; } -// public Map exportOnlineFeedbackFail( Long requestId) { -// List poList = getAddUpDeductionService(user).getAddUpDeductionRequestFailPOList(requestId); -// if (CollectionUtils.isEmpty(poList)) { -// throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel( 95795, "数据不存在") + "[id:%s]", requestId)); -// } -// // 构建异步导出参数 -// Map map = salaryBatchService.buildeExportParam("exportOnlineFeedbackFail"); -// map.put("sheetName", SalaryI18nUtil.getI18nLabel( 183778, "在线获取专项附加扣除失败数据")); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// try { -// DSTenantKeyThreadVar.tenantKey.set(tenantKey); -// getAddUpDeductionService(user).exportOnlineFeedbackFail(map, requestId); -// } finally { -// DSTenantKeyThreadVar.tenantKey.remove(); -// } -// } -// }; -// ThreadPoolUtil.execute(localRunnable); -// return map; -// } -// + public XSSFWorkbook exportOnlineFeedbackFail(Long requestId) { + List poList = getAddUpDeductionService(user).getAddUpDeductionRequestFailPOList(requestId); + if (CollectionUtils.isEmpty(poList)) { + throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(95795, "数据不存在") + "[id:%s]", requestId)); + } + return getAddUpDeductionService(user).exportOnlineFeedbackFail(requestId); + } + // public WeaForm getRequestForm() { // WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(AddUpDeductionRequestFormDTO.class, new AddUpDeductionRequestFormDTO()); // WeaFormSalaryItem item = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER, "month", "YYYY-MM", "YYYY-MM"); diff --git a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java index 9e76f49b2..015dcb91f 100644 --- a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java @@ -5,10 +5,7 @@ import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO; import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpSituationDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpSituationImportParam; -import com.engine.salary.entity.datacollection.param.AddUpSituationParam; -import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam; +import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.AddUpSituationService; import com.engine.salary.service.impl.AddUpSituationServiceImpl; @@ -169,4 +166,8 @@ public class AddUpSituationWrapper extends Service { public AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam) { return getAddUpSituationService(user).getAddUpSituation(addUpSituationParam); } + + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + return getAddUpSituationService(user).onlineRequest(param); + } } From 6059174e7c9ffb5a6371a99a8a1ffab578899d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Sep 2023 09:40:50 +0800 Subject: [PATCH 050/298] =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E7=9A=84=E5=9C=A8=E7=BA=BF=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202309050203.sql | 21 +++ resource/sqlupgrade/GS/sql202309050203.sql | 21 +++ resource/sqlupgrade/JC/sql202309050203.sql | 21 +++ resource/sqlupgrade/Mysql/sql202309050203.sql | 15 +- .../sqlupgrade/Oracle/sql202309050203.sql | 17 ++ resource/sqlupgrade/PG/sql202309050203.sql | 25 ++- .../sqlupgrade/SQLServer/sql202309050203.sql | 19 +++ resource/sqlupgrade/ST/sql202309050203.sql | 21 +++ .../entity/datacollection/AddUpSituation.java | 20 +-- .../salaryacct/po/SalaryAcctTaxAgentPO.java | 16 +- .../salaryacct/SalaryAcctTaxAgentMapper.java | 26 +++ .../salaryacct/SalaryAcctTaxAgentMapper.xml | 42 +++++ .../service/SalaryAcctRecordService.java | 7 + .../service/SalaryAcctTaxAgentService.java | 43 +++-- .../salary/service/TaxDeclarationService.java | 11 ++ .../impl/SalaryAcctRecordServiceImpl.java | 155 +++++++++++++++++- .../impl/SalaryAcctTaxAgentServiceImpl.java | 111 +++++-------- .../impl/SalarySobInitServiceImpl.java | 6 + .../impl/TaxDeclarationServiceImpl.java | 8 + .../impl/TaxDeclareRecordServiceImpl.java | 5 +- 20 files changed, 500 insertions(+), 110 deletions(-) create mode 100644 src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.java create mode 100644 src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.xml diff --git a/resource/sqlupgrade/DM/sql202309050203.sql b/resource/sqlupgrade/DM/sql202309050203.sql index 77982e200..4603c0e75 100644 --- a/resource/sqlupgrade/DM/sql202309050203.sql +++ b/resource/sqlupgrade/DM/sql202309050203.sql @@ -7,3 +7,24 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658; +/ + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658; +/ + diff --git a/resource/sqlupgrade/GS/sql202309050203.sql b/resource/sqlupgrade/GS/sql202309050203.sql index 77982e200..4603c0e75 100644 --- a/resource/sqlupgrade/GS/sql202309050203.sql +++ b/resource/sqlupgrade/GS/sql202309050203.sql @@ -7,3 +7,24 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658; +/ + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658; +/ + diff --git a/resource/sqlupgrade/JC/sql202309050203.sql b/resource/sqlupgrade/JC/sql202309050203.sql index 77982e200..4603c0e75 100644 --- a/resource/sqlupgrade/JC/sql202309050203.sql +++ b/resource/sqlupgrade/JC/sql202309050203.sql @@ -7,3 +7,24 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658; +/ + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202309050203.sql b/resource/sqlupgrade/Mysql/sql202309050203.sql index 449c25f07..c5fce8081 100644 --- a/resource/sqlupgrade/Mysql/sql202309050203.sql +++ b/resource/sqlupgrade/Mysql/sql202309050203.sql @@ -3,4 +3,17 @@ alter table hrsa_add_up_situation add add_up_taxable_income varchar(255) alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar(255) ; alter table hrsa_add_up_situation add tax_adjustment varchar(255) -; \ No newline at end of file +; + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12'); + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12'); + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12'); + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658; + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql index 14347cd8b..62458bdf3 100644 --- a/resource/sqlupgrade/Oracle/sql202309050203.sql +++ b/resource/sqlupgrade/Oracle/sql202309050203.sql @@ -3,4 +3,21 @@ alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255) alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255) / alter table hrsa_add_up_situation add tax_adjustment varchar2(255) +/ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5) +/ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6) +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) +/ +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) +/ +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) +/ + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658 +/ + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658 / \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309050203.sql b/resource/sqlupgrade/PG/sql202309050203.sql index 4b9085caa..50cbec61f 100644 --- a/resource/sqlupgrade/PG/sql202309050203.sql +++ b/resource/sqlupgrade/PG/sql202309050203.sql @@ -1,6 +1,25 @@ -alter table hrsa_add_up_situation add add_up_taxable_income varchar(255); +alter table hrsa_add_up_situation add add_up_taxable_income varchar(255) / -alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar(255); +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar(255) / -alter table hrsa_add_up_situation add tax_adjustment varchar(255); +alter table hrsa_add_up_situation add tax_adjustment varchar(255) +/ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5) +/ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6) +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12') +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12') +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12') +/ + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658 +/ + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658 / \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309050203.sql b/resource/sqlupgrade/SQLServer/sql202309050203.sql index ea69e5604..7e102b81a 100644 --- a/resource/sqlupgrade/SQLServer/sql202309050203.sql +++ b/resource/sqlupgrade/SQLServer/sql202309050203.sql @@ -3,4 +3,23 @@ GO alter table hrsa_add_up_situation add actual_add_up_advance_tax nvarchar(255) GO alter table hrsa_add_up_situation add tax_adjustment nvarchar(255) +GO + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5) +GO + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6) +GO + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12') +GO +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12') +GO +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12') +GO + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658 +GO + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658 GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202309050203.sql b/resource/sqlupgrade/ST/sql202309050203.sql index 77982e200..4603c0e75 100644 --- a/resource/sqlupgrade/ST/sql202309050203.sql +++ b/resource/sqlupgrade/ST/sql202309050203.sql @@ -7,3 +7,24 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658; +/ + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658; +/ + diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index aefe36a4d..5771dabf0 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -87,7 +87,7 @@ public class AddUpSituation { /** * 累计子女教育 */ - @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number") @Encrypt @Deprecated private String addUpChildEducation; @@ -95,7 +95,7 @@ public class AddUpSituation { /** * 累计继续教育 */ - @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number") @Encrypt @Deprecated private String addUpContinuingEducation; @@ -103,7 +103,7 @@ public class AddUpSituation { /** * 累计住房贷款利息 */ - @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number") @Encrypt @Deprecated private String addUpHousingLoanInterest; @@ -111,7 +111,7 @@ public class AddUpSituation { /** * 累计住房租金 */ - @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number") @Encrypt @Deprecated private String addUpHousingRent; @@ -119,7 +119,7 @@ public class AddUpSituation { /** * 累计赡养老人 */ - @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number") @Encrypt @Deprecated private String addUpSupportElderly; @@ -127,7 +127,7 @@ public class AddUpSituation { /** * 累计大病医疗 */ - @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number") @Encrypt @Deprecated private String addUpIllnessMedical; @@ -135,7 +135,7 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ - @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number") @Encrypt @Deprecated private String addUpInfantCare; @@ -143,7 +143,7 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ - @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number") @Encrypt @Deprecated private String addUpPrivatePension; @@ -191,14 +191,14 @@ public class AddUpSituation { private String addUpAdvanceTax; /** - * 累计已预扣预缴税额 + * 实际累计已预扣预缴税额 */ @SalaryFormulaVar(defaultLabel = "实际累计已预扣预缴税额", labelId = 233557, dataType = "number") @Encrypt private String actualAddUpAdvanceTax; /** - * 累计已预扣预缴税额 + * 个税调差 */ @SalaryFormulaVar(defaultLabel = "个税调差", labelId = 233559, dataType = "number") @Encrypt diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java index 4a7dd7da6..d12a5a5ac 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java @@ -1,9 +1,11 @@ package com.engine.salary.entity.salaryacct.po; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import java.time.LocalDateTime; import java.util.Date; /** @@ -15,7 +17,10 @@ import java.util.Date; * @version 1.0 **/ @Data +@Builder @Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor // "hrsa_acct_tax_agent") public class SalaryAcctTaxAgentPO { @@ -67,10 +72,15 @@ public class SalaryAcctTaxAgentPO { /** * 创建时间 */ - private LocalDateTime createTime; + private Date createTime; /** * 更新时间 */ - private LocalDateTime updateTime; + private Date updateTime; + + + + private Date startMonth; + private Date endMonth; } diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.java new file mode 100644 index 000000000..ce3c104a4 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.java @@ -0,0 +1,26 @@ +package com.engine.salary.mapper.salaryacct; + +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +/** + * @description: 薪资核算记录对应的个税扣缴义务人 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/22 1:47 PM + * @version:v1.0 + */ +public interface SalaryAcctTaxAgentMapper { + + /** + * 获取核算记录和扣缴义务人对应关系 + * @param salaryAcctIds + * @return + */ + List listAcctTaxAgent(@Param("salaryAcctRecordIds") Collection salaryAcctIds); + + List listByTaxCycleRange(SalaryAcctTaxAgentPO queryWrapper); +} diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.xml new file mode 100644 index 000000000..e9ed7eb66 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 4e7c8eb2e..51eb656e1 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -124,6 +124,13 @@ public interface SalaryAcctRecordService { */ Long save(SalaryAcctRecordSaveParam saveParam); + /** + * 保存之前检查一下是否可以新建核算 + * + * @param salaryAcctTaxAgents + */ + void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List salaryAcctTaxAgents); + /** * 更新薪资核算记录的状态 * diff --git a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java index be75f76bf..e2796aa4a 100644 --- a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java +++ b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java @@ -1,7 +1,6 @@ package com.engine.salary.service; import com.engine.salary.common.YearMonthRange; -import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import java.util.Collection; @@ -33,25 +32,25 @@ public interface SalaryAcctTaxAgentService { */ List listByTaxCycleRange(YearMonthRange taxCycleRange); - /** - * 根据薪资核算人员初始化 - * - * @param salaryAcctEmployees - * @return - */ - List initBySalaryAcctEmployees(List salaryAcctEmployees); - - /** - * 批量保存 - * - * @param salaryAcctTaxAgents - */ - void batchSave(List salaryAcctTaxAgents); - - /** - * 根据薪资核算记录id删除关联的个税扣缴义务人 - * - * @param salaryAcctRecordIds - */ - void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds); +// /** +// * 根据薪资核算人员初始化 +// * +// * @param salaryAcctEmployees +// * @return +// */ +// List initBySalaryAcctEmployees(List salaryAcctEmployees); +// +// /** +// * 批量保存 +// * +// * @param salaryAcctTaxAgents +// */ +// void batchSave(List salaryAcctTaxAgents); +// +// /** +// * 根据薪资核算记录id删除关联的个税扣缴义务人 +// * +// * @param salaryAcctRecordIds +// */ +// void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds); } diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 4e7d0e3ce..2731904a5 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.common.YearMonthRange; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; @@ -59,4 +60,14 @@ public interface TaxDeclarationService { void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); void saveBatch(List taxDeclarations); + + + /** + * 根据税款所属期查询个税申报表 + * + * @param yearMonthRange + * @return + */ + List listByTaxCycleRange(YearMonthRange yearMonthRange); + } diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 9b4b123f6..94dd92579 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.YearMonthRange; import com.engine.salary.entity.salaryBill.po.SalarySendPO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; @@ -14,6 +15,8 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -32,6 +35,8 @@ import com.engine.salary.util.db.MapperProxyFactory; 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.Sets; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -78,6 +83,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { + return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); + } + // private SalaryCheckResultService salaryCheckResultService; // // private SalaryCheckResultDetailService salaryCheckResultDetailService; @@ -271,9 +280,11 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe public Long save(SalaryAcctRecordSaveParam saveParam) { ValidUtil.doValidator(saveParam); //检查 - checkBeforeSave(saveParam); +// checkBeforeSave(saveParam); + SalarySobPO salarySobPO = getSalarySobService(user).getById(saveParam.getSalarySobId()); + // 查询税款所属期 SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(saveParam.getSalarySobId(), saveParam.getSalaryMonth()); // 薪资所属月所在年的日期范围(第一天~最后一天) @@ -293,12 +304,20 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 转换成po SalaryAcctRecordPO salaryAcctRecordPO = SalaryAcctRecordBO.convert2PO(saveParam, salarySobCycleDTO, (int) acctTimes, (long) user.getUID()); + + //检查 + // 检查是否能够新建核算 + SalaryAcctTaxAgentPO build = SalaryAcctTaxAgentPO.builder().incomeCategory(salarySobPO.getIncomeCategory()).taxAgentId(salarySobPO.getTaxAgentId()).taxCycle(salaryAcctRecordPO.getTaxCycle()).build(); + List salaryAcctTaxAgents = new ArrayList<>(); + salaryAcctTaxAgents.add(build); + checkBeforeSave(salaryAcctRecordPO, salaryAcctTaxAgents); + // 保存薪资核算记录 getSalaryAcctRecordMapper().insertIgnoreNull(salaryAcctRecordPO); // 初始化薪资核算人员 getSalaryAcctEmployeeService(user).initBySalaryAcctRecord(salaryAcctRecordPO); // 记录日志 -// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); +// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId()); // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); // loggerContext.setTargetName(targetName); @@ -438,6 +457,136 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe } + + /** + * 保存之前检查一下是否可以新建核算 + * + * @param salaryAcctTaxAgents + */ + @Override + public void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List salaryAcctTaxAgents) { + // 查询薪资账套 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecord.getSalarySobId()); + IncomeCategoryEnum incomeCategoryEnums = IncomeCategoryEnum.parseByValue(salarySobPO.getIncomeCategory()); + if (incomeCategoryEnums == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { + // 如果当前是单独核算年终奖,无需校验其他所得项目的薪资核算记录 + checkBeforeSaveAnnual(salaryAcctTaxAgents); + } else { + checkBeforeSaveCommon(salaryAcctTaxAgents); + } + } + + private void checkBeforeSaveAnnual(List salaryAcctTaxAgents) { + salaryAcctTaxAgents = salaryAcctTaxAgents.stream() + .filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(salaryAcctTaxAgents)) { + return; + } + // 查询本次薪资核算记录的税款所属期所在年度的薪资核算记录 + Set sameYearSet = Sets.newHashSet(); + List otherSalaryAcctTaxAgents = Lists.newArrayList(); + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + Date taxCycle = salaryAcctTaxAgent.getTaxCycle(); + if (!sameYearSet.contains(taxCycle.getYear())) { + sameYearSet.add(taxCycle.getYear()); + // 税款所属期所在年度的1月~12月 + YearMonthRange taxCycleRange = new YearMonthRange() + .setStartMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(1))) + .setEndMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(12))); + // 税款所属期所在年度所有的薪资核算记录 + otherSalaryAcctTaxAgents.addAll(getSalaryAcctTaxAgentService(user).listByTaxCycleRange(taxCycleRange)); + } + } + // 排除掉所得项目不是全年一次性奖金收入的薪资核算记录 + otherSalaryAcctTaxAgents = otherSalaryAcctTaxAgents.stream() + .filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) + .collect(Collectors.toList()); + // 全年一次性奖金收入一年内只能申报一次,所以税款所属期必须相同 + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + SalaryAcctTaxAgentPO diffTaxCycleSalaryAcctTaxAgent = otherSalaryAcctTaxAgents.stream() + .filter(e -> Objects.equals(salaryAcctTaxAgent.getTaxAgentId(), e.getTaxAgentId()) + && !Objects.equals(salaryAcctTaxAgent.getTaxCycle(), e.getTaxCycle())) + .findAny() + .orElse(null); + if (diffTaxCycleSalaryAcctTaxAgent != null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160502, "全年一次性奖金收入一年内只能申报一次,所以税款所属期必须相同")); + } + } + } + + private void checkBeforeSaveCommon(List salaryAcctTaxAgents) { + // 排除掉所得项目为全年一次性奖金收入的薪资核算记录 + salaryAcctTaxAgents = salaryAcctTaxAgents.stream() + .filter(e -> !Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) + .collect(Collectors.toList()); + Set sameYearSet = Sets.newHashSet(); + List sameYearTaxDeclarations = Lists.newArrayList(); + List sameYearSalaryAcctTaxAgents = Lists.newArrayList(); + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + Date taxCycle = salaryAcctTaxAgent.getTaxCycle(); + if (!sameYearSet.contains(taxCycle.getYear())) { + sameYearSet.add(taxCycle.getYear()); + // 税款所属期所在年度的1月~12月 + YearMonthRange taxCycleRange = new YearMonthRange() + .setStartMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(1))) + .setEndMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(12))); + // 税款所属期所在年度所有的个税申报表 + sameYearTaxDeclarations.addAll(getTaxDeclarationService(user).listByTaxCycleRange(taxCycleRange)); + // 税款所属期所在年度所有的薪资核算记录 + sameYearSalaryAcctTaxAgents.addAll(getSalaryAcctTaxAgentService(user).listByTaxCycleRange(taxCycleRange)); + } + } + // 排除掉所得项目为全年一次性奖金收入的个税申报表和薪资核算记录 + sameYearTaxDeclarations = sameYearTaxDeclarations.stream() + .filter(e -> !Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) + .collect(Collectors.toList()); + sameYearSalaryAcctTaxAgents = sameYearSalaryAcctTaxAgents.stream() + .filter(e -> !Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) + .collect(Collectors.toList()); + + // 查询个税扣缴义务人 + Set taxAgentIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + + Set declareTaxAgents = SalaryEntityUtil.properties(sameYearTaxDeclarations, e -> e.getTaxAgentId() + "-" + e.getTaxCycle()); + Map> sameYearSalaryAcctTaxAgentMap = SalaryEntityUtil + .group2Map(sameYearSalaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + List salaryAcctTaxAgentList = sameYearSalaryAcctTaxAgentMap.getOrDefault(salaryAcctTaxAgent.getTaxAgentId(), Collections.emptyList()) + .stream() + .filter(e -> !Objects.equals(salaryAcctTaxAgent.getSalaryAcctRecordId(), e.getSalaryAcctRecordId())) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(salaryAcctTaxAgentList)) { + continue; + } + // 如果某个月(税款所属期)还未申报,不可以新建之后月份的薪资核算 + SalaryAcctTaxAgentPO notDeclareSalaryAcctTaxAgent = salaryAcctTaxAgentList.stream() + .filter(e -> salaryAcctTaxAgent.getTaxCycle().compareTo(e.getTaxCycle()) > 0 + && !declareTaxAgents.contains(e.getTaxAgentId() + "-" + e.getTaxCycle())) + .findAny() + .orElse(null); + if (Objects.nonNull(notDeclareSalaryAcctTaxAgent)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160504, "个税扣缴义务人「{0}」的税款所属期「{1}」的个税还未申报,请先申报后再来新建税款所属期「{2}」的薪资核算") + .replace("{0}", taxAgentMap.get(notDeclareSalaryAcctTaxAgent.getTaxAgentId())) + .replace("{1}", SalaryDateUtil.getFormatYYYYMM(notDeclareSalaryAcctTaxAgent.getTaxCycle())) + .replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getTaxCycle()))); + } + // 如果某个月(税款所属期)已经核算了,不可以新建之前月份的薪资核算 + SalaryAcctTaxAgentPO calculatedSalaryAcctTaxAgent = salaryAcctTaxAgentList.stream() + .filter(e -> salaryAcctTaxAgent.getTaxCycle().compareTo(e.getTaxCycle()) < 0) + .findAny() + .orElse(null); + if (Objects.nonNull(calculatedSalaryAcctTaxAgent)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160506, "个税扣缴义务人「{0}」已经存在薪资所属月「{1}」的薪资核算记录了,无法新建薪资所属月「{2}」的薪资核算") + .replace("{0}", taxAgentMap.get(calculatedSalaryAcctTaxAgent.getTaxAgentId())) + .replace("{1}", SalaryDateUtil.getFormatYYYYMM(calculatedSalaryAcctTaxAgent.getSalaryMonth())) + .replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getSalaryMonth()))); + } + } + } + private List listByCreateDate(LocalDateRange taxCycleRebootYearRange, Set salarySobIds) { return getSalaryAcctRecordMapper().listByCreateDate(taxCycleRebootYearRange, salarySobIds); } @@ -594,7 +743,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // salaryAcctRecordPO.setUpdateTime(new Date()); // getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO); // 记录日志 -// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); +// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId()); // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); // loggerContext.setTargetName(targetName); diff --git a/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java index 49acd5b52..8bd4fe4f1 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java @@ -1,65 +1,45 @@ -//package com.engine.salary.service.impl; -// -//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -//import com.baomidou.mybatisplus.core.toolkit.Wrappers; -//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; -//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; -//import com.engine.core.impl.Service; -//import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; -//import com.engine.salary.service.SalaryAcctTaxAgentService; -//import com.google.common.collect.Lists; -//import com.google.common.collect.Sets; -//import com.weaver.common.distribution.genid.IdGenerator; -//import com.weaver.common.hr.util.Util; -//import com.weaver.hrm.salary.common.YearMonthRange; -//import com.weaver.hrm.salary.dao.SalaryAcctTaxAgentMapper; -//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; -//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; -//import org.apache.commons.collections4.CollectionUtils; -//import org.springframework.transaction.annotation.Transactional; -// -//import java.time.LocalDateTime; -//import java.util.*; -// -///** -// * @description: -// * @author: xiajun -// * @modified By: xiajun -// * @date: 2022/7/29 9:45 -// * @version:v1.0 -// */ -//public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService { -// -// private SalaryAcctTaxAgentMapper salaryAcctTaxAgentMapper; -// +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.engine.salary.mapper.salaryacct.SalaryAcctTaxAgentMapper; +import com.engine.salary.service.SalaryAcctTaxAgentService; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService { + + private SalaryAcctTaxAgentMapper getSalaryAcctTaxAgentMapper() { + return MapperProxyFactory.getProxy(SalaryAcctTaxAgentMapper.class); + } + @Override + public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { + if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { + return Collections.emptyList(); + } + return getSalaryAcctTaxAgentMapper().listAcctTaxAgent(salaryAcctRecordIds); + } + + @Override + public List listByTaxCycleRange(YearMonthRange taxCycleRange) { + SalaryAcctTaxAgentPO queryWrapper = new SalaryAcctTaxAgentPO(); + if (Objects.nonNull(taxCycleRange.getStartMonth())) { + queryWrapper.setStartMonth(taxCycleRange.getStartMonth()); + } + if (Objects.nonNull(taxCycleRange.getEndMonth())) { + queryWrapper.setEndMonth(taxCycleRange.getEndMonth()); + } + return getSalaryAcctTaxAgentMapper().listByTaxCycleRange(queryWrapper); + } + // @Override -// public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { -// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { -// return Collections.emptyList(); -// } -// return new LambdaQueryChainWrapper<>(salaryAcctTaxAgentMapper) -// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey) -// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) -// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds) -// .list(); -// } -// -// @Override -// public List listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey) { -// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); -// queryWrapper.eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey); -// queryWrapper.eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()); -// if (Objects.nonNull(taxCycleRange.getStartMonth())) { -// queryWrapper.ge(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getStartMonth().toString()); -// } -// if (Objects.nonNull(taxCycleRange.getEndMonth())) { -// queryWrapper.le(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getEndMonth().toString()); -// } -// return salaryAcctTaxAgentMapper.selectList(queryWrapper); -// } -// -// @Override -// public List initBySalaryAcctEmployees(List salaryAcctEmployees, Long employeeId, String tenantKey) { +// public List initBySalaryAcctEmployees(List salaryAcctEmployees) { // if (CollectionUtils.isEmpty(salaryAcctEmployees)) { // return Collections.emptyList(); // } @@ -89,19 +69,18 @@ // } // // @Override -// @Transactional(rollbackFor = Exception.class) -// public void batchSave(List salaryAcctTaxAgents, String tenantKey) { +// public void batchSave(List salaryAcctTaxAgents) { // if (CollectionUtils.isNotEmpty(salaryAcctTaxAgents)) { // saveBatch(salaryAcctTaxAgents); // } // } // // @Override -// public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { +// public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { // if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { // return; // } -// new LambdaUpdateChainWrapper<>(salaryAcctTaxAgentMapper) +// new LambdaUpdateChainWrapper<>(getSalaryAcctTaxAgentMapper()) // .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey) // .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) // .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds) @@ -109,4 +88,4 @@ // .set(SalaryAcctTaxAgentPO::getUpdateTime, LocalDateTime.now()) // .update(); // } -//} +} diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java index d5414a8fe..d1ded8b46 100644 --- a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -335,6 +335,12 @@ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { if (Objects.equals(declaredField.getName(), "addUpAdvanceTax")) { salarySobItem = salarySobItemMap.get("addUpTaxPayable"); } + if (Objects.equals(declaredField.getName(), "addUpTaxExemptIncome")) { + salarySobItem = salarySobItemMap.get("addUpTaxFreeIncome"); + } + if (Objects.equals(declaredField.getName(), "addUpTaxSavings")) { + salarySobItem = salarySobItemMap.get("addUpTaxDeduction"); + } if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class) || Objects.isNull(salarySobItem)) { continue; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 20ed01799..f778da6fd 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -3,6 +3,7 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.YearMonthRange; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -357,4 +358,11 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration getTaxDeclarationMapper().batchInsert(taxDeclarations); } } + + @Override + public List listByTaxCycleRange(YearMonthRange yearMonthRange) { + return getTaxDeclarationMapper().listSome(TaxDeclarationPO.builder() + .salaryMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) + .build()); + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 6991bdeea..efbd618c6 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -122,8 +122,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); } - private SalaryAcctTaxAgentService salaryAcctTaxAgentService; - + private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { + return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); + } private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } From f9611212d4fa42ef75fc630d011737cab34a3952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Sep 2023 11:40:22 +0800 Subject: [PATCH 051/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202307100103.sql | 0 resource/sqlupgrade/JC/sql202307100103.sql | 0 resource/sqlupgrade/Mysql/sql202307100103.sql | 0 .../sqlupgrade/Oracle/sql202307100103.sql | 0 .../sqlupgrade/SQLServer/sql202307100103.sql | 0 resource/sqlupgrade/ST/sql202307100103.sql | 0 .../salaryacct/bo/SalaryCalcItemGraph.java | 177 ++++++++++++++++++ 7 files changed, 177 insertions(+) delete mode 100644 resource/sqlupgrade/DM/sql202307100103.sql delete mode 100644 resource/sqlupgrade/JC/sql202307100103.sql delete mode 100644 resource/sqlupgrade/Mysql/sql202307100103.sql delete mode 100644 resource/sqlupgrade/Oracle/sql202307100103.sql delete mode 100644 resource/sqlupgrade/SQLServer/sql202307100103.sql delete mode 100644 resource/sqlupgrade/ST/sql202307100103.sql create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java diff --git a/resource/sqlupgrade/DM/sql202307100103.sql b/resource/sqlupgrade/DM/sql202307100103.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/resource/sqlupgrade/JC/sql202307100103.sql b/resource/sqlupgrade/JC/sql202307100103.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/resource/sqlupgrade/Mysql/sql202307100103.sql b/resource/sqlupgrade/Mysql/sql202307100103.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/resource/sqlupgrade/Oracle/sql202307100103.sql b/resource/sqlupgrade/Oracle/sql202307100103.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/resource/sqlupgrade/SQLServer/sql202307100103.sql b/resource/sqlupgrade/SQLServer/sql202307100103.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/resource/sqlupgrade/ST/sql202307100103.sql b/resource/sqlupgrade/ST/sql202307100103.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java new file mode 100644 index 000000000..e9f840fd3 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java @@ -0,0 +1,177 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.util.SalaryEntityUtil; +import com.google.common.collect.Lists; +import com.googlecode.aviator.Expression; +import com.weaver.excel.formula.api.entity.FormulaVar; +import com.weaver.hrm.salary.constant.SalaryConstant; +import com.weaver.hrm.salary.enums.salaryitem.SalaryFormulaReferenceEnum; +import com.weaver.teams.domain.user.SimpleEmployee; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.*; +import java.util.concurrent.LinkedTransferQueue; + +/** + * @description: 对薪资核算时涉及的薪资项目进行排序 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/5/19 16:01 + * @version:v1.0 + */ +public class SalaryCalcItemGraph { + + private List nodes; + + /** + * 根据薪资账套的薪资项目、公式详情构建实例 + * + * @param salarySobItems 薪资账套的薪资项目 + * @param expressFormulas 公式详情 + */ + public SalaryCalcItemGraph(List salarySobItems, List expressFormulas, SimpleEmployee currentUser) { + Map salaryItemMap = SalaryEntityUtil.convert2Map(salarySobItems, + SalarySobItemPO::getSalaryItemCode); + Map expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, + ExpressFormula::getId); + Map> formulaVarMap = ExpressFormulaBO.buildFormulaVar(expressFormulas); + Map expressionMap = ExpressFormulaBO.compile(expressFormulas, currentUser); + + Map nodeMap = new HashMap<>(); + for (SalarySobItemPO salarySobItem : salarySobItems) { + Expression expression = expressionMap.get(salarySobItem.getFormulaId()); + ExpressFormula expressFormula = expressFormulaMap.get(salarySobItem.getFormulaId()); + SalaryCalcItemGraphNode node = nodeMap.computeIfAbsent(salarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(salarySobItem, expressFormula, expression)); + List formulaVars = expressFormula == null ? Collections.emptyList() + : formulaVarMap.getOrDefault(expressFormula.getId(), Collections.emptyList()); + for (FormulaVar formulaVar : formulaVars) { + if (StringUtils.equalsIgnoreCase(formulaVar.getModule(), SalaryConstant.MODULE) + && StringUtils.isNotEmpty(formulaVar.getFieldId()) + && StringUtils.startsWith(formulaVar.getFieldId(), SalaryFormulaReferenceEnum.CURRENT_CALC.getValue() + SalaryConstant.FORMULA_VAR_SEPARATOR)) { + String salaryItemCode = formulaVar.getFieldId().split(SalaryConstant.FORMULA_VAR_SEPARATOR)[1]; + SalarySobItemPO subSalarySobItem = salaryItemMap.get(salaryItemCode); + if (subSalarySobItem == null) { + continue; + } + ExpressFormula subExpressFormula = expressFormulaMap.get(subSalarySobItem.getFormulaId()); + Expression subExpression = expressionMap.get(subSalarySobItem.getFormulaId()); + SalaryCalcItemGraphNode destNode = nodeMap.computeIfAbsent(subSalarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(subSalarySobItem, subExpressFormula, subExpression)); + node.getDestNodes().add(destNode); + } + } + } + this.nodes = Lists.newArrayList(nodeMap.values()); + } + + /** + * 对薪资核算时涉及的薪资项目进行排序 + * 对于一次薪资核算而言,不同的薪资项目之间可能会存在引用。 + * 例如「绩效工资=绩效比例*(基本工资+岗位工资)」,在计算「绩效工资」前需要先计算出「绩效比例」、「基本工资」、「岗位工资」 + * 所以薪资核算前需要对所涉及的所有薪资项目进行一个计算排序 + * 对薪资项目的排序就相当于是对一个「有向无环的图」进行拓扑排序,一个薪资项目就相当于图中的一个「顶点」 + * 具体算法如下: + * 1、根据「薪资账套的薪资项目」、「公式详情」构建出所有的「顶点」 + * 2、将所有顶点的入度都初始化为0 + * 3、遍历所有的顶点,计算每个顶点的入度 + * 4、创建一个队列,将所有入度为0的顶点都存入队列 + * 5、每次从队列中取出一个点,将该点存入结果集合中,并将该顶点的所有邻接点的入度减1。如果邻接点的入度变为了0,将其加入队列中 + * 6、重复步骤5,直到队列空了 + * + * @return 排好序的薪资项目id + */ + public List sort() { + // 循环遍历所有顶点 + for (SalaryCalcItemGraphNode node : nodes) { + // 循环遍历每个顶点的邻居 + for (SalaryCalcItemGraphNode destNode : node.getDestNodes()) { + // 维护每个顶点的入度 + destNode.setInDegree(destNode.getInDegree() + 1); + } + } + + // 创建一个队列 + LinkedTransferQueue queue = new LinkedTransferQueue<>(); + + // 再次循环所有顶点 + for (SalaryCalcItemGraphNode node : nodes) { + // 若该顶点入度为0,则加入队列 + if (node.getInDegree() == 0) { + queue.offer(node); + } + } + + // 存储结果的列表 + List result = new ArrayList<>(); + // 循环直到队列为空 + while (!queue.isEmpty()) { + // 取出队列头部的顶点编号 + SalaryCalcItemGraphNode node = queue.poll(); + // 将该顶点加入到结果列表中 + result.add(node.getSalaryCalcItem()); + // 标记该顶点已被访问 + node.setVisited(true); + + // 遍历该顶点的邻居 + for (SalaryCalcItemGraphNode destNode : node.getDestNodes()) { + // 若该邻居未被访问过 + if (!destNode.isVisited()) { + // 将该邻居的入度减一 + destNode.setInDegree(destNode.getInDegree() - 1); + // 若该邻居入度已经变为0 + if (destNode.getInDegree() == 0) { + // 将该邻居加入到队列中 + queue.offer(destNode); + } + } + } + } + + // 倒序 + Collections.reverse(result); + // 返回结果列表 + return result; + } + + @Data + private static class SalaryCalcItemGraphNode { + + /** + * 薪资项目的id + */ + private SalaryCalcItem salaryCalcItem; + + /** + * 入度 + */ + private int inDegree; + + /** + * 是否已被访问 + */ + private boolean visited; + + /** + * 当前顶点的邻居 + */ + private List destNodes; + + public SalaryCalcItemGraphNode(SalarySobItemPO salarySobItem, ExpressFormula expressFormula, Expression expression) { + this.salaryCalcItem = new SalaryCalcItem() + .setSalaryItemId(salarySobItem.getSalaryItemId()) + .setSalaryItemCode(salarySobItem.getSalaryItemCode()) + .setIncomeCategory(salarySobItem.getIncomeCategory()) + .setUseInEmployeeSalary(salarySobItem.getUseInEmployeeSalary()) + .setDataType(salarySobItem.getDataType()) + .setRoundingMode(salarySobItem.getRoundingMode()) + .setPattern(salarySobItem.getPattern()) + .setExpressFormula(expressFormula) + .setExpression(expression); + this.inDegree = 0; + this.visited = false; + this.destNodes = new ArrayList<>(); + } + } +} From d03aed1d1b03c757d18696b2ea5909d348a144d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Sep 2023 14:01:56 +0800 Subject: [PATCH 052/298] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salaryacct/bo/SalaryCalcItem.java | 57 +++++++++++++++++++ .../salaryacct/bo/SalaryCalcItemGraph.java | 32 ++++------- .../common/constant/SalaryConstant.java | 31 ++++++++++ .../impl/SalaryAcctResultServiceImpl.java | 8 ++- 4 files changed, 106 insertions(+), 22 deletions(-) create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java new file mode 100644 index 000000000..576e14dc9 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java @@ -0,0 +1,57 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.enums.SalaryRoundingModeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @description: 薪资核算涉及的薪资项目 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2023/5/19 16:00 + * @version:v1.0 + */ +@Data +@Accessors(chain = true) +public class SalaryCalcItem { + + /** + * 薪资项目id + */ + private Long salaryItemId; + /** + * 薪资项目编号 + */ + private String salaryItemCode; + /** + * 所得项目 + */ + private String incomeCategory; + /** + * 薪资档案引用。0:薪资档案未引用、1:薪资档案引用 + * 为处理历史数据而留,不再使用 + */ + @Deprecated + private Integer useInEmployeeSalary; + /** + * 字段类型 + * @see SalaryDataTypeEnum + */ + private String dataType; + /** + * 舍入规则 + * @see SalaryRoundingModeEnum + */ + private Integer roundingMode; + /** + * 小数位数 + */ + private Integer pattern; + /** + * 公式 + */ + private ExpressFormula expressFormula; + +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java index e9f840fd3..a78bdfacf 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java @@ -1,14 +1,11 @@ package com.engine.salary.entity.salaryacct.bo; import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; -import com.googlecode.aviator.Expression; -import com.weaver.excel.formula.api.entity.FormulaVar; -import com.weaver.hrm.salary.constant.SalaryConstant; -import com.weaver.hrm.salary.enums.salaryitem.SalaryFormulaReferenceEnum; -import com.weaver.teams.domain.user.SimpleEmployee; import lombok.Data; import org.apache.commons.lang3.StringUtils; @@ -32,33 +29,27 @@ public class SalaryCalcItemGraph { * @param salarySobItems 薪资账套的薪资项目 * @param expressFormulas 公式详情 */ - public SalaryCalcItemGraph(List salarySobItems, List expressFormulas, SimpleEmployee currentUser) { + public SalaryCalcItemGraph(List salarySobItems, List expressFormulas) { Map salaryItemMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); Map expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId); Map> formulaVarMap = ExpressFormulaBO.buildFormulaVar(expressFormulas); - Map expressionMap = ExpressFormulaBO.compile(expressFormulas, currentUser); Map nodeMap = new HashMap<>(); for (SalarySobItemPO salarySobItem : salarySobItems) { - Expression expression = expressionMap.get(salarySobItem.getFormulaId()); ExpressFormula expressFormula = expressFormulaMap.get(salarySobItem.getFormulaId()); - SalaryCalcItemGraphNode node = nodeMap.computeIfAbsent(salarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(salarySobItem, expressFormula, expression)); - List formulaVars = expressFormula == null ? Collections.emptyList() - : formulaVarMap.getOrDefault(expressFormula.getId(), Collections.emptyList()); + SalaryCalcItemGraphNode node = nodeMap.computeIfAbsent(salarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(salarySobItem, expressFormula)); + List formulaVars = expressFormula == null ? Collections.emptyList() : formulaVarMap.getOrDefault(expressFormula.getId(), Collections.emptyList()); for (FormulaVar formulaVar : formulaVars) { - if (StringUtils.equalsIgnoreCase(formulaVar.getModule(), SalaryConstant.MODULE) - && StringUtils.isNotEmpty(formulaVar.getFieldId()) - && StringUtils.startsWith(formulaVar.getFieldId(), SalaryFormulaReferenceEnum.CURRENT_CALC.getValue() + SalaryConstant.FORMULA_VAR_SEPARATOR)) { + if ( StringUtils.isNotEmpty(formulaVar.getFieldId())) { String salaryItemCode = formulaVar.getFieldId().split(SalaryConstant.FORMULA_VAR_SEPARATOR)[1]; SalarySobItemPO subSalarySobItem = salaryItemMap.get(salaryItemCode); if (subSalarySobItem == null) { continue; } ExpressFormula subExpressFormula = expressFormulaMap.get(subSalarySobItem.getFormulaId()); - Expression subExpression = expressionMap.get(subSalarySobItem.getFormulaId()); - SalaryCalcItemGraphNode destNode = nodeMap.computeIfAbsent(subSalarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(subSalarySobItem, subExpressFormula, subExpression)); + SalaryCalcItemGraphNode destNode = nodeMap.computeIfAbsent(subSalarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(subSalarySobItem, subExpressFormula)); node.getDestNodes().add(destNode); } } @@ -158,17 +149,16 @@ public class SalaryCalcItemGraph { */ private List destNodes; - public SalaryCalcItemGraphNode(SalarySobItemPO salarySobItem, ExpressFormula expressFormula, Expression expression) { + public SalaryCalcItemGraphNode(SalarySobItemPO salarySobItem, ExpressFormula expressFormula) { this.salaryCalcItem = new SalaryCalcItem() .setSalaryItemId(salarySobItem.getSalaryItemId()) .setSalaryItemCode(salarySobItem.getSalaryItemCode()) .setIncomeCategory(salarySobItem.getIncomeCategory()) - .setUseInEmployeeSalary(salarySobItem.getUseInEmployeeSalary()) - .setDataType(salarySobItem.getDataType()) +// .setUseInEmployeeSalary(salarySobItem.getUseInEmployeeSalary()) +// .setDataType(salarySobItem.getDataType()) .setRoundingMode(salarySobItem.getRoundingMode()) .setPattern(salarySobItem.getPattern()) - .setExpressFormula(expressFormula) - .setExpression(expression); + .setExpressFormula(expressFormula); this.inDegree = 0; this.visited = false; this.destNodes = new ArrayList<>(); diff --git a/src/com/engine/salary/report/common/constant/SalaryConstant.java b/src/com/engine/salary/report/common/constant/SalaryConstant.java index b6af93d9d..4e3a32a5f 100644 --- a/src/com/engine/salary/report/common/constant/SalaryConstant.java +++ b/src/com/engine/salary/report/common/constant/SalaryConstant.java @@ -9,4 +9,35 @@ public class SalaryConstant { * 列表中薪资项目动态列后缀标识 */ public static final String DYNAMIC_SUFFIX = "_salaryItem"; + + /** + * 模块标识 + */ + public static final String MODULE = "hrmsalary"; + + /** + * 公共租户标识 + */ + public static final String DEFAULT_TENANT_KEY = "all_teams"; + /** + * 通用的分隔符 + */ + public static final String COMMON_SEPARATOR = "-"; + /** + * 下划线 + */ + public static final String FORMULA_VAR_SEPARATOR = "_"; + /** + * 下划线分隔符 + */ + public static final String UNDERLINE_SEPARATOR = "_"; + /** + * 完整主域名 + */ + public static final String PRIMARY_DOMAIN = "primary.domain"; + + /** + * 图片公共地址 + */ + public static final String IMG_URL = "/papi/file/preview?type=imgs&fileId=%s&random=123456"; } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 717cfc917..ab3612b8c 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -733,7 +733,13 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 本次运算的回算薪资项目所涉及的变量 Set issuedFieldIds = new HashSet<>(); // 9、计算薪资项目的运算优先级 - List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); +// List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); + List> salarySobItemsWithPriority = new ArrayList<>(); + SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, expressFormulas); + List salaryCalcItems = salaryCalcItemGraph.sort(); + List properties = SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + salarySobItemsWithPriority.add(properties); + // 10、根据id查询其他合并计税的薪资核算记录 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); // 11、查询本次核算人员 From 43cdf98411109a5cb9bbd97e5a08decb64b7c552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Sep 2023 15:48:43 +0800 Subject: [PATCH 053/298] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salaryacct/bo/SalaryCalcItem.java | 80 ++++++++++++++++++- .../salaryacct/bo/SalaryCalcItemGraph.java | 27 +++---- .../impl/SalaryAcctResultServiceImpl.java | 12 +-- 3 files changed, 97 insertions(+), 22 deletions(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java index 576e14dc9..4636d3276 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java @@ -3,7 +3,6 @@ package com.engine.salary.entity.salaryacct.bo; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.enums.SalaryRoundingModeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; -import lombok.Data; import lombok.experimental.Accessors; /** @@ -13,7 +12,6 @@ import lombok.experimental.Accessors; * @date: Created in 2023/5/19 16:00 * @version:v1.0 */ -@Data @Accessors(chain = true) public class SalaryCalcItem { @@ -54,4 +52,82 @@ public class SalaryCalcItem { */ private ExpressFormula expressFormula; + + public Long getSalaryItemId() { + return salaryItemId; + } + + public void setSalaryItemId(Long salaryItemId) { + this.salaryItemId = salaryItemId; + } + + public String getSalaryItemCode() { + return salaryItemCode; + } + + public void setSalaryItemCode(String salaryItemCode) { + this.salaryItemCode = salaryItemCode; + } + + public String getIncomeCategory() { + return incomeCategory; + } + + public void setIncomeCategory(String incomeCategory) { + this.incomeCategory = incomeCategory; + } + + public Integer getUseInEmployeeSalary() { + return useInEmployeeSalary; + } + + public void setUseInEmployeeSalary(Integer useInEmployeeSalary) { + this.useInEmployeeSalary = useInEmployeeSalary; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public Integer getRoundingMode() { + return roundingMode; + } + + public void setRoundingMode(Integer roundingMode) { + this.roundingMode = roundingMode; + } + + public Integer getPattern() { + return pattern; + } + + public void setPattern(Integer pattern) { + this.pattern = pattern; + } + + public ExpressFormula getExpressFormula() { + return expressFormula; + } + + public void setExpressFormula(ExpressFormula expressFormula) { + this.expressFormula = expressFormula; + } + + @Override + public String toString() { + return "SalaryCalcItem{" + + "salaryItemId=" + salaryItemId + + ", salaryItemCode='" + salaryItemCode + '\'' + + ", incomeCategory='" + incomeCategory + '\'' + + ", useInEmployeeSalary=" + useInEmployeeSalary + + ", dataType='" + dataType + '\'' + + ", roundingMode=" + roundingMode + + ", pattern=" + pattern + + ", expressFormula=" + expressFormula + + '}'; + } } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java index a78bdfacf..42d522bd7 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java @@ -30,10 +30,8 @@ public class SalaryCalcItemGraph { * @param expressFormulas 公式详情 */ public SalaryCalcItemGraph(List salarySobItems, List expressFormulas) { - Map salaryItemMap = SalaryEntityUtil.convert2Map(salarySobItems, - SalarySobItemPO::getSalaryItemCode); - Map expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, - ExpressFormula::getId); + Map salaryItemMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); + Map expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId); Map> formulaVarMap = ExpressFormulaBO.buildFormulaVar(expressFormulas); Map nodeMap = new HashMap<>(); @@ -42,7 +40,7 @@ public class SalaryCalcItemGraph { SalaryCalcItemGraphNode node = nodeMap.computeIfAbsent(salarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(salarySobItem, expressFormula)); List formulaVars = expressFormula == null ? Collections.emptyList() : formulaVarMap.getOrDefault(expressFormula.getId(), Collections.emptyList()); for (FormulaVar formulaVar : formulaVars) { - if ( StringUtils.isNotEmpty(formulaVar.getFieldId())) { + if (StringUtils.isNotEmpty(formulaVar.getFieldId())) { String salaryItemCode = formulaVar.getFieldId().split(SalaryConstant.FORMULA_VAR_SEPARATOR)[1]; SalarySobItemPO subSalarySobItem = salaryItemMap.get(salaryItemCode); if (subSalarySobItem == null) { @@ -150,15 +148,16 @@ public class SalaryCalcItemGraph { private List destNodes; public SalaryCalcItemGraphNode(SalarySobItemPO salarySobItem, ExpressFormula expressFormula) { - this.salaryCalcItem = new SalaryCalcItem() - .setSalaryItemId(salarySobItem.getSalaryItemId()) - .setSalaryItemCode(salarySobItem.getSalaryItemCode()) - .setIncomeCategory(salarySobItem.getIncomeCategory()) -// .setUseInEmployeeSalary(salarySobItem.getUseInEmployeeSalary()) -// .setDataType(salarySobItem.getDataType()) - .setRoundingMode(salarySobItem.getRoundingMode()) - .setPattern(salarySobItem.getPattern()) - .setExpressFormula(expressFormula); + SalaryCalcItem salaryCalcItem = new SalaryCalcItem(); + salaryCalcItem.setSalaryItemId(salarySobItem.getSalaryItemId()); + salaryCalcItem.setSalaryItemCode(salarySobItem.getSalaryItemCode()); + salaryCalcItem.setIncomeCategory(salarySobItem.getIncomeCategory()); +// salaryCalcItem.setUseInEmployeeSalary(salarySobItem.getUseInEmployeeSalary()); +// salaryCalcItem.setDataType(salarySobItem.getDataType()); + salaryCalcItem.setRoundingMode(salarySobItem.getRoundingMode()); + salaryCalcItem.setPattern(salarySobItem.getPattern()); + salaryCalcItem.setExpressFormula(expressFormula); + this.salaryCalcItem = salaryCalcItem; this.inDegree = 0; this.visited = false; this.destNodes = new ArrayList<>(); diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index ab3612b8c..5daa95397 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -733,12 +733,12 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 本次运算的回算薪资项目所涉及的变量 Set issuedFieldIds = new HashSet<>(); // 9、计算薪资项目的运算优先级 -// List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); - List> salarySobItemsWithPriority = new ArrayList<>(); - SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, expressFormulas); - List salaryCalcItems = salaryCalcItemGraph.sort(); - List properties = SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); - salarySobItemsWithPriority.add(properties); + List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); +// List> salarySobItemsWithPriority = new ArrayList<>(); +// SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, expressFormulas); +// List salaryCalcItems = salaryCalcItemGraph.sort(); +// List properties = SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); +// salarySobItemsWithPriority.add(properties); // 10、根据id查询其他合并计税的薪资核算记录 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); From d0382ca239609cb518e62c22df4a73a21c1c575d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Sep 2023 16:20:25 +0800 Subject: [PATCH 054/298] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalaryAcctResultServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 5daa95397..6b0193809 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -735,9 +735,9 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 9、计算薪资项目的运算优先级 List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); // List> salarySobItemsWithPriority = new ArrayList<>(); -// SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, expressFormulas); -// List salaryCalcItems = salaryCalcItemGraph.sort(); -// List properties = SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, expressFormulas); + List salaryCalcItems = salaryCalcItemGraph.sort(); + List properties = SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); // salarySobItemsWithPriority.add(properties); // 10、根据id查询其他合并计税的薪资核算记录 From 02100c2ee360f5518a9440aa17e37b8661d3a16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 7 Sep 2023 15:15:59 +0800 Subject: [PATCH 055/298] =?UTF-8?q?=E6=9C=89=E5=90=91=E6=97=A0=E7=8E=AF?= =?UTF-8?q?=E6=8B=93=E6=89=91=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryacct/bo/SalaryAcctCalculateBO.java | 2 +- .../bo/SalaryAcctCalculatePriorityBO.java | 14 +- .../entity/salaryacct/bo/SalaryCalcItem.java | 92 ++---------- .../salaryacct/bo/SalaryCalcItemGraph.java | 34 +++-- .../bo/TaxDeclarationValueList.java | 2 +- .../salaryacct/SalaryAcctManager.java | 54 ++++++- .../impl/SalaryAcctCalculateServiceImpl.java | 142 +++++++++--------- .../impl/SalaryAcctResultServiceImpl.java | 100 ++++++++---- .../impl/TaxDeclarationValueServiceImpl.java | 4 +- .../impl/TaxDeclareRecordServiceImpl.java | 3 + 10 files changed, 232 insertions(+), 215 deletions(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java index 22af2b674..f29ccd1ce 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java @@ -68,7 +68,7 @@ public class SalaryAcctCalculateBO { /** * 本次运算的薪资项目(已排好运算优先级) */ - private List> salaryItemIdWithPriorityList; + private List salaryItemIdWithPriorityList; /** * 本次运算涉及的所有公式 diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java index 197ad1245..bc5ee6d93 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.salaryacct.bo; -import com.engine.salary.constant.SalaryFormulaFieldConstant; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -21,9 +20,10 @@ import org.apache.commons.lang3.StringUtils; import java.util.*; import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN; + /** * 薪资核算-薪资项目运算优先级 *

Copyright: Copyright (c) 2022

@@ -34,16 +34,6 @@ import java.util.stream.Collectors; **/ public class SalaryAcctCalculatePriorityBO { - /** - * 公式中变量的fieldId的正则表达式 - */ - private static final String SALARY_REGEX = "(\\w+)" + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + "(\\w+)"; - - /** - * 解析公式中变量的fieldId的正则表达式 - */ - private static final Pattern SALARY_PATTERN = Pattern.compile(SALARY_REGEX); - /** * 计算优先级 * diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java index 4636d3276..42df567df 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java @@ -3,15 +3,18 @@ package com.engine.salary.entity.salaryacct.bo; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.enums.SalaryRoundingModeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 薪资核算涉及的薪资项目 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/5/19 16:00 - * @version:v1.0 - */ + * 薪资核算涉及的薪资项目 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data @Accessors(chain = true) public class SalaryCalcItem { @@ -53,81 +56,4 @@ public class SalaryCalcItem { private ExpressFormula expressFormula; - public Long getSalaryItemId() { - return salaryItemId; - } - - public void setSalaryItemId(Long salaryItemId) { - this.salaryItemId = salaryItemId; - } - - public String getSalaryItemCode() { - return salaryItemCode; - } - - public void setSalaryItemCode(String salaryItemCode) { - this.salaryItemCode = salaryItemCode; - } - - public String getIncomeCategory() { - return incomeCategory; - } - - public void setIncomeCategory(String incomeCategory) { - this.incomeCategory = incomeCategory; - } - - public Integer getUseInEmployeeSalary() { - return useInEmployeeSalary; - } - - public void setUseInEmployeeSalary(Integer useInEmployeeSalary) { - this.useInEmployeeSalary = useInEmployeeSalary; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public Integer getRoundingMode() { - return roundingMode; - } - - public void setRoundingMode(Integer roundingMode) { - this.roundingMode = roundingMode; - } - - public Integer getPattern() { - return pattern; - } - - public void setPattern(Integer pattern) { - this.pattern = pattern; - } - - public ExpressFormula getExpressFormula() { - return expressFormula; - } - - public void setExpressFormula(ExpressFormula expressFormula) { - this.expressFormula = expressFormula; - } - - @Override - public String toString() { - return "SalaryCalcItem{" + - "salaryItemId=" + salaryItemId + - ", salaryItemCode='" + salaryItemCode + '\'' + - ", incomeCategory='" + incomeCategory + '\'' + - ", useInEmployeeSalary=" + useInEmployeeSalary + - ", dataType='" + dataType + '\'' + - ", roundingMode=" + roundingMode + - ", pattern=" + pattern + - ", expressFormula=" + expressFormula + - '}'; - } } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java index 42d522bd7..52baba1db 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java @@ -2,7 +2,9 @@ package com.engine.salary.entity.salaryacct.bo; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; @@ -13,12 +15,13 @@ import java.util.*; import java.util.concurrent.LinkedTransferQueue; /** - * @description: 对薪资核算时涉及的薪资项目进行排序 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2023/5/19 16:01 - * @version:v1.0 - */ + * 对薪资核算时涉及的薪资项目进行排序 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryCalcItemGraph { private List nodes; @@ -29,8 +32,9 @@ public class SalaryCalcItemGraph { * @param salarySobItems 薪资账套的薪资项目 * @param expressFormulas 公式详情 */ - public SalaryCalcItemGraph(List salarySobItems, List expressFormulas) { - Map salaryItemMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); + public SalaryCalcItemGraph(List salarySobItems, List salaryItemPOS, List expressFormulas) { + Map salarySobItemMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItemPOS, SalaryItemPO::getCode); Map expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId); Map> formulaVarMap = ExpressFormulaBO.buildFormulaVar(expressFormulas); @@ -40,14 +44,20 @@ public class SalaryCalcItemGraph { SalaryCalcItemGraphNode node = nodeMap.computeIfAbsent(salarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(salarySobItem, expressFormula)); List formulaVars = expressFormula == null ? Collections.emptyList() : formulaVarMap.getOrDefault(expressFormula.getId(), Collections.emptyList()); for (FormulaVar formulaVar : formulaVars) { - if (StringUtils.isNotEmpty(formulaVar.getFieldId())) { + if (StringUtils.isNotEmpty(formulaVar.getFieldId()) && StringUtils.startsWith(formulaVar.getFieldId(), SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryConstant.FORMULA_VAR_SEPARATOR)) { String salaryItemCode = formulaVar.getFieldId().split(SalaryConstant.FORMULA_VAR_SEPARATOR)[1]; - SalarySobItemPO subSalarySobItem = salaryItemMap.get(salaryItemCode); + SalarySobItemPO subSalarySobItem = salarySobItemMap.get(salaryItemCode); if (subSalarySobItem == null) { - continue; + SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemCode); + if (salaryItemPO == null) { + continue; + }else { + subSalarySobItem = SalarySobItemPO.builder().salaryItemId(salaryItemPO.getId()).salaryItemCode(salaryItemPO.getCode()).build(); + } } ExpressFormula subExpressFormula = expressFormulaMap.get(subSalarySobItem.getFormulaId()); - SalaryCalcItemGraphNode destNode = nodeMap.computeIfAbsent(subSalarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(subSalarySobItem, subExpressFormula)); + SalarySobItemPO finalSubSalarySobItem = subSalarySobItem; + SalaryCalcItemGraphNode destNode = nodeMap.computeIfAbsent(subSalarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(finalSubSalarySobItem, subExpressFormula)); node.getDestNodes().add(destNode); } } diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index 8b78d34d8..ee755aad5 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -94,7 +94,7 @@ public class TaxDeclarationValueList { dataMap.put("username", employeeDeclare.getEmployeeName()); dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); dataMap.put("cardNum", employeeDeclare.getCardNum()); - } else if (Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + } else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(taxDeclarationValue.getEmployeeId()); dataMap.put("jobNum", simpleEmployee.getWorkcode()); diff --git a/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java b/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java index 207bd1649..1c3c7da23 100644 --- a/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java +++ b/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java @@ -4,20 +4,23 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; -import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO; -import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; import com.engine.salary.entity.progress.ProgressDTO; +import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItemGraph; 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.SalaryAcctResultTempPO; import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper; import com.engine.salary.service.*; @@ -38,6 +41,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.BeanUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import weaver.hrm.User; @@ -47,8 +51,11 @@ import java.util.*; import java.util.concurrent.BlockingDeque; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingDeque; +import java.util.regex.Matcher; import java.util.stream.Collectors; +import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN; + /** * 薪资核算维护类 *

Copyright: Copyright (c) 2022

@@ -294,9 +301,10 @@ public class SalaryAcctManager extends Service { formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); // 本次运算的回算薪资项目所涉及的变量 - Set issuedFieldIds = new HashSet<>(); + Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); // 9、计算薪资项目的运算优先级 - List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); +// List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); + List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); // 10、根据id查询其他合并计税的薪资核算记录 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); // 11、查询本次核算人员 @@ -396,5 +404,43 @@ public class SalaryAcctManager extends Service { getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey); } + @NotNull + private List sortItems(List salarySobItemPOS, List salarySobBackItems, List salaryItemPOS, List expressFormulas) { + List temp = salarySobBackItems.stream() + .map(e -> { + SalarySobItemPO salarySobItem = new SalarySobItemPO(); + BeanUtils.copyProperties(e, salarySobItem); + return salarySobItem; + }).collect(Collectors.toList()); + salarySobItemPOS.addAll(temp); + + SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, salaryItemPOS, expressFormulas); + List salaryCalcItems = salaryCalcItemGraph.sort(); + return SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + } + + /** + * 获取回算变量 + * + * @param salarySobBackItems + * @return + */ + @NotNull + private Set getIssuedFieldIds(List salarySobBackItems) { + Set issuedFieldIds; + Set issuedFormulaIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId); + List expressFormulas1 = getSalaryFormulaService(user).listExpressFormula(issuedFormulaIds); + List issuedFormulaVars = new ArrayList<>(); + expressFormulas1.forEach(f -> issuedFormulaVars.addAll(f.getParameters())); + issuedFieldIds = issuedFormulaVars.stream() + .map(FormulaVar::getFieldId) + .filter(StringUtils::isNotBlank) + .filter(v -> v.startsWith(SalaryFormulaReferenceEnum.ISSUED.getValue() + "_")) + .map(SALARY_PATTERN::matcher) + .filter(Matcher::find) + .map(m -> m.group(2)) + .collect(Collectors.toSet()); + return issuedFieldIds; + } } diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index 018702a7a..fc29dabff 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -183,82 +183,80 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc formulaVarValues.addAll(empInfo); Map formulaVarValueMap = SalaryEntityUtil.convert2Map(formulaVarValues, CalculateFormulaVarBO.FormulaVarValue::getFieldId, CalculateFormulaVarBO.FormulaVarValue::getFieldValue); // 按照计算好的优先级计算薪资项目的值 - for (List salaryItemIds : salaryAcctCalculateBO.getSalaryItemIdWithPriorityList()) { + for (Long salaryItemId : salaryAcctCalculateBO.getSalaryItemIdWithPriorityList()) { // 同一运算优先级下的薪资项目逐个独立运算 - for (Long salaryItemId : salaryItemIds) { - String resultValue; - SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemId); - ExpressFormula expressFormula; - if (salarySobBackItemMap.containsKey(salaryItemId)) { - // 如果薪资账套的回算项目中重新定义了回算项目公式,则使用薪资账套下的公式 - SalarySobBackItemPO salarySobBackItemPO = salarySobBackItemMap.get(salaryItemId); - expressFormula = expressFormulaMap.get(salarySobBackItemPO.getFormulaId()); - } else if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId)) { - // 如果薪资账套下重新定义了薪资项目的公式,则使用薪资账套下的公式,否则使用薪资项目本身的公式 - SalarySobItemPO salarySobItemPO = salaryItemIdKeySalarySobItemPOMap.get(salaryItemId); - expressFormula = expressFormulaMap.get(salarySobItemPO.getFormulaId()); - } else { - expressFormula = expressFormulaMap.get(salaryItemPO.getFormulaId()); + String resultValue; + SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemId); + ExpressFormula expressFormula; + if (salarySobBackItemMap.containsKey(salaryItemId)) { + // 如果薪资账套的回算项目中重新定义了回算项目公式,则使用薪资账套下的公式 + SalarySobBackItemPO salarySobBackItemPO = salarySobBackItemMap.get(salaryItemId); + expressFormula = expressFormulaMap.get(salarySobBackItemPO.getFormulaId()); + } else if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId)) { + // 如果薪资账套下重新定义了薪资项目的公式,则使用薪资账套下的公式,否则使用薪资项目本身的公式 + SalarySobItemPO salarySobItemPO = salaryItemIdKeySalarySobItemPOMap.get(salaryItemId); + expressFormula = expressFormulaMap.get(salarySobItemPO.getFormulaId()); + } else { + expressFormula = expressFormulaMap.get(salaryItemPO.getFormulaId()); + } + if (Objects.nonNull(expressFormula)) { + // 运行公式 + ExcelResult result = runExpressFormula(expressFormula, formulaVarValueMap, simpleEmployee); + resultValue = Utils.null2String(result.getData()); + //公式异常信息 + if (!result.isStatus()) { + String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); + String errorMsg = String.format("%s的%s核算异常,原因:%s \r\n", username, salaryItemPO.getName(), result.getErrorMsg()); + noticeMsg.append(errorMsg); } - if (Objects.nonNull(expressFormula)) { - // 运行公式 - ExcelResult result = runExpressFormula(expressFormula, formulaVarValueMap, simpleEmployee); - resultValue = Utils.null2String(result.getData()); - //公式异常信息 - if (!result.isStatus()) { - String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); - String errorMsg = String.format("%s的%s核算异常,原因:%s \r\n", username, salaryItemPO.getName(), result.getErrorMsg()); - noticeMsg.append(errorMsg); - } - //提醒运行超时 - if (StringUtils.isNotBlank(formulaRunOvertimeThreshold) && result.getRunTime() > Long.parseLong(formulaRunOvertimeThreshold)) { - String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); - String errorMsg = String.format("%s的%s核算超时,耗时:%s毫秒 \r\n", username, salaryItemPO.getName(), result.getRunTime()); - noticeMsg.append(errorMsg); - } - } else { - // 处理取值类型为“输入/导入”的薪资项目 - String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); - resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); + //提醒运行超时 + if (StringUtils.isNotBlank(formulaRunOvertimeThreshold) && result.getRunTime() > Long.parseLong(formulaRunOvertimeThreshold)) { + String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); + String errorMsg = String.format("%s的%s核算超时,耗时:%s毫秒 \r\n", username, salaryItemPO.getName(), result.getRunTime()); + noticeMsg.append(errorMsg); } - // 处理薪资档案 - if (Objects.equals(salaryItemPO.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { - String key = SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); - resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); - } - // 处理合并计税 - resultValue = handleConsolidatedTax(resultValue, salaryItemPO, salaryAcctCalculateBO, otherSalaryAcctEmployeePOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()), otherSalaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId())); - - // 处理小数点 - resultValue = SalaryAcctFormulaBO.roundResultValue(resultValue, salaryItemPO, salarySobBackItems, salarySobBackItemMap, salaryItemIdKeySalarySobItemPOMap); - //是否锁定 - if (lockSalaryItemIds.contains(salaryItemId) && salaryAcctLockResultPOS.get(salaryItemId + "_" + salaryAcctEmployeePOId) != null) { - resultValue = salaryAcctLockResultPOS.get(salaryItemId + "_" + salaryAcctEmployeePOId).getResultValue(); - } - // 将已经计算过的薪资项目的值转换成公式变量的值添加到集合中 + } else { + // 处理取值类型为“输入/导入”的薪资项目 String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); - formulaVarValueMap.put(key, resultValue); - // 值保存薪资账套下的薪资项目的核算结果 - if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId) || salarySobBackItemIds.contains(salaryItemId)) { - // 转换成薪资核算结果po - SalaryAcctResultTempPO salaryAcctResultTempPO = new SalaryAcctResultTempPO() - .setSalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()) - .setSalaryAcctEmpId(salaryAcctEmployeePOId) - .setEmployeeId(salaryAcctEmployeePO.getEmployeeId()) - .setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId()) - .setSalarySobId(salaryAcctEmployeePO.getSalarySobId()) - .setSalaryItemId(salaryItemPO.getId()) - .setResultValue(resultValue) - .setOriginResultValue(salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId) == null - ? StringUtils.EMPTY : salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId)) - .setCalculateKey(salaryAcctCalculateBO.getCalculateKey()) - .setCreator((long) user.getUID()) - .setCreateTime(now) - .setUpdateTime(now) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setDeleteType(0); - salaryAcctResultTempPOS.add(salaryAcctResultTempPO); - } + resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); + } + // 处理薪资档案 + if (Objects.equals(salaryItemPO.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { + String key = SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); + resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); + } + // 处理合并计税 + resultValue = handleConsolidatedTax(resultValue, salaryItemPO, salaryAcctCalculateBO, otherSalaryAcctEmployeePOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()), otherSalaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId())); + + // 处理小数点 + resultValue = SalaryAcctFormulaBO.roundResultValue(resultValue, salaryItemPO, salarySobBackItems, salarySobBackItemMap, salaryItemIdKeySalarySobItemPOMap); + //是否锁定 + if (lockSalaryItemIds.contains(salaryItemId) && salaryAcctLockResultPOS.get(salaryItemId + "_" + salaryAcctEmployeePOId) != null) { + resultValue = salaryAcctLockResultPOS.get(salaryItemId + "_" + salaryAcctEmployeePOId).getResultValue(); + } + // 将已经计算过的薪资项目的值转换成公式变量的值添加到集合中 + String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); + formulaVarValueMap.put(key, resultValue); + // 值保存薪资账套下的薪资项目的核算结果 + if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId) || salarySobBackItemIds.contains(salaryItemId)) { + // 转换成薪资核算结果po + SalaryAcctResultTempPO salaryAcctResultTempPO = new SalaryAcctResultTempPO() + .setSalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()) + .setSalaryAcctEmpId(salaryAcctEmployeePOId) + .setEmployeeId(salaryAcctEmployeePO.getEmployeeId()) + .setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .setSalarySobId(salaryAcctEmployeePO.getSalarySobId()) + .setSalaryItemId(salaryItemPO.getId()) + .setResultValue(resultValue) + .setOriginResultValue(salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId) == null + ? StringUtils.EMPTY : salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId)) + .setCalculateKey(salaryAcctCalculateBO.getCalculateKey()) + .setCreator((long) user.getUID()) + .setCreateTime(now) + .setUpdateTime(now) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setDeleteType(0); + salaryAcctResultTempPOS.add(salaryAcctResultTempPO); } } } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 6b0193809..2c732564f 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -17,6 +17,7 @@ import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.*; import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.*; import com.engine.salary.entity.salarysob.po.*; @@ -26,6 +27,7 @@ import com.engine.salary.enums.SalaryValueTypeEnum; import com.engine.salary.enums.salaryaccounting.LockStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctResultDataSourceEnum; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -54,6 +56,8 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.BeanUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import weaver.hrm.User; @@ -62,8 +66,11 @@ import java.util.*; import java.util.concurrent.BlockingDeque; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingDeque; +import java.util.regex.Matcher; import java.util.stream.Collectors; +import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN; + /** * 薪资核算结果 *

Copyright: Copyright (c) 2022

@@ -331,7 +338,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); Map salaryItemIdKeySalarySobItemPOMap = SalaryEntityUtil.convert2Map(salarySobItemPOS, SalarySobItemPO::getSalaryItemId); Set salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId); - if(Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), NumberUtils.INTEGER_ONE)){ + if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), NumberUtils.INTEGER_ONE)) { // 是回算,获取回算项 List salarySobBackItemPOS = getSalarySobBackItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); salaryItemIds.addAll(salarySobBackItemPOS.stream().map(SalarySobBackItemPO::getSalaryItemId).collect(Collectors.toList())); @@ -339,7 +346,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds); // 查询薪资核算结果 - List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId,Collectors.toList()); + List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId, Collectors.toList()); List salaryAcctResultPOS = listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); Map map = new HashMap<>(); @@ -396,7 +403,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds); // 查询薪资核算结果 - List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId,Collectors.toList()); + List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId, Collectors.toList()); List salaryAcctResultPOS = listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); // 查询人员信息 List employeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); @@ -477,7 +484,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listByRecordIdsAndEmpIdAndTaxAgentId(salaryAcctRecordIds, salaryAcctEmployeePO.getEmployeeId(), salaryAcctEmployeePO.getTaxAgentId()); } // 查询薪资核算人员的薪资核算结果 - List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId,Collectors.toList()); + List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId, Collectors.toList()); List salaryAcctResultPOS = listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); // 查询薪资核算人员所有合并计税的薪资核算记录所用的账套 Set salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getSalarySobId); @@ -555,13 +562,13 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 保存参数转换成薪资核算结果po List salaryAcctResultPOS = SalaryAcctResultBO.convert2PO(salaryAcctResultPOSOld, saveParam, salaryAcctEmployeePO, (long) user.getUID()); SalarySysConfPO autoLock = getSalarySysConfService(user).getOneByCode(SalarySysConstant.EDIT_IMPORT_AUTO_LOCK); - if(autoLock != null && StringUtils.equals(autoLock.getConfValue(),"1")){ + if (autoLock != null && StringUtils.equals(autoLock.getConfValue(), "1")) { // 对比核算结果提取修改了哪些薪资项目 Set needLockItems = new HashSet<>(); Map oldResutMap = SalaryEntityUtil.convert2Map(salaryAcctResultPOSOld, SalaryAcctResultPO::getSalaryItemId); salaryAcctResultPOS.stream().forEach(PO -> { String oldValue = Optional.ofNullable(oldResutMap.get(PO.getSalaryItemId())).map(SalaryAcctResultPO::getResultValue).orElse(""); - if(!StringUtils.equals(oldValue,PO.getResultValue())){ + if (!StringUtils.equals(oldValue, PO.getResultValue())) { needLockItems.add(PO.getSalaryItemId()); } }); @@ -601,7 +608,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 存储薪资核算结果数据来源日志 salaryAcctResultPOS = getSalaryAcctRecordService(user).listBySalaryAcctEmpId(saveParam.getSalaryAcctEmpId()); - saveSalaryAcctResultLog(salaryAcctResultPOSOld,salaryAcctResultPOS); + saveSalaryAcctResultLog(salaryAcctResultPOSOld, salaryAcctResultPOS); // 查询操作日志的targetName // String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(salaryAcctEmployeePO.getSalaryAcctRecordId()); @@ -623,6 +630,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe /** * 存储薪资核算结果数据来源日志 + * * @param salaryAcctResultPOSOld * @param salaryAcctResultPOS */ @@ -631,11 +639,11 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List editItems = new ArrayList<>(); Map oldResutMap = SalaryEntityUtil.convert2Map(salaryAcctResultPOSOld, SalaryAcctResultPO::getSalaryItemId); salaryAcctResultPOS.stream().forEach(PO -> { - if(oldResutMap.get(PO.getSalaryItemId()) == null){ + if (oldResutMap.get(PO.getSalaryItemId()) == null) { editItems.add(PO); - }else{ + } else { String oldValue = oldResutMap.get(PO.getSalaryItemId()).getResultValue(); - if(!StringUtils.equals(oldValue,PO.getResultValue())){ + if (!StringUtils.equals(oldValue, PO.getResultValue())) { editItems.add(PO); } } @@ -731,14 +739,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); // 本次运算的回算薪资项目所涉及的变量 - Set issuedFieldIds = new HashSet<>(); + Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); // 9、计算薪资项目的运算优先级 - List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); -// List> salarySobItemsWithPriority = new ArrayList<>(); - SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, expressFormulas); - List salaryCalcItems = salaryCalcItemGraph.sort(); - List properties = SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); -// salarySobItemsWithPriority.add(properties); +// List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); + List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); // 10、根据id查询其他合并计税的薪资核算记录 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); @@ -825,8 +829,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List salaryAcctEmployeeIds = salaryAcctEmployeePOS.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList()); exceptItemIds.addAll(lockSalaryItemIds); exceptItemIds.addAll(salaryItemPOS.stream().filter(PO -> Objects.equals(PO.getValueType(), NumberUtils.INTEGER_ONE) && - Objects.equals(PO.getUseInEmployeeSalary(),0)) - .map(SalaryItemPO::getId).collect(Collectors.toList()) ); + Objects.equals(PO.getUseInEmployeeSalary(), 0)) + .map(SalaryItemPO::getId).collect(Collectors.toList())); getSalaryAcctResultLogService(user).deleteBySalaryAcctEmpIdExceptItemIds(salaryAcctEmployeeIds, exceptItemIds); } }.start(); @@ -849,6 +853,46 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } } + @NotNull + private List sortItems(List salarySobItemPOS, List salarySobBackItems, List salaryItemPOS, List expressFormulas) { + + List temp = salarySobBackItems.stream() + .map(e -> { + SalarySobItemPO salarySobItem = new SalarySobItemPO(); + BeanUtils.copyProperties(e, salarySobItem); + return salarySobItem; + }).collect(Collectors.toList()); + salarySobItemPOS.addAll(temp); + + SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, salaryItemPOS, expressFormulas); + List salaryCalcItems = salaryCalcItemGraph.sort(); + return SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + } + + /** + * 获取回算变量 + * + * @param salarySobBackItems + * @return + */ + @NotNull + private Set getIssuedFieldIds(List salarySobBackItems) { + Set issuedFieldIds; + Set issuedFormulaIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId); + List expressFormulas1 = getSalaryFormulaService(user).listExpressFormula(issuedFormulaIds); + List issuedFormulaVars = new ArrayList<>(); + expressFormulas1.forEach(f -> issuedFormulaVars.addAll(f.getParameters())); + issuedFieldIds = issuedFormulaVars.stream() + .map(FormulaVar::getFieldId) + .filter(StringUtils::isNotBlank) + .filter(v -> v.startsWith(SalaryFormulaReferenceEnum.ISSUED.getValue() + "_")) + .map(SALARY_PATTERN::matcher) + .filter(Matcher::find) + .map(m -> m.group(2)) + .collect(Collectors.toSet()); + return issuedFieldIds; + } + /** * 处理薪资核算临时存储表中的数据 * @@ -946,9 +990,9 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // } Set salaryItemIds; - if(CollectionUtils.isNotEmpty(updateParam.getSalaryItemIds())){ + if (CollectionUtils.isNotEmpty(updateParam.getSalaryItemIds())) { salaryItemIds = updateParam.getSalaryItemIds(); - }else{ + } else { salaryItemIds = Collections.singleton(updateParam.getSalaryItemId()); } if (updateParam.getLockStatus() == LockStatusEnum.LOCK) { @@ -987,10 +1031,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe @Override public List listByAcctEmployeeIdsAndSalaryItemIds(List salaryAcctEmployeeIds, Collection salaryItemIds) { - if(CollectionUtils.isEmpty(salaryAcctEmployeeIds)){ + if (CollectionUtils.isEmpty(salaryAcctEmployeeIds)) { return Collections.emptyList(); } - List> partition = Lists.partition((List)salaryAcctEmployeeIds, 200); + List> partition = Lists.partition((List) salaryAcctEmployeeIds, 200); List result = new ArrayList<>(); partition.forEach(empIds -> { SalaryAcctResultPO build = SalaryAcctResultPO.builder().salaryAcctEmpIds(empIds).salaryItemIds(salaryItemIds).build(); @@ -1013,10 +1057,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe @Override public List listAcctEmpIdByAcctEmpId(List salaryAcctEmployeeIds) { - if(CollectionUtils.isEmpty(salaryAcctEmployeeIds)){ + if (CollectionUtils.isEmpty(salaryAcctEmployeeIds)) { return Collections.emptyList(); } - List> partition = Lists.partition((List)salaryAcctEmployeeIds, 1000); + List> partition = Lists.partition((List) salaryAcctEmployeeIds, 1000); List result = new ArrayList<>(); partition.forEach(empIds -> { result.addAll(getSalaryAcctResultMapper().getAcctEmpIsExist(empIds)); @@ -1053,15 +1097,15 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe public Boolean checkAuth(Long salaryAcctRecordId) { // 获取该核算记录的个税扣缴义务 SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); - if(Objects.isNull(recordPO)) { + if (Objects.isNull(recordPO)) { return false; } SalarySobPO salarySobPO = getSalarySobService(user).getById(recordPO.getSalarySobId()); Long taxAgentId = salarySobPO.getTaxAgentId(); List adminTaxAgentList = getTaxAgentAdminService(user).listByEmployeeId(Long.valueOf(user.getUID())); Optional canOperate = adminTaxAgentList.stream().filter(po -> NumberUtils.compare(taxAgentId, po.getTaxAgentId()) == 0).findFirst(); - if(!canOperate.isPresent()){ - return false; + if (!canOperate.isPresent()) { + return false; } return true; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index c2fe1eabc..f7aaf17c9 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -32,7 +32,7 @@ import java.util.*; import java.util.stream.Collectors; /** - * 个税申报表 + * 个税申报表 *

Copyright: Copyright (c) 2023

*

Company: 泛微软件

* @@ -92,7 +92,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); // 查询人员信息 List simpleEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) .map(TaxDeclarationValuePO::getEmployeeId) .distinct() .collect(Collectors.toList()); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index efbd618c6..0474f38d8 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -368,6 +368,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getAddUpSituationService(user).batchSave(entry.getValue()); } } + + //更新核算记录状态 + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); } private TaxDeclarationResult generateReportPerRecord(TaxDeclareRecordPO taxDeclareRecord, List salaryAcctEmployees) { From 83e0b1668e1b24488be7a31567dcb604851282e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 7 Sep 2023 18:21:22 +0800 Subject: [PATCH 056/298] =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacollection/dto/AddUpSituationDTO.java | 89 +++++++-------- .../dto/AddUpSituationRecordDTO.java | 107 ++++++++++-------- .../param/AddUpSituationParam.java | 9 ++ .../bo/TaxDeclarationCommon.java | 2 +- .../datacollection/AddUpSituationMapper.xml | 62 ++++++++-- .../impl/AddUpSituationServiceImpl.java | 93 +++++++-------- 6 files changed, 205 insertions(+), 157 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java index fd217469e..0d31ad308 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java @@ -23,7 +23,6 @@ import lombok.NoArgsConstructor; public class AddUpSituationDTO { //主键id @JsonSerialize(using = ToStringSerializer.class) - @SalaryTableColumn(column = "id", display = false) private Long id; //员工id @@ -36,7 +35,6 @@ public class AddUpSituationDTO { private Integer month; //姓名 - @SalaryTableColumn(text = "姓名", width = "10%", column = "username") @TableTitle(title = "姓名", dataIndex = "username", key = "username") @ExcelProperty(index = 0) private String username; @@ -45,7 +43,6 @@ public class AddUpSituationDTO { // private String taxYearMonth; //个税扣缴义务人 - @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") @ExcelProperty(index = 1) private String taxAgentName; @@ -56,162 +53,154 @@ public class AddUpSituationDTO { private Long taxAgentId; //部门 - @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") @ExcelProperty(index = 2) private String departmentName; //手机号 - @SalaryTableColumn(text = "手机号", width = "10%", column = "mobile") @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") @ExcelProperty(index = 3) private String mobile; //工号 - @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") @ExcelProperty(index = 4) private String jobNum; //证件号码 - @SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo") @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") @ExcelProperty(index = 5) private String idNo; //入职日期 - @SalaryTableColumn(text = "入职日期", width = "10%", column = "hiredate") @TableTitle(title = "入职日期", dataIndex = "hiredate", key = "hiredate") @ExcelProperty(index = 6) private String hiredate; //累计收入额 - @SalaryTableColumn(text = "累计收入额", width = "10%", column = "addUpIncome") @TableTitle(title = "累计收入额", dataIndex = "addUpIncome", key = "addUpIncome") @ExcelProperty(index = 7) @Encrypt private String addUpIncome; //累计减除费用 - @SalaryTableColumn(text = "累计减除费用", width = "10%", column = "addUpSubtraction") @TableTitle(title = "累计减除费用", dataIndex = "addUpSubtraction", key = "addUpSubtraction") @ExcelProperty(index = 8) @Encrypt private String addUpSubtraction; //累计社保个人合计 - @SalaryTableColumn(text = "累计社保个人合计", width = "10%", column = "addUpSocialSecurityTotal") @TableTitle(title = "累计社保个人合计", dataIndex = "addUpSocialSecurityTotal", key = "addUpSocialSecurityTotal") @ExcelProperty(index = 9) @Encrypt private String addUpSocialSecurityTotal; //累计公积金个人合计 - @SalaryTableColumn(text = "累计公积金个人合计", width = "10%", column = "addUpAccumulationFundTotal") @TableTitle(title = "累计公积金个人合计", dataIndex = "addUpAccumulationFundTotal", key = "addUpAccumulationFundTotal") @ExcelProperty(index = 10) @Encrypt private String addUpAccumulationFundTotal; //累计子女教育 - @SalaryTableColumn(text = "累计子女教育", width = "10%", column = "addUpChildEducation") - @TableTitle(title = "累计子女教育", dataIndex = "addUpChildEducation", key = "addUpChildEducation") - @ExcelProperty(index = 11) @Encrypt + @Deprecated private String addUpChildEducation; //累计继续教育 - @SalaryTableColumn(text = "累计继续教育", width = "10%", column = "addUpContinuingEducation") - @TableTitle(title = "累计继续教育", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation") - @ExcelProperty(index = 12) @Encrypt + @Deprecated private String addUpContinuingEducation; //累计住房贷款利息 - @SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "addUpHousingLoanInterest") - @TableTitle(title = "累计住房贷款利息", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest") - @ExcelProperty(index = 13) @Encrypt + @Deprecated private String addUpHousingLoanInterest; //累计住房租金 - @SalaryTableColumn(text = "累计住房租金", width = "10%", column = "addUpHousingRent") - @TableTitle(title = "累计住房租金", dataIndex = "addUpHousingRent", key = "addUpHousingRent") - @ExcelProperty(index = 14) @Encrypt + @Deprecated private String addUpHousingRent; //累计赡养老人 - @SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "addUpSupportElderly") - @TableTitle(title = "累计赡养老人", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly") - @ExcelProperty(index = 15) @Encrypt + @Deprecated private String addUpSupportElderly; //累计大病医疗 - @SalaryTableColumn(text = "累计大病医疗", width = "10%", column = "addUpIllnessMedical") - @TableTitle(title = "累计大病医疗", dataIndex = "addUpIllnessMedical", key = "addUpIllnessMedical") - @ExcelProperty(index = 16) @Encrypt + @Deprecated private String addUpIllnessMedical; //累计企业(职业)年金及其他福利 - @SalaryTableColumn(text = "累计企业(职业)年金及其他福利", width = "10%", column = "addUpEnterpriseAndOther") @TableTitle(title = "累计企业(职业)年金及其他福利", dataIndex = "addUpEnterpriseAndOther", key = "addUpEnterpriseAndOther") - @ExcelProperty(index = 17) + @ExcelProperty(index = 11) @Encrypt private String addUpEnterpriseAndOther; //累计其他扣除 - @SalaryTableColumn(text = "累计其他扣除", width = "10%", column = "addUpOtherDeduction") - @TableTitle(title = "累计其他扣除", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") - @ExcelProperty(index = 18) + @TableTitle(title = "累计其他免税扣除", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") + @ExcelProperty(index = 12) @Encrypt private String addUpOtherDeduction; //累计免税收入 - @SalaryTableColumn(text = "累计免税收入", width = "10%", column = "addUpTaxExemptIncome") @TableTitle(title = "累计免税收入", dataIndex = "addUpTaxExemptIncome", key = "addUpTaxExemptIncome") - @ExcelProperty(index = 19) + @ExcelProperty(index = 13) @Encrypt private String addUpTaxExemptIncome; //累计准予扣除的捐赠额 - @SalaryTableColumn(text = "累计准予扣除的捐赠额", width = "10%", column = "addUpAllowedDonation") @TableTitle(title = "累计准予扣除的捐赠额", dataIndex = "addUpAllowedDonation", key = "addUpAllowedDonation") - @ExcelProperty(index = 20) + @ExcelProperty(index = 14) @Encrypt private String addUpAllowedDonation; //累计减免税额 - @SalaryTableColumn(text = "累计减免税额", width = "10%", column = "addUpTaxSavings") @TableTitle(title = "累计减免税额", dataIndex = "addUpTaxSavings", key = "addUpTaxSavings") - @ExcelProperty(index = 21) + @ExcelProperty(index = 15) @Encrypt private String addUpTaxSavings; //累计已预扣预缴税额 - @SalaryTableColumn(text = "累计已预扣预缴税额", width = "10%", column = "addUpAdvanceTax") @TableTitle(title = "累计已预扣预缴税额", dataIndex = "addUpAdvanceTax", key = "addUpAdvanceTax") - @ExcelProperty(index = 22) + @ExcelProperty(index = 16) @Encrypt private String addUpAdvanceTax; //累计婴幼儿照护 - @ExcelProperty(index = 23) - @SalaryTableColumn(text = "累计婴幼儿照护", width = "10%", column = "addUpInfantCare") - @TableTitle(title = "累计婴幼儿照护", dataIndex = "addUpInfantCare", key = "addUpInfantCare") @Encrypt + @Deprecated private String addUpInfantCare; //累计个人养老金 - @ExcelProperty(index = 24) - @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "addUpPrivatePension") - @TableTitle(title = "累计个人养老金", dataIndex = "addUpPrivatePension", key = "addUpPrivatePension") @Encrypt + @Deprecated private String addUpPrivatePension; - @SalaryTableColumn(text = "操作", width = "20%", column = "operate") + /** + * 实际累计已预扣预缴税额 + */ + @ExcelProperty(index = 17) + @TableTitle(title = "实际累计已预扣预缴税额", dataIndex = "actualAddUpAdvanceTax", key = "actualAddUpAdvanceTax") + @Encrypt + private String actualAddUpAdvanceTax; + + /** + * 个税调差 + */ + @ExcelProperty(index = 18) + @TableTitle(title = "个税调差", dataIndex = "taxAdjustment", key = "taxAdjustment") + @Encrypt + private String taxAdjustment; + + /** + * 累计应纳税所得额 + */ + @ExcelProperty(index = 19) + @TableTitle(title = "累计应纳税所得额", dataIndex = "addUpTaxableIncome", key = "addUpTaxableIncome") + @Encrypt + private String addUpTaxableIncome; + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") private String operate; } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java index e8c2fd0aa..dbd78ce3d 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java @@ -69,111 +69,128 @@ public class AddUpSituationRecordDTO { @ExcelProperty(index = 5) private String jobNum; - @SalaryTableColumn(text = "累计收入额", width = "10%", column = "addUpIncome") + //累计收入额 @TableTitle(title = "累计收入额", dataIndex = "addUpIncome", key = "addUpIncome") - @ExcelProperty(index = 6) + @ExcelProperty(index = 7) @Encrypt private String addUpIncome; - @SalaryTableColumn(text = "累计减除费用", width = "10%", column = "addUpSubtraction") + //累计减除费用 @TableTitle(title = "累计减除费用", dataIndex = "addUpSubtraction", key = "addUpSubtraction") - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @Encrypt private String addUpSubtraction; - @SalaryTableColumn(text = "累计社保个人合计", width = "10%", column = "addUpSocialSecurityTotal") + //累计社保个人合计 @TableTitle(title = "累计社保个人合计", dataIndex = "addUpSocialSecurityTotal", key = "addUpSocialSecurityTotal") - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @Encrypt private String addUpSocialSecurityTotal; - @SalaryTableColumn(text = "累计公积金个人合计", width = "10%", column = "addUpAccumulationFundTotal") + //累计公积金个人合计 @TableTitle(title = "累计公积金个人合计", dataIndex = "addUpAccumulationFundTotal", key = "addUpAccumulationFundTotal") - @ExcelProperty(index = 9) + @ExcelProperty(index = 10) @Encrypt private String addUpAccumulationFundTotal; - @ExcelProperty(index = 10) - @SalaryTableColumn(text = "累计子女教育", width = "10%", column = "addUpChildEducation") - @TableTitle(title = "累计子女教育", dataIndex = "addUpChildEducation", key = "addUpChildEducation") + //累计子女教育 @Encrypt + @Deprecated private String addUpChildEducation; - @ExcelProperty(index = 11) - @SalaryTableColumn(text = "累计继续教育", width = "10%", column = "addUpContinuingEducation") - @TableTitle(title = "累计继续教育", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation") + //累计继续教育 @Encrypt + @Deprecated private String addUpContinuingEducation; - @ExcelProperty(index = 12) - @SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "addUpHousingLoanInterest") - @TableTitle(title = "累计住房贷款利息", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest") + //累计住房贷款利息 @Encrypt + @Deprecated private String addUpHousingLoanInterest; - @ExcelProperty(index = 13) - @SalaryTableColumn(text = "累计住房租金", width = "10%", column = "addUpHousingRent") - @TableTitle(title = "累计住房租金", dataIndex = "addUpHousingRent", key = "addUpHousingRent") + //累计住房租金 @Encrypt + @Deprecated private String addUpHousingRent; - @ExcelProperty(index = 14) - @SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "addUpSupportElderly") - @TableTitle(title = "累计赡养老人", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly") + //累计赡养老人 @Encrypt + @Deprecated private String addUpSupportElderly; - @ExcelProperty(index = 15) - @SalaryTableColumn(text = "累计大病医疗", width = "10%", column = "addUpIllnessMedical") - @TableTitle(title = "累计大病医疗", dataIndex = "addUpIllnessMedical", key = "addUpIllnessMedical") + //累计大病医疗 @Encrypt + @Deprecated private String addUpIllnessMedical; - @ExcelProperty(index = 16) - @SalaryTableColumn(text = "累计企业(职业)年金及其他福利", width = "10%", column = "addUpEnterpriseAndOther") + //累计企业(职业)年金及其他福利 @TableTitle(title = "累计企业(职业)年金及其他福利", dataIndex = "addUpEnterpriseAndOther", key = "addUpEnterpriseAndOther") + @ExcelProperty(index = 11) @Encrypt private String addUpEnterpriseAndOther; - @ExcelProperty(index = 17) - @SalaryTableColumn(text = "累计其他扣除", width = "10%", column = "addUpOtherDeduction") - @TableTitle(title = "累计其他扣除", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") + //累计其他扣除 + @TableTitle(title = "累计其他免税扣除", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") + @ExcelProperty(index = 12) @Encrypt private String addUpOtherDeduction; - @ExcelProperty(index = 18) - @SalaryTableColumn(text = "累计免税收入", width = "10%", column = "addUpTaxExemptIncome") + //累计免税收入 @TableTitle(title = "累计免税收入", dataIndex = "addUpTaxExemptIncome", key = "addUpTaxExemptIncome") + @ExcelProperty(index = 13) @Encrypt private String addUpTaxExemptIncome; - @ExcelProperty(index = 19) - @SalaryTableColumn(text = "累计准予扣除的捐赠额", width = "10%", column = "addUpAllowedDonation") + //累计准予扣除的捐赠额 @TableTitle(title = "累计准予扣除的捐赠额", dataIndex = "addUpAllowedDonation", key = "addUpAllowedDonation") + @ExcelProperty(index = 14) @Encrypt private String addUpAllowedDonation; - @ExcelProperty(index = 20) - @SalaryTableColumn(text = "累计减免税额", width = "10%", column = "addUpTaxSavings") + //累计减免税额 @TableTitle(title = "累计减免税额", dataIndex = "addUpTaxSavings", key = "addUpTaxSavings") + @ExcelProperty(index = 15) @Encrypt private String addUpTaxSavings; - @ExcelProperty(index = 21) - @SalaryTableColumn(text = "累计已预扣预缴税额", width = "10%", column = "addUpAdvanceTax") + //累计已预扣预缴税额 @TableTitle(title = "累计已预扣预缴税额", dataIndex = "addUpAdvanceTax", key = "addUpAdvanceTax") + @ExcelProperty(index = 16) @Encrypt private String addUpAdvanceTax; - @ExcelProperty(index = 22) - @SalaryTableColumn(text = "累计婴幼儿照护", width = "10%", column = "addUpInfantCare") - @TableTitle(title = "累计婴幼儿照护", dataIndex = "addUpInfantCare", key = "addUpInfantCare") + //累计婴幼儿照护 @Encrypt + @Deprecated private String addUpInfantCare; - @ExcelProperty(index = 23) - @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "addUpPrivatePension") - @TableTitle(title = "累计个人养老金", dataIndex = "addUpPrivatePension", key = "addUpPrivatePension") + //累计个人养老金 @Encrypt + @Deprecated private String addUpPrivatePension; + + /** + * 实际累计已预扣预缴税额 + */ + @ExcelProperty(index = 17) + @TableTitle(title = "实际累计已预扣预缴税额", dataIndex = "actualAddUpAdvanceTax", key = "actualAddUpAdvanceTax") + @Encrypt + private String actualAddUpAdvanceTax; + + /** + * 个税调差 + */ + @ExcelProperty(index = 18) + @TableTitle(title = "个税调差", dataIndex = "taxAdjustment", key = "taxAdjustment") + @Encrypt + private String taxAdjustment; + + /** + * 累计应纳税所得额 + */ + @ExcelProperty(index = 19) + @TableTitle(title = "累计应纳税所得额", dataIndex = "addUpTaxableIncome", key = "addUpTaxableIncome") + @Encrypt + private String addUpTaxableIncome; + } diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpSituationParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpSituationParam.java index d50184b2f..2fc47acd9 100644 --- a/src/com/engine/salary/entity/datacollection/param/AddUpSituationParam.java +++ b/src/com/engine/salary/entity/datacollection/param/AddUpSituationParam.java @@ -98,4 +98,13 @@ public class AddUpSituationParam { //累计个人养老金 private String addUpPrivatePension; + //实际累计已预扣预缴税额 + private String actualAddUpAdvanceTax; + + //个税调差 + private String taxAdjustment; + + //累计应纳税所得额 + private String addUpTaxableIncome; + } diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index 6fc30bf15..5a4f908e3 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -160,7 +160,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { .addUpTaxExemptIncome(valueMap.get("addUpTaxExemptIncome")) .addUpAllowedDonation(valueMap.get("addUpAllowedDonation")) .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) -// .addUpTaxableIncome(valueMap.get("addUpTaxableIncome")) + .addUpTaxableIncome(valueMap.get("addUpTaxableIncome")) // .modifier(taxDeclaration.getCreator()) .creator(taxDeclaration.getCreator()) .createTime(taxDeclaration.getCreateTime()) diff --git a/src/com/engine/salary/mapper/datacollection/AddUpSituationMapper.xml b/src/com/engine/salary/mapper/datacollection/AddUpSituationMapper.xml index 1a4e58158..9e309c506 100644 --- a/src/com/engine/salary/mapper/datacollection/AddUpSituationMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/AddUpSituationMapper.xml @@ -20,6 +20,9 @@ + + + @@ -64,6 +67,9 @@ , t.add_up_tax_savings , t.add_up_infant_care , t.add_up_private_pension + , t.actual_add_up_advance_tax + , t.tax_adjustment + , t.add_up_taxable_income @@ -126,7 +132,10 @@ t1.add_up_tax_exempt_income, t1.add_up_allowed_donation, t1.add_up_tax_savings, - t1.add_up_advance_tax + t1.add_up_advance_tax, + t1.actual_add_up_advance_tax, + t1.tax_adjustment, + t1.add_up_taxable_income @@ -438,7 +447,10 @@ add_up_tax_savings, add_up_illness_medical, add_up_infant_care, - add_up_private_pension + add_up_private_pension, + actual_add_up_advance_tax, + tax_adjustment, + add_up_taxable_income ) VALUES @@ -468,7 +480,10 @@ #{item.addUpTaxSavings}, #{item.addUpIllnessMedical}, #{item.addUpInfantCare}, - #{item.addUpPrivatePension} + #{item.addUpPrivatePension}, + #{item.actualAddUpAdvanceTax}, + #{item.taxAdjustment}, + #{item.addUpTaxableIncome} ) @@ -499,7 +514,10 @@ add_up_tax_savings, add_up_illness_medical, add_up_infant_care, - add_up_private_pension + add_up_private_pension, + actual_add_up_advance_tax, + tax_adjustment, + add_up_taxable_income ) @@ -529,7 +547,10 @@ #{item.addUpTaxSavings,jdbcType=VARCHAR}, #{item.addUpIllnessMedical,jdbcType=VARCHAR}, #{item.addUpInfantCare,jdbcType=VARCHAR}, - #{item.addUpPrivatePension,jdbcType=VARCHAR} + #{item.addUpPrivatePension,jdbcType=VARCHAR}, + #{item.actualAddUpAdvanceTax,jdbcType=VARCHAR}, + #{item.taxAdjustment,jdbcType=VARCHAR}, + #{item.addUpTaxableIncome,jdbcType=VARCHAR} from dual @@ -561,7 +582,10 @@ add_up_tax_savings, add_up_illness_medical, add_up_infant_care, - add_up_private_pension + add_up_private_pension, + actual_add_up_advance_tax, + tax_adjustment, + add_up_taxable_income ) VALUES ( @@ -590,7 +614,10 @@ #{item.addUpTaxSavings}, #{item.addUpIllnessMedical}, #{item.addUpInfantCare}, - #{item.addUpPrivatePension} + #{item.addUpPrivatePension}, + #{item.actualAddUpAdvanceTax}, + #{item.taxAdjustment}, + #{item.addUpTaxableIncome} ) @@ -724,6 +751,27 @@ + + + + when id=#{item.id} then #{item.actualAddUpAdvanceTax} + + + + + + + when id=#{item.id} then #{item.taxAdjustment} + + + + + + + when id=#{item.id} then #{item.addUpTaxableIncome} + + + where id in diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index c0e108de2..9c360d55c 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -298,8 +298,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation long employeeId = user.getUID(); // excel标题 final List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用", - "累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", - "累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金"); + "累计社保个人合计", "累计公积金个人合计", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", + "累计已预扣预缴税额", "实际累计已预扣预缴税额", "个税调差", "累计应纳税所得额"); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -329,20 +329,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation cellList.add(Util.null2String(dto.getAddUpSubtraction())); cellList.add(Util.null2String(dto.getAddUpSocialSecurityTotal())); cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); - cellList.add(Util.null2String(dto.getAddUpChildEducation())); - cellList.add(Util.null2String(dto.getAddUpContinuingEducation())); - cellList.add(Util.null2String(dto.getAddUpHousingLoanInterest())); - cellList.add(Util.null2String(dto.getAddUpHousingRent())); - cellList.add(Util.null2String(dto.getAddUpSupportElderly())); - cellList.add(Util.null2String(dto.getAddUpIllnessMedical())); cellList.add(Util.null2String(dto.getAddUpEnterpriseAndOther())); cellList.add(Util.null2String(dto.getAddUpOtherDeduction())); cellList.add(Util.null2String(dto.getAddUpTaxExemptIncome())); cellList.add(Util.null2String(dto.getAddUpAllowedDonation())); cellList.add(Util.null2String(dto.getAddUpTaxSavings())); cellList.add(Util.null2String(dto.getAddUpAdvanceTax())); - cellList.add(Util.null2String(dto.getAddUpInfantCare())); - cellList.add(Util.null2String(dto.getAddUpPrivatePension())); + cellList.add(Util.null2String(dto.getActualAddUpAdvanceTax())); + cellList.add(Util.null2String(dto.getTaxAdjustment())); + cellList.add(Util.null2String(dto.getAddUpTaxableIncome())); return cellList; }).collect(Collectors.toList())) .orElse(Collections.emptyList()); @@ -363,9 +358,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation private List> getExcelRowDetailList(AddUpSituationQueryParam param) { long employeeId = user.getUID(); //excel标题 - List title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", "累计社保个人合计", - "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计企业(职业)年金及其他福利", - "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金"); + List title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", + "累计社保个人合计", "累计公积金个人合计", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", + "累计已预扣预缴税额", "实际累计已预扣预缴税额", "个税调差", "累计应纳税所得额"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 @@ -393,20 +388,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation cellList.add(Util.null2String(dto.getAddUpSubtraction())); cellList.add(Util.null2String(dto.getAddUpSocialSecurityTotal())); cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); - cellList.add(Util.null2String(dto.getAddUpChildEducation())); - cellList.add(Util.null2String(dto.getAddUpContinuingEducation())); - cellList.add(Util.null2String(dto.getAddUpHousingLoanInterest())); - cellList.add(Util.null2String(dto.getAddUpHousingRent())); - cellList.add(Util.null2String(dto.getAddUpSupportElderly())); - cellList.add(Util.null2String(dto.getAddUpIllnessMedical())); cellList.add(Util.null2String(dto.getAddUpEnterpriseAndOther())); cellList.add(Util.null2String(dto.getAddUpOtherDeduction())); cellList.add(Util.null2String(dto.getAddUpTaxExemptIncome())); cellList.add(Util.null2String(dto.getAddUpAllowedDonation())); cellList.add(Util.null2String(dto.getAddUpTaxSavings())); cellList.add(Util.null2String(dto.getAddUpAdvanceTax())); - cellList.add(Util.null2String(dto.getAddUpInfantCare())); - cellList.add(Util.null2String(dto.getAddUpPrivatePension())); + cellList.add(Util.null2String(dto.getActualAddUpAdvanceTax())); + cellList.add(Util.null2String(dto.getTaxAdjustment())); + cellList.add(Util.null2String(dto.getAddUpTaxableIncome())); return cellList; }).collect(Collectors.toList())) .orElse(Collections.emptyList()); @@ -470,20 +460,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation SalaryI18nUtil.getI18nLabel(86711, "累计减除费用"), SalaryI18nUtil.getI18nLabel(86710, "累计社保个人合计"), SalaryI18nUtil.getI18nLabel(86709, "累计公积金个人合计"), - SalaryI18nUtil.getI18nLabel(86321, "累计子女教育"), - SalaryI18nUtil.getI18nLabel(86323, "累计继续教育"), - SalaryI18nUtil.getI18nLabel(86324, "累计住房贷款利息"), - SalaryI18nUtil.getI18nLabel(86325, "累计住房租金"), - SalaryI18nUtil.getI18nLabel(86326, "累计赡养老人"), - SalaryI18nUtil.getI18nLabel(105142, "累计大病医疗"), SalaryI18nUtil.getI18nLabel(90567, "累计企业(职业)年金及其他福利"), SalaryI18nUtil.getI18nLabel(93902, "累计其他免税扣除"), SalaryI18nUtil.getI18nLabel(86704, "累计免税收入"), SalaryI18nUtil.getI18nLabel(86703, "累计准予扣除的捐赠额"), SalaryI18nUtil.getI18nLabel(105478, "累计减免税额"), SalaryI18nUtil.getI18nLabel(86702, "累计已预扣预缴税额"), - SalaryI18nUtil.getI18nLabel(86702, "累计婴幼儿照护"), - SalaryI18nUtil.getI18nLabel(86702, "累计个人养老金") + SalaryI18nUtil.getI18nLabel(86702, "实际累计已预扣预缴税额"), + SalaryI18nUtil.getI18nLabel(86702, "个税调差"), + SalaryI18nUtil.getI18nLabel(86702, "累计应纳税所得额") }; // 2.表头 List headerList = Arrays.asList(header); @@ -521,23 +506,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation row.add(Util.null2String(dto.getJobNum())); row.add(Util.null2String(dto.getIdNo())); row.add(Util.null2String(dto.getHiredate())); -// row.add(Util.null2String(dto.getAddUpIncome())); -// row.add(Util.null2String(dto.getAddUpSubtraction())); -// row.add(Util.null2String(dto.getAddUpSocialSecurityTotal())); -// row.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); -// row.add(Util.null2String(dto.getAddUpChildEducation())); -// row.add(Util.null2String(dto.getAddUpContinuingEducation())); -// row.add(Util.null2String(dto.getAddUpHousingLoanInterest())); -// row.add(Util.null2String(dto.getAddUpHousingRent())); -// row.add(Util.null2String(dto.getAddUpSupportElderly())); -// row.add(Util.null2String(dto.getAddUpIllnessMedical())); -// row.add(Util.null2String(dto.getAddUpEnterpriseAndOther())); -// row.add(Util.null2String(dto.getAddUpOtherDeduction())); -// row.add(Util.null2String(dto.getAddUpTaxExemptIncome())); -// row.add(Util.null2String(dto.getAddUpAllowedDonation())); -// row.add(Util.null2String(dto.getAddUpTaxSavings())); -// row.add(Util.null2String(dto.getAddUpAdvanceTax())); -// row.add(Util.null2String(dto.getAddUpInfantCare())); rows.add(row); } // 4.注释 @@ -557,11 +525,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation excelComments.add(new ExcelComment(17, 0, 22, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); excelComments.add(new ExcelComment(18, 0, 23, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); excelComments.add(new ExcelComment(19, 0, 24, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); - excelComments.add(new ExcelComment(20, 0, 25, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); - excelComments.add(new ExcelComment(21, 0, 26, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); - excelComments.add(new ExcelComment(22, 0, 27, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); - excelComments.add(new ExcelComment(23, 0, 28, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); - excelComments.add(new ExcelComment(24, 0, 29, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); return ExcelUtil.genWorkbookV2(rows, sheetName, excelComments); } @@ -596,7 +559,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId)); - List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 25, "template.xlsx"); + List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 20, "template.xlsx"); apidatas.put("preview", excelDates); } finally { IOUtils.closeQuietly(fileInputStream); @@ -650,7 +613,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 25, "template.xlsx"); + List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 20, "template.xlsx"); int total = excelDates.size(); int index = 0; @@ -829,6 +792,16 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation po.setAddUpInfantCare(dto.getAddUpInfantCare()); po.setAddUpPrivatePension(dto.getAddUpPrivatePension()); + //实际累计已预扣预缴税额 + String actualAddUpAdvanceTax = dto.getActualAddUpAdvanceTax(); + po.setActualAddUpAdvanceTax(actualAddUpAdvanceTax); + //个税调差 + String taxAdjustment = dto.getTaxAdjustment(); + po.setTaxAdjustment(taxAdjustment); + //累计应纳税所得额 + String addUpTaxableIncome = dto.getAddUpTaxableIncome(); + po.setAddUpTaxableIncome(addUpTaxableIncome); + if (errorSum == 0) { successCount += 1; // 合格数据 @@ -922,6 +895,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation .addUpTaxSavings(addUpSituationParam.getAddUpTaxSavings()).addUpAdvanceTax(addUpSituationParam.getAddUpAdvanceTax()) .addUpInfantCare(addUpSituationParam.getAddUpInfantCare()) .addUpPrivatePension(addUpSituationParam.getAddUpPrivatePension()) + .actualAddUpAdvanceTax(addUpSituationParam.getActualAddUpAdvanceTax()) + .taxAdjustment(addUpSituationParam.getTaxAdjustment()) + .addUpTaxableIncome(addUpSituationParam.getAddUpTaxableIncome()) .build(); updateList.add(build); biz.batchUpdate(updateList); @@ -1058,6 +1034,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation po.setAddUpTaxSavings(addUpSituationParam.getAddUpTaxSavings()); po.setAddUpInfantCare(addUpSituationParam.getAddUpInfantCare()); po.setAddUpPrivatePension(addUpSituationParam.getAddUpPrivatePension()); + //实际累计已预扣预缴税额 + po.setActualAddUpAdvanceTax(addUpSituationParam.getActualAddUpAdvanceTax()); + //个税调差 + po.setTaxAdjustment(addUpSituationParam.getTaxAdjustment()); + //累计应纳税所得额 + po.setAddUpTaxableIncome(addUpSituationParam.getAddUpTaxableIncome()); + + insertList.add(po); //入库 @@ -1223,6 +1207,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation continue; } List poList = getAddUpSituationMapper().listSome((AddUpSituation.builder().taxYearMonth(param.getDeclareMonth()).taxAgentId(returnPO.getTaxAgentId()).build())); + encryptUtil.decryptList(poList,AddUpSituation.class); Map poMap = SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); // 内部员工(身份证信息) @@ -1346,7 +1331,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation private Map> getEmpDeclareMap(Collection taxAgentIds, Date declareMonth) { List employeeDeclarePOS = getEmployeeDeclarePOList(taxAgentIds, declareMonth); - SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "暂无人员报送状态为正常的数据,请先报送再获取累计专项附加扣除数据。")); + SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "暂无人员报送状态为正常的数据,请先报送再获取往期累计数据。")); return employeeDeclarePOS.stream().collect(Collectors.groupingBy(EmployeeDeclarePO::getTaxAgentId)); } From 6b97efde4d9e675cf4edac0aeccf0ceba45bba73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 18 Sep 2023 14:43:02 +0800 Subject: [PATCH 057/298] =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E7=9A=84=E5=8A=A0=E8=A7=A3?= =?UTF-8?q?=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/sys/service/impl/SalarySysConfServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index b61775290..5559819dc 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -988,6 +988,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setAddUpTaxSavings(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxSavings())); po.setAddUpInfantCare(AESEncryptUtil.closeEncryptSetting(po.getAddUpInfantCare())); po.setAddUpPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getAddUpPrivatePension())); + po.setActualAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getActualAddUpAdvanceTax())); + po.setTaxAdjustment(AESEncryptUtil.closeEncryptSetting(po.getTaxAdjustment())); + po.setAddUpTaxableIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxableIncome())); } else { po.setAddUpIncome(AESEncryptUtil.encrypt(po.getAddUpIncome())); po.setAddUpSubtraction(AESEncryptUtil.encrypt(po.getAddUpSubtraction())); @@ -1007,6 +1010,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setAddUpTaxSavings(AESEncryptUtil.encrypt(po.getAddUpTaxSavings())); po.setAddUpInfantCare(AESEncryptUtil.encrypt(po.getAddUpInfantCare())); po.setAddUpPrivatePension(AESEncryptUtil.encrypt(po.getAddUpPrivatePension())); + po.setActualAddUpAdvanceTax(AESEncryptUtil.encrypt(po.getActualAddUpAdvanceTax())); + po.setTaxAdjustment(AESEncryptUtil.encrypt(po.getTaxAdjustment())); + po.setAddUpTaxableIncome(AESEncryptUtil.encrypt(po.getAddUpTaxableIncome())); } }); List> partition = Lists.partition(addUpSituations, 50); From 3f3089369b1e43e7ebac0fa1e3d2be0ea6d07298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 20 Sep 2023 18:49:19 +0800 Subject: [PATCH 058/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TaxDeclareRecordServiceImpl.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 0474f38d8..eefc505e6 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -125,6 +125,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); } + private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } @@ -716,21 +717,23 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe errorMsg.add(msg); } List details = JsonUtil.parseList(map.get("details"), List.class); - for (List detail : details) { - String employeeName = Util.null2String(detail.get(0)); - String cardNum = Util.null2String(detail.get(2)); - String incomeCategoryCode = Util.null2String(detail.get(4)); - TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecord.getId()).employeeName(employeeName).cardNum(cardNum).incomeCategory(incomeCategoryCode).errorMsg(msg).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).creator((long) user.getUID()).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).createTime(now).updateTime(now).build(); - taxDeclareFails.add(taxDeclareFailPO); - // 流量使用记录 - EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); - if (Objects.isNull(employeeDeclarePO)) { - continue; + if (details != null) { + for (List detail : details) { + String employeeName = Util.null2String(detail.get(0)); + String cardNum = Util.null2String(detail.get(2)); + String incomeCategoryCode = Util.null2String(detail.get(4)); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecord.getId()).employeeName(employeeName).cardNum(cardNum).incomeCategory(incomeCategoryCode).errorMsg(msg).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).creator((long) user.getUID()).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).createTime(now).updateTime(now).build(); + taxDeclareFails.add(taxDeclareFailPO); + // 流量使用记录 + EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); + if (Objects.isNull(employeeDeclarePO)) { + continue; + } + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + employeeInfoMap.remove(employeeName + "-" + cardNum); } - TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); - flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); - apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); - employeeInfoMap.remove(employeeName + "-" + cardNum); } } taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg)); From a5d019799cbe91e07ce3093b920b645283c24df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 22 Sep 2023 11:47:51 +0800 Subject: [PATCH 059/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salarysob/po/SalarySobAddUpRulePO.java | 2 - .../po/SalarySobTaxReportRulePO.java | 2 - .../impl/SalarySobAddUpRuleServiceImpl.java | 26 ++++---- .../impl/SalarySobInitServiceImpl.java | 44 +++++++------- .../service/impl/SalarySobServiceImpl.java | 59 ++++++++++++++++++- .../SalarySobTaxReportRuleServiceImpl.java | 23 ++++---- 6 files changed, 104 insertions(+), 52 deletions(-) diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java index 5ae545bf1..68be3de77 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java @@ -4,7 +4,6 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import java.util.Collection; import java.util.Date; @@ -18,7 +17,6 @@ import java.util.Date; * @version 1.0 **/ @Data -@Accessors(chain = true) @Builder @AllArgsConstructor @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java index 927069540..05ec43f5c 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java @@ -4,7 +4,6 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import java.util.Collection; import java.util.Date; @@ -18,7 +17,6 @@ import java.util.Date; * @version 1.0 **/ @Data -@Accessors(chain = true) @Builder @AllArgsConstructor @NoArgsConstructor diff --git a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java index b1d74cf3b..ce9280183 100644 --- a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java @@ -58,6 +58,7 @@ public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobA private SalarySobBackItemService getSalarySobBackItemService(User user) { return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); } + @Override public List listBySalarySobIds(Collection salarySobIds) { if (CollectionUtils.isEmpty(salarySobIds)) { @@ -136,17 +137,17 @@ public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobA List salarySobAddUpRulePOS = Lists.newArrayList(); for (SalarySobAddUpRuleSaveParam.AddUpRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { for (SalarySobAddUpRuleSaveParam.AddUpRuleParam addUpRuleParam : incomeCategoryParam.getAddUpRuleParams()) { - SalarySobAddUpRulePO salarySobAddUpRulePO = new SalarySobAddUpRulePO() - .setId(IdGenerator.generate()) - .setSalarySobId(saveParam.getSalarySobId()) - .setIncomeCategory(incomeCategoryParam.getIncomeCategory()) - .setSalaryItemId(addUpRuleParam.getSalaryItemId()) - .setAddUpColumnDataIndex(addUpRuleParam.getAddUpColumnDataIndex()) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .setCreator((long) user.getUID()) - .setCreateTime(now) - .setUpdateTime(now); + SalarySobAddUpRulePO salarySobAddUpRulePO = new SalarySobAddUpRulePO(); + salarySobAddUpRulePO.setId(IdGenerator.generate()); + salarySobAddUpRulePO.setSalarySobId(saveParam.getSalarySobId()); + salarySobAddUpRulePO.setIncomeCategory(incomeCategoryParam.getIncomeCategory()); + salarySobAddUpRulePO.setSalaryItemId(addUpRuleParam.getSalaryItemId()); + salarySobAddUpRulePO.setAddUpColumnDataIndex(addUpRuleParam.getAddUpColumnDataIndex()); + salarySobAddUpRulePO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobAddUpRulePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobAddUpRulePO.setCreator((long) user.getUID()); + salarySobAddUpRulePO.setCreateTime(now); + salarySobAddUpRulePO.setUpdateTime(now); salarySobAddUpRulePOS.add(salarySobAddUpRulePO); } } @@ -167,8 +168,7 @@ public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobA @Override public void saveBatch(List salarySobAddUpRules) { if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) { - salarySobAddUpRules.forEach(o->getSalarySobAddUpRuleMapper().insertIgnoreNull(o)); -// getSalarySobAddUpRuleMapper().batchInsert(salarySobAddUpRules); + salarySobAddUpRules.forEach(o -> getSalarySobAddUpRuleMapper().insertIgnoreNull(o)); } } } diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java index d1ded8b46..e277bac7f 100644 --- a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -344,17 +344,17 @@ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class) || Objects.isNull(salarySobItem)) { continue; } - SalarySobAddUpRulePO salarySobAddUpRule = new SalarySobAddUpRulePO() - .setId(IdGenerator.generate()) - .setSalarySobId(env.getSalarySob().getId()) - .setIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()) - .setSalaryItemId(salarySobItem.getSalaryItemId()) - .setAddUpColumnDataIndex(declaredField.getName()) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setCreator((long) env.getCurrentUser().getUID()) - .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .setCreateTime(now) - .setUpdateTime(now); + SalarySobAddUpRulePO salarySobAddUpRule = new SalarySobAddUpRulePO(); + salarySobAddUpRule.setId(IdGenerator.generate()); + salarySobAddUpRule.setSalarySobId(env.getSalarySob().getId()); + salarySobAddUpRule.setIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()); + salarySobAddUpRule.setSalaryItemId(salarySobItem.getSalaryItemId()); + salarySobAddUpRule.setAddUpColumnDataIndex(declaredField.getName()); + salarySobAddUpRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobAddUpRule.setCreator((long) env.getCurrentUser().getUID()); + salarySobAddUpRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobAddUpRule.setCreateTime(now); + salarySobAddUpRule.setUpdateTime(now); salarySobAddUpRules.add(salarySobAddUpRule); } if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) { @@ -375,17 +375,17 @@ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { for (TaxReportColumnPO taxReportColumn : taxReportColumns) { SalarySobItemPO salarySobItem = salarySobItemMap.get(taxReportColumn.getIncomeCategory() + "-" + taxReportColumn.getReportColumnDataIndex()); if (Objects.nonNull(salarySobItem)) { - SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO() - .setId(IdGenerator.generate()) - .setSalarySobId(env.getSalarySob().getId()) - .setIncomeCategory(salarySobItem.getIncomeCategory()) - .setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex()) - .setSalaryItemId(salarySobItem.getSalaryItemId()) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setCreator((long) env.getCurrentUser().getUID()) - .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .setCreateTime(now) - .setUpdateTime(now); + SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO(); + salarySobTaxReportRule.setId(IdGenerator.generate()); + salarySobTaxReportRule.setSalarySobId(env.getSalarySob().getId()); + salarySobTaxReportRule.setIncomeCategory(salarySobItem.getIncomeCategory()); + salarySobTaxReportRule.setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex()); + salarySobTaxReportRule.setSalaryItemId(salarySobItem.getSalaryItemId()); + salarySobTaxReportRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobTaxReportRule.setCreator((long) env.getCurrentUser().getUID()); + salarySobTaxReportRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobTaxReportRule.setCreateTime(now); + salarySobTaxReportRule.setUpdateTime(now); salarySobTaxReportRules.add(salarySobTaxReportRule); } } diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 0e58c83e3..20b0576be 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -9,7 +9,10 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; -import com.engine.salary.entity.salarysob.bo.*; +import com.engine.salary.entity.salarysob.bo.SalarySobBackItemBO; +import com.engine.salary.entity.salarysob.bo.SalarySobCycleBO; +import com.engine.salary.entity.salarysob.bo.SalarySobDuplicateBO; +import com.engine.salary.entity.salarysob.bo.SalarySobItemBO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.param.*; import com.engine.salary.entity.salarysob.po.*; @@ -135,6 +138,14 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(SalarySobInitServiceImpl.class, user); } + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + @Override public SalarySobPO getById(Long id) { return salarySobMapper.getById(id); @@ -773,6 +784,52 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { if (CollectionUtils.isNotEmpty(result.getSalarySobCheckRules())) { getSalarySobCheckRuleService(user).batchSave(result.getSalarySobCheckRules()); } + + //复制累计字段对应 + + // 查询薪资账套的累计字段对应规则 + List originSalarySobAddUpRules = getSalarySobAddUpRuleService(user).listBySalarySobIds(Collections.singleton(duplicateParam.getId())); + if (CollectionUtils.isEmpty(originSalarySobAddUpRules)) { + return; + } + Date now = new Date(); + List newSalarySobAddUpRules = new ArrayList<>(); + for (SalarySobAddUpRulePO originSalarySobAddUpRule : originSalarySobAddUpRules) { + SalarySobAddUpRulePO newSalarySobAddUpRule = new SalarySobAddUpRulePO(); + BeanUtils.copyProperties(originSalarySobAddUpRule, newSalarySobAddUpRule); + newSalarySobAddUpRule.setId(IdGenerator.generate()); + newSalarySobAddUpRule.setSalarySobId(newSalarySob.getId()); + newSalarySobAddUpRule.setCreator((long)user.getUID()); + newSalarySobAddUpRule.setCreateTime(now); + newSalarySobAddUpRule.setUpdateTime(now); + newSalarySobAddUpRules.add(newSalarySobAddUpRule); + } + if (CollectionUtils.isNotEmpty(newSalarySobAddUpRules)) { + getSalarySobAddUpRuleService(user).saveBatch(newSalarySobAddUpRules); + } + + + //复制个税申报字段对应 + // 查询薪资账套的个税申报表字段对应规则 + List originSalarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(Collections.singleton(duplicateParam.getId())); + if (CollectionUtils.isEmpty(originSalarySobTaxReportRules)) { + return; + } + List newSalarySobTaxReportRules = new ArrayList<>(); + for (SalarySobTaxReportRulePO originSalarySobTaxReportRule : originSalarySobTaxReportRules) { + SalarySobTaxReportRulePO newSalarySobTaxReportRule = new SalarySobTaxReportRulePO(); + BeanUtils.copyProperties(originSalarySobTaxReportRule, newSalarySobTaxReportRule); + newSalarySobTaxReportRule.setId(IdGenerator.generate()); + newSalarySobTaxReportRule.setSalarySobId(newSalarySob.getId()); + newSalarySobTaxReportRule.setCreator((long)user.getUID()); + newSalarySobTaxReportRule.setCreateTime(now); + newSalarySobTaxReportRule.setUpdateTime(now); + newSalarySobTaxReportRules.add(newSalarySobTaxReportRule); + } + if (CollectionUtils.isNotEmpty(newSalarySobTaxReportRules)) { + getSalarySobTaxReportRuleService(user).saveBatch(newSalarySobTaxReportRules); + } + // // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId("" + result.getSalarySob().getId()); diff --git a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java index 27ba515c8..4a1882e96 100644 --- a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java @@ -132,17 +132,17 @@ public class SalarySobTaxReportRuleServiceImpl extends Service implements Salary List salarySobTaxReportRules = Lists.newArrayList(); for (SalarySobTaxReportRuleSaveParam.TaxReportRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { for (SalarySobTaxReportRuleSaveParam.TaxReportRuleParam taxReportRuleParam : incomeCategoryParam.getTaxReportRuleParams()) { - SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO() - .setId(IdGenerator.generate()) - .setSalarySobId(saveParam.getSalarySobId()) - .setIncomeCategory(incomeCategoryParam.getIncomeCategory()) - .setReportColumnDataIndex(taxReportRuleParam.getReportColumnDataIndex()) - .setSalaryItemId(taxReportRuleParam.getSalaryItemId()) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setCreator((long) user.getUID()) - .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .setCreateTime(now) - .setUpdateTime(now); + SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO(); + salarySobTaxReportRule.setId(IdGenerator.generate()); + salarySobTaxReportRule.setSalarySobId(saveParam.getSalarySobId()); + salarySobTaxReportRule.setIncomeCategory(incomeCategoryParam.getIncomeCategory()); + salarySobTaxReportRule.setReportColumnDataIndex(taxReportRuleParam.getReportColumnDataIndex()); + salarySobTaxReportRule.setSalaryItemId(taxReportRuleParam.getSalaryItemId()); + salarySobTaxReportRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobTaxReportRule.setCreator((long) user.getUID()); + salarySobTaxReportRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobTaxReportRule.setCreateTime(now); + salarySobTaxReportRule.setUpdateTime(now); salarySobTaxReportRules.add(salarySobTaxReportRule); } } @@ -167,6 +167,5 @@ public class SalarySobTaxReportRuleServiceImpl extends Service implements Salary return; } salarySobTaxReportRules.forEach(salarySobTaxReportRuleMapper()::insertIgnoreNull); -// salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); } } From 7c5af2166e188c66eea45fad0e9590075b9e3a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 22 Sep 2023 17:57:47 +0800 Subject: [PATCH 060/298] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/prop/hrmSalaryCustom.properties | 2 +- .../salaryacct/bo/CalculateFormulaVarBO.java | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/resource/WEB-INF/prop/hrmSalaryCustom.properties b/resource/WEB-INF/prop/hrmSalaryCustom.properties index b873bc15e..0a68219c5 100644 --- a/resource/WEB-INF/prop/hrmSalaryCustom.properties +++ b/resource/WEB-INF/prop/hrmSalaryCustom.properties @@ -1 +1 @@ -formulaRunOvertimeThreshold=10 \ No newline at end of file +salaryDateFormat=yyyy-MM \ No newline at end of file diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index 74835472d..896b615a0 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -30,6 +30,7 @@ import lombok.Data; import lombok.experimental.Accessors; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; +import weaver.general.BaseBean; import java.lang.reflect.Field; import java.math.BigDecimal; @@ -51,6 +52,8 @@ import static com.engine.salary.util.SalaryDateUtil.DATE_TIME_FORMATTER_PATTERN; @Data @Accessors(chain = true) public class CalculateFormulaVarBO { + BaseBean bb = new BaseBean(); + String salaryDateFormat = bb.getPropValue("hrmSalaryCustom", "salaryDateFormat"); /** * 员工信息 @@ -168,7 +171,11 @@ public class CalculateFormulaVarBO { String fieldValue = map.getOrDefault(fieldName, StringUtils.EMPTY); //日期值取yyyy-MM-dd if (StringUtils.isNotBlank(fieldValue) && fieldValue.length() > 10 && SalaryDateUtil.parse(fieldValue, DATE_TIME_FORMATTER_PATTERN) != null) { - fieldValue = fieldValue.substring(0, 10); + if (StringUtils.isNotBlank(salaryDateFormat)) { + fieldValue = fieldValue.substring(0, salaryDateFormat.length()); + } else { + fieldValue = fieldValue.substring(0, 10); + } } formulaVarValues.add(new FormulaVarValue().setFieldId(fieldId).setFieldValue(fieldValue)); } @@ -208,7 +215,7 @@ public class CalculateFormulaVarBO { formulaVarValues.addAll(salaryAcctCalculateBO.getIssuedFieldIds().stream() .map(fieldId -> { String originResultValue = salaryAcctResultPOMap.getOrDefault( - salaryCodeItemMap.get(fieldId),SalaryAcctResultPO.builder().originResultValue("").build()) + salaryCodeItemMap.get(fieldId), SalaryAcctResultPO.builder().originResultValue("").build()) .getOriginResultValue(); String fieldId2 = SalaryFormulaReferenceEnum.ISSUED.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR @@ -520,7 +527,11 @@ public class CalculateFormulaVarBO { String fieldValue = map.getOrDefault(fieldName, StringUtils.EMPTY); //判断是否是日期,日期值取yyyy-MM-dd if (StringUtils.isNotBlank(fieldValue) && fieldValue.length() > 10 && SalaryDateUtil.parse(fieldValue, DATE_TIME_FORMATTER_PATTERN) != null) { - fieldValue = fieldValue.substring(0, 10); + if (StringUtils.isNotBlank(salaryDateFormat)) { + fieldValue = fieldValue.substring(0, salaryDateFormat.length()); + } else { + fieldValue = fieldValue.substring(0, 10); + } } return new FormulaVarValue().setFieldId(fieldId).setFieldValue(fieldValue); }).collect(Collectors.toList())); From 7368363631101705d9dec939680d80f1da10fc4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 11 Oct 2023 18:24:02 +0800 Subject: [PATCH 061/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/EmployeeDeclareParam.java | 3 +- .../taxagent/po/TaxAgentTaxReturnPO.java | 5 + .../remote/tax/client/EmployeeClient.java | 65 ++++ .../remote/tax/client/TaxBaseClient.java | 46 +++ .../employee/GetCompanyEmployeeRequest.java | 65 ++++ .../employee/GetCompanyEmployeeResponse.java | 334 ++++++++++++++++++ .../salary/web/EmployeeDeclareController.java | 15 + .../wrapper/EmployeeDeclareWrapper.java | 13 + test/ApiDes.java | 20 ++ test/ParseTaxApi.java | 55 +++ 10 files changed, 620 insertions(+), 1 deletion(-) create mode 100644 src/com/engine/salary/remote/tax/client/EmployeeClient.java create mode 100644 src/com/engine/salary/remote/tax/client/TaxBaseClient.java create mode 100644 src/com/engine/salary/remote/tax/request/employee/GetCompanyEmployeeRequest.java create mode 100644 src/com/engine/salary/remote/tax/response/employee/GetCompanyEmployeeResponse.java create mode 100644 test/ApiDes.java create mode 100644 test/ParseTaxApi.java diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java index 8f99c2e98..8af42f76a 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.employeedeclare.param; +import com.engine.salary.common.BaseQueryParam; import com.engine.salary.util.valid.DataCheck; import lombok.AllArgsConstructor; import lombok.Builder; @@ -20,7 +21,7 @@ import java.util.Date; @Builder @AllArgsConstructor @NoArgsConstructor -public class EmployeeDeclareParam { +public class EmployeeDeclareParam extends BaseQueryParam { /** * 个税扣缴义务人id diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java index 717a5e960..b20fd8d43 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -38,6 +38,11 @@ public class TaxAgentTaxReturnPO implements Serializable { */ private Long taxAgentId; + /** + * 企业名称 + */ + private Long taxAgentName; + /** * 税号 */ diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java new file mode 100644 index 000000000..8ea3f8177 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java @@ -0,0 +1,65 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareParam; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.remote.tax.request.employee.GetCompanyEmployeeRequest; +import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse; +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SingnatureData; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * 人员信息登记报送服务 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class EmployeeClient extends TaxBaseClient { + + public EmployeeClient(Long taxAgentId) { + super(taxAgentId); + } + + //4.2.3企业人员列表查询 + public GetCompanyEmployeeResponse getCompanyEmployee(EmployeeDeclareParam param) { + + String url = super.apiConfig.getHost() + "gateway/iit/data/getCompanyEmployee"; + GetCompanyEmployeeRequest getCompanyEmployeeRequest = new GetCompanyEmployeeRequest(); + getCompanyEmployeeRequest.setNsrsbh( returnPO.getTaxCode()); + getCompanyEmployeeRequest.setQymc(""); + getCompanyEmployeeRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + getCompanyEmployeeRequest.setAreaid(returnPO.getAreaCode()); + getCompanyEmployeeRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + getCompanyEmployeeRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + getCompanyEmployeeRequest.setJmsbmm("0"); + getCompanyEmployeeRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + getCompanyEmployeeRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + getCompanyEmployeeRequest.setJmsmmm("0"); + getCompanyEmployeeRequest.setMmlx(""+returnPO.getPasswordType()); + getCompanyEmployeeRequest.setSsyf(SalaryDateUtil.getFormatYYYYMM(param.getTaxCycle())); + getCompanyEmployeeRequest.setPageNo(""+param.getCurrent()); + getCompanyEmployeeRequest.setPageSize(""+param.getPageSize()); + + String reqJson = JsonUtil.toJsonString(getCompanyEmployeeRequest); + log.info("getCompanyEmployee params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("getCompanyEmployee res --- {}", res); + return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class); + + } + +} diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java new file mode 100644 index 000000000..38ba9862a --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -0,0 +1,46 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; +import com.engine.salary.util.Sm4Utils; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; + +/** + * 人员信息登记报送服务 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxBaseClient { + private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() { + return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class); + } + + + private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + public Long taxAgentId; + public TaxDeclarationApiConfigPO apiConfig ; + public TaxAgentTaxReturnPO returnPO ; + + public TaxBaseClient(Long taxAgentId) { + this.taxAgentId = taxAgentId; + this.apiConfig = getTaxDeclareApiConfigMapper().getOne(); + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); + try { + // 密码解密 + taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); + } catch (Exception e) { + log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); + } + this.returnPO = taxReturnPO; + } +} diff --git a/src/com/engine/salary/remote/tax/request/employee/GetCompanyEmployeeRequest.java b/src/com/engine/salary/remote/tax/request/employee/GetCompanyEmployeeRequest.java new file mode 100644 index 000000000..799722704 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/GetCompanyEmployeeRequest.java @@ -0,0 +1,65 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +@Data +public class GetCompanyEmployeeRequest { + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 企业名称 必填:是 扣缴义务人名称:例如:测试网络科技有限公司 + */ + private String qymc; + /** + * 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:条件必填 分部门代报时必传 + */ + private String bmbh; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 实名账号 必填:是 + */ + private String smzh; + /** + * 实名密码 必填:是 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明 + */ + private String jmsmmm; + + /** + * 密码类型 必填:是 0表示申报密码; 2表示实名账号实名密码 + */ + private String mmlx; + + /** + * 所属月份 必填:是 格式YYYYMM年 + */ + private String ssyf; + /** + * 页码 必填:是 大于0 + */ + private String pageNo; + /** + * 数量 必填:是 大于0 + */ + private String pageSize; +} diff --git a/src/com/engine/salary/remote/tax/response/employee/GetCompanyEmployeeResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetCompanyEmployeeResponse.java new file mode 100644 index 000000000..300dc9a1a --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/employee/GetCompanyEmployeeResponse.java @@ -0,0 +1,334 @@ +package com.engine.salary.remote.tax.response.employee; + +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 GetCompanyEmployeeResponse extends BaseResponse { + /** + * 返回数据 + */ + private List body; + + + @Data + public static class Employee { + /** + * 其他证件类型 必填:条件必填 见证件类型字典 + */ + private String qtzzlx; + + + /** + * 员工姓名 必填:纳税人姓名 + */ + private String xm; + + /** + * 证件类型 必填:见证件类型字典 + */ + private String zzlx; + + /** + * 证件号码 必填: + */ + private String zzhm; + + /** + * 部门编号 必填:条件必填 若人员存在部门编号则返回 + */ + private String bmbh; + + /** + * 其他证件号码 必填:条件必填 见证件类型字典 + */ + private String qtzzhm; + + /** + * 工号 必填:否 + */ + private String gh; + + /** + * 报送状态 必填: 1 待报送 2 报送中 3 报送失败 4 报送成功 + */ + private String sbzt; + + + /** + * 验证状态 必填: 0 若是身份证,状态为验证中;其他证件为暂不验证 1 验证通过 2 验证不通过 4 待验证 9 同代码0处理 + */ + private String rzzt; + + /** + * 任职受雇类型 必填:是 可选择雇员、保险营销员、证券经纪人、其他、实习学生(全日制学历教育) + */ + private String sfgy; + + /** + * 所属期 必填:否 YYYYMM + */ + private String skssq; + + /** + * 电话号码 必填:是 11位手机号码 + */ + private String lxdh; + + /** + * 人员状态 必填:是 0 :正常 1 :非正常 + */ + private String nsrzt; + + /** + * 入职年度就业情形 必填:否 + */ + private String rzndjyqk; + + /** + * 受雇日期 必填:条件必填 YYYY-MM-DD, + */ + private String rzsgrq; + + /** + * 性别 必填:是 1:男 2:女 + */ + private String xb; + + /** + * 出生日期 必填:是 YYYY-MM-DD + */ + private String csny; + + /** + * 国籍 必填:是 见国籍字典 + */ + private String gj; + + /** + * 人员地区 必填:是 1:境内 2:境外 + */ + private String rydq; + + /** + * 离职日期 必填:否 YYYY-MM-DD,不能大于当前时间 + */ + private String lzrq; + + /** + * 个人投资总额 必填:条件必填 当为股东投资者时必填 + */ + private BigDecimal grgbze; + /** + * 个人投资比例 必填:否 范围为0~100,不包含0 + */ + private BigDecimal grgbbl; + + /** + * 是否残疾 必填:否 0:否 1:是 + */ + private String sfcj; + + /** + * 是否烈属 必填:否 0:否 1:是 + */ + private String sfls; + + /** + * 是否孤老 必填:否 0:否 1:是 + */ + private String sfgl; + + /** + * 残疾证号 必填:条件必填 + */ + private String cjzh; + + /** + * 烈属证号 必填:条件必填 + */ + private String lszh; + + /** + * 邮箱 必填:否 + */ + private String dzyx; + + /** + * 学历 必填:否 10:研究生 20:大学本科 30:大学本科以下 + */ + private String xl; + + /** + * 职务 必填:否 1:高层 3:普通 + */ + private String zw; + + /** + * 人员状态名称 必填:否 + */ + private String nsrztmc; + + /** + * 性别名称 必填:否 + */ + private String xbmc; + + /** + * 人员地区名称 必填:否 + */ + private String rydqmc; + + /** + * 是否残疾名称 必填:否 + */ + private String sfcjmc; + + /** + * 是否烈属名称 必填:否 + */ + private String sflsmc; + + /** + * 是否孤老名称 必填:否 + */ + private String sfglmc; + + /** + * 学历名称 必填:否 + */ + private String xlmc; + + /** + * 职务名称 必填:否 + */ + private String zwmc; + + /** + * 开户银行 必填:否 + */ + private String khyh; + + /** + * 银行账号 必填:否 + */ + private String yhzh; + + /** + * 居住省份 必填:否 中文,例如浙江省 + */ + private String lxdz_sheng; + + /** + * 居住城市 必填:否 中文,例如杭州市 + */ + private String lxdz_shi; + + /** + * 居住区县 必填:否 中文,例如滨江区 + */ + private String lxdz_qx; + + /** + * 居住街道 必填:否 + */ + private String lxdz_jd; + + /** + * 居住详细地址 必填:否 + */ + private String lxdz; + + /** + * 户籍省份 必填:否 中文,例如浙江省 + */ + private String hjszd_sheng; + + /** + * 户籍城市 必填:否 中文,例如杭州市 + */ + private String hjszd_shi; + + /** + * 户籍区县 必填:否 中文,例如滨江区 + */ + private String hjszd_qx; + + /** + * 户籍街道 必填:否 + */ + private String hjszd_jd; + + /** + * 户籍详细地址 必填:否 + */ + private String hjszd_xxdz; + + /** + * 备注 必填:否 + */ + private String bz; + + /** + * 出生地 必填:条件必填 外籍人员必填,填写出生地国家(地区见国籍字典 + */ + private String csd; + + /** + * 涉税事由 必填:是 ("10","任职受雇")("20","提供临时劳务")("30","转让财产")("40","从事投资和经营活动")("90","其他"), + */ + private String sssx; + + + /** + * 首次入境时间 必填:条件必填 证件类型为港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时,且任职受雇类型选择雇员时必填,格式YYYY-MM-DD + */ + private String scrjsj; + + /** + * 预计离境时间 必填:条件必填 证件类型为港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时,且任职受雇类型选择雇员时必填,格式YYYY-MM-DD + */ + private String yjljsj; + + /** + * 联系地省份 必填:否 + */ + private String wjrlxdz_sheng; + + /** + * 联系地城市 必填:否 + */ + private String wjrlxdz_shi; + + /** + * 联系地区县 必填:否 + */ + private String wjrlxdz_qx; + + /** + * 联系地街道 必填:否 + */ + private String wjrlxdz_jd; + + /** + * 联系地详细地址 必填:否 + */ + private String wjrlxdz_xxdz; + + /** + * 中文名 必填:否 证件类型为外国护照、外国人永久居留身份证、外国人工作许可证(A类)、外国人工作许可证(B类)、外国人工作许可证(C类)时不可填写,其他证件类型可填写。如果有填写必须为中文 + */ + private String xmzw; + + /** + * 涉税事项是否扣除减除费用 必填:否 + */ + private String sfzdw; + + } +} diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 75535d32f..420863bbb 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -248,6 +248,21 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getRate, index); } + /** + * 企业人员列表查询 + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/getCompanyEmployee") + @Produces(MediaType.APPLICATION_JSON) + public String getCompanyEmployee(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getCompanyEmployee, param); + } + // /** // * 人员报送-导出全部人员 // * diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index e42aea3d6..5a5b907f7 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -5,6 +5,7 @@ import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.remote.tax.client.EmployeeClient; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; @@ -16,6 +17,7 @@ import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryDateUtil; @@ -538,6 +540,17 @@ public class EmployeeDeclareWrapper extends Service { return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE + index); } + public Object getCompanyEmployee(EmployeeDeclareParam param) { + ValidUtil.doValidator(param); + + EmployeeClient employeeClient = new EmployeeClient(param.getTaxAgentId()); + GetCompanyEmployeeResponse companyEmployee = employeeClient.getCompanyEmployee(param); + + + + return companyEmployee; + } + // /** // * 人员报送-导出本月全部的人员 // * diff --git a/test/ApiDes.java b/test/ApiDes.java new file mode 100644 index 000000000..f2751fe24 --- /dev/null +++ b/test/ApiDes.java @@ -0,0 +1,20 @@ +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ApiDes { + @ExcelProperty(index = 0) + public String name; + @ExcelProperty(index = 1) + public String mean; + @ExcelProperty(index = 2) + public String type; + @ExcelProperty(index = 3) + public String required; + @ExcelProperty(index = 4) + public String des; +} diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java new file mode 100644 index 000000000..957f424d3 --- /dev/null +++ b/test/ParseTaxApi.java @@ -0,0 +1,55 @@ +import com.engine.salary.util.excel.ExcelParseHelper; +import org.apache.commons.lang3.StringUtils; + +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.List; + +public class ParseTaxApi { + public static void main(String[] args) { + readExcel("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); + } + + + public static void readExcel(String path) { + try { + // 获取文件输入流 + InputStream inputStream = new FileInputStream(path); + + List apiDesList = ExcelParseHelper.parse2Map(inputStream, ApiDes.class, 0, 1, 5, "ApiDes.xlsx"); + + /** + * 字段名称 字段含义 字段类型 必填 说明 + * qtzzlx 其他证件类型 String(64) 条件必填 见证件类型字典 + * + * private String qtzzlx; + */ + + apiDesList.forEach(des -> { + String type = des.getType(); + if(StringUtils.isNotEmpty(type)){ + if(type.startsWith("String")){ + type= "String"; + } + } + + String a = "/** * " + + des.getMean() + +" " + + "必填:" + des.getRequired() + +" " + des.getDes() + + " */" + " private " + type + " " + des.getName() + ";"; + System.out.println(a); + + }); + + + } catch (Exception e) { + e.printStackTrace(); + } + } + + + + +} From 665dc7b36a723a1413bd0d3300acaf675c016999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 11 Oct 2023 19:55:09 +0800 Subject: [PATCH 062/298] =?UTF-8?q?fix=E9=87=8D=E6=96=B0=E6=A0=B8=E7=AE=97?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/TaxDeclareEmployeeBO.java | 2 +- .../impl/SalaryAcctRecordServiceImpl.java | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java index 2b587f652..709b797df 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -60,7 +60,7 @@ public class TaxDeclareEmployeeBO { .setCardNum(employeeDeclare.getCardNum()) .setDeclareStatus(declareStatusEnum) .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); - } else if (Objects.equals(taxDeclareEmployee.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + } else if (taxDeclareEmployee.getEmployeeType() == null || Objects.equals(taxDeclareEmployee.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclareEmployee.getEmployeeId()); DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(taxDeclareEmployee.getEmployeeId()); abnormalEmployeeListDTO diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 94dd92579..63d03f562 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -792,6 +792,17 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // salaryAcctRecordPO.setRootId(Objects.equals(salaryAcctRecordPO.getRootId(), 0L) ? salaryAcctRecordPO.getId() : salaryAcctRecordPO.getRootId()); } + // 保存回算前的薪资核算结果 + if (!isReCalc) { + getSalaryAcctResultService(user).reCalc(salaryAcctRecordPO.getId()); + } + + // 撤回工资单 + getSalarySendService(user).revokeSalaryBill(salaryAcctRecordPO); + + //删除报表缓存 + getSalaryStatisticsReportService(user).removeReportCache(); + // 查询本次薪资核算记录关联的个税扣缴义务人 List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordPO.getId())); // 如果已经存在税款所属期为8月份的薪资核算记录,就不能再重新核算1-7月份的薪资核算记录了 @@ -811,17 +822,6 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); salaryAcctRecordPO.setUpdateTime(new Date()); getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO); - - // 保存回算前的薪资核算结果 - if (!isReCalc) { - getSalaryAcctResultService(user).reCalc(salaryAcctRecordPO.getId()); - } - - // 撤回工资单 - getSalarySendService(user).revokeSalaryBill(salaryAcctRecordPO); - - //删除报表缓存 - getSalaryStatisticsReportService(user).removeReportCache(); } From 053e2855d7f0d3ea7f3a173953ee74b39bb274e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 13 Oct 2023 16:33:06 +0800 Subject: [PATCH 063/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8Esql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308150503.sql | 741 +++++++++++++++++- resource/sqlupgrade/GS/sql202308150503.sql | 741 +++++++++++++++++- resource/sqlupgrade/JC/sql202308150503.sql | 741 +++++++++++++++++- .../sqlupgrade/Oracle/sql202308150503.sql | 644 ++++++++++++++- resource/sqlupgrade/ST/sql202308150503.sql | 741 +++++++++++++++++- 5 files changed, 3427 insertions(+), 181 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202308150503.sql b/resource/sqlupgrade/DM/sql202308150503.sql index d4c74b78c..e268c0264 100644 --- a/resource/sqlupgrade/DM/sql202308150503.sql +++ b/resource/sqlupgrade/DM/sql202308150503.sql @@ -1,60 +1,729 @@ -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' -where report_column_data_index = 'annual_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' -where report_column_data_index = 'annual_tax_free_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' -where report_column_data_index = 'annual_other'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' -where report_column_data_index = 'annual_donate_tax'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' -where report_column_data_index = 'annual_tax_savings'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' -where report_column_data_index = 'annual_remark'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz'); / diff --git a/resource/sqlupgrade/GS/sql202308150503.sql b/resource/sqlupgrade/GS/sql202308150503.sql index d4c74b78c..e268c0264 100644 --- a/resource/sqlupgrade/GS/sql202308150503.sql +++ b/resource/sqlupgrade/GS/sql202308150503.sql @@ -1,60 +1,729 @@ -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' -where report_column_data_index = 'annual_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' -where report_column_data_index = 'annual_tax_free_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' -where report_column_data_index = 'annual_other'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' -where report_column_data_index = 'annual_donate_tax'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' -where report_column_data_index = 'annual_tax_savings'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' -where report_column_data_index = 'annual_remark'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz'); / diff --git a/resource/sqlupgrade/JC/sql202308150503.sql b/resource/sqlupgrade/JC/sql202308150503.sql index d4c74b78c..e268c0264 100644 --- a/resource/sqlupgrade/JC/sql202308150503.sql +++ b/resource/sqlupgrade/JC/sql202308150503.sql @@ -1,60 +1,729 @@ -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' -where report_column_data_index = 'annual_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' -where report_column_data_index = 'annual_tax_free_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' -where report_column_data_index = 'annual_other'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' -where report_column_data_index = 'annual_donate_tax'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' -where report_column_data_index = 'annual_tax_savings'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' -where report_column_data_index = 'annual_remark'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz'); / diff --git a/resource/sqlupgrade/Oracle/sql202308150503.sql b/resource/sqlupgrade/Oracle/sql202308150503.sql index b51e6e345..6de504e07 100644 --- a/resource/sqlupgrade/Oracle/sql202308150503.sql +++ b/resource/sqlupgrade/Oracle/sql202308150503.sql @@ -1,49 +1,619 @@ -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome') +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre') / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome') +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd') / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther') +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt') / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax') +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze') / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings') +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse') / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark') +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz') / - -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' -where report_column_data_index = 'annual_income' +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre') / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' -where report_column_data_index = 'annual_tax_free_income' +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd') / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' -where report_column_data_index = 'annual_other' +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx') / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' -where report_column_data_index = 'annual_donate_tax' +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx') / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' -where report_column_data_index = 'annual_tax_savings' +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf') / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' -where report_column_data_index = 'annual_remark' +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz') / \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308150503.sql b/resource/sqlupgrade/ST/sql202308150503.sql index d4c74b78c..e268c0264 100644 --- a/resource/sqlupgrade/ST/sql202308150503.sql +++ b/resource/sqlupgrade/ST/sql202308150503.sql @@ -1,60 +1,729 @@ -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome', 'number', 'sre'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome', 'number', 'mssd'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther', 'number', 'qt'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax', 'number', + 'zykcjze'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings', 'number', 'jmse'); / -INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, - tax_report_type, income_category, report_column_name, - report_column_data_index) -VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark', 'string', 'bz'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' -where report_column_data_index = 'annual_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '', 'laborIncome', 'number', 'sre'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' -where report_column_data_index = 'annual_tax_free_income'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '˰', 'laborTaxFreeIncome', 'number', 'mssd'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' -where report_column_data_index = 'annual_other'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', 'ҵ', 'commercialHealthInsurance4', + 'number', 'syjkbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' -where report_column_data_index = 'annual_donate_tax'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '˰ϱ', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' -where report_column_data_index = 'annual_tax_savings'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '۳˰', 'allowedDeductTax4', 'number', + 'yxkcsf'); / -update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' -where report_column_data_index = 'annual_remark'; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '˰', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', 'ע', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', 'ϱշ', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', 'ҽƱշ', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', 'ʧҵշ', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', 'ס', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', 'ۼŮ', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', 'ۼסϢ', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', 'ۼס', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', 'ۼ', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', 'ۼ3Ӥ׶ջ֧', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', 'ҵ(ְҵ)', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', 'ҵ', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '˰ϱ', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '׼۳ľ', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '˰', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', 'ע', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', 'һԲ', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', 'ڹ', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '׼۳ľ', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '˰', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', 'ע', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '̯·', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', 'ע', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '׼۳ľ', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '˰', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '˰ɷѶ', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', 'ȫɷѶ', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', 'Ƿһȡ', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', 'ȡʽ', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', 'ȡԭ', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '˰', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', 'ҵ', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '˰ϱ', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '׼۳ľ', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', 'ע', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', 'ҵ', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '˰ϱ', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', 'ע', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '˰', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '۳˰', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', 'ҵ', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '˰ϱ', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', 'ע', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '˰', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '۳˰', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', 'ҵ', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '˰ϱ', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', 'ע', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '˰', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '۳˰', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', 'ҵ', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '˰ϱ', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '۳˰', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', 'ע', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '˰', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '˰', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', 'ע', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', 'ע', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '˰', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '¹Ȩ', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', 'ۼƹȨ()', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', 'ۼ', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', 'ۼ׼۳ľ', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', 'ۼƼ˰', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', 'ۼѿ۽˰', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', 'ۼ˰', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', 'ע', 'stockRightRemark', 'string', 'bz'); / From 895d3065e90304e200a7bebe1d132dff3dcd2901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 16 Oct 2023 10:45:19 +0800 Subject: [PATCH 064/298] =?UTF-8?q?=E8=B4=A6=E5=A5=97=E6=8B=93=E6=89=91?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/SalarySobItemService.java | 3 +++ .../impl/SalarySobItemServiceImpl.java | 24 +++++++++++++++++++ .../service/impl/SalarySobServiceImpl.java | 9 +++++++ .../salary/web/SalarySobController.java | 15 ++++++++++++ .../salary/wrapper/SalarySobItemWrapper.java | 5 ++++ .../salary/wrapper/SalarySobWrapper.java | 14 +++++------ 6 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index b9d6c78db..9eeeb2424 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; @@ -128,4 +129,6 @@ public interface SalarySobItemService { SalarySobItemFormDTO getSalaryItemForm(SalarySobItemPO param); void update(SalarySobItemPO po); + + List itemTopology(Long salarySobId); } diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index def2cd40c..9b1542cc7 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -7,6 +7,8 @@ import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItemGraph; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; @@ -799,4 +801,26 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe return salarySobItemFormDTO; } + + @Override + public List itemTopology(Long salarySobId) { + // 3、查询薪资核算记录所用薪资账套的薪资项目副本 + List salarySobItemPOS = listBySalarySobId(salarySobId); + if (CollectionUtils.isEmpty(salarySobItemPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99151, "当前所用的薪资账套未选择任何薪资项目,无法核算")); + } + // 4、查询当前租户的所有薪资项目 + List salaryItemPOS = getSalaryItemService(user).listAll(); + + // 8、查询公式详情 + Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); + formulaIds.addAll(SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId)); + List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + // 9、计算薪资项目的运算优先级 + SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, salaryItemPOS, expressFormulas); + List salaryCalcItems = salaryCalcItemGraph.sort(); + return salaryCalcItems; + } + + } diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 20b0576be..007fb0d65 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -122,6 +122,14 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user); } + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalaryFormulaService getSalaryFormulaService(User user) { + return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); + } + private SalarySobBackItemService getSalarySobBackItemService(User user) { return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); } @@ -146,6 +154,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); } + @Override public SalarySobPO getById(Long id) { return salarySobMapper.getById(id); diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index aab9889e3..a6107e4c3 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.SalarySobExtRangePO; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salarysob.dto.*; @@ -385,6 +386,20 @@ public class SalarySobController { return new ResponseResult(user).run(getSalarySobItemWrapper(user)::getSalaryItemForm, param); } + /** + * 账套项目拓扑图 + * @param request + * @param response + * @param salarySobId + * @return + */ + @GET + @Path("/item/topology") + @Produces(MediaType.APPLICATION_JSON) + public String getSalaryItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::itemTopology, salarySobId); + } /**********************************薪资账套的薪资项目 end*********************************/ diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 1fbe0e0e0..8b0b815e0 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -3,6 +3,7 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO; import com.engine.salary.entity.salaryitem.bo.SalaryItemBO; @@ -177,4 +178,8 @@ public class SalarySobItemWrapper extends Service { public SalarySobItemFormDTO getSalaryItemForm(SalarySobItemPO param) { return getSalarySobItemService(user).getSalaryItemForm(param); } + + public List itemTopology(Long salarySobId) { + return getSalarySobItemService(user).itemTopology(salarySobId); + } } diff --git a/src/com/engine/salary/wrapper/SalarySobWrapper.java b/src/com/engine/salary/wrapper/SalarySobWrapper.java index c9f1ddd8e..7665ced9c 100644 --- a/src/com/engine/salary/wrapper/SalarySobWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobWrapper.java @@ -83,7 +83,7 @@ public class SalarySobWrapper extends Service { List taxAgentPOS = getTaxAgentService(user).listAll(); Map taxAgentIdTONameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); - List salarySobListDTOS = SalarySobBO.convert2ListDTO(page.getList(),taxAgentIdTONameMap); + List salarySobListDTOS = SalarySobBO.convert2ListDTO(page.getList(), taxAgentIdTONameMap); PageInfo dtoPage = new PageInfo<>(salarySobListDTOS, SalarySobListDTO.class); dtoPage.setTotal(page.getTotal()); dtoPage.setPageNum(page.getPageNum()); @@ -97,10 +97,10 @@ public class SalarySobWrapper extends Service { private void handleSalarySobBackItemHistory(SalarySobListQueryParam queryParam) { queryParam.setPageSize(100000); List list = getSalarySobService(user).listPageByParam(queryParam).getList(); - if(list != null && list.size()>0){ + if (list != null && list.size() > 0) { List salarySobIds = list.stream().map(SalarySobPO::getId).collect(Collectors.toList()); Long count = getSalarySobBackItemService(user).getCountBySalarySobIdIn(salarySobIds); - if(count.equals(0L)){ + if (count.equals(0L)) { // 薪资账套的默认的回算薪资项目 Set SalarySobBackItemIds = SalaryEntityUtil.properties(SalarySobBackItemBO.getDefault(), SalarySobDefaultBackItemPO::getSysSalaryItemId); // 获取薪资项目中是否已经添加回算薪资项目 @@ -118,7 +118,7 @@ public class SalarySobWrapper extends Service { List salarySobBackItems = new ArrayList<>(); // 获取默认添加后的回算薪资项目 List salaryBackItemPOS = getSalaryItemService(user).listBySysSalaryItemIds(SalarySobBackItemIds); - for(Long id : salarySobIds){ + for (Long id : salarySobIds) { for (SalarySobDefaultBackItemPO salarySobDefaultBackItemPO : SalarySobBackItemBO.getDefault()) { Date now = new Date(); Map sysSalaryItemMap = SalaryEntityUtil.convert2Map(salaryBackItemPOS, SalaryItemPO::getSysSalaryItemId); @@ -134,7 +134,7 @@ public class SalarySobWrapper extends Service { .valueType(salaryItemPO.getValueType()) .formulaId(salarySobDefaultBackItemPO.getFormulaId()) .backCalcType(salarySobDefaultBackItemPO.getBackCalcType()) - .creator((long)user.getUID()) + .creator((long) user.getUID()) .createTime(now) .updateTime(now) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) @@ -174,7 +174,7 @@ public class SalarySobWrapper extends Service { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); } // 薪资装套po转换成薪资账套详情dto - basicForm = SalarySobBO.convert2FormDTO(basicForm,salarySobPO); + basicForm = SalarySobBO.convert2FormDTO(basicForm, salarySobPO); } // 转换成前端所需的数据格式 data.put("basicForm", basicForm); @@ -251,7 +251,7 @@ public class SalarySobWrapper extends Service { Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId); - return taxAgentIds.contains(salarySobPO.getTaxAgentId())||Objects.isNull(salarySobPO.getTaxAgentId()); + return taxAgentIds.contains(salarySobPO.getTaxAgentId()) || Objects.isNull(salarySobPO.getTaxAgentId()); } } From 72fbd5f33680cc7eb6493c0bbc7a9ac2bad695d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 16 Oct 2023 15:00:54 +0800 Subject: [PATCH 065/298] =?UTF-8?q?=E6=8B=93=E6=89=91=E5=9B=BE=E6=9A=82?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/SalaryItemTopologyQueryParam.java | 29 +++++++++ .../salary/service/SalarySobItemService.java | 3 + .../impl/SalarySobItemServiceImpl.java | 62 +++++++++++++++++++ .../salary/web/SalarySobController.java | 10 ++- .../salary/wrapper/SalarySobItemWrapper.java | 8 +++ 5 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java diff --git a/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java new file mode 100644 index 000000000..7b27e17d3 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.salarysob.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 薪资项目拓扑查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryItemTopologyQueryParam { + + //薪资账套id + @DataCheck(require = true, message = "薪资账套的ID不允许为空") + private Long salarySobId; + + //薪资项目id + private Long salaryItemId; +} diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index 9eeeb2424..7f10b1c45 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -4,6 +4,7 @@ import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; +import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; @@ -131,4 +132,6 @@ public interface SalarySobItemService { void update(SalarySobItemPO po); List itemTopology(Long salarySobId); + + Object topology(SalaryItemTopologyQueryParam param); } diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 9b1542cc7..6f40a25d7 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; +import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -822,5 +823,66 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe return salaryCalcItems; } + @Override + public Object topology(SalaryItemTopologyQueryParam param) { + SalarySobItemFormDTO salarySobItemFormDTO = new SalarySobItemFormDTO(); + salarySobItemFormDTO.setCanEdit(1); + // 默认可以编辑 + if (param.getSalarySobId() != null && param.getSalaryItemId() != null) { + // 查询薪资账套 + SalarySobPO salarySobPO = salarySobBiz.getById(param.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); + } + // 查询薪资项目 + List salarySobItemPOS = getSalarySobItemMapper().listSome(SalarySobItemPO.builder().salarySobId(param.getSalarySobId()).salaryItemId(param.getSalaryItemId()).build()); + if (CollectionUtils.isEmpty(salarySobItemPOS)) { + throw new SalaryRunTimeException("账套中薪资项目不存在"); + } + SalarySobItemPO salarySobItemPO = salarySobItemPOS.get(0); + SalaryItemPO salaryItemPO = getSalaryItemService(user).getById(salarySobItemPO.getSalaryItemId()); + if (salaryItemPO == null) { + throw new SalaryRunTimeException("薪资项目不存在或已被删除"); + } + //获取系统值 + List salarySobDefaultItemPOS = getSalarySobDefaultItemMapper().listAll(); + salarySobDefaultItemPOS = salarySobDefaultItemPOS.stream().filter(po -> po.getSysSalaryItemId() != 0).collect(Collectors.toList()); + Map longIntegerMap = SalaryEntityUtil.convert2Map(salarySobDefaultItemPOS, SalarySobDefaultItemPO::getSysSalaryItemId, SalarySobDefaultItemPO::getCanDelete); + if (salaryItemPO.getSysSalaryItemId() != null) { + salarySobItemPO.setCanDelete(longIntegerMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), 1)); + } + // 获取薪资项目公式 + List expressFormulas = getSalaryFormulaService(user).listExpressFormula(Collections.singleton(salarySobItemPO.getFormulaId())); + // 强制开启账套的公式配置 + BaseBean baseBean = new BaseBean(); + final Boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing")); + // 获取核算时隐藏的薪资项目id + List hideItemIds = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder() + .salarySobId(param.getSalarySobId()) + .isGroup(new Integer(0)) + .salaryItemId(param.getSalaryItemId()) + .build()); + + String formulaContent = CollectionUtils.isEmpty(expressFormulas) ? "" : expressFormulas.get(0).getFormula(); + Integer valueType = salarySobItemPO.getValueType() == null ? salaryItemPO.getValueType() : salarySobItemPO.getValueType(); + salarySobItemFormDTO + .setId(salarySobItemPO.getId()) + .setName(salaryItemPO.getName()) + .setItemHide(hideItemIds.contains(salaryItemPO.getId()) ? 1 : 0) + .setDataType(salaryItemPO.getDataType()) + .setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode()) + .setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern()) + .setValueType(valueType) + .setFormulaId(salarySobItemPO.getFormulaId()) + .setFormulaContent(CollectionUtils.isNotEmpty(expressFormulas) ? formulaContent : "") + .setOriginFormulaContent(valueType.equals(SalaryValueTypeEnum.FORMULA.getValue()) ? formulaContent : "") + .setOriginSqlContent(valueType.equals(SalaryValueTypeEnum.SQL.getValue()) ? formulaContent : "") + .setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) + .setDescription(salarySobItemPO.getDescription()) + .setCanEdit((openFormulaForcedEditing || salaryItemPO.getCanEdit().equals(1)) ? 1 : 0); + } + return salarySobItemFormDTO; + } + } diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index a6107e4c3..e0456bca7 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -396,11 +396,19 @@ public class SalarySobController { @GET @Path("/item/topology") @Produces(MediaType.APPLICATION_JSON) - public String getSalaryItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { + public String topology(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::itemTopology, salarySobId); } + @POST + @Path("/item/topology") + @Produces(MediaType.APPLICATION_JSON) + public String getSalaryItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemTopologyQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::topology, param); + } + /**********************************薪资账套的薪资项目 end*********************************/ diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 8b0b815e0..712720c0b 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -13,6 +13,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; +import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; @@ -182,4 +183,11 @@ public class SalarySobItemWrapper extends Service { public List itemTopology(Long salarySobId) { return getSalarySobItemService(user).itemTopology(salarySobId); } + + public Object topology(SalaryItemTopologyQueryParam param) { + + getSalarySobItemService(user).topology(param); + return null; + + } } From 3443cd0dff597be0b6170a5e1066fc432ed72044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 17 Oct 2023 10:24:30 +0800 Subject: [PATCH 066/298] =?UTF-8?q?=E6=8B=93=E6=89=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salarysob/dto/SalaryItemTopologyDTO.java | 62 +++++ .../salary/service/SalaryFormulaService.java | 3 + .../salary/service/SalarySobItemService.java | 3 +- .../impl/SalaryFormulaServiceImpl.java | 13 + .../impl/SalarySobItemServiceImpl.java | 235 +++++++++++++----- .../salary/web/SalarySobController.java | 2 +- .../salary/wrapper/SalarySobItemWrapper.java | 6 +- 7 files changed, 263 insertions(+), 61 deletions(-) create mode 100644 src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java diff --git a/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java new file mode 100644 index 000000000..8ed20b4c7 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java @@ -0,0 +1,62 @@ +package com.engine.salary.entity.salarysob.dto; + +import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.enums.SalaryRoundingModeEnum; +import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import lombok.Data; + +import java.util.List; + +@Data +public class SalaryItemTopologyDTO { + + /** + * 薪资项目id + */ + private Long salaryItemId; + + /** + * 薪资项目名称 + */ + private String salaryItemName; + + /** + * 核算时隐藏 + */ + private Integer itemHide; + + /** + * 字段类型 + * + * @see SalaryDataTypeEnum + */ + private String dataType; + + /** + * 舍入规则 + * + * @see SalaryRoundingModeEnum + */ + private Integer roundingMode; + + /** + * 保留小数位 + */ + private Integer pattern; + + /** + * 取值方式 + * + * @see SalaryValueTypeEnum + */ + private Integer valueType; + + /** + * 公式 + */ + ExpressFormula formula; + + private List children; + +} diff --git a/src/com/engine/salary/service/SalaryFormulaService.java b/src/com/engine/salary/service/SalaryFormulaService.java index 618011426..493754f6b 100644 --- a/src/com/engine/salary/service/SalaryFormulaService.java +++ b/src/com/engine/salary/service/SalaryFormulaService.java @@ -27,6 +27,9 @@ public interface SalaryFormulaService { */ List listExpressFormula(Collection formulaIds); + + List listAllExpressFormula(); + /** * 根据公式id获取公式内容 * diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index 7f10b1c45..62d0050e2 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -2,6 +2,7 @@ package com.engine.salary.service; import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; @@ -133,5 +134,5 @@ public interface SalarySobItemService { List itemTopology(Long salarySobId); - Object topology(SalaryItemTopologyQueryParam param); + SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param); } diff --git a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java index 3e34a2715..6b2508558 100644 --- a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java @@ -85,6 +85,19 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe } } + @Override + public List listAllExpressFormula() { + List expressFormulas = getFormulaMapper().listAll(); + + return expressFormulas.stream().filter(Objects::nonNull).map(m -> { + ExpressFormula expressFormula = new ExpressFormula(); + BeanUtils.copyProperties(m, expressFormula); + List formulaVarPOS = getFormulaVarMapper().listSome(FormulaVar.builder().formulaId(m.getId()).build()); + expressFormula.setParameters(formulaVarPOS); + return expressFormula; + }).collect(Collectors.toList()); + } + @Override public ExpressFormula getExpressFormula(Long formulaId) { if (formulaId == null || formulaId <= 0) { diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 6f40a25d7..181228d4f 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -10,8 +10,10 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryacct.bo.SalaryCalcItemGraph; import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; +import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; @@ -19,6 +21,8 @@ import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; +import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper; import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper; @@ -29,6 +33,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.valid.ValidUtil; import dm.jdbc.util.IdGenerator; +import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -824,64 +829,182 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } @Override - public Object topology(SalaryItemTopologyQueryParam param) { - SalarySobItemFormDTO salarySobItemFormDTO = new SalarySobItemFormDTO(); - salarySobItemFormDTO.setCanEdit(1); - // 默认可以编辑 - if (param.getSalarySobId() != null && param.getSalaryItemId() != null) { - // 查询薪资账套 - SalarySobPO salarySobPO = salarySobBiz.getById(param.getSalarySobId()); - if (Objects.isNull(salarySobPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); - } - // 查询薪资项目 - List salarySobItemPOS = getSalarySobItemMapper().listSome(SalarySobItemPO.builder().salarySobId(param.getSalarySobId()).salaryItemId(param.getSalaryItemId()).build()); - if (CollectionUtils.isEmpty(salarySobItemPOS)) { - throw new SalaryRunTimeException("账套中薪资项目不存在"); - } - SalarySobItemPO salarySobItemPO = salarySobItemPOS.get(0); - SalaryItemPO salaryItemPO = getSalaryItemService(user).getById(salarySobItemPO.getSalaryItemId()); - if (salaryItemPO == null) { - throw new SalaryRunTimeException("薪资项目不存在或已被删除"); - } - //获取系统值 - List salarySobDefaultItemPOS = getSalarySobDefaultItemMapper().listAll(); - salarySobDefaultItemPOS = salarySobDefaultItemPOS.stream().filter(po -> po.getSysSalaryItemId() != 0).collect(Collectors.toList()); - Map longIntegerMap = SalaryEntityUtil.convert2Map(salarySobDefaultItemPOS, SalarySobDefaultItemPO::getSysSalaryItemId, SalarySobDefaultItemPO::getCanDelete); - if (salaryItemPO.getSysSalaryItemId() != null) { - salarySobItemPO.setCanDelete(longIntegerMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), 1)); - } - // 获取薪资项目公式 - List expressFormulas = getSalaryFormulaService(user).listExpressFormula(Collections.singleton(salarySobItemPO.getFormulaId())); - // 强制开启账套的公式配置 - BaseBean baseBean = new BaseBean(); - final Boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing")); - // 获取核算时隐藏的薪资项目id - List hideItemIds = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder() - .salarySobId(param.getSalarySobId()) - .isGroup(new Integer(0)) - .salaryItemId(param.getSalaryItemId()) - .build()); + public SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param) { - String formulaContent = CollectionUtils.isEmpty(expressFormulas) ? "" : expressFormulas.get(0).getFormula(); - Integer valueType = salarySobItemPO.getValueType() == null ? salaryItemPO.getValueType() : salarySobItemPO.getValueType(); - salarySobItemFormDTO - .setId(salarySobItemPO.getId()) - .setName(salaryItemPO.getName()) - .setItemHide(hideItemIds.contains(salaryItemPO.getId()) ? 1 : 0) - .setDataType(salaryItemPO.getDataType()) - .setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode()) - .setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern()) - .setValueType(valueType) - .setFormulaId(salarySobItemPO.getFormulaId()) - .setFormulaContent(CollectionUtils.isNotEmpty(expressFormulas) ? formulaContent : "") - .setOriginFormulaContent(valueType.equals(SalaryValueTypeEnum.FORMULA.getValue()) ? formulaContent : "") - .setOriginSqlContent(valueType.equals(SalaryValueTypeEnum.SQL.getValue()) ? formulaContent : "") - .setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) - .setDescription(salarySobItemPO.getDescription()) - .setCanEdit((openFormulaForcedEditing || salaryItemPO.getCanEdit().equals(1)) ? 1 : 0); + + // 查询薪资账套 + SalarySobPO salarySobPO = salarySobBiz.getById(param.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); } - return salarySobItemFormDTO; + // 查询薪资项目 + List salarySobItemPOS = getSalarySobItemMapper().listSome(SalarySobItemPO.builder().salarySobId(param.getSalarySobId()).salaryItemId(param.getSalaryItemId()).build()); + if (CollectionUtils.isEmpty(salarySobItemPOS)) { + throw new SalaryRunTimeException("账套中薪资项目不存在"); + } + SalarySobItemPO salarySobItemPO = salarySobItemPOS.get(0); + + + //所有薪资项目 + TopologyData topologyData = init(param); + SalaryItemPO salaryItemPO = topologyData.getSalaryItemPO(); + Map salaryItemIdMap = topologyData.getSalaryItemIdMap(); + List hideItemIds = topologyData.getHideItemIds(); + + // 获取薪资项目公式 + ExpressFormula expressFormula = getSalaryFormulaService(user).getExpressFormula(salarySobItemPO.getFormulaId()); + + SalaryItemTopologyDTO salaryItemTopologyDTO = new SalaryItemTopologyDTO(); + salaryItemTopologyDTO.setSalaryItemId(salarySobItemPO.getId()); + salaryItemTopologyDTO.setSalaryItemName(salaryItemPO.getName()); + salaryItemTopologyDTO.setItemHide(hideItemIds.contains(salaryItemPO.getId()) ? 1 : 0); + salaryItemTopologyDTO.setDataType(salaryItemPO.getDataType()); + salaryItemTopologyDTO.setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode()); + salaryItemTopologyDTO.setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern()); + salaryItemTopologyDTO.setValueType(salarySobItemPO.getValueType() == null ? salaryItemPO.getValueType() : salarySobItemPO.getValueType()); + salaryItemTopologyDTO.setFormula(expressFormula); + + + topology(salaryItemTopologyDTO, topologyData); + + + return salaryItemTopologyDTO; + } + + private void topology(SalaryItemTopologyDTO salaryItemTopologyDTO, TopologyData topologyData) { + + List hideItemIds = topologyData.getHideItemIds(); + Long salaryItemId = topologyData.getSalaryItemId(); + Map salaryItemIdMap = topologyData.getSalaryItemIdMap(); + SalaryItemPO salaryItemPO = salaryItemIdMap.get(salaryItemId); + Map salaryItemCodeMap = topologyData.getSalaryItemCodeMap(); + Map salarySobItemCodeMap = topologyData.getSalarySobItemCodeMap(); + Map expressFormulaIdMap = topologyData.getExpressFormulaIdMap(); + + ExpressFormula formula = salaryItemTopologyDTO.getFormula(); + if (formula != null) { + List parameters = formula.getParameters(); + if (CollectionUtils.isNotEmpty(parameters)) { + List salaryItemTopologyDTOChildren = new ArrayList<>(); + for (int i = 0; i < parameters.size(); i++) { + FormulaVar formulaVar = parameters.get(i); + String source = formulaVar.getSource(); + String fieldId = formulaVar.getFieldId().replace(source + "_", ""); + String name = formulaVar.getName(); + + //是否是薪资项目 + boolean isSalaryItemVar; + SalaryFormulaReferenceEnum salaryFormulaReferenceEnum = SalaryFormulaReferenceEnum.parseByValue(source); + if (salaryFormulaReferenceEnum == null) { + SalarySQLReferenceEnum referenceEnum = SalarySQLReferenceEnum.parseByValue(source); + if (referenceEnum == null) { + isSalaryItemVar = false; + } else { + isSalaryItemVar = referenceEnum == SalarySQLReferenceEnum.SALARY_ITEM; + } + } else { + isSalaryItemVar = salaryFormulaReferenceEnum == SalaryFormulaReferenceEnum.SALARY_ITEM; + } + + ExpressFormula expressFormula; + if (salarySobItemCodeMap.containsKey(fieldId)) { + // 如果薪资账套下重新定义了薪资项目的公式,则使用薪资账套下的公式,否则使用薪资项目本身的公式 + expressFormula = expressFormulaIdMap.get(salarySobItemCodeMap.get(salaryItemPO.getCode()).getFormulaId()); + } else { + expressFormula = expressFormulaIdMap.get(salaryItemPO.getFormulaId()); + } + SalaryItemPO salaryItemChild = isSalaryItemVar ? salaryItemCodeMap.get(fieldId) : new SalaryItemPO(); + SalarySobItemPO salarySobItemChild = salarySobItemCodeMap.get(fieldId); + + if (salarySobItemChild == null) { + continue; + } + + SalaryItemTopologyDTO salaryItemTopologyChild = new SalaryItemTopologyDTO(); + salaryItemTopologyChild.setSalaryItemId(salaryItemChild.getId()); + salaryItemTopologyChild.setSalaryItemName(salaryItemChild.getName()); + salaryItemTopologyChild.setItemHide(hideItemIds.contains(salaryItemChild.getId()) ? 1 : 0); + salaryItemTopologyChild.setDataType(salaryItemChild.getDataType()); + salaryItemTopologyChild.setRoundingMode(salarySobItemChild == null ? salaryItemChild.getRoundingMode() : salarySobItemChild.getRoundingMode()); + salaryItemTopologyChild.setPattern(salarySobItemChild == null ? salaryItemChild.getPattern() : salarySobItemChild.getPattern()); + salaryItemTopologyChild.setValueType(salarySobItemChild == null ? salaryItemChild.getValueType() : salarySobItemChild.getValueType()); + salaryItemTopologyChild.setFormula(expressFormula); + salaryItemTopologyDTOChildren.add(salaryItemTopologyChild); + + if (isSalaryItemVar) { + SalaryItemPO salaryItemChildChild = salaryItemCodeMap.get(fieldId); + SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(salaryItemChildChild.getValueType()); + if (salaryValueTypeEnum != SalaryValueTypeEnum.INPUT) { + topologyData.setSalaryItemId(salaryItemChildChild.getId()); + topology(salaryItemTopologyChild, topologyData); + } + } + + } + salaryItemTopologyDTO.setChildren(salaryItemTopologyDTOChildren); + } + } + } + + private TopologyData init(SalaryItemTopologyQueryParam param) { + TopologyData topologyData = new TopologyData(); + + topologyData.setSalaryItemId(param.getSalaryItemId()); + + // 获取核算时隐藏的薪资项目id + List hideItemIds = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder() + .salarySobId(param.getSalarySobId()) + .isGroup(new Integer(0)) + .salaryItemId(param.getSalaryItemId()) + .build()); + topologyData.setHideItemIds(hideItemIds); + + List salaryItems = getSalaryItemService(user).listAll(); + topologyData.setSalaryItems(salaryItems); + + Map salaryItemIdMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + topologyData.setSalaryItemIdMap(salaryItemIdMap); + + Map salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getCode); + topologyData.setSalaryItemCodeMap(salaryItemCodeMap); + + SalaryItemPO salaryItemPO = salaryItemIdMap.get(topologyData.salaryItemId); + topologyData.setSalaryItemPO(salaryItemPO); + + //账套项目 + List salarySobItems = listBySalarySobId(param.getSalarySobId()); + topologyData.setSalarySobItems(salarySobItems); + + Map salarySobItemCodeMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); + topologyData.setSalarySobItemCodeMap(salarySobItemCodeMap); + + //公式 + List expressFormulas = getSalaryFormulaService(user).listAllExpressFormula(); + topologyData.setExpressFormulas(expressFormulas); + + Map expressFormulaIdMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId); + topologyData.setExpressFormulaIdMap(expressFormulaIdMap); + return topologyData; + } + + @Data + class TopologyData { + Long salaryItemId; + + List hideItemIds; + + List salaryItems; + Map salaryItemIdMap; + Map salaryItemCodeMap; + + //账套项目 + SalaryItemPO salaryItemPO; + List salarySobItems; + Map salarySobItemCodeMap; + + //公式 + List expressFormulas; + Map expressFormulaIdMap; } diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index e0456bca7..8632dd4e1 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -406,7 +406,7 @@ public class SalarySobController { @Produces(MediaType.APPLICATION_JSON) public String getSalaryItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemTopologyQueryParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::topology, param); + return new ResponseResult(user).run(getSalarySobItemWrapper(user)::topology, param); } diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 712720c0b..4b2b1d8ce 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -11,6 +11,7 @@ import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; @@ -184,10 +185,9 @@ public class SalarySobItemWrapper extends Service { return getSalarySobItemService(user).itemTopology(salarySobId); } - public Object topology(SalaryItemTopologyQueryParam param) { + public SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param) { - getSalarySobItemService(user).topology(param); - return null; + return getSalarySobItemService(user).topology(param); } } From cf1e1395f7eb4f0b24d252ef6ea7e31ce9e56016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 17 Oct 2023 14:24:52 +0800 Subject: [PATCH 067/298] =?UTF-8?q?=E6=8B=93=E6=89=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salarysob/dto/SalaryItemTopologyDTO.java | 39 +----- .../param/SalaryItemTopologyQueryParam.java | 13 +- .../salary/service/SalarySobItemService.java | 12 +- .../impl/SalarySobItemServiceImpl.java | 127 ++++++++---------- .../salary/web/SalarySobController.java | 18 +-- .../salary/wrapper/SalarySobItemWrapper.java | 10 +- 6 files changed, 91 insertions(+), 128 deletions(-) diff --git a/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java index 8ed20b4c7..22a1a7a37 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java @@ -1,9 +1,6 @@ package com.engine.salary.entity.salarysob.dto; import com.engine.salary.entity.salaryformula.ExpressFormula; -import com.engine.salary.enums.SalaryRoundingModeEnum; -import com.engine.salary.enums.SalaryValueTypeEnum; -import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import lombok.Data; import java.util.List; @@ -21,42 +18,16 @@ public class SalaryItemTopologyDTO { */ private String salaryItemName; - /** - * 核算时隐藏 - */ - private Integer itemHide; - - /** - * 字段类型 - * - * @see SalaryDataTypeEnum - */ - private String dataType; - - /** - * 舍入规则 - * - * @see SalaryRoundingModeEnum - */ - private Integer roundingMode; - - /** - * 保留小数位 - */ - private Integer pattern; - - /** - * 取值方式 - * - * @see SalaryValueTypeEnum - */ - private Integer valueType; - /** * 公式 */ ExpressFormula formula; + /** + * 核算值 + */ + private String result; + private List children; } diff --git a/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java index 7b27e17d3..2db5e982e 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java @@ -20,10 +20,19 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class SalaryItemTopologyQueryParam { - //薪资账套id + /** + * 薪资账套id + */ @DataCheck(require = true, message = "薪资账套的ID不允许为空") private Long salarySobId; - //薪资项目id + /** + * 薪资项目id + */ private Long salaryItemId; + + /** + * 薪资核算人员id + */ + private Long acctEmpId; } diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index 62d0050e2..8106f4561 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -1,6 +1,5 @@ package com.engine.salary.service; -import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; @@ -130,9 +129,16 @@ public interface SalarySobItemService { */ SalarySobItemFormDTO getSalaryItemForm(SalarySobItemPO param); + /** + * 更新 + * @param po + */ void update(SalarySobItemPO po); - List itemTopology(Long salarySobId); - + /** + * 拓扑图 + * @param param + * @return + */ SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param); } diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 181228d4f..f717c1850 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -7,8 +7,7 @@ import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; -import com.engine.salary.entity.salaryacct.bo.SalaryCalcItemGraph; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -101,6 +100,10 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe private SalarySobDefaultItemMapper getSalarySobDefaultItemMapper() { return MapperProxyFactory.getProxy(SalarySobDefaultItemMapper.class); } + + private SalaryAcctResultService getSalaryAcctResultService(User user) { + return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); + } // private LoggerTemplate salarySobLoggerTemplate; @Override @@ -807,31 +810,15 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe return salarySobItemFormDTO; } - - @Override - public List itemTopology(Long salarySobId) { - // 3、查询薪资核算记录所用薪资账套的薪资项目副本 - List salarySobItemPOS = listBySalarySobId(salarySobId); - if (CollectionUtils.isEmpty(salarySobItemPOS)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99151, "当前所用的薪资账套未选择任何薪资项目,无法核算")); - } - // 4、查询当前租户的所有薪资项目 - List salaryItemPOS = getSalaryItemService(user).listAll(); - - // 8、查询公式详情 - Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); - formulaIds.addAll(SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId)); - List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); - // 9、计算薪资项目的运算优先级 - SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, salaryItemPOS, expressFormulas); - List salaryCalcItems = salaryCalcItemGraph.sort(); - return salaryCalcItems; - } - + /** + * 拓扑图 + * + * @param param + * @return + */ @Override public SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param) { - // 查询薪资账套 SalarySobPO salarySobPO = salarySobBiz.getById(param.getSalarySobId()); if (Objects.isNull(salarySobPO)) { @@ -848,35 +835,30 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe //所有薪资项目 TopologyData topologyData = init(param); SalaryItemPO salaryItemPO = topologyData.getSalaryItemPO(); - Map salaryItemIdMap = topologyData.getSalaryItemIdMap(); - List hideItemIds = topologyData.getHideItemIds(); // 获取薪资项目公式 ExpressFormula expressFormula = getSalaryFormulaService(user).getExpressFormula(salarySobItemPO.getFormulaId()); SalaryItemTopologyDTO salaryItemTopologyDTO = new SalaryItemTopologyDTO(); - salaryItemTopologyDTO.setSalaryItemId(salarySobItemPO.getId()); + salaryItemTopologyDTO.setSalaryItemId(salaryItemPO.getId()); salaryItemTopologyDTO.setSalaryItemName(salaryItemPO.getName()); - salaryItemTopologyDTO.setItemHide(hideItemIds.contains(salaryItemPO.getId()) ? 1 : 0); - salaryItemTopologyDTO.setDataType(salaryItemPO.getDataType()); - salaryItemTopologyDTO.setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode()); - salaryItemTopologyDTO.setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern()); - salaryItemTopologyDTO.setValueType(salarySobItemPO.getValueType() == null ? salaryItemPO.getValueType() : salarySobItemPO.getValueType()); salaryItemTopologyDTO.setFormula(expressFormula); - + salaryItemTopologyDTO.setResult(topologyData.getResultItemMap().getOrDefault(salaryItemPO.getId(), "")); topology(salaryItemTopologyDTO, topologyData); - return salaryItemTopologyDTO; } + /** + * 递归拓扑 + * + * @param salaryItemTopologyDTO + * @param topologyData + */ private void topology(SalaryItemTopologyDTO salaryItemTopologyDTO, TopologyData topologyData) { - - List hideItemIds = topologyData.getHideItemIds(); Long salaryItemId = topologyData.getSalaryItemId(); Map salaryItemIdMap = topologyData.getSalaryItemIdMap(); - SalaryItemPO salaryItemPO = salaryItemIdMap.get(salaryItemId); Map salaryItemCodeMap = topologyData.getSalaryItemCodeMap(); Map salarySobItemCodeMap = topologyData.getSalarySobItemCodeMap(); Map expressFormulaIdMap = topologyData.getExpressFormulaIdMap(); @@ -891,7 +873,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe String source = formulaVar.getSource(); String fieldId = formulaVar.getFieldId().replace(source + "_", ""); String name = formulaVar.getName(); - + String fieldName = formulaVar.getFieldName(); //是否是薪资项目 boolean isSalaryItemVar; SalaryFormulaReferenceEnum salaryFormulaReferenceEnum = SalaryFormulaReferenceEnum.parseByValue(source); @@ -909,26 +891,20 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe ExpressFormula expressFormula; if (salarySobItemCodeMap.containsKey(fieldId)) { // 如果薪资账套下重新定义了薪资项目的公式,则使用薪资账套下的公式,否则使用薪资项目本身的公式 - expressFormula = expressFormulaIdMap.get(salarySobItemCodeMap.get(salaryItemPO.getCode()).getFormulaId()); + expressFormula = expressFormulaIdMap.get(salarySobItemCodeMap.get(fieldId).getFormulaId()); + } else if (salaryItemCodeMap.containsKey(fieldId)) { + expressFormula = expressFormulaIdMap.get(salaryItemCodeMap.get(fieldId).getFormulaId()); } else { - expressFormula = expressFormulaIdMap.get(salaryItemPO.getFormulaId()); + expressFormula = null; } - SalaryItemPO salaryItemChild = isSalaryItemVar ? salaryItemCodeMap.get(fieldId) : new SalaryItemPO(); - SalarySobItemPO salarySobItemChild = salarySobItemCodeMap.get(fieldId); - if (salarySobItemChild == null) { - continue; - } + SalaryItemPO salaryItemChild = isSalaryItemVar ? salaryItemCodeMap.get(fieldId) : new SalaryItemPO(); SalaryItemTopologyDTO salaryItemTopologyChild = new SalaryItemTopologyDTO(); - salaryItemTopologyChild.setSalaryItemId(salaryItemChild.getId()); - salaryItemTopologyChild.setSalaryItemName(salaryItemChild.getName()); - salaryItemTopologyChild.setItemHide(hideItemIds.contains(salaryItemChild.getId()) ? 1 : 0); - salaryItemTopologyChild.setDataType(salaryItemChild.getDataType()); - salaryItemTopologyChild.setRoundingMode(salarySobItemChild == null ? salaryItemChild.getRoundingMode() : salarySobItemChild.getRoundingMode()); - salaryItemTopologyChild.setPattern(salarySobItemChild == null ? salaryItemChild.getPattern() : salarySobItemChild.getPattern()); - salaryItemTopologyChild.setValueType(salarySobItemChild == null ? salaryItemChild.getValueType() : salarySobItemChild.getValueType()); + salaryItemTopologyChild.setSalaryItemId(isSalaryItemVar ? salaryItemChild.getId() : null); + salaryItemTopologyChild.setSalaryItemName(isSalaryItemVar ? salaryItemChild.getName() : fieldName); salaryItemTopologyChild.setFormula(expressFormula); + salaryItemTopologyChild.setResult(isSalaryItemVar ? topologyData.getResultItemMap().getOrDefault(salaryItemChild.getId(), "") : ""); salaryItemTopologyDTOChildren.add(salaryItemTopologyChild); if (isSalaryItemVar) { @@ -949,18 +925,9 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe private TopologyData init(SalaryItemTopologyQueryParam param) { TopologyData topologyData = new TopologyData(); + //薪资项目 topologyData.setSalaryItemId(param.getSalaryItemId()); - - // 获取核算时隐藏的薪资项目id - List hideItemIds = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder() - .salarySobId(param.getSalarySobId()) - .isGroup(new Integer(0)) - .salaryItemId(param.getSalaryItemId()) - .build()); - topologyData.setHideItemIds(hideItemIds); - List salaryItems = getSalaryItemService(user).listAll(); - topologyData.setSalaryItems(salaryItems); Map salaryItemIdMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); topologyData.setSalaryItemIdMap(salaryItemIdMap); @@ -973,38 +940,56 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe //账套项目 List salarySobItems = listBySalarySobId(param.getSalarySobId()); - topologyData.setSalarySobItems(salarySobItems); Map salarySobItemCodeMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); topologyData.setSalarySobItemCodeMap(salarySobItemCodeMap); //公式 List expressFormulas = getSalaryFormulaService(user).listAllExpressFormula(); - topologyData.setExpressFormulas(expressFormulas); Map expressFormulaIdMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId); topologyData.setExpressFormulaIdMap(expressFormulaIdMap); + + //薪资结果 + Long acctEmpId = param.getAcctEmpId(); + if (acctEmpId != null) { + List results = getSalaryAcctResultService(user).listBySalaryAcctEmployeeId(acctEmpId); + Map resultItemMap = SalaryEntityUtil.convert2Map(results, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); + topologyData.setResultItemMap(resultItemMap); + } else { + topologyData.setResultItemMap(new HashMap<>()); + } return topologyData; } @Data class TopologyData { + /** + * 薪资项目id + */ Long salaryItemId; - List hideItemIds; - - List salaryItems; + /** + * 薪资项目 + */ Map salaryItemIdMap; Map salaryItemCodeMap; - //账套项目 + /** + * 账套项目 + */ SalaryItemPO salaryItemPO; - List salarySobItems; Map salarySobItemCodeMap; - //公式 - List expressFormulas; + /** + * 公式 + */ Map expressFormulaIdMap; + + /** + * 核算结果 + */ + Map resultItemMap; } diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 8632dd4e1..951553ad0 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -2,7 +2,6 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.SalarySobExtRangePO; -import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salarysob.dto.*; @@ -388,25 +387,18 @@ public class SalarySobController { /** * 账套项目拓扑图 + * * @param request * @param response - * @param salarySobId + * @param param * @return */ - @GET - @Path("/item/topology") - @Produces(MediaType.APPLICATION_JSON) - public String topology(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::itemTopology, salarySobId); - } - @POST @Path("/item/topology") @Produces(MediaType.APPLICATION_JSON) - public String getSalaryItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemTopologyQueryParam param) { + public String getSalaryItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemTopologyQueryParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobItemWrapper(user)::topology, param); + return new ResponseResult(user).run(getSalarySobItemWrapper(user)::topology, param); } @@ -486,7 +478,7 @@ public class SalarySobController { @Produces(MediaType.APPLICATION_JSON) public String saveSalarySobAddUp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobAddUpRuleSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobAddUpRuleWrapper(user)::save, saveParam); + return new ResponseResult(user).run(getSalarySobAddUpRuleWrapper(user)::save, saveParam); } /**********************************薪资账套的累计字段对应关系 end*********************************/ diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 4b2b1d8ce..8cc48d6fb 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -3,7 +3,6 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.annotation.SalaryFormulaVar; -import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO; import com.engine.salary.entity.salaryitem.bo.SalaryItemBO; @@ -181,12 +180,13 @@ public class SalarySobItemWrapper extends Service { return getSalarySobItemService(user).getSalaryItemForm(param); } - public List itemTopology(Long salarySobId) { - return getSalarySobItemService(user).itemTopology(salarySobId); - } + /** + * 拓扑图 + * @param param + * @return + */ public SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param) { - return getSalarySobItemService(user).topology(param); } From 328158204d63dd447255c518388f3593587c1d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 23 Oct 2023 10:03:04 +0800 Subject: [PATCH 068/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E8=B0=83=E5=B7=AE?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index 5a4f908e3..88192ff3e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -159,7 +159,9 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { .addUpOtherDeduction(valueMap.get("addUpOtherDeduction")) .addUpTaxExemptIncome(valueMap.get("addUpTaxExemptIncome")) .addUpAllowedDonation(valueMap.get("addUpAllowedDonation")) + .addUpTaxSavings(valueMap.get("addUpTaxSavings")) .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) + .taxAdjustment(valueMap.get("taxAdjustment")) .addUpTaxableIncome(valueMap.get("addUpTaxableIncome")) // .modifier(taxDeclaration.getCreator()) .creator(taxDeclaration.getCreator()) From fe4e13831759a5743caa880219ad8ab7cbb5946a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 23 Oct 2023 14:44:26 +0800 Subject: [PATCH 069/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E8=B0=83=E5=B7=AE?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/TaxDeclareRecordServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index eefc505e6..71baa2d0b 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -283,7 +283,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe deleteByIds(needDeleteTaxDeclareRecordIds); // 保存个税申报记录 if (CollectionUtils.isNotEmpty(newTaxDeclareRecords)) { - getTaxDeclareRecordMapper().batchInsert(newTaxDeclareRecords); + newTaxDeclareRecords.forEach(getTaxDeclareRecordMapper()::insertIgnoreNull); +// getTaxDeclareRecordMapper().batchInsert(newTaxDeclareRecords); } // 保存个税申报表 if (CollectionUtils.isNotEmpty(newTaxDeclarations)) { @@ -431,7 +432,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 如果存在未归档的薪资核算记录,不允许生成个税申报表 boolean notArchived = salaryAcctRecords.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报").replace("{0}", saveParam.getSalaryMonth().toString())); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报").replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询已归档的薪资核算记录 List archivedSalaryAcctRecords = salaryAcctRecords.stream().filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue())).collect(Collectors.toList()); From 321a565c3558ec04c2034faeeda2c84e3f4bed45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 26 Oct 2023 14:40:56 +0800 Subject: [PATCH 070/298] =?UTF-8?q?fix=E4=B8=AA=E7=A8=8Esql=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202309050203.sql | 4 ++-- resource/sqlupgrade/GS/sql202309050203.sql | 4 ++-- resource/sqlupgrade/JC/sql202309050203.sql | 4 ++-- resource/sqlupgrade/Oracle/sql202309050203.sql | 4 ++-- resource/sqlupgrade/ST/sql202309050203.sql | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202309050203.sql b/resource/sqlupgrade/DM/sql202309050203.sql index 4603c0e75..2b3f805e1 100644 --- a/resource/sqlupgrade/DM/sql202309050203.sql +++ b/resource/sqlupgrade/DM/sql202309050203.sql @@ -7,10 +7,10 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6); / INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); diff --git a/resource/sqlupgrade/GS/sql202309050203.sql b/resource/sqlupgrade/GS/sql202309050203.sql index 4603c0e75..2b3f805e1 100644 --- a/resource/sqlupgrade/GS/sql202309050203.sql +++ b/resource/sqlupgrade/GS/sql202309050203.sql @@ -7,10 +7,10 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6); / INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); diff --git a/resource/sqlupgrade/JC/sql202309050203.sql b/resource/sqlupgrade/JC/sql202309050203.sql index 4603c0e75..2b3f805e1 100644 --- a/resource/sqlupgrade/JC/sql202309050203.sql +++ b/resource/sqlupgrade/JC/sql202309050203.sql @@ -7,10 +7,10 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6); / INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); diff --git a/resource/sqlupgrade/Oracle/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql index 62458bdf3..3caa7ac50 100644 --- a/resource/sqlupgrade/Oracle/sql202309050203.sql +++ b/resource/sqlupgrade/Oracle/sql202309050203.sql @@ -4,9 +4,9 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255) / alter table hrsa_add_up_situation add tax_adjustment varchar2(255) / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5) +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5) / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6) +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6) / INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) diff --git a/resource/sqlupgrade/ST/sql202309050203.sql b/resource/sqlupgrade/ST/sql202309050203.sql index 4603c0e75..2b3f805e1 100644 --- a/resource/sqlupgrade/ST/sql202309050203.sql +++ b/resource/sqlupgrade/ST/sql202309050203.sql @@ -7,10 +7,10 @@ alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255); alter table hrsa_add_up_situation add tax_adjustment varchar2(255); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); / -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6); +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6); / INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); From 8f333c4ad475b63fb64f28d1446e7a282603f925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 1 Nov 2023 16:44:37 +0800 Subject: [PATCH 071/298] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=97=A5=E6=9C=9F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalaryAcctRecordServiceImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 63d03f562..dcff012c7 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -305,9 +305,13 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 转换成po SalaryAcctRecordPO salaryAcctRecordPO = SalaryAcctRecordBO.convert2PO(saveParam, salarySobCycleDTO, (int) acctTimes, (long) user.getUID()); - //检查 // 检查是否能够新建核算 - SalaryAcctTaxAgentPO build = SalaryAcctTaxAgentPO.builder().incomeCategory(salarySobPO.getIncomeCategory()).taxAgentId(salarySobPO.getTaxAgentId()).taxCycle(salaryAcctRecordPO.getTaxCycle()).build(); + SalaryAcctTaxAgentPO build = SalaryAcctTaxAgentPO.builder() + .incomeCategory(salarySobPO.getIncomeCategory()) + .taxAgentId(salarySobPO.getTaxAgentId()) + .salaryMonth(salaryAcctRecordPO.getSalaryMonth()) + .taxCycle(salaryAcctRecordPO.getTaxCycle()) + .build(); List salaryAcctTaxAgents = new ArrayList<>(); salaryAcctTaxAgents.add(build); checkBeforeSave(salaryAcctRecordPO, salaryAcctTaxAgents); @@ -579,10 +583,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe .findAny() .orElse(null); if (Objects.nonNull(calculatedSalaryAcctTaxAgent)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160506, "个税扣缴义务人「{0}」已经存在薪资所属月「{1}」的薪资核算记录了,无法新建薪资所属月「{2}」的薪资核算") + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160506, "个税扣缴义务人「{0}」已经存在税款所属期「{1}」的薪资核算记录了,无法新建税款所属期「{2}」的薪资核算") .replace("{0}", taxAgentMap.get(calculatedSalaryAcctTaxAgent.getTaxAgentId())) - .replace("{1}", SalaryDateUtil.getFormatYYYYMM(calculatedSalaryAcctTaxAgent.getSalaryMonth())) - .replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getSalaryMonth()))); + .replace("{1}", SalaryDateUtil.getFormatYYYYMM(calculatedSalaryAcctTaxAgent.getTaxCycle())) + .replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getTaxCycle()))); } } } From fdfeae934493ee001e7f7fb43fc332234a0bca88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 8 Nov 2023 16:21:53 +0800 Subject: [PATCH 072/298] =?UTF-8?q?=E5=90=88=E5=B9=B61101?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalarySysConfServiceImpl.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 40fd69d53..5f3b87d70 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -984,27 +984,27 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe if (CollectionUtils.isNotEmpty(addUpSituations)) { addUpSituations.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { - po.setAddUpIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpIncome())); - po.setAddUpSubtraction(AESEncryptUtil.closeEncryptSetting(po.getAddUpSubtraction())); - po.setAddUpSocialSecurityTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpSocialSecurityTotal())); - po.setAddUpAccumulationFundTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpAccumulationFundTotal())); - po.setAddUpChildEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpChildEducation())); - po.setAddUpContinuingEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpContinuingEducation())); - po.setAddUpHousingLoanInterest(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingLoanInterest())); - po.setAddUpHousingRent(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingRent())); - po.setAddUpSupportElderly(AESEncryptUtil.closeEncryptSetting(po.getAddUpSupportElderly())); - po.setAddUpEnterpriseAndOther(AESEncryptUtil.closeEncryptSetting(po.getAddUpEnterpriseAndOther())); - po.setAddUpOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getAddUpOtherDeduction())); - po.setAddUpTaxExemptIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxExemptIncome())); - po.setAddUpAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getAddUpAllowedDonation())); - po.setAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getAddUpAdvanceTax())); - po.setAddUpIllnessMedical(AESEncryptUtil.closeEncryptSetting(po.getAddUpIllnessMedical())); - po.setAddUpTaxSavings(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxSavings())); - po.setAddUpInfantCare(AESEncryptUtil.closeEncryptSetting(po.getAddUpInfantCare())); - po.setAddUpPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getAddUpPrivatePension())); - po.setActualAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getActualAddUpAdvanceTax())); - po.setTaxAdjustment(AESEncryptUtil.closeEncryptSetting(po.getTaxAdjustment())); - po.setAddUpTaxableIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxableIncome())); + po.setAddUpIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpIncome(), sysConfPo)); + po.setAddUpSubtraction(AESEncryptUtil.closeEncryptSetting(po.getAddUpSubtraction(), sysConfPo)); + po.setAddUpSocialSecurityTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpSocialSecurityTotal(), sysConfPo)); + po.setAddUpAccumulationFundTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpAccumulationFundTotal(), sysConfPo)); + po.setAddUpChildEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpChildEducation(), sysConfPo)); + po.setAddUpContinuingEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpContinuingEducation(), sysConfPo)); + po.setAddUpHousingLoanInterest(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingLoanInterest(), sysConfPo)); + po.setAddUpHousingRent(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingRent(), sysConfPo)); + po.setAddUpSupportElderly(AESEncryptUtil.closeEncryptSetting(po.getAddUpSupportElderly(), sysConfPo)); + po.setAddUpEnterpriseAndOther(AESEncryptUtil.closeEncryptSetting(po.getAddUpEnterpriseAndOther(), sysConfPo)); + po.setAddUpOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getAddUpOtherDeduction(), sysConfPo)); + po.setAddUpTaxExemptIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxExemptIncome(), sysConfPo)); + po.setAddUpAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getAddUpAllowedDonation(), sysConfPo)); + po.setAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getAddUpAdvanceTax(), sysConfPo)); + po.setAddUpIllnessMedical(AESEncryptUtil.closeEncryptSetting(po.getAddUpIllnessMedical(), sysConfPo)); + po.setAddUpTaxSavings(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxSavings(), sysConfPo)); + po.setAddUpInfantCare(AESEncryptUtil.closeEncryptSetting(po.getAddUpInfantCare(), sysConfPo)); + po.setAddUpPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getAddUpPrivatePension(), sysConfPo)); + po.setActualAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getActualAddUpAdvanceTax(), sysConfPo)); + po.setTaxAdjustment(AESEncryptUtil.closeEncryptSetting(po.getTaxAdjustment(), sysConfPo)); + po.setAddUpTaxableIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxableIncome(), sysConfPo)); } else { po.setAddUpIncome(AESEncryptUtil.encrypt(po.getAddUpIncome())); po.setAddUpSubtraction(AESEncryptUtil.encrypt(po.getAddUpSubtraction())); From 753eaa5b222b96175829ec4d299e78327eea719c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 17 Nov 2023 16:00:59 +0800 Subject: [PATCH 073/298] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=97=AD=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/SalaryAcctCalculatePriorityBO.java | 2 +- .../salary/service/SalarySobItemService.java | 2 ++ .../service/impl/SalarySobItemServiceImpl.java | 14 ++++++++++++++ src/com/engine/salary/web/SalarySobController.java | 8 ++++++++ .../salary/wrapper/SalarySobItemWrapper.java | 4 ++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java index bc5ee6d93..2296b157e 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java @@ -185,7 +185,7 @@ public class SalaryAcctCalculatePriorityBO { if (Objects.equals(pre.getSalaryItemId(), current.getSalaryItemId())) { SalaryItemPO preSalaryItemPO = salaryItemPOMap.get(pre.getSalaryItemId()); SalaryItemPO currentSalaryItemPO = salaryItemPOMap.get(current.getSalaryItemId()); - String errMsg = SalaryI18nUtil.getI18nLabel(101426, "{0}和{1}的公式中存在相互引用") + String errMsg = SalaryI18nUtil.getI18nLabel(101426, "{0} {1}的公式中存在相互引用") .replace("{0}", Optional.ofNullable(preSalaryItemPO).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) .replace("{1}", Optional.ofNullable(currentSalaryItemPO).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)); throw new SalaryRunTimeException(errMsg); diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index 8106f4561..609d07341 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -141,4 +141,6 @@ public interface SalarySobItemService { * @return */ SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param); + + void checkLoop(Long salarySobId); } diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index f717c1850..e076c8e42 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -7,6 +7,7 @@ import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; @@ -850,6 +851,19 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe return salaryItemTopologyDTO; } + @Override + public void checkLoop(Long salarySobId) { + // 查询薪资项目副本 + List salarySobItemPOS = listBySalarySobId(salarySobId); + // 查询薪资项目 + List salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId,Collectors.toList()); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + // 查询公式详情 + List formulaIds = SalaryEntityUtil.properties(salaryItems, SalaryItemPO::getFormulaId,Collectors.toList()); + List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS,salaryItems,expressFormulas,new ArrayList<>(),new HashSet<>()); + } + /** * 递归拓扑 * diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 951553ad0..c7c4255e1 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -401,6 +401,14 @@ public class SalarySobController { return new ResponseResult(user).run(getSalarySobItemWrapper(user)::topology, param); } + @GET + @Path("/item/checkLoop") + @Produces(MediaType.APPLICATION_JSON) + public String checkLoop(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobItemWrapper(user)::checkLoop, salarySobId); + } + /**********************************薪资账套的薪资项目 end*********************************/ diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 8cc48d6fb..55436194d 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -190,4 +190,8 @@ public class SalarySobItemWrapper extends Service { return getSalarySobItemService(user).topology(param); } + + public void checkLoop(Long salarySobId) { + getSalarySobItemService(user).checkLoop(salarySobId); + } } From a026a8ff88095d390c8aabaa247eaf21976a234c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 20 Nov 2023 17:48:49 +0800 Subject: [PATCH 074/298] =?UTF-8?q?=E6=B8=85=E9=99=A4=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/TaxDeclareRecordServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 71baa2d0b..1e5268e74 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -738,6 +738,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg)); + }else { + //清除之前的错误 + taxDeclareRecord.setTaxDeclareErrorMsg(""); } // 申报状态 Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), 0); From 819937edebb2bbd3ce9d2ac80c1eca0d237e9791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 30 Nov 2023 10:09:26 +0800 Subject: [PATCH 075/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A8=8E=E5=8F=B7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml index e5a86e57f..d5ecfdbe5 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -147,7 +147,7 @@ - AND taxCode IN + AND tax_code IN #{taxCode} From 121da2f7adcc8da6ed0f762734809b8b72abe3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 1 Dec 2023 11:46:21 +0800 Subject: [PATCH 076/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E4=BA=91=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxapiflow/response/QueryAccountBalanceResponse.java | 2 +- .../impl/TaxDeclarationApiFlowStatisticServiceImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java index 67779fd42..4c5cb33e3 100644 --- a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java @@ -43,7 +43,7 @@ public class QueryAccountBalanceResponse { /** * 税号 */ - private String taxNumber; + private String taxNum; /** * 已使用流量 */ diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java index 2a2e51fed..7d09f19f1 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java @@ -62,7 +62,7 @@ public class TaxDeclarationApiFlowStatisticServiceImpl extends Service implement return TaxDeclarationApiFlowTotalDTO.builder() .total(apiConfigPO.getTotality()) .remain(apiConfigPO.getRemain()) - .used(apiConfigPO.getTotality() - apiConfigPO.getRemain()) + .used(Long.parseLong(response.getBody().getSurplus())) .lastUpdateTime(SalaryDateUtil.getFormatLocalDateTime(apiConfigPO.getLastUpdateTime())) .build(); } @@ -81,7 +81,7 @@ public class TaxDeclarationApiFlowStatisticServiceImpl extends Service implement log.info("details is empty"); return new ArrayList<>(); } - Set taxCodes = details.stream().map(QueryAccountBalanceResponse.Detail::getTaxNumber).collect(Collectors.toSet()); + Set taxCodes = details.stream().map(QueryAccountBalanceResponse.Detail::getTaxNum).collect(Collectors.toSet()); List returnPOList = getTaxAgentTaxReturnService(user).getByTaxCodes(taxCodes); if (returnPOList.isEmpty()) { log.info("TaxAgentTaxReturnPO is empty"); @@ -98,7 +98,7 @@ public class TaxDeclarationApiFlowStatisticServiceImpl extends Service implement Map> taxCodeMap = returnPOList.stream().collect(Collectors.groupingBy(TaxAgentTaxReturnPO::getTaxCode)); List flowStatisticDTOS = new ArrayList<>(); for (QueryAccountBalanceResponse.Detail detail : details) { - List list = taxCodeMap.getOrDefault(detail.getTaxNumber(), new ArrayList<>()); + List list = taxCodeMap.getOrDefault(detail.getTaxNum(), new ArrayList<>()); for (TaxAgentTaxReturnPO returnPO : list) { TaxDeclarationApiFlowStatisticListDTO statisticDTO = new TaxDeclarationApiFlowStatisticListDTO(); statisticDTO.setId(IdGenerator.generate()); From 045873525c429ed18214e2782dfefe58c4aadb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 5 Dec 2023 14:58:02 +0800 Subject: [PATCH 077/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E4=BA=91=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8A=A5=E7=A8=8E=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../remote/tax/client/DeclareClient.java | 31 +++++++++++++++++++ .../service/TaxDeclareRecordService.java | 8 +++++ .../impl/TaxDeclareRecordServiceImpl.java | 12 +++++++ .../salary/web/TaxDeclarationController.java | 15 +++++++++ .../wrapper/TaxDeclareRecordWrapper.java | 5 +++ 5 files changed, 71 insertions(+) create mode 100644 src/com/engine/salary/remote/tax/client/DeclareClient.java diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java new file mode 100644 index 000000000..3f5722b24 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -0,0 +1,31 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.SingnatureData; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class DeclareClient extends TaxBaseClient{ + public DeclareClient(Long taxAgentId) { + super(taxAgentId); + } + + /** + * 申报内置算税结果查询 + * @param requestId· + * @return + */ + public Object getDeclareTaxResultFeedback(String requestId){ + // 供应商信息 + String url = super.apiConfig.getHost() + "/gateway/iit/report/getDeclareTaxResultFeedback"; + Map params = new HashMap<>(1); + params.put("requestId", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + return res; + } + + +} diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index c21ad68a7..4c325a520 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -131,6 +131,14 @@ public interface TaxDeclareRecordService { */ void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate); + + /** + * 申报内置算税结果查询 + * @param id + * @return + */ + Object getDeclareTaxResultFeedback(Long id); + /** * 作废 * diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 1e5268e74..109ef366c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -40,6 +40,7 @@ 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.remote.tax.client.DeclareClient; import com.engine.salary.service.*; import com.engine.salary.service.factory.TaxPaymentServiceFactory; import com.engine.salary.util.*; @@ -913,6 +914,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // taxDeclarationLoggerTemplate.write(loggerContext); } + + @Override + public Object getDeclareTaxResultFeedback(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getRequestId()); + } + + @Override public void updateDeclare(Long id) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index c717016f5..ba563895b 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -202,6 +202,21 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam.getTaxDeclareRecordId()); } + /** + * 申报内置算税结果查询 + * + * @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(user).run(getTaxDeclareRecordWrapper(user)::getDeclareTaxResultFeedback, id); + } + + /** * 作废 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 277d1d9d0..c47959f3c 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -461,6 +461,11 @@ public class TaxDeclareRecordWrapper extends Service { return taxDeclarationRate.getIndex(); } + + public Object getDeclareTaxResultFeedback(Long id) { + return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); + } + /** * 作废 * From 1a061aa3460b917a777c89542c8cced822ffccdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 5 Dec 2023 17:08:35 +0800 Subject: [PATCH 078/298] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=89=80=E6=9C=89?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81=E5=8F=91=E8=96=AA=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E4=B8=BA=E5=85=A5=E8=81=8C=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmployeeDeclareSyncStartDateParam.java | 31 +++++++++++++ .../EmployeeDeclareManager.java | 44 +++++++++++++++++++ .../maintainer/MaintainerController.java | 36 +++++++++++++++ .../salaryarchive/SalaryArchiveManager.java | 11 +++++ .../service/EmployeeDeclareService.java | 7 +++ .../impl/EmployeeDeclareServiceImpl.java | 20 +++++++++ .../salary/web/SalaryArchiveController.java | 12 ----- 7 files changed, 149 insertions(+), 12 deletions(-) create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSyncStartDateParam.java create mode 100644 src/com/engine/salary/maintainer/EmployeeDeclare/EmployeeDeclareManager.java diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSyncStartDateParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSyncStartDateParam.java new file mode 100644 index 000000000..c4410c28a --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSyncStartDateParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 同步入职日期参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareSyncStartDateParam { + // 个税扣缴义务人id + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + // 税款所属期 + @DataCheck(require = true, message = "参数错误,税款所属期参数格式错误") + private Date taxCycle; +} diff --git a/src/com/engine/salary/maintainer/EmployeeDeclare/EmployeeDeclareManager.java b/src/com/engine/salary/maintainer/EmployeeDeclare/EmployeeDeclareManager.java new file mode 100644 index 000000000..8cbfc06ba --- /dev/null +++ b/src/com/engine/salary/maintainer/EmployeeDeclare/EmployeeDeclareManager.java @@ -0,0 +1,44 @@ +package com.engine.salary.maintainer.EmployeeDeclare; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareSyncStartDateParam; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; +import com.engine.salary.util.valid.ValidUtil; +import weaver.hrm.User; + +public class EmployeeDeclareManager extends Service { + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryCacheService getSalaryCacheService(User user) { + return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); + } + + + /** + * 同步任职受雇日期为入职日期 + * + * @return + */ + public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) { + ValidUtil.doValidator(param); + + return getEmployeeDeclareService(user).syncEmploymentDate(param); + } + +} diff --git a/src/com/engine/salary/maintainer/MaintainerController.java b/src/com/engine/salary/maintainer/MaintainerController.java index c184a6082..9bffd7681 100644 --- a/src/com/engine/salary/maintainer/MaintainerController.java +++ b/src/com/engine/salary/maintainer/MaintainerController.java @@ -1,11 +1,14 @@ package com.engine.salary.maintainer; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareSyncStartDateParam; +import com.engine.salary.maintainer.EmployeeDeclare.EmployeeDeclareManager; import com.engine.salary.maintainer.datacollection.AddUpSituationManager; import com.engine.salary.maintainer.salaryacct.SalaryAcctManager; import com.engine.salary.maintainer.salaryacct.SalaryAcctSupplementParam; import com.engine.salary.maintainer.salaryarchive.SalaryArchiveManager; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import weaver.hrm.HrmUserVarify; @@ -16,6 +19,7 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.Arrays; @@ -45,6 +49,10 @@ public class MaintainerController { return ServiceUtil.getService(SalaryArchiveManager.class, user); } + private EmployeeDeclareManager getEmployeeDeclareManager(User user) { + return ServiceUtil.getService(EmployeeDeclareManager.class, user); + } + //---------------------------薪资核算 start ------------------------------------ /** @@ -108,4 +116,32 @@ public class MaintainerController { return new ResponseResult(user).run(getSalaryArchiveManager(user)::initPayStartDate); } + /** + * 同步所有档案起始发薪日期变为入职日期 + * + * @return + */ + @GET + @Path("/salaryArchive/syncPayStartDate") + @Produces(MediaType.APPLICATION_JSON) + public String syncPayStartDate(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryArchiveManager(user)::syncPayStartDate); + } + + /** + * 同步任职受雇日期为入职日期 + * + * @return + */ + @GET + @Path("/employeedeclare/syncEmploymentDate") + @Produces(MediaType.APPLICATION_JSON) + public String syncEmploymentDate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxAgentId") Long taxAgentId, @QueryParam(value = "taxCycle")String taxCycle) { + User user = HrmUserVarify.getUser(request, response); + EmployeeDeclareSyncStartDateParam param = EmployeeDeclareSyncStartDateParam.builder().taxAgentId(taxAgentId).taxCycle(SalaryDateUtil.stringToDate(taxCycle)).build(); + return new ResponseResult(user).run(getEmployeeDeclareManager(user)::syncEmploymentDate,param); + } + + } diff --git a/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java b/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java index cbd52a6ca..751088d46 100644 --- a/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java +++ b/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java @@ -61,4 +61,15 @@ public class SalaryArchiveManager extends Service { return null; } + + + /** + * 同步所有档案起始发薪日期变为入职日期 + * + * @return + */ + public String syncPayStartDate() { + return getSalaryArchiveService(user).syncPayStartDate(); + } + } diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 72e987d3c..0869a5869 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -175,4 +175,11 @@ public interface EmployeeDeclareService{ * @param param */ void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate); + + /** + * 同步任职受雇日期为入职日期 + * + * @return + */ + String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param); } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index f50a2d337..eea830dcc 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -28,6 +28,7 @@ import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.SalaryCycleTypeEnum; import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; @@ -703,4 +704,23 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size()))); } } + + @Override + public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) { + List employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); + Map empPayStartDateMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getCompanystartdate); + + List employeeDeclarePOS = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + employeeDeclarePOS.forEach(po -> { + String payStartDate = empPayStartDateMap.getOrDefault(po.getEmployeeId(), ""); + if (SalaryDateUtil.checkDay(payStartDate)) { + po.setEmploymentDate(SalaryDateUtil.dateStrToLocalDate(payStartDate)); + po.setNewEmployeeInfo(1); + po.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + getEmployeeDeclareMapper().updateIgnoreNull(po); + } + }); + + return "执行完毕"; + } } diff --git a/src/com/engine/salary/web/SalaryArchiveController.java b/src/com/engine/salary/web/SalaryArchiveController.java index 6b6e59ae1..b77174441 100644 --- a/src/com/engine/salary/web/SalaryArchiveController.java +++ b/src/com/engine/salary/web/SalaryArchiveController.java @@ -586,18 +586,6 @@ public class SalaryArchiveController { return new ResponseResult(user).run(getSalaryArchiveWrapper(user)::stopSalary, stopSalaryParam); } - /** - * 同步所有档案起始发薪日期变为入职日期 - * - * @return - */ - @GET - @Path("/syncPayStartDate") - @Produces(MediaType.APPLICATION_JSON) - public String syncPayStartDate(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalaryArchiveWrapper(user)::syncPayStartDate); - } // ******** 薪资档案主表 end ***********************************************************************************************/ From 54d8f3ef3916f5141d6fc24a8c49d70cf91c0323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 5 Dec 2023 17:17:11 +0800 Subject: [PATCH 079/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=97=A0=E6=B3=95=E7=BD=AE=E7=A9=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/mapper/employeedeclare/EmployeeDeclareMapper.xml | 6 ++---- .../salary/service/impl/EmployeeDeclareServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 5f8eab4af..890181735 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -639,7 +639,7 @@ ) - + @@ -730,9 +730,7 @@ employment_date=#{employmentDate}, - - dismiss_date=#{dismissDate}, - + dismiss_date=#{dismissDate}, disability=#{disability}, diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index eea830dcc..fbb34e775 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -250,7 +250,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { employeeDeclare.setNewEmployeeInfo(1); } - getEmployeeDeclareMapper().updateIgnoreNull(employeeDeclare); + getEmployeeDeclareMapper().update(employeeDeclare); // 记录日志 // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); From e093c6aa7e10a3941e242821fe6a71975e18abe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Dec 2023 15:19:07 +0800 Subject: [PATCH 080/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../response/QueryAccountBalanceResponse.java | 6 +- .../remote/tax/client/DeclareClient.java | 11 + .../remote/tax/client/EmployeeClient.java | 2 +- .../remote/tax/client/TaxBaseClient.java | 8 - .../GetDeclareTaxResultFeedbackResponse.java | 540 ++++++++++++++++++ .../salary/web/EmployeeDeclareController.java | 2 + .../wrapper/EmployeeDeclareWrapper.java | 1 - test/ApiReturnDes.java | 18 + test/ParseTaxApi.java | 49 +- 9 files changed, 618 insertions(+), 19 deletions(-) create mode 100644 src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java create mode 100644 test/ApiReturnDes.java diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java index 4c5cb33e3..584244e09 100644 --- a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java @@ -22,15 +22,15 @@ public class QueryAccountBalanceResponse { public static class Body { /** * 已购买总流量 - **/ + */ private String total; /** * 已使用流量 - **/ + */ private String used; /** * 剩余流量 - **/ + */ private String surplus; /** * 使用明细 diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index 3f5722b24..bcd390856 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -7,6 +7,14 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +/** + * 个税申报客户端 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class DeclareClient extends TaxBaseClient{ public DeclareClient(Long taxAgentId) { super(taxAgentId); @@ -24,6 +32,9 @@ public class DeclareClient extends TaxBaseClient{ params.put("requestId", requestId); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, params); + + + return res; } diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java index 8ea3f8177..90da29385 100644 --- a/src/com/engine/salary/remote/tax/client/EmployeeClient.java +++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.Map; /** - * 人员信息登记报送服务 + * 人员信息登记报送客户端 *

Copyright: Copyright (c) 2023

*

Company: 泛微软件

* diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java index 38ba9862a..1eae80e88 100644 --- a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -8,14 +8,6 @@ import com.engine.salary.util.Sm4Utils; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; -/** - * 人员信息登记报送服务 - *

Copyright: Copyright (c) 2023

- *

Company: 泛微软件

- * - * @author qiantao - * @version 1.0 - **/ @Slf4j public class TaxBaseClient { private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() { diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java new file mode 100644 index 000000000..45e773ab0 --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -0,0 +1,540 @@ +package com.engine.salary.remote.tax.response.employee; + +import java.math.BigDecimal; +import java.util.List; + +public class GetDeclareTaxResultFeedbackResponse { + /** + * 企业名称 必填:是 + */ + 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; +// /** +// * 非居民所得 必填:是 见非居民所得计算结果 +// */ +// private 对象 fjmsd; +// /** +// * 限售股所得 必填:是 见限售股所得计算结果 +// */ +// private 对象 xsgsd; +// /** +// * 人员申报失败列表 必填:是 参考人员代报结果对象 +// */ +// private 数组 rysbsblb; + + + public class zhsd { + /** + * 人员代代报失败列表 参考人员代报结果对象 + */ + private List rysbsblb; + /** + * 正常工资薪金算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj zcgzxj; +// /** +// * 全年一次性奖金收入算税结果对象 参考综合所得算税结果对象 +// */ +// private 对象 qnycxjjsslb; +// /** +// * 稿酬所得算税结果对象 参考综合所得算税结果对象 +// */ +// private 对象 gcsdlb; +// /** +// * 一般劳务报酬算税结果对象 参考综合所得算税结果对象 +// */ +// private 对象 lwbclb; +// /** +// * 解除劳动合同一次性补偿金列表 参考综合所得算税结果对象 +// */ +// private 对象 jcldhtycxbcjlb; +// /** +// * 保险营销员薪金算税结果对象 参考综合所得算税结果对象 +// */ +// private 对象 bxyxy; +// /** +// * 证券经纪人薪金算税结果对象 参考综合所得算税结果对象 +// */ +// private 对象 zqjjr; +// /** +// * 特许权算税结果对象 参考综合所得算税结果对象 +// */ +// private 对象 txq; +// /** +// * 个人股权激励结果对象 参考综合所得算税结果对象 +// */ +// private 对象 grgqjl; +// /** +// * 企业年金结果对象 参考综合所得算税结果对象 +// */ +// private 对象 qynj; +// /** +// * 内退一次性补偿金 参考综合所得算税结果对象 +// */ +// private 对象 ntycxbcjlb; +// /** +// * 其他连续劳务报酬 参考综合所得算税结果对象 +// */ +// private 对象 qtlxlwbc; +// /** +// * 其他非连续劳务报酬 参考综合所得算税结果对象 +// */ +// private 对象 qtflxlwbc; +// /** +// * 提前退休一次性补贴 参考综合所得算税结果对象 +// */ +// private 对象 tqtxycxbt; +// /** +// * 央企负责人绩效薪金延期兑现收入和任期奖励 参考综合所得算税结果对象 +// */ +// private 对象 yqfzrsrhjl; +// /** +// * 法律援助劳务报酬 参考综合所得算税结果对象 +// */ +// private 对象 flyzlwbclb; + + + /** + * 人员代报结果对象 + */ + public class rydbjgdx { + /** + * 姓名 + */ + 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; + } + + + /** + * 综合所得算税结果对象 + */ + public class zcgzxj { + /** + * 综合算税成功列表 参考综合所得输出结果报文 + */ + private List sscglb; + /** + * 综合算税失败列表 参考综合所得输出结果报文 + */ + private List sssblb; + /** + * 综合算税失败原因列表 参考算税失败原因对象 + */ + private List sssbyylb; + /** + * 参与综合算税总人数 + */ + private int sszrs; + /** + * 综合算税失败总人数 + */ + private int sssbrs; + /** + * 年金上限 + */ + private BigDecimal njsx; + /** + * 住房公积金上限 + */ + private BigDecimal zfgjjsx; + /** + * 年平均工资 + */ + private BigDecimal npjgz; + /** + * 企业上月是否已申报 0:上月未申报 1:上月已申报 2:上上月未申报 + */ + private String qysysfysb; + /** + * 专项代报状态 + */ + private String clzt; + /** + * 专项代报结果原因 + */ + private String cljgms; + + + /** + * 综合所得输出结果报文 + */ + public class zhsdscjgbw { + /** + * 是否明细申报 必填:否 是或者否 + */ + private String sfmxsb; + /** + * 姓名 必填:null 如果是汇总申报返回空 + */ + private String xm; + /** + * 证件类型 必填:null 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:null 如果是汇总申报返回空 + */ + private String zzhm; + /** + * 任职受雇日期 必填:是 格式YYYY-MM-DD + */ + private String rzsgrq; + /** + * 离职日期 必填:否 格式YYYY-MM-DD + */ + private String lzrq; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 当期免税收入 必填:null + */ + private BigDecimal mssd; + /** + * 基本养老保险 必填:null + */ + private BigDecimal jbylaobxf; + /** + * 基本医疗保险 必填:null + */ + private BigDecimal jbylbxf; + /** + * 失业保险 必填:null + */ + private BigDecimal sybxf; + /** + * 住房公积金 必填:null + */ + private BigDecimal zfgjj; + /** + * 子女教育支出 必填:null + */ + private BigDecimal znjyzc; + /** + * 赡养老人支出 必填:null + */ + private BigDecimal sylrzc; + /** + * 住房贷款利息支出 必填:null + */ + private BigDecimal zfdklxzc; + /** + * 住房租金支出 必填:null + */ + private BigDecimal zfzjzc; + /** + * 继续教育支出 必填:null + */ + private BigDecimal jxjyzc; + /** + * 非学历继续教育支出 必填:null + */ + private BigDecimal fxljxjyzc; + /** + * 3岁以下婴幼儿照护支出 必填:null + */ + private BigDecimal yyezhzc; + /** + * 年金 必填:null + */ + private BigDecimal nj; + /** + * 商业健康保险 必填:null + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:null + */ + private BigDecimal syylbx; + /** + * 其他 必填:null 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 准予扣除的捐赠额 必填:null + */ + private BigDecimal zykcjze; + /** + * 减免税额 必填:null + */ + private BigDecimal jmse; + /** + * 备注 必填:null + */ + private String bz; + /** + * 减除费用 必填:null 正常工资薪金的减除费用。 对应保险营销员、证券经纪人的费用 + */ + private BigDecimal jcfy; + /** + * 其他扣除合计 必填:null + */ + private BigDecimal qtckhj; + /** + * 应纳税所得额 必填:null 正常工资薪金返回Null + */ + private BigDecimal ynssde; + /** + * 应纳税额 必填:null 正常工资薪金返回Null + */ + private BigDecimal ynse; + /** + * 已缴税额 必填:null 正常工资薪金返回Null + */ + private BigDecimal ykjse; + /** + * 应扣缴税额 必填:null 正常工资薪金返回Null + */ + private BigDecimal yingkjse; + /** + * 税率 必填:null + */ + private BigDecimal sl; + /** + * 速算扣除数 必填:null + */ + private BigDecimal sskcs; + /** + * 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬 + */ + private String sdxm; + /** + * 应补退税额 必填:null 应补退税额=累计应扣缴税额-累计已缴税额 + */ + private BigDecimal ybtse; + /** + * 累计收入额 必填:null + */ + private BigDecimal ljsre; + /** + * 累计免税收入额 必填:null + */ + private BigDecimal ljmssd; + /** + * 累计专项扣除额 必填:null 三险一金合计 + */ + private BigDecimal ljzxkce; + /** + * 累计专项附加扣除额 必填:null 专项附加合计 + */ + private BigDecimal ljzxfjkce; + /** + * 累计其他扣除额 必填:null + */ + private BigDecimal ljqtkce; + /** + * 累计减免税额 必填:null + */ + private BigDecimal ljjmse; + /** + * 累计减除费用额 必填:null 正常工资薪金累计减除费用 对应保险营销员、证券经纪人累计费用 + */ + private BigDecimal ljjcfye; + /** + * 累计月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 + */ + private BigDecimal ljyjcfy; + /** + * 允许扣除税费 必填:null 保险营销员、证券经纪人 + */ + private BigDecimal yxkcsf; + /** + * 展业成本 必填:null 保险营销员、证券经纪人 + */ + private BigDecimal zycb; + /** + * 月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 + */ + private BigDecimal yjcfy; + /** + * 累计应纳税所得额 必填:null + */ + private BigDecimal ljynssde; + /** + * 累计应纳税额 必填:null + */ + private BigDecimal ljynse; + /** + * 累计应扣缴税额 必填:null 累计应扣缴税额 = 累计应纳税额 - 累计减免税额 + */ + private BigDecimal ljyingkjse; + /** + * 累计已缴税额 必填:null + */ + private BigDecimal ljykjse; + /** + * 累计子女教育支出 必填:null + */ + private BigDecimal ljznjyzc; + /** + * 累计继续教育支出 必填:null + */ + private BigDecimal ljjxjyzc; + /** + * 累计非学历继续教育支持 必填:null + */ + private BigDecimal ljfxljxjyzc; + /** + * 累计学历继续教育支持 必填:null + */ + private BigDecimal ljxljxjyzc; + /** + * 累计住房租金支出 必填:null + */ + private BigDecimal ljzfzjzc; + /** + * 累计房屋贷款支出 必填:null + */ + private BigDecimal ljzfdklxzc; + /** + * 累计赡养老人支出 必填:null + */ + private BigDecimal ljsylrzc; + /** + * 累计3岁以下婴幼儿照护支出 必填:null + */ + private BigDecimal ljyyezhzc; + /** + * 累计准予扣除的捐赠额 必填:null + */ + private BigDecimal ljzykcjze; + /** + * 累计个人养老金 必填:null + */ + private BigDecimal ljgrylj; + /** + * 累计个人养老金校验码 必填:null + */ + private String ljgryljjym; + /** + * 企业上月是否已申报 必填:null 仅在两个月算税场景时使用,当前月分为N月: + * 0表示N-1月(上月)未申报 + * 1表示N-1月(上月)已申报 + * 2表示N-2月(上上个月)未申报 + */ + private String qysysfysb; + /** + * 员工在税局累计已扣缴的税额 必填:null 当前月分为N,如果N-1(上月)已申报,则返回N-1月员工在税局累计已扣缴的税额; + * 如果N-1月未申报,则返回N-2月工在税局累计已扣缴的税额; + */ + private BigDecimal ygzsjljykjse; + + /** + * 本月已累计扣除税额 必填:null 针对一月多次算税的场景字段 + */ + private BigDecimal byyljkjse; + /** + * 本次应扣缴税额 必填:null 针对一月多次算税的场景字段,本次应扣缴税额=本月应扣缴税额-本月已累计税额 + */ + private BigDecimal bcykjse; + /** + * 分摊年度数 必填:null + */ + private Integer ftnds; + /** + * 年减除费用 必填:null 默认为60000 + */ + private BigDecimal njcfy; + + } + + /** + * 4.4.1.3.2算税失败原因对象 + */ + public class sssbyydx { + /** + * 人员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; + } + + } + + } + + +} diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 420863bbb..bd8b5bbb3 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -11,6 +11,7 @@ import com.engine.salary.util.ResponseResult; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.EmployeeDeclareWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -30,6 +31,7 @@ import java.util.Map; * @author qiantao * @version 1.0 **/ +@Slf4j public class EmployeeDeclareController { private EmployeeDeclareWrapper getEmployeeDeclareWrapper(User user) { diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 5a5b907f7..57442d505 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -547,7 +547,6 @@ public class EmployeeDeclareWrapper extends Service { GetCompanyEmployeeResponse companyEmployee = employeeClient.getCompanyEmployee(param); - return companyEmployee; } diff --git a/test/ApiReturnDes.java b/test/ApiReturnDes.java new file mode 100644 index 000000000..e27dc5cc4 --- /dev/null +++ b/test/ApiReturnDes.java @@ -0,0 +1,18 @@ +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ApiReturnDes { + @ExcelProperty(index = 0) + public String name; + @ExcelProperty(index = 1) + public String mean; + @ExcelProperty(index = 2) + public String type; + @ExcelProperty(index = 3) + public String des; +} diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java index 957f424d3..3e4b45d9d 100644 --- a/test/ParseTaxApi.java +++ b/test/ParseTaxApi.java @@ -7,7 +7,9 @@ import java.util.List; public class ParseTaxApi { public static void main(String[] args) { - readExcel("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); +// readExcel("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); + + readExcel2("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); } @@ -27,17 +29,17 @@ public class ParseTaxApi { apiDesList.forEach(des -> { String type = des.getType(); - if(StringUtils.isNotEmpty(type)){ - if(type.startsWith("String")){ - type= "String"; + if (StringUtils.isNotEmpty(type)) { + if (type.startsWith("String")) { + type = "String"; } } String a = "/** * " + des.getMean() - +" " + + " " + "必填:" + des.getRequired() - +" " + des.getDes() + + " " + (des.getDes() == null ? "" : des.getDes()) + " */" + " private " + type + " " + des.getName() + ";"; System.out.println(a); @@ -50,6 +52,41 @@ public class ParseTaxApi { } + public static void readExcel2(String path) { + try { + // 获取文件输入流 + InputStream inputStream = new FileInputStream(path); + + List apiDesList = ExcelParseHelper.parse2Map(inputStream, ApiReturnDes.class, 0, 1, 4, "ApiDes.xlsx"); + + /** + * 字段名称 字段含义 字段类型 必填 说明 + * qtzzlx 其他证件类型 String(64) 条件必填 见证件类型字典 + * + * private String qtzzlx; + */ + + apiDesList.forEach(des -> { + String type = des.getType(); + if (StringUtils.isNotEmpty(type)) { + if (type.startsWith("String")) { + type = "String"; + } + } + + String a = "/** * " + + des.getMean() + + " " + (des.getDes() == null ? "" : des.getDes()) + + " */" + " private " + type + " " + des.getName() + ";"; + System.out.println(a); + + }); + + + } catch (Exception e) { + e.printStackTrace(); + } + } } From 009a3e3c7441e6f30db60b2f000f9f17b7f1fe05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Dec 2023 16:37:42 +0800 Subject: [PATCH 081/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=20=E4=BF=AE=E5=A4=8D=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E7=A6=BB=E8=81=8C=E6=97=A5=E6=9C=9Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/EmployeeDeclareExcelService.java | 54 ++ .../impl/EmployeeDeclareExcelServiceImpl.java | 649 ++++++++++++++++++ .../impl/EmployeeDeclareServiceImpl.java | 6 +- .../salary/web/EmployeeDeclareController.java | 53 +- .../wrapper/EmployeeDeclareWrapper.java | 42 +- 5 files changed, 766 insertions(+), 38 deletions(-) create mode 100644 src/com/engine/salary/service/EmployeeDeclareExcelService.java create mode 100644 src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java diff --git a/src/com/engine/salary/service/EmployeeDeclareExcelService.java b/src/com/engine/salary/service/EmployeeDeclareExcelService.java new file mode 100644 index 000000000..6b0f75775 --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareExcelService.java @@ -0,0 +1,54 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * @description: 人员报送(人员)导入导出 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/5/22 10:22 AM + * @version:v1.0 + */ +public interface EmployeeDeclareExcelService { + + /** + * 导出下载模板 + * + * @param importParam + * @return + */ +// Map exportTemplate(EmployeeDeclareImportParam importParam); + + /** + * 导出人员信息采集-全部 + * + * @param queryParam + * @return + */ + XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam); + +// /** +// * 导出人员信息采集-本月新增 +// * +// * @param queryParam +// * @return +// */ +// XSSFWorkbook export4Add(EmployeeDeclareAddListQueryParam queryParam); +// +// /** +// * 导出人员信息采集-本月信息变动 +// * +// * @param queryParam +// * @return +// */ +// XSSFWorkbook export4Update(EmployeeDeclareListQueryParam queryParam); +// +// /** +// * 导出人员信息采集-本月报送失败 +// * +// * @param queryParam +// * @return +// */ +// XSSFWorkbook export4Fail(EmployeeDeclareFailListQueryParam queryParam); +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java new file mode 100644 index 000000000..bdf2bfb67 --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -0,0 +1,649 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.service.EmployeeDeclareExcelService; +import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.excel.ExcelUtil; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.User; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @description: 人员报送(人员)导入导出 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/7/22 5:39 PM + * @version:v1.0 + */ +@Slf4j +public class EmployeeDeclareExcelServiceImpl extends Service implements EmployeeDeclareExcelService { + + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } +// private ExtEmployeeService extEmployeeService; + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + +// @Override +// public Map exportTemplate( EmployeeDeclareImportParam importParam) { +// String tenantKey = simpleEmployee.getTenantKey(); +// Long currentEmployeeId = simpleEmployee.getEmployeeId(); +// // 查询人员 +// List employeeDeclares = Collections.emptyList(); +// if (StringUtils.equalsIgnoreCase(importParam.getExportData(), "true")) { +// employeeDeclares = getEmployeeDeclareService(user).listByParam(importParam); +// } +// String yesI18 = SalaryI18nUtil.getI18nLabel( 84967, "是"); +// String noI18 = SalaryI18nUtil.getI18nLabel( 84968, "否"); +// List> rows = Lists.newArrayList(); +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); +// EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); +// List row = Lists.newArrayList(); +// row.add(employeeDeclare.getJobNum()); +// row.add(employeeDeclare.getEmployeeName()); +// row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); +// row.add(employeeDeclare.getCardNum()); +// row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); +// row.add(employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); +// row.add(employeeDeclare.getEmploymentFirstYear()); +// row.add(employeeDeclare.getMobile()); +// row.add(Util.null2String(employeeDeclare.getEmploymentDate())); +// row.add(Util.null2String(employeeDeclare.getDismissDate())); +// row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); +// row.add(employeeDeclare.getDisabilityCardNo()); +// row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); +// row.add(employeeDeclare.getMartyrDependentsCardNo()); +// row.add(Objects.equals(employeeDeclare.getLonelyOld(), 1) ? yesI18 : noI18); +// row.add(Objects.equals(employeeDeclare.getDeductExpenses(), 1) ? yesI18 : noI18); +// rows.add(row); +// } +// // 组装excel导出数据 +// String[] headers = getImportHeader(currentEmployeeId, tenantKey).toArray(new String[0]); +// ExcelSheetData excelSheetData = new ExcelSheetData(); +// excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel( 156425, "人员信息采集")); +// excelSheetData.setHeaders(Collections.singletonList(headers)); +// excelSheetData.setRows(rows); +// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() +// .fileName(SalaryI18nUtil.getI18nLabel( 156424, "人员信息采集导入模板") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) +// .dataType(SalaryI18nUtil.getI18nLabel( 156424, "人员信息采集导入模板")) +// .function(excelExportParam.getFunction()) +// .handlerName("exportEmployeeDeclareTemplate") +// .flag(true) +// .bizId(excelExportParam.getBiz()) +// .module(excelExportParam.getModule()) +// .userId(simpleEmployee.getEmployeeId()) +// .tenantKey(simpleEmployee.getTenantKey()) +// .operator(simpleEmployee.getUsername()) +// .eteamsId(TenantRpcContext.getEteamsId()) +// .build(); +// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); +// } +// +// @BatchExportHandler("exportEmployeeDeclareTemplate") +// private void exportEmployeeDeclareTemplate() { +// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); +// log.info("导出结束:{}", JsonUtil.toJsonString(message)); +// } + + @Override + public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { + // 查询需要报送的人员 + List employeeDeclares = getEmployeeDeclareService(user).listByParam(queryParam); + // 转换成dto + List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); + // 需要导出的数据 + List> excelSheetData = getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); + + return ExcelUtil.genWorkbookV2(excelSheetData, "人员信息采集"); + } + +// @Override +// public XSSFWorkbook export4Add(EmployeeDeclareAddListQueryParam queryParam) { +// String tenantKey = simpleEmployee.getTenantKey(); +// Long currentEmployeeId = simpleEmployee.getEmployeeId(); +// // 查询需要报送的人员 +// List employeeDeclares = getEmployeeDeclareService(user).list4AddByParam(queryParam); +// // 转换成dto +// List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); +// // 需要导出的数据 +// ExcelSheetData excelSheetData = getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); +// CustomExportUtil.customColumnsBuild(false, queryParam.getCustomColumns(), excelSheetData); +// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() +// .fileName(SalaryI18nUtil.getI18nLabel(156426, "人员信息采集本月新增") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) +// .dataType(SalaryI18nUtil.getI18nLabel(156426, "人员信息采集本月新增")) +// .function(excelExportParam.getFunction()) +// .handlerName("exportEmployeeDeclare4Add") +// .flag(true) +// .bizId(excelExportParam.getBiz()) +// .module(excelExportParam.getModule()) +// .userId(simpleEmployee.getEmployeeId()) +// .tenantKey(simpleEmployee.getTenantKey()) +// .operator(simpleEmployee.getUsername()) +// .eteamsId(TenantRpcContext.getEteamsId()) +// .build(); +// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); +// } +// +// @BatchExportHandler("exportEmployeeDeclare4Add") +// private void exportEmployeeDeclare4Add() { +// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); +// log.info("导出结束:{}", JsonUtil.toJsonString(message)); +// } +// +// @Override +// public XSSFWorkbook export4Update(EmployeeDeclareListQueryParam queryParam) { +// String tenantKey = simpleEmployee.getTenantKey(); +// Long currentEmployeeId = simpleEmployee.getEmployeeId(); +// // 查询需要报送的人员 +// List employeeDeclares = getEmployeeDeclareService(user).list4UpdateByParam(queryParam); +// // 转换成dto +// List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); +// // 需要导出的数据 +// ExcelSheetData excelSheetData = getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); +// CustomExportUtil.customColumnsBuild(false, queryParam.getCustomColumns(), excelSheetData); +// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() +// .fileName(SalaryI18nUtil.getI18nLabel(156427, "人员信息采集本月信息变动") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) +// .dataType(SalaryI18nUtil.getI18nLabel(156427, "人员信息采集本月信息变动")) +// .function(excelExportParam.getFunction()) +// .handlerName("exportEmployeeDeclare4Update") +// .flag(true) +// .bizId(excelExportParam.getBiz()) +// .module(excelExportParam.getModule()) +// .userId(simpleEmployee.getEmployeeId()) +// .tenantKey(simpleEmployee.getTenantKey()) +// .operator(simpleEmployee.getUsername()) +// .eteamsId(TenantRpcContext.getEteamsId()) +// .build(); +// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); +// } +// +// @BatchExportHandler("exportEmployeeDeclare4Update") +// private void exportEmployeeDeclare4Update() { +// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); +// log.info("导出结束:{}", JsonUtil.toJsonString(message)); +// } +// +// @Override +// public XSSFWorkbook export4Fail(EmployeeDeclareFailListQueryParam queryParam) { +// String tenantKey = simpleEmployee.getTenantKey(); +// Long currentEmployeeId = simpleEmployee.getEmployeeId(); +// // 查询需要报送的人员 +// List employeeDeclares = getEmployeeDeclareService(user).list4FailByParam(queryParam); +// // 转换成dto +// List dtos = getEmployeeDeclareService(user).convert2FailListDTO(employeeDeclares); +// // 需要导出的数据 +// ExcelSheetData excelSheetData = getExcelSheetData(EmployeeDeclareFailListDTO.class, dtos); +// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() +// .fileName(SalaryI18nUtil.getI18nLabel(156428, "人员信息采集本月报送失败") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) +// .dataType(SalaryI18nUtil.getI18nLabel(156428, "人员信息采集本月报送失败")) +// .function(excelExportParam.getFunction()) +// .handlerName("exportEmployeeDeclare4Fail") +// .flag(true) +// .bizId(excelExportParam.getBiz()) +// .module(excelExportParam.getModule()) +// .userId(simpleEmployee.getEmployeeId()) +// .tenantKey(simpleEmployee.getTenantKey()) +// .operator(simpleEmployee.getUsername()) +// .eteamsId(TenantRpcContext.getEteamsId()) +// .build(); +// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); +// } + + + private List> getExcelSheetData(Class clazz, List dtoList) { + // 导出的表头 + Map> headerMap = getHeader(clazz); + // 导出的数据 + List> rows = new ArrayList<>(); + rows.add(headerMap.get("header")); + dtoList.forEach(dto -> { + Map map = JsonUtil.parseMap(dto, Object.class); + List row = Lists.newArrayListWithExpectedSize(headerMap.get("dataIndex").size()); + headerMap.get("dataIndex").forEach(dataIndex -> row.add(map.get(dataIndex))); + rows.add(row); + }); + return rows; + } +// +// @Transactional(rollbackFor = Exception.class) +// @BatchImportHandler("importEmployeeDeclare") +// public void importEmployeeDeclare() { +// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage(); +// Long employeeId = message.getUserId(); +// String tenantKey = message.getTenantKey(); +// try { +// LocalDateTime now = LocalDateTime.now(); +// Map paramMap = JsonUtil.parseMap(message.getUploadSet().getCustomData(), Object.class); +// // 个税扣缴义务人id +// Long taxAgentId = Util.getLongValue(Util.null2String(paramMap.get("taxAgentId"))); +// TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId, employeeId, tenantKey); +// if (taxAgent == null) { +// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 187469, "参数错误,无法找到个税扣缴义务人")); +// return; +// } +// // 税款所属期 +// String taxCycle = Util.null2String(paramMap.get("taxCycle")); +// if (!SalaryDateUtil.checkYearMonth(taxCycle)) { +// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 156384, "参数错误,税款所属期参数格式错误")); +// return; +// } +// +// // 导出模板中的表头 +// List headerList = getImportHeader(employeeId, tenantKey); +// // 查询所有的人员 +// List orgEmployeeIds = hrmCommonEmployeeService.getAllEmployee(tenantKey); +// List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(orgEmployeeIds, tenantKey); +// // 查询所有的外部人员 +// List extEmployees = extEmployeeService.listAll(tenantKey); +// // 查询人员报送表的人员 +// List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(YearMonth.parse(taxCycle), +// taxAgentId, tenantKey); +// // 校验字段 +// String checkType = Util.null2String(paramMap.getOrDefault("checkType", "jobNum")); +// Map extEmployeeMap = Maps.newHashMap(); +// Map simpleEmployeeMap = Maps.newHashMap(); +// Map employeeDeclareMap = Maps.newHashMapWithExpectedSize(employeeDeclares.size()); +// if (Objects.equals(checkType, "jobNum")) { +// extEmployeeMap = Collections.emptyMap(); +// simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getJobNum); +// employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getJobNum); +// } else { +// // 查询所有人员的个人信息 +// List simpleUserInfos = getSalaryEmployeeService(user).listByEmployeeIds(orgEmployeeIds, tenantKey); +// Map idKeySimpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getId); +// for (SimpleUserInfo simpleUserInfo : simpleUserInfos) { +// if (idKeySimpleEmployeeMap.containsKey(simpleUserInfo.getEmployeeId())) { +// simpleEmployeeMap.put(simpleUserInfo.getIdNo(), idKeySimpleEmployeeMap.get(simpleUserInfo.getEmployeeId())); +// } +// } +// extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getCardNum); +// employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getCardNum); +// +// } +// // 需要新增的报送人员 +// List needAddEmployeeDeclares = Lists.newArrayList(); +// // 需要更新的报送人员 +// List needUpdateEmployeeDeclares = Lists.newArrayList(); +// // 索引(用于计算进度) +// int index = 0; +// // 失败的数量 +// int failCount = 0; +// // 成功的数量 +// int successCount = 0; +// // 错误行的索引 +// int failRowIndex = 1; +// // 包含错误提示信息的sheet页 +// List errorExcelSheets = Lists.newArrayList(); +// for (ExcelSheet excelSheet : message.getBatchFile().getExcelSheets()) { +// if (CollectionUtils.isEmpty(excelSheet.getHeader())) { +// continue; +// } +// // 表头 +// List headers = excelSheet.getHeader().stream() +// .map(m -> Util.null2String(m.get("key"))) +// .collect(Collectors.toList()); +// // 检查表头 +// boolean isCorrectHeader = checkHeader(message, headers, headerList); +// if (!isCorrectHeader) { +// return; +// } +// // 表头每一列的位置 +// Map columnIndexMap = Maps.newHashMap(); +// for (int i = 0; i < headers.size(); i++) { +// columnIndexMap.put(headers.get(i), i); +// } +// // 数据 +// List> data = excelSheet.getData(); +// if (CollectionUtils.isEmpty(data)) { +// continue; +// } +// // 错误提示信息 +// List excelComments = Lists.newArrayList(); +// // 存在错误的那行数据 +// List> errorData = Lists.newArrayList(); +// for (int i = 0; i < data.size(); i++) { +// Map map = data.get(i); +// // 数据是否存在错误 +// boolean isError = false; +// EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); +// for (String dataKey : getImportHeader(employeeId, tenantKey)) { +// Integer j = columnIndexMap.get(dataKey); +// String dataValue = Util.null2String(map.get(dataKey)); +// if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 86317, "工号"))) { +// if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 136250, "工号不能为空"), failRowIndex, failRowIndex, j, j); +// } +// employeeDeclareExcel.setJobNum(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 85429, "姓名"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 102838, "姓名不能为空"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmployeeName(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 105139, "证件类型"))) { +// employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 86318, "证件号码"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156386, "证件号码不能为空"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkIdNum(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156429, "证件号码格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setCardNum(dataValue); +// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue()); +// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue)); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156394, "人员状态"))) { +// boolean legalDataValue = false; +// for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { +// if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); +// break; +// } +// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156430, "人员状态只能填写正常或非正常"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156396, "任职受雇从业类型"))) { +// boolean legalDataValue = false; +// for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { +// if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); +// break; +// } +// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156431, "任职受雇从业类型填写错误"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 187374, "入职年度就业情形"))) { +// employeeDeclareExcel.setEmploymentFirstYear(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 98621, "手机号码"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 106429, "手机号码不能为空"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkMobile(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160510, "手机号码格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setMobile(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156409, "任职受雇从业日期"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160511, "任职受雇从业类型不为「其他」时,任职受雇从业日期为必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156432, "日期格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 95228, "离职日期"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160512, "人员状态为非正常时,离职日期必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156432, "日期格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156399, "是否残疾"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156433, "是否残疾只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156412, "残疾证号"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160513, "「是否残疾」填「是」时,残疾证号必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setDisabilityCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 187385, "是否烈属"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156433, "是否烈属只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156413, "烈属证号"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160514, "「是否烈属」填「是」时,烈属证号必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156400, "是否孤老"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156434, "是否孤老只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156402, "是否扣除减除费用"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156435, "是否扣除减除费用只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } +// } +// if (!isError) { +// if (StringUtils.equals(checkType, "jobNum")) { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String jobNumI18 = SalaryI18nUtil.getI18nLabel(employeeId, 86317, "工号"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156436, "系统内的人员不存在该工号"), failRowIndex, failRowIndex, headers.indexOf(jobNumI18), headers.indexOf(jobNumI18)); +// } else { +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId, tenantKey)); +// } +// } else { +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); +// } +// } +// } else { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String cardNoI18 = SalaryI18nUtil.getI18nLabel(employeeId, 86318, "证件号码"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156437, "系统内的人员不存在该证件号码"), failRowIndex, failRowIndex, headers.indexOf(cardNoI18), headers.indexOf(cardNoI18)); +// } else { +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId, tenantKey)); +// } +// } else { +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); +// } +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// } +// } +// } +// if (isError) { +// failCount++; +// failRowIndex++; +// errorData.add(map); +// continue; +// } +// successCount++; +// } +// // 如果sheet包含错误数据 +// if (CollectionUtils.isNotEmpty(errorData)) { +// salaryBatchService.createErrorExcelSheet(excelSheet.getHeader(), errorData, excelSheet.getName(), excelComments, errorExcelSheets); +// } +// } +// if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { +// getEmployeeDeclareService(user).saveBatch(needAddEmployeeDeclares); +// } +// if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { +// getEmployeeDeclareService(user).updateBatchById(needUpdateEmployeeDeclares); +// } +// // 发送导入回调信息 +// salaryBatchService.sendImportCallBackInfo(message, successCount, failCount, errorExcelSheets); +// } catch (Exception e) { +// log.error("人员报送信息导入失败:{}", e.getMessage(), e); +// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 156438, "人员报送信息导入失败:") + e.getMessage()); +// } +// } +// +// private EmployeeDeclarePO buildEmployeeDeclare(ExtEmployeePO extEmployee, +// EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, +// String taxCycle, LocalDateTime now, Long employeeId, String tenantKey) { +// EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() +// .setId(IdGenerator.generate()) +// .setTaxAgentId(taxAgentId) +// .setTaxCycle(taxCycle) +// .setTenantKey(tenantKey) +// .setCreator(employeeId) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// BeanUtils.copyProperties(employeeDeclareExcel, employeeDeclare); +// if (extEmployee != null) { +// employeeDeclare.setEmployeeId(extEmployee.getId()) +// .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()); +// } +// if (simpleEmployee != null) { +// employeeDeclare.setEmployeeId(simpleEmployee.getEmployeeId()) +// .setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); +// } +// return employeeDeclare; +// } +// +// private List getImportHeader(Long employeeId, String tenantKey) { +// return Lists.newArrayList( +// SalaryI18nUtil.getI18nLabel(employeeId, 86317, "工号"), +// SalaryI18nUtil.getI18nLabel(employeeId, 85429, "姓名"), +// SalaryI18nUtil.getI18nLabel(employeeId, 105139, "证件类型"), +// SalaryI18nUtil.getI18nLabel(employeeId, 86318, "证件号码"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156394, "人员状态"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156396, "任职受雇从业类型"), +// SalaryI18nUtil.getI18nLabel(employeeId, 187374, "入职年度就业情形"), +// SalaryI18nUtil.getI18nLabel(employeeId, 98621, "手机号码"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156409, "任职受雇从业日期"), +// SalaryI18nUtil.getI18nLabel(employeeId, 95228, "离职日期"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156399, "是否残疾"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156412, "残疾证号"), +// SalaryI18nUtil.getI18nLabel(employeeId, 187385, "是否烈属"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156413, "烈属证号"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156400, "是否孤老"), +// SalaryI18nUtil.getI18nLabel(employeeId, 156402, "是否扣除减除费用")); +// } + + private Map> getHeader(Class clazz) { + Map> headerMap = new HashMap<>(); + // 导出的表头 + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + Field[] declaredFields = clazz.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { + continue; + } + SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); + headerList.add(annotation.text()); + dataIndexList.add(annotation.column()); + } + headerMap.put("header", headerList); + headerMap.put("dataIndex", dataIndexList); + return headerMap; + } + +// /** +// * 检查表头 +// * +// * @param message +// * @param headers +// * @return +// */ +// private boolean checkHeader(BatchDocumentMessage message, List headers, List headerList) { +// Long employeeId = message.getUserId(); +// String tenantKey = message.getTenantKey(); +// // 缺少的列 +// List lackHeaders = headerList.stream() +// .filter(header -> !headers.contains(header)) +// .collect(Collectors.toList()); +// if (CollectionUtils.isNotEmpty(lackHeaders)) { +// // 发送导入回调信息 +// String errorMsg = SalaryI18nUtil.getI18nLabel(employeeId, 101850, "缺少如下列,请检查:") + Joiner.on(",").join(lackHeaders); +// salaryBatchService.sendImportCallBackInfo(message, errorMsg); +// return false; +// } +// return true; +// } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index fbb34e775..32bf9a06b 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -244,8 +244,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setId(originEmployeeDeclare.getId()); employeeDeclare.setEmployeeId(originEmployeeDeclare.getEmployeeId()); employeeDeclare.setEmployeeType(originEmployeeDeclare.getEmployeeType()); - employeeDeclare.setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()); + employeeDeclare.setTenantKey(originEmployeeDeclare.getTenantKey()); + employeeDeclare.setCreator(originEmployeeDeclare.getCreator()); + employeeDeclare.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + employeeDeclare.setCreateTime(originEmployeeDeclare.getCreateTime()); employeeDeclare.setUpdateTime(now); + employeeDeclare.setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()); // 判断本次编辑是否有修改人员信息 if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { employeeDeclare.setNewEmployeeInfo(1); diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 420863bbb..d63e336be 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -11,6 +11,8 @@ import com.engine.salary.util.ResponseResult; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.EmployeeDeclareWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -19,6 +21,11 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.time.LocalDate; import java.util.Collection; import java.util.Map; @@ -30,6 +37,7 @@ import java.util.Map; * @author qiantao * @version 1.0 **/ +@Slf4j public class EmployeeDeclareController { private EmployeeDeclareWrapper getEmployeeDeclareWrapper(User user) { @@ -263,19 +271,38 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getCompanyEmployee, param); } -// /** -// * 人员报送-导出全部人员 -// * -// * @param queryParam 导出参数 -// * @return -// */ -// @POST -// @Path("/export") -// @Produces(MediaType.APPLICATION_JSON) -// public String export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { -// Map exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser()); -// return WeaResult.success(exportMap); -// } + /** + * 人员报送-导出全部人员 + * + * @param queryParam 导出参数 + * @return + */ + @POST + @Path("/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(queryParam); + 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; + } + } // /** // * 人员报送-导出本月新增人员 diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 5a5b907f7..5c8fb6c19 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -5,7 +5,6 @@ import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; -import com.engine.salary.remote.tax.client.EmployeeClient; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; @@ -17,6 +16,7 @@ import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.client.EmployeeClient; import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; @@ -35,6 +35,7 @@ import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; import java.util.*; @@ -71,6 +72,12 @@ public class EmployeeDeclareWrapper extends Service { return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); } + private EmployeeDeclareExcelService employeeDeclareExcelService; + + private EmployeeDeclareExcelService getEmployeeDeclareExcelService(User user) { + return ServiceUtil.getService(EmployeeDeclareExcelServiceImpl.class, user); + } + /** * 人员报送的个税扣缴义务人列表 * @@ -547,32 +554,19 @@ public class EmployeeDeclareWrapper extends Service { GetCompanyEmployeeResponse companyEmployee = employeeClient.getCompanyEmployee(param); - return companyEmployee; } -// /** -// * 人员报送-导出本月全部的人员 -// * -// * @param queryParam -// * @param simpleEmployee -// * @return -// */ -// public Map export(EmployeeDeclareListQueryParam queryParam, SimpleEmployee simpleEmployee) { -// ExcelExportParam excelExportParam = new ExcelExportParam() -// .setBiz(String.valueOf(IdGenerator.generate())) -// .setModule(EntityType.hrmsalary.name()) -// .setFunction("exportEmployeeDeclare"); -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// employeeDeclareExcelService.export(excelExportParam, queryParam, simpleEmployee); -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare", localRunnable); -// return JsonUtil.parseMap(excelExportParam, Object.class); -// } -// + /** + * 人员报送-导出本月全部的人员 + * + * @param queryParam + * @return + */ + public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { + return getEmployeeDeclareExcelService(user).export(queryParam); + } + // /** // * 人员报送-导出本月新增的人员 // * From 48f5d5ab0ea4246925f66a07aa4bf53e2295e7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 7 Dec 2023 15:48:06 +0800 Subject: [PATCH 082/298] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=88=86=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E4=BC=81=E4=B8=9A=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/taxagent/bo/TaxAgentTaxReturnBO.java | 4 ++-- .../AbstractTaxAgentTaxReturnCheckService.java | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java index fab88eda0..b14674d76 100644 --- a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -96,8 +96,8 @@ public class TaxAgentTaxReturnBO { requestMap.put("djxhid", taxAgentTaxReturn.getTaxRegistrationNumber()); requestMap.put("nsrsbh", taxAgentTaxReturn.getTaxCode()); requestMap.put("areaid", taxAgentTaxReturn.getAreaCode()); - requestMap.put("bmbh", ""); - requestMap.put("bmmc", ""); + requestMap.put("bmbh", taxAgentTaxReturn.getDepartmentCode()); + requestMap.put("bmmc", taxAgentTaxReturn.getDepartmentName()); return requestMap; } diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java index 296100b7a..f5d2422e6 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -134,7 +134,21 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl for (int i = 1; i <= registerInfos.size(); i++) { CompanyRegisterInfoResponse.CompanyRegisterInfo registerInfo = registerInfos.get(i - 1); SalaryAssert.notNull(registerInfo.getFbmba(), "税局接口异常,请稍后重试"); - TaxAgentTaxReturnCheckFormDTO checkFormDTO = TaxAgentTaxReturnCheckFormDTO.builder().taxAgentName(registerInfo.getQymc()).taxAgentId(saveParam.getTaxAgentId()).taxCode(saveParam.getTaxCode()).businessAddress(registerInfo.getScjydz()).legalPersonName(registerInfo.getFrxm()).mobile(registerInfo.getLxdh()).industryName(registerInfo.getHymc()).taxAuthorities(registerInfo.getZgswjgmc()).taxBranch(registerInfo.getZgswjgskmc()).taxRegistrationNumber(registerInfo.getDjxhid()).divideFiling(SalaryOnOffEnum.parseByValue(Integer.parseInt(registerInfo.getFbmba()))).index((long) i).build(); + TaxAgentTaxReturnCheckFormDTO checkFormDTO = TaxAgentTaxReturnCheckFormDTO + .builder() + .taxAgentName(registerInfo.getQymc()) + .taxAgentId(saveParam.getTaxAgentId()) + .taxCode(saveParam.getTaxCode()) + .businessAddress(registerInfo.getScjydz()) + .legalPersonName(registerInfo.getFrxm()) + .mobile(registerInfo.getLxdh()) + .industryName(registerInfo.getHymc()) + .taxAuthorities(registerInfo.getZgswjgmc()) + .taxBranch(registerInfo.getZgswjgskmc()) + .taxRegistrationNumber(registerInfo.getDjxhid()) + .divideFiling(SalaryOnOffEnum.parseByValue(Integer.parseInt(registerInfo.getFbmba()))) + .index((long) i) + .build(); checkFormDTOList.add(checkFormDTO); } return checkFormDTOList; From 82ec08bfd905d965d108899398f40b07df9476c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 8 Dec 2023 18:15:56 +0800 Subject: [PATCH 083/298] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../remote/tax/client/DeclareClient.java | 11 +- .../GetDeclareTaxResultFeedbackResponse.java | 940 ++++++++++-------- .../service/TaxDeclareRecordService.java | 2 + .../impl/EmployeeDeclareExcelServiceImpl.java | 42 +- .../impl/TaxDeclareRecordServiceImpl.java | 20 +- .../engine/salary/util/excel/ExcelUtil.java | 42 +- .../salary/web/TaxDeclarationController.java | 41 +- .../wrapper/TaxDeclareRecordWrapper.java | 6 + 8 files changed, 628 insertions(+), 476 deletions(-) diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index bcd390856..bd7a500da 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -1,7 +1,10 @@ package com.engine.salary.remote.tax.client; +import com.engine.salary.remote.tax.response.employee.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; @@ -15,6 +18,7 @@ import java.util.Map; * @author qiantao * @version 1.0 **/ +@Slf4j public class DeclareClient extends TaxBaseClient{ public DeclareClient(Long taxAgentId) { super(taxAgentId); @@ -25,7 +29,7 @@ public class DeclareClient extends TaxBaseClient{ * @param requestId· * @return */ - public Object getDeclareTaxResultFeedback(String requestId){ + public GetDeclareTaxResultFeedbackResponse getDeclareTaxResultFeedback(String requestId){ // 供应商信息 String url = super.apiConfig.getHost() + "/gateway/iit/report/getDeclareTaxResultFeedback"; Map params = new HashMap<>(1); @@ -33,9 +37,8 @@ public class DeclareClient extends TaxBaseClient{ Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, params); - - - return res; + log.info("getDeclareTaxResultFeedback res --- {}", res); + return JsonUtil.parseObject(res, GetDeclareTaxResultFeedbackResponse.class); } diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java index 45e773ab0..47f9c42fe 100644 --- a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -1,37 +1,51 @@ package com.engine.salary.remote.tax.response.employee; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; +import lombok.EqualsAndHashCode; + import java.math.BigDecimal; import java.util.List; -public class GetDeclareTaxResultFeedbackResponse { +@Data +@EqualsAndHashCode(callSuper = true) +public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** - * 企业名称 必填:是 + * 返回数据 */ - private String qymc; - /** - * 税号 必填:是 - */ - private String nsrsbh; - /** - * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码 - */ - private String areaid; - /** - * 部门编号 必填:是 - */ - private String bmbh; - /** - * 部门名称 必填:否 - */ - private String bmmc; - /** - * 算税月份 必填:是 - */ - private String skssq; - /** - * 综合所得 必填:是 见综合所得计算结果 - */ - private zhsd zhsd; + 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; // /** // * 分类所得 必填:是 见分类所得计算结果 // */ @@ -49,16 +63,16 @@ public class GetDeclareTaxResultFeedbackResponse { // */ // private 数组 rysbsblb; - - public class zhsd { - /** - * 人员代代报失败列表 参考人员代报结果对象 - */ - private List rysbsblb; - /** - * 正常工资薪金算税结果对象 参考综合所得算税结果对象 - */ - private zcgzxj zcgzxj; + @Data + public static class zhsd { + /** + * 人员代代报失败列表 参考人员代报结果对象 + */ + private List rysbsblb; + /** + * 正常工资薪金算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj zcgzxj; // /** // * 全年一次性奖金收入算税结果对象 参考综合所得算税结果对象 // */ @@ -121,393 +135,17 @@ public class GetDeclareTaxResultFeedbackResponse { // private 对象 flyzlwbclb; - /** - * 人员代报结果对象 - */ - public class rydbjgdx { /** - * 姓名 + * 人员代报结果对象 */ - 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; - } - - - /** - * 综合所得算税结果对象 - */ - public class zcgzxj { - /** - * 综合算税成功列表 参考综合所得输出结果报文 - */ - private List sscglb; - /** - * 综合算税失败列表 参考综合所得输出结果报文 - */ - private List sssblb; - /** - * 综合算税失败原因列表 参考算税失败原因对象 - */ - private List sssbyylb; - /** - * 参与综合算税总人数 - */ - private int sszrs; - /** - * 综合算税失败总人数 - */ - private int sssbrs; - /** - * 年金上限 - */ - private BigDecimal njsx; - /** - * 住房公积金上限 - */ - private BigDecimal zfgjjsx; - /** - * 年平均工资 - */ - private BigDecimal npjgz; - /** - * 企业上月是否已申报 0:上月未申报 1:上月已申报 2:上上月未申报 - */ - private String qysysfysb; - /** - * 专项代报状态 - */ - private String clzt; - /** - * 专项代报结果原因 - */ - private String cljgms; - - - /** - * 综合所得输出结果报文 - */ - public class zhsdscjgbw { + @Data + public static class rydbjgdx { /** - * 是否明细申报 必填:否 是或者否 - */ - private String sfmxsb; - /** - * 姓名 必填:null 如果是汇总申报返回空 + * 姓名 */ private String xm; /** - * 证件类型 必填:null 见证件类型字典 - */ - private String zzlx; - /** - * 证件号码 必填:null 如果是汇总申报返回空 - */ - private String zzhm; - /** - * 任职受雇日期 必填:是 格式YYYY-MM-DD - */ - private String rzsgrq; - /** - * 离职日期 必填:否 格式YYYY-MM-DD - */ - private String lzrq; - /** - * 当期收入额 必填:是 不填写默认为0 - */ - private BigDecimal sre; - /** - * 当期免税收入 必填:null - */ - private BigDecimal mssd; - /** - * 基本养老保险 必填:null - */ - private BigDecimal jbylaobxf; - /** - * 基本医疗保险 必填:null - */ - private BigDecimal jbylbxf; - /** - * 失业保险 必填:null - */ - private BigDecimal sybxf; - /** - * 住房公积金 必填:null - */ - private BigDecimal zfgjj; - /** - * 子女教育支出 必填:null - */ - private BigDecimal znjyzc; - /** - * 赡养老人支出 必填:null - */ - private BigDecimal sylrzc; - /** - * 住房贷款利息支出 必填:null - */ - private BigDecimal zfdklxzc; - /** - * 住房租金支出 必填:null - */ - private BigDecimal zfzjzc; - /** - * 继续教育支出 必填:null - */ - private BigDecimal jxjyzc; - /** - * 非学历继续教育支出 必填:null - */ - private BigDecimal fxljxjyzc; - /** - * 3岁以下婴幼儿照护支出 必填:null - */ - private BigDecimal yyezhzc; - /** - * 年金 必填:null - */ - private BigDecimal nj; - /** - * 商业健康保险 必填:null - */ - private BigDecimal syjkbx; - /** - * 税延养老保险 必填:null - */ - private BigDecimal syylbx; - /** - * 其他 必填:null 按法律规定可以在税前扣除的项目 - */ - private BigDecimal qt; - /** - * 准予扣除的捐赠额 必填:null - */ - private BigDecimal zykcjze; - /** - * 减免税额 必填:null - */ - private BigDecimal jmse; - /** - * 备注 必填:null - */ - private String bz; - /** - * 减除费用 必填:null 正常工资薪金的减除费用。 对应保险营销员、证券经纪人的费用 - */ - private BigDecimal jcfy; - /** - * 其他扣除合计 必填:null - */ - private BigDecimal qtckhj; - /** - * 应纳税所得额 必填:null 正常工资薪金返回Null - */ - private BigDecimal ynssde; - /** - * 应纳税额 必填:null 正常工资薪金返回Null - */ - private BigDecimal ynse; - /** - * 已缴税额 必填:null 正常工资薪金返回Null - */ - private BigDecimal ykjse; - /** - * 应扣缴税额 必填:null 正常工资薪金返回Null - */ - private BigDecimal yingkjse; - /** - * 税率 必填:null - */ - private BigDecimal sl; - /** - * 速算扣除数 必填:null - */ - private BigDecimal sskcs; - /** - * 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬 - */ - private String sdxm; - /** - * 应补退税额 必填:null 应补退税额=累计应扣缴税额-累计已缴税额 - */ - private BigDecimal ybtse; - /** - * 累计收入额 必填:null - */ - private BigDecimal ljsre; - /** - * 累计免税收入额 必填:null - */ - private BigDecimal ljmssd; - /** - * 累计专项扣除额 必填:null 三险一金合计 - */ - private BigDecimal ljzxkce; - /** - * 累计专项附加扣除额 必填:null 专项附加合计 - */ - private BigDecimal ljzxfjkce; - /** - * 累计其他扣除额 必填:null - */ - private BigDecimal ljqtkce; - /** - * 累计减免税额 必填:null - */ - private BigDecimal ljjmse; - /** - * 累计减除费用额 必填:null 正常工资薪金累计减除费用 对应保险营销员、证券经纪人累计费用 - */ - private BigDecimal ljjcfye; - /** - * 累计月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 - */ - private BigDecimal ljyjcfy; - /** - * 允许扣除税费 必填:null 保险营销员、证券经纪人 - */ - private BigDecimal yxkcsf; - /** - * 展业成本 必填:null 保险营销员、证券经纪人 - */ - private BigDecimal zycb; - /** - * 月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 - */ - private BigDecimal yjcfy; - /** - * 累计应纳税所得额 必填:null - */ - private BigDecimal ljynssde; - /** - * 累计应纳税额 必填:null - */ - private BigDecimal ljynse; - /** - * 累计应扣缴税额 必填:null 累计应扣缴税额 = 累计应纳税额 - 累计减免税额 - */ - private BigDecimal ljyingkjse; - /** - * 累计已缴税额 必填:null - */ - private BigDecimal ljykjse; - /** - * 累计子女教育支出 必填:null - */ - private BigDecimal ljznjyzc; - /** - * 累计继续教育支出 必填:null - */ - private BigDecimal ljjxjyzc; - /** - * 累计非学历继续教育支持 必填:null - */ - private BigDecimal ljfxljxjyzc; - /** - * 累计学历继续教育支持 必填:null - */ - private BigDecimal ljxljxjyzc; - /** - * 累计住房租金支出 必填:null - */ - private BigDecimal ljzfzjzc; - /** - * 累计房屋贷款支出 必填:null - */ - private BigDecimal ljzfdklxzc; - /** - * 累计赡养老人支出 必填:null - */ - private BigDecimal ljsylrzc; - /** - * 累计3岁以下婴幼儿照护支出 必填:null - */ - private BigDecimal ljyyezhzc; - /** - * 累计准予扣除的捐赠额 必填:null - */ - private BigDecimal ljzykcjze; - /** - * 累计个人养老金 必填:null - */ - private BigDecimal ljgrylj; - /** - * 累计个人养老金校验码 必填:null - */ - private String ljgryljjym; - /** - * 企业上月是否已申报 必填:null 仅在两个月算税场景时使用,当前月分为N月: - * 0表示N-1月(上月)未申报 - * 1表示N-1月(上月)已申报 - * 2表示N-2月(上上个月)未申报 - */ - private String qysysfysb; - /** - * 员工在税局累计已扣缴的税额 必填:null 当前月分为N,如果N-1(上月)已申报,则返回N-1月员工在税局累计已扣缴的税额; - * 如果N-1月未申报,则返回N-2月工在税局累计已扣缴的税额; - */ - private BigDecimal ygzsjljykjse; - - /** - * 本月已累计扣除税额 必填:null 针对一月多次算税的场景字段 - */ - private BigDecimal byyljkjse; - /** - * 本次应扣缴税额 必填:null 针对一月多次算税的场景字段,本次应扣缴税额=本月应扣缴税额-本月已累计税额 - */ - private BigDecimal bcykjse; - /** - * 分摊年度数 必填:null - */ - private Integer ftnds; - /** - * 年减除费用 必填:null 默认为60000 - */ - private BigDecimal njcfy; - - } - - /** - * 4.4.1.3.2算税失败原因对象 - */ - public class sssbyydx { - /** - * 人员ID - */ - private Integer ygid; - /** - * 人员名称 - */ - private String xm; - /** - * 证件类型 见证件类型字典 + * 证件类型名称 */ private String zzlx; /** @@ -515,21 +153,471 @@ public class GetDeclareTaxResultFeedbackResponse { */ private String zzhm; /** - * 错误码 + * 代报状态 1 待报送 2 代报中 3 代报失败 4 代报成功 */ - private String cwm; + private String sbzt; /** - * 错误信息 + * 人员认证状态 */ - private String cwxx; + private String rzzt; /** - * 所得税的code + * 失败原因 */ - private String sdxmdm; + private String sbyy; /** - * 所得税的名称 + * 专项代报状态 */ - private String sdxmmc; + private String clzt; + /** + * 专项代报结果原因 + */ + private String cljgms; + } + + + /** + * 综合所得算税结果对象 + */ + @Data + public static class zcgzxj { + /** + * 综合算税成功列表 参考综合所得输出结果报文 + */ + private List sscglb; + /** + * 综合算税失败列表 参考综合所得输出结果报文 + */ + private List sssblb; + /** + * 综合算税失败原因列表 参考算税失败原因对象 + */ + private List sssbyylb; + /** + * 参与综合算税总人数 + */ + private int sszrs; + /** + * 综合算税失败总人数 + */ + private int sssbrs; + /** + * 年金上限 + */ + private BigDecimal njsx; + /** + * 住房公积金上限 + */ + private BigDecimal zfgjjsx; + /** + * 年平均工资 + */ + private BigDecimal npjgz; + /** + * 企业上月是否已申报 0:上月未申报 1:上月已申报 2:上上月未申报 + */ + private String qysysfysb; + /** + * 专项代报状态 + */ + private String clzt; + /** + * 专项代报结果原因 + */ + private String cljgms; + + + /** + * 综合所得输出结果报文 + */ + @Data + public static class zhsdscjgbw { + /** + * 是否明细申报 必填:否 是或者否 + */ + @SalaryTableColumn(text = "是否明细申报", width = "10%", column = "sfmxsb") + private String sfmxsb; + /** + * 姓名 必填:null 如果是汇总申报返回空 + */ + @SalaryTableColumn(text = "姓名", width = "10%", column = "xm") + private String xm; + /** + * 证件类型 必填:null 见证件类型字典 + */ + @SalaryTableColumn(text = "证件类型", width = "10%", column = "zzlx") + private String zzlx; + /** + * 证件号码 必填:null 如果是汇总申报返回空 + */ + @SalaryTableColumn(text = "证件号码", width = "10%", column = "zzhm") + private String zzhm; + /** + * 任职受雇日期 必填:是 格式YYYY-MM-DD + */ + @SalaryTableColumn(text = "任职受雇日期", width = "10%", column = "rzsgrq") + private String rzsgrq; + /** + * 离职日期 必填:否 格式YYYY-MM-DD + */ + @SalaryTableColumn(text = "离职日期", width = "10%", column = "lzrq") + private String lzrq; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + @SalaryTableColumn(text = "当期收入额", width = "10%", column = "sre") + private BigDecimal sre; + /** + * 当期免税收入 必填:null + */ + @SalaryTableColumn(text = "当期免税收入", width = "10%", column = "mssd") + private BigDecimal mssd; + /** + * 基本养老保险 必填:null + */ + @SalaryTableColumn(text = "基本养老保险", width = "10%", column = "jbylaobxf") + private BigDecimal jbylaobxf; + /** + * 基本医疗保险 必填:null + */ + @SalaryTableColumn(text = "基本医疗保险", width = "10%", column = "jbylbxf") + private BigDecimal jbylbxf; + /** + * 失业保险 必填:null + */ + @SalaryTableColumn(text = "失业保险", width = "10%", column = "sybxf") + private BigDecimal sybxf; + /** + * 住房公积金 必填:null + */ + @SalaryTableColumn(text = "住房公积金", width = "10%", column = "zfgjj") + private BigDecimal zfgjj; + /** + * 子女教育支出 必填:null + */ + @SalaryTableColumn(text = "子女教育支出", width = "10%", column = "znjyzc") + private BigDecimal znjyzc; + /** + * 赡养老人支出 必填:null + */ + @SalaryTableColumn(text = "赡养老人支出", width = "10%", column = "sylrzc") + private BigDecimal sylrzc; + /** + * 住房贷款利息支出 必填:null + */ + @SalaryTableColumn(text = "住房贷款利息支出", width = "10%", column = "zfdklxzc") + private BigDecimal zfdklxzc; + /** + * 住房租金支出 必填:null + */ + @SalaryTableColumn(text = "住房租金支出", width = "10%", column = "zfzjzc") + private BigDecimal zfzjzc; + /** + * 继续教育支出 必填:null + */ + @SalaryTableColumn(text = "继续教育支出", width = "10%", column = "jxjyzc") + private BigDecimal jxjyzc; + /** + * 非学历继续教育支出 必填:null + */ + @SalaryTableColumn(text = "非学历继续教育支出", width = "10%", column = "fxljxjyzc") + private BigDecimal fxljxjyzc; + /** + * 3岁以下婴幼儿照护支出 必填:null + */ + @SalaryTableColumn(text = "3岁以下婴幼儿照护支出", width = "10%", column = "yyezhzc") + private BigDecimal yyezhzc; + /** + * 年金 必填:null + */ + @SalaryTableColumn(text = "年金", width = "10%", column = "nj") + private BigDecimal nj; + /** + * 商业健康保险 必填:null + */ + @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "syjkbx") + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:null + */ + @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "syylbx") + private BigDecimal syylbx; + /** + * 其他 必填:null 按法律规定可以在税前扣除的项目 + */ + @SalaryTableColumn(text = "其他", width = "10%", column = "qt") + private BigDecimal qt; + /** + * 准予扣除的捐赠额 必填:null + */ + @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "zykcjze") + private BigDecimal zykcjze; + /** + * 减免税额 必填:null + */ + @SalaryTableColumn(text = "减免税额", width = "10%", column = "jmse") + private BigDecimal jmse; + /** + * 备注 必填:null + */ + @SalaryTableColumn(text = "备注", width = "10%", column = "bz") + private String bz; + /** + * 减除费用 必填:null 正常工资薪金的减除费用。 对应保险营销员、证券经纪人的费用 + */ + @SalaryTableColumn(text = "减除费用", width = "10%", column = "jcfy") + private BigDecimal jcfy; + /** + * 其他扣除合计 必填:null + */ + @SalaryTableColumn(text = "其他扣除合计", width = "10%", column = "qtckhj") + private BigDecimal qtckhj; + /** + * 应纳税所得额 必填:null 正常工资薪金返回Null + */ + @SalaryTableColumn(text = "应纳税所得额", width = "10%", column = "ynssde") + private BigDecimal ynssde; + /** + * 应纳税额 必填:null 正常工资薪金返回Null + */ + @SalaryTableColumn(text = "应纳税额", width = "10%", column = "ynse") + private BigDecimal ynse; + /** + * 已缴税额 必填:null 正常工资薪金返回Null + */ + @SalaryTableColumn(text = "已缴税额", width = "10%", column = "ykjse") + private BigDecimal ykjse; + /** + * 应扣缴税额 必填:null 正常工资薪金返回Null + */ + @SalaryTableColumn(text = "应扣缴税额", width = "10%", column = "yingkjse") + private BigDecimal yingkjse; + /** + * 税率 必填:null + */ + @SalaryTableColumn(text = "税率", width = "10%", column = "sl") + private BigDecimal sl; + /** + * 速算扣除数 必填:null + */ + @SalaryTableColumn(text = "速算扣除数", width = "10%", column = "sskcs") + private BigDecimal sskcs; + /** + * 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬 + */ + @SalaryTableColumn(text = "所得项目名称", width = "10%", column = "sdxm") + private String sdxm; + /** + * 应补退税额 必填:null 应补退税额=累计应扣缴税额-累计已缴税额 + */ + @SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse") + private BigDecimal ybtse; + /** + * 累计收入额 必填:null + */ + @SalaryTableColumn(text = "累计收入额", width = "10%", column = "ljsre") + private BigDecimal ljsre; + /** + * 累计免税收入额 必填:null + */ + @SalaryTableColumn(text = "累计免税收入额", width = "10%", column = "ljmssd") + private BigDecimal ljmssd; + /** + * 累计专项扣除额 必填:null 三险一金合计 + */ + @SalaryTableColumn(text = "累计专项扣除额", width = "10%", column = "ljzxkce") + private BigDecimal ljzxkce; + /** + * 累计专项附加扣除额 必填:null 专项附加合计 + */ + @SalaryTableColumn(text = "累计专项附加扣除额", width = "10%", column = "ljzxfjkce") + private BigDecimal ljzxfjkce; + /** + * 累计其他扣除额 必填:null + */ + @SalaryTableColumn(text = "累计其他扣除额", width = "10%", column = "ljqtkce") + private BigDecimal ljqtkce; + /** + * 累计减免税额 必填:null + */ + @SalaryTableColumn(text = "累计减免税额", width = "10%", column = "ljjmse") + private BigDecimal ljjmse; + /** + * 累计减除费用额 必填:null 正常工资薪金累计减除费用 对应保险营销员、证券经纪人累计费用 + */ + @SalaryTableColumn(text = "累计减除费用额", width = "10%", column = "ljjcfye") + private BigDecimal ljjcfye; + /** + * 累计月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 + */ + @SalaryTableColumn(text = "累计月减除费用", width = "10%", column = "ljyjcfy") + private BigDecimal ljyjcfy; + /** + * 允许扣除税费 必填:null 保险营销员、证券经纪人 + */ + @SalaryTableColumn(text = "允许扣除税费", width = "10%", column = "yxkcsf") + private BigDecimal yxkcsf; + /** + * 展业成本 必填:null 保险营销员、证券经纪人 + */ + @SalaryTableColumn(text = "展业成本", width = "10%", column = "zycb") + private BigDecimal zycb; + /** + * 月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 + */ + @SalaryTableColumn(text = "月减除费用", width = "10%", column = "yjcfy") + private BigDecimal yjcfy; + /** + * 累计应纳税所得额 必填:null + */ + @SalaryTableColumn(text = "累计应纳税所得额", width = "10%", column = "ljynssde") + private BigDecimal ljynssde; + /** + * 累计应纳税额 必填:null + */ + @SalaryTableColumn(text = "累计应纳税额", width = "10%", column = "ljynse") + private BigDecimal ljynse; + /** + * 累计应扣缴税额 必填:null 累计应扣缴税额 = 累计应纳税额 - 累计减免税额 + */ + @SalaryTableColumn(text = "累计应扣缴税额", width = "10%", column = "ljyingkjse") + private BigDecimal ljyingkjse; + /** + * 累计已缴税额 必填:null + */ + @SalaryTableColumn(text = "累计已缴税额", width = "10%", column = "ljykjse") + private BigDecimal ljykjse; + /** + * 累计子女教育支出 必填:null + */ + @SalaryTableColumn(text = "累计子女教育支出", width = "10%", column = "ljznjyzc") + private BigDecimal ljznjyzc; + /** + * 累计继续教育支出 必填:null + */ + @SalaryTableColumn(text = "累计继续教育支出", width = "10%", column = "ljjxjyzc") + private BigDecimal ljjxjyzc; + /** + * 累计非学历继续教育支持 必填:null + */ + @SalaryTableColumn(text = "累计非学历继续教育支持", width = "10%", column = "ljfxljxjyzc") + private BigDecimal ljfxljxjyzc; + /** + * 累计学历继续教育支持 必填:null + */ + @SalaryTableColumn(text = "累计学历继续教育支持", width = "10%", column = "ljxljxjyzc") + private BigDecimal ljxljxjyzc; + /** + * 累计住房租金支出 必填:null + */ + @SalaryTableColumn(text = "累计住房租金支出", width = "10%", column = "ljzfzjzc") + private BigDecimal ljzfzjzc; + /** + * 累计房屋贷款支出 必填:null + */ + @SalaryTableColumn(text = "累计房屋贷款支出", width = "10%", column = "ljzfdklxzc") + private BigDecimal ljzfdklxzc; + /** + * 累计赡养老人支出 必填:null + */ + @SalaryTableColumn(text = "累计赡养老人支出", width = "10%", column = "ljsylrzc") + private BigDecimal ljsylrzc; + /** + * 累计3岁以下婴幼儿照护支出 必填:null + */ + @SalaryTableColumn(text = "累计3岁以下婴幼儿照护支出", width = "10%", column = "ljyyezhzc") + private BigDecimal ljyyezhzc; + /** + * 累计准予扣除的捐赠额 必填:null + */ + @SalaryTableColumn(text = "累计准予扣除的捐赠额", width = "10%", column = "ljzykcjze") + private BigDecimal ljzykcjze; + /** + * 累计个人养老金 必填:null + */ + @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "ljgrylj") + private BigDecimal ljgrylj; + /** + * 累计个人养老金校验码 必填:null + */ + @SalaryTableColumn(text = "累计个人养老金校验码", width = "10%", column = "ljgryljjym") + private String ljgryljjym; + /** + * 企业上月是否已申报 必填:null 仅在两个月算税场景时使用,当前月分为N月: + * 0表示N-1月(上月)未申报 + * 1表示N-1月(上月)已申报 + * 2表示N-2月(上上个月)未申报 + */ + @SalaryTableColumn(text = "企业上月是否已申报", width = "10%", column = "qysysfysb") + private String qysysfysb; + /** + * 员工在税局累计已扣缴的税额 必填:null 当前月分为N,如果N-1(上月)已申报,则返回N-1月员工在税局累计已扣缴的税额; + * 如果N-1月未申报,则返回N-2月工在税局累计已扣缴的税额; + */ + @SalaryTableColumn(text = "员工在税局累计已扣缴的税额", width = "10%", column = "ygzsjljykjse") + private BigDecimal ygzsjljykjse; + + /** + * 本月已累计扣除税额 必填:null 针对一月多次算税的场景字段 + */ + @SalaryTableColumn(text = "本月已累计扣除税额", width = "10%", column = "byyljkjse") + private BigDecimal byyljkjse; + /** + * 本次应扣缴税额 必填:null 针对一月多次算税的场景字段,本次应扣缴税额=本月应扣缴税额-本月已累计税额 + */ + @SalaryTableColumn(text = "本次应扣缴税额", width = "10%", column = "bcykjse") + private BigDecimal bcykjse; + /** + * 分摊年度数 必填:null + */ + @SalaryTableColumn(text = "分摊年度数", width = "10%", column = "ftnds") + private Integer ftnds; + /** + * 年减除费用 必填:null 默认为60000 + */ + @SalaryTableColumn(text = "年减除费用", width = "10%", column = "njcfy") + private BigDecimal njcfy; + + } + + /** + * 4.4.1.3.2算税失败原因对象 + */ + @Data + public static class sssbyydx { + /** + * 人员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; + } + } } diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 4c325a520..a294e259d 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -7,6 +7,7 @@ import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; 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; @@ -139,6 +140,7 @@ public interface TaxDeclareRecordService { */ Object getDeclareTaxResultFeedback(Long id); + XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id,String requestId); /** * 作废 * diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index bdf2bfb67..07490e5e1 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -2,7 +2,6 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -10,18 +9,12 @@ import com.engine.salary.service.EmployeeDeclareExcelService; import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; -import com.engine.salary.util.JsonUtil; import com.engine.salary.util.excel.ExcelUtil; -import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * @description: 人员报送(人员)导入导出 @@ -115,7 +108,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // 转换成dto List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); // 需要导出的数据 - List> excelSheetData = getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); + List> excelSheetData = ExcelUtil.getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); return ExcelUtil.genWorkbookV2(excelSheetData, "人员信息采集"); } @@ -213,20 +206,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // } - private List> getExcelSheetData(Class clazz, List dtoList) { - // 导出的表头 - Map> headerMap = getHeader(clazz); - // 导出的数据 - List> rows = new ArrayList<>(); - rows.add(headerMap.get("header")); - dtoList.forEach(dto -> { - Map map = JsonUtil.parseMap(dto, Object.class); - List row = Lists.newArrayListWithExpectedSize(headerMap.get("dataIndex").size()); - headerMap.get("dataIndex").forEach(dataIndex -> row.add(map.get(dataIndex))); - rows.add(row); - }); - return rows; - } // // @Transactional(rollbackFor = Exception.class) // @BatchImportHandler("importEmployeeDeclare") @@ -605,24 +584,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // SalaryI18nUtil.getI18nLabel(employeeId, 156402, "是否扣除减除费用")); // } - private Map> getHeader(Class clazz) { - Map> headerMap = new HashMap<>(); - // 导出的表头 - List headerList = Lists.newArrayList(); - List dataIndexList = Lists.newArrayList(); - Field[] declaredFields = clazz.getDeclaredFields(); - for (Field declaredField : declaredFields) { - if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { - continue; - } - SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); - headerList.add(annotation.text()); - dataIndexList.add(annotation.column()); - } - headerMap.put("header", headerList); - headerMap.put("dataIndex", dataIndexList); - return headerMap; - } + // /** // * 检查表头 diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 109ef366c..ac6829f00 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -41,10 +41,12 @@ import com.engine.salary.enums.taxdeclaration.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.remote.tax.client.DeclareClient; +import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.service.*; import com.engine.salary.service.factory.TaxPaymentServiceFactory; import com.engine.salary.util.*; 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.google.common.collect.ImmutableMap; @@ -54,6 +56,7 @@ import dm.jdbc.util.IdGenerator; 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 org.springframework.transaction.annotation.Transactional; import weaver.general.Util; import weaver.hrm.User; @@ -739,7 +742,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg)); - }else { + } else { //清除之前的错误 taxDeclareRecord.setTaxDeclareErrorMsg(""); } @@ -924,6 +927,21 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getRequestId()); } + @Override + public XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id, String requestId) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? taxDeclareRecord.getRequestId() : requestId); + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + + // 需要导出的数据 + List> excelSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, sscglb); + + return ExcelUtil.genWorkbookV2(excelSheetData, "申报内置算税结果"); + } + @Override public void updateDeclare(Long id) { diff --git a/src/com/engine/salary/util/excel/ExcelUtil.java b/src/com/engine/salary/util/excel/ExcelUtil.java index 8c271981a..5126cfc96 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -1,6 +1,9 @@ package com.engine.salary.util.excel; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryDateUtil; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.FillPatternType; @@ -9,6 +12,7 @@ import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.xssf.usermodel.*; import java.awt.*; +import java.lang.reflect.Field; import java.util.*; import java.util.List; @@ -271,7 +275,43 @@ public class ExcelUtil { public static XSSFWorkbook genWorkbook(ExcelSheetData excelSheetData) { List> list = new ArrayList<>(); list.add(Collections.singletonList(excelSheetData.getHeaders())); - list.addAll( excelSheetData.getRows()); + list.addAll(excelSheetData.getRows()); return genWorkbookV2(list, excelSheetData.getSheetName()); } + + + public static Map> getHeader(Class clazz) { + Map> headerMap = new HashMap<>(); + // 导出的表头 + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + Field[] declaredFields = clazz.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { + continue; + } + SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); + headerList.add(annotation.text()); + dataIndexList.add(annotation.column()); + } + headerMap.put("header", headerList); + headerMap.put("dataIndex", dataIndexList); + return headerMap; + } + + public static List> getExcelSheetData(Class clazz, List dtoList) { + // 导出的表头 + Map> headerMap = getHeader(clazz); + // 导出的数据 + List> rows = new ArrayList<>(); + rows.add(headerMap.get("header")); + dtoList.forEach(dto -> { + Map map = JsonUtil.parseMap(dto, Object.class); + List row = Lists.newArrayListWithExpectedSize(headerMap.get("dataIndex").size()); + headerMap.get("dataIndex").forEach(dataIndex -> row.add(map.get(dataIndex))); + rows.add(row); + }); + return rows; + } + } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index ba563895b..57dba6fb2 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -31,6 +31,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Collection; import java.util.List; @@ -211,11 +212,43 @@ public class TaxDeclarationController { @GET @Path("/getDeclareTaxResultFeedback") @Produces(MediaType.APPLICATION_JSON) - public String getDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + public String getDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareTaxResultFeedback, id); } + /** + * 人员报送-导出全部人员 + * + * @return + */ + @GET + @Path("/exportGetDeclareTaxResultFeedback") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportGetDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id, @QueryParam(value = "requestId") String requestId) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(id ,requestId); + 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; + } + } + /** * 作废 @@ -466,7 +499,7 @@ public class TaxDeclarationController { try { User user = HrmUserVarify.getUser(request, response); - AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NotDeclare(queryParam); String fileName = SalaryI18nUtil.getI18nLabel(156420, "未报送的人员") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); @@ -503,7 +536,7 @@ public class TaxDeclarationController { try { User user = HrmUserVarify.getUser(request, response); - AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NoValue(queryParam); String fileName = SalaryI18nUtil.getI18nLabel(156421, "缺少申报数据的人员") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); @@ -539,7 +572,7 @@ public class TaxDeclarationController { public Response exportEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response) { try { User user = HrmUserVarify.getUser(request, response); - AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4Fail(queryParam); String fileName = SalaryI18nUtil.getI18nLabel(156422, "申报失败人员") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index c47959f3c..edd3900df 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -466,6 +466,11 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); } + + public XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id,String requestId) { + return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(id, requestId); + } + /** * 作废 * @@ -654,4 +659,5 @@ public class TaxDeclareRecordWrapper extends Service { public XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam) { return getTaxDeclarationExcelService(user).exportEmployee4Fail(queryParam); } + } From 4d573956c8c3bd085d1520319f3537165b64bd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 12 Dec 2023 11:06:25 +0800 Subject: [PATCH 084/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=A6=E5=A5=97?= =?UTF-8?q?=E7=A8=8E=E6=AC=BE=E6=89=80=E5=B1=9E=E6=9C=9F=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalarySobInitServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java index e277bac7f..e2dec0af8 100644 --- a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -11,7 +11,6 @@ import com.engine.salary.entity.salarysob.bo.SalarySobInitEnv; import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; -import com.engine.salary.enums.SalaryCycleTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -112,7 +111,7 @@ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { .setIncomeCategory(saveParam.getTaxableItems()) .setSalaryCycleType(saveParam.getSalaryCycleType()) .setSalaryCycleFromDay(saveParam.getSalaryCycleFromDay()) - .setTaxCycleType(SalaryCycleTypeEnum.THIS_MONTH.getValue()) + .setTaxCycleType(saveParam.getTaxCycleType()) .setAttendCycleType(saveParam.getAttendCycleType()) .setAttendCycleFromDay(saveParam.getAttendCycleFromDay()) .setSocialSecurityCycleType(saveParam.getSocialSecurityCycleType()) From f53922a3abe392ab9bdf02617bf6dfe7f8cde2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 12 Dec 2023 17:18:56 +0800 Subject: [PATCH 085/298] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E4=BD=9C=E5=BA=9F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxpayment/po/TaxPaymentRequestPO.java | 6 ++++-- .../service/impl/AbstractTaxPaymentService.java | 16 +++++++++------- .../impl/TaxPaymentWithholdingServiceImpl.java | 4 ++-- .../TaxPaymentWithholdingVoucherServiceImpl.java | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 48c2a0973..34141f5a2 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -1,5 +1,7 @@ package com.engine.salary.entity.taxpayment.po; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -58,7 +60,7 @@ public class TaxPaymentRequestPO implements Serializable { /** * 请求类型 * - * com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum + * @see TaxPaymentServiceTypeEnum */ //异步请求ID") private Integer requestType; @@ -66,7 +68,7 @@ public class TaxPaymentRequestPO implements Serializable { /** * 是否已获取反馈 * - * com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum + *@see SalaryOnOffEnum */ //是否已获取反馈") private Integer feedback; diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index 2b001a10c..47647f058 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -39,7 +39,6 @@ import java.math.BigDecimal; import java.util.*; /** - * *

Copyright: Copyright (c) 2023

*

Company: 泛微软件

* @@ -202,12 +201,15 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .taxYearMonth(param.getTaxYearMonth()) .build()); if (Objects.isNull(param.getCheckFeedback()) || SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { - TaxPaymentRequestPO notFeedback = paymentRequests.stream().filter(e -> { - boolean conditionA = getServiceType().equals(e.getRequestType()) - || TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue().equals(e.getRequestType()); - boolean conditionB = SalaryOnOffEnum.OFF.getValue().equals(e.getFeedback()); - return !conditionA && conditionB; - }).findFirst().orElse(null); + TaxPaymentRequestPO notFeedback = paymentRequests.stream() + .filter(e -> { + boolean conditionA = getServiceType().equals(e.getRequestType()) + || TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue().equals(e.getRequestType()); + boolean conditionB = SalaryOnOffEnum.OFF.getValue().equals(e.getFeedback()); + return !conditionA && conditionB; + }) + .findFirst() + .orElse(null); if (Objects.nonNull(notFeedback)) { TaxPaymentServiceTypeEnum notFeedbackType = TaxPaymentServiceTypeEnum.parseByValue(notFeedback.getRequestType()); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 4e6c5180e..eab790615 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -117,7 +117,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - if (paymentRequestPO != null) { +// if (paymentRequestPO != null) { String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) @@ -132,7 +132,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - } +// } } protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 048f286ab..44e895087 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -113,7 +113,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - if (paymentRequestPO != null) { +// if (paymentRequestPO != null) { String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) @@ -126,7 +126,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - } +// } } @Override From fa30083d0775d9bb241866c5b31f7e5856c23165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 13 Dec 2023 17:52:51 +0800 Subject: [PATCH 086/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/EmployeeDeclareExcelDTO.java | 126 +++ .../EmployeeDeclareImportEmployeeParam.java | 30 + .../param/EmployeeDeclareImportParam.java | 18 + .../service/EmployeeDeclareExcelService.java | 3 +- .../impl/EmployeeDeclareExcelServiceImpl.java | 795 +++++++++--------- .../impl/TaxDeclarationExcelServiceImpl.java | 6 +- .../salary/util/excel/ExcelSheetData.java | 2 +- .../engine/salary/util/excel/ExcelUtil.java | 2 +- .../salary/web/EmployeeDeclareController.java | 38 +- .../salary/web/TaxDeclarationController.java | 2 +- .../wrapper/EmployeeDeclareWrapper.java | 18 +- 11 files changed, 641 insertions(+), 399 deletions(-) create mode 100644 src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java new file mode 100644 index 000000000..5e1c658d7 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java @@ -0,0 +1,126 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import com.engine.salary.annotation.SalaryTable; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Set; + +/** + * 人员报送(人员)列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +@SalaryTable(pageId = "a4f89287-289scf07669d7a23de0ef8u8s2710oe7") +public class EmployeeDeclareExcelDTO { + + // 主键id + private Long id; + + // 人员ID + private Long employeeId; + + // 人员类型 + private EmployeeTypeEnum employeeType; + + + // 姓名 + @SalaryTableColumn(text = "姓名", width = "10%", column = "employeeName") + @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + // 分部 + @SalaryTableColumn(text = "分部", width = "10%", column = "subCompanyName") + @TableTitle(title = "分部", dataIndex = "subCompanyName", key = "subCompanyName") + private String subCompanyName; + + // 部门 + @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + private String departmentName; + + // 个税扣缴义务人 + @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + private String taxAgentName; + + // 工号 + @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + // 证件类型 + @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") + @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") + private String cardType; + + // 证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + // 性别 + @SalaryTableColumn(text = "性别", width = "10%", column = "gender") + @TableTitle(title = "性别", dataIndex = "gender", key = "gender") + private String gender; + + // 出生日期 + @SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday") + @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") + private String birthday; + + // 人员状态 + @SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus") + @TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus") + private String employmentStatus; + + // 手机号码 + @SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile") + @TableTitle(title = "手机号码", dataIndex = "mobile", key = "mobile") + private String mobile; + + // 任职受雇从业类型 + @SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType") + @TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType") + private String employmentType; + + // 任职受雇从业日期 + @SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate") + @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") + private String employmentDate; + + + // 离职日期 + @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") + @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") + private String dismissDate; + + // 申报状态 + private DeclareStatusEnum declareStatus; + + // 申报状态 + @SalaryTableColumn(text = "申报状态", width = "10%", column = "declareStatusDesc") + @TableTitle(title = "申报状态", dataIndex = "declareStatusDesc", key = "declareStatusDesc") + private String declareStatusDesc; + + // 申报失败原因 + private String declareErrorMsg; + + // 编辑过的字段 + private Set updatedDataIndexSet; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java new file mode 100644 index 000000000..16f994ee5 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.employeedeclare.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 人员报送(人员)导入参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareImportEmployeeParam { + //上传文件id + String imageId; + + Long taxAgentId; + + Date taxCycle; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java new file mode 100644 index 000000000..72a7bd9f3 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.employeedeclare.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 人员报送导入参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/21 4:58 PM + * @version:v1.0 + */ +@Data +public class EmployeeDeclareImportParam extends EmployeeDeclareListQueryParam { + + @ApiModelProperty("是否导出现有数据") + private String exportData; +} diff --git a/src/com/engine/salary/service/EmployeeDeclareExcelService.java b/src/com/engine/salary/service/EmployeeDeclareExcelService.java index 6b0f75775..f48aa1199 100644 --- a/src/com/engine/salary/service/EmployeeDeclareExcelService.java +++ b/src/com/engine/salary/service/EmployeeDeclareExcelService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -18,7 +19,7 @@ public interface EmployeeDeclareExcelService { * @param importParam * @return */ -// Map exportTemplate(EmployeeDeclareImportParam importParam); + XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam); /** * 导出人员信息采集-全部 diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 07490e5e1..15afa6d35 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -3,33 +3,50 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; import com.engine.salary.service.EmployeeDeclareExcelService; import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.excel.ExcelSheetData; import com.engine.salary.util.excel.ExcelUtil; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; 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; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** - * @description: 人员报送(人员)导入导出 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/7/22 5:39 PM - * @version:v1.0 - */ + * 人员报送(人员)导入导出 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class EmployeeDeclareExcelServiceImpl extends Service implements EmployeeDeclareExcelService { - private EmployeeDeclareService getEmployeeDeclareService(User user) { return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } @@ -39,67 +56,45 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } -// @Override -// public Map exportTemplate( EmployeeDeclareImportParam importParam) { -// String tenantKey = simpleEmployee.getTenantKey(); -// Long currentEmployeeId = simpleEmployee.getEmployeeId(); -// // 查询人员 -// List employeeDeclares = Collections.emptyList(); -// if (StringUtils.equalsIgnoreCase(importParam.getExportData(), "true")) { -// employeeDeclares = getEmployeeDeclareService(user).listByParam(importParam); -// } -// String yesI18 = SalaryI18nUtil.getI18nLabel( 84967, "是"); -// String noI18 = SalaryI18nUtil.getI18nLabel( 84968, "否"); -// List> rows = Lists.newArrayList(); -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); -// EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); -// List row = Lists.newArrayList(); -// row.add(employeeDeclare.getJobNum()); -// row.add(employeeDeclare.getEmployeeName()); -// row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); -// row.add(employeeDeclare.getCardNum()); -// row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); -// row.add(employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); -// row.add(employeeDeclare.getEmploymentFirstYear()); -// row.add(employeeDeclare.getMobile()); -// row.add(Util.null2String(employeeDeclare.getEmploymentDate())); -// row.add(Util.null2String(employeeDeclare.getDismissDate())); -// row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); -// row.add(employeeDeclare.getDisabilityCardNo()); -// row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); -// row.add(employeeDeclare.getMartyrDependentsCardNo()); -// row.add(Objects.equals(employeeDeclare.getLonelyOld(), 1) ? yesI18 : noI18); -// row.add(Objects.equals(employeeDeclare.getDeductExpenses(), 1) ? yesI18 : noI18); -// rows.add(row); -// } -// // 组装excel导出数据 -// String[] headers = getImportHeader(currentEmployeeId, tenantKey).toArray(new String[0]); -// ExcelSheetData excelSheetData = new ExcelSheetData(); -// excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel( 156425, "人员信息采集")); -// excelSheetData.setHeaders(Collections.singletonList(headers)); -// excelSheetData.setRows(rows); -// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() -// .fileName(SalaryI18nUtil.getI18nLabel( 156424, "人员信息采集导入模板") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) -// .dataType(SalaryI18nUtil.getI18nLabel( 156424, "人员信息采集导入模板")) -// .function(excelExportParam.getFunction()) -// .handlerName("exportEmployeeDeclareTemplate") -// .flag(true) -// .bizId(excelExportParam.getBiz()) -// .module(excelExportParam.getModule()) -// .userId(simpleEmployee.getEmployeeId()) -// .tenantKey(simpleEmployee.getTenantKey()) -// .operator(simpleEmployee.getUsername()) -// .eteamsId(TenantRpcContext.getEteamsId()) -// .build(); -// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); -// } -// -// @BatchExportHandler("exportEmployeeDeclareTemplate") -// private void exportEmployeeDeclareTemplate() { -// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); -// log.info("导出结束:{}", JsonUtil.toJsonString(message)); -// } + @Override + public XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam) { + // 查询人员 + List employeeDeclares = Collections.emptyList(); + if (StringUtils.equalsIgnoreCase(importParam.getExportData(), "true")) { + employeeDeclares = getEmployeeDeclareService(user).listByParam(importParam); + } + String yesI18 = SalaryI18nUtil.getI18nLabel(84967, "是"); + String noI18 = SalaryI18nUtil.getI18nLabel(84968, "否"); + List> rows = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); + EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); + List row = Lists.newArrayList(); + row.add(employeeDeclare.getJobNum()); + row.add(employeeDeclare.getEmployeeName()); + row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + row.add(employeeDeclare.getCardNum()); + row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); + row.add(employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); + row.add(employeeDeclare.getEmploymentFirstYear()); + row.add(employeeDeclare.getMobile()); + row.add(Util.null2String(employeeDeclare.getEmploymentDate())); + row.add(Util.null2String(employeeDeclare.getDismissDate())); + row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); + row.add(employeeDeclare.getDisabilityCardNo()); + row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); + row.add(employeeDeclare.getMartyrDependentsCardNo()); + row.add(Objects.equals(employeeDeclare.getLonelyOld(), 1) ? yesI18 : noI18); + row.add(Objects.equals(employeeDeclare.getDeductExpenses(), 1) ? yesI18 : noI18); + rows.add(row); + } + // 组装excel导出数据 + ExcelSheetData excelSheetData = new ExcelSheetData(); + excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel(156425, "人员信息采集")); + excelSheetData.setHeaders(getImportHeader()); + excelSheetData.setRows(rows); + return ExcelUtil.genWorkbook(excelSheetData); + } @Override public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { @@ -206,59 +201,46 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // } -// -// @Transactional(rollbackFor = Exception.class) -// @BatchImportHandler("importEmployeeDeclare") -// public void importEmployeeDeclare() { -// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage(); -// Long employeeId = message.getUserId(); -// String tenantKey = message.getTenantKey(); +// public Map importEmployeeDeclare(EmployeeDeclareImportEmployeeParam param) { // try { -// LocalDateTime now = LocalDateTime.now(); -// Map paramMap = JsonUtil.parseMap(message.getUploadSet().getCustomData(), Object.class); +// Date now = new Date(); // // 个税扣缴义务人id -// Long taxAgentId = Util.getLongValue(Util.null2String(paramMap.get("taxAgentId"))); -// TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId, employeeId, tenantKey); +// Long taxAgentId = param.getTaxAgentId(); +// TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); // if (taxAgent == null) { -// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 187469, "参数错误,无法找到个税扣缴义务人")); -// return; +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(111111, "参数错误,无法找到个税扣缴义务人")); // } // // 税款所属期 -// String taxCycle = Util.null2String(paramMap.get("taxCycle")); -// if (!SalaryDateUtil.checkYearMonth(taxCycle)) { -// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 156384, "参数错误,税款所属期参数格式错误")); -// return; +// Date taxCycle = param.getTaxCycle(); +// if (taxCycle == null) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(111111, "参数错误,税款所属期参数格式错误")); // } // +// InputStream fileInputStream = null; +// fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); +// // // 导出模板中的表头 -// List headerList = getImportHeader(employeeId, tenantKey); +// List headerList = getImportHeader(); // // 查询所有的人员 -// List orgEmployeeIds = hrmCommonEmployeeService.getAllEmployee(tenantKey); -// List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(orgEmployeeIds, tenantKey); -// // 查询所有的外部人员 -// List extEmployees = extEmployeeService.listAll(tenantKey); +// List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); // // 查询人员报送表的人员 -// List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(YearMonth.parse(taxCycle), -// taxAgentId, tenantKey); +// List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxCycle, taxAgentId); // // 校验字段 // String checkType = Util.null2String(paramMap.getOrDefault("checkType", "jobNum")); -// Map extEmployeeMap = Maps.newHashMap(); -// Map simpleEmployeeMap = Maps.newHashMap(); +// Map simpleEmployeeMap = Maps.newHashMap(); // Map employeeDeclareMap = Maps.newHashMapWithExpectedSize(employeeDeclares.size()); // if (Objects.equals(checkType, "jobNum")) { -// extEmployeeMap = Collections.emptyMap(); // simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getJobNum); // employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getJobNum); // } else { // // 查询所有人员的个人信息 -// List simpleUserInfos = getSalaryEmployeeService(user).listByEmployeeIds(orgEmployeeIds, tenantKey); -// Map idKeySimpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getId); +// List simpleUserInfos = getSalaryEmployeeService(user).listByEmployeeIds(orgEmployeeIds); +// Map idKeySimpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getId); // for (SimpleUserInfo simpleUserInfo : simpleUserInfos) { // if (idKeySimpleEmployeeMap.containsKey(simpleUserInfo.getEmployeeId())) { // simpleEmployeeMap.put(simpleUserInfo.getIdNo(), idKeySimpleEmployeeMap.get(simpleUserInfo.getEmployeeId())); // } // } -// extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getCardNum); // employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getCardNum); // // } @@ -269,263 +251,308 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // // 索引(用于计算进度) // int index = 0; // // 失败的数量 -// int failCount = 0; +// int errorCount = 0; // // 成功的数量 // int successCount = 0; // // 错误行的索引 // int failRowIndex = 1; -// // 包含错误提示信息的sheet页 -// List errorExcelSheets = Lists.newArrayList(); -// for (ExcelSheet excelSheet : message.getBatchFile().getExcelSheets()) { -// if (CollectionUtils.isEmpty(excelSheet.getHeader())) { -// continue; +// // 错误提示 +// List> excelComments = new ArrayList<>(); +// // 错误excel内容 +// List errorData = new ArrayList<>(); +// +// Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); +// // 表头 +// List headers = ExcelSupport.getSheetHeader(sheet, 0); +// +// // 检查表头 +// String isValidHeader = checkHeader(headers, headerList); +// if (StringUtils.isNotBlank(isValidHeader)) { +// Map apidatas = new HashMap(); +// apidatas.put("successCount", successCount); +// apidatas.put("errorCount", errorCount); +// +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", isValidHeader); +// excelComments.add(errorMessageMap); +// apidatas.put("errorData", excelComments); +// return apidatas; +// } +// +// // 数据 +// List data = ExcelParseHelper.parse2Map(fileInputStream, EmployeeDeclareExcelDTO.class, 0, 1, 14, "1.xlsx"); +// if (CollectionUtils.isEmpty(data)) { +// Map apidatas = new HashMap(); +// apidatas.put("successCount", successCount); +// apidatas.put("errorCount", errorCount); +// return apidatas; +// } +// +// for (int i = 0; i < data.size(); i++) { +// EmployeeDeclareExcelDTO employeeDeclareExcelDTO = data.get(i); +// +// employeeDeclareExcelDTO.getEmployeeName() +// +// //筛选导入人员信息可以在人力资源池中匹配到的人员信息 +// List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(simpleEmployees, userName, deparmentName, mobile, workcode, null); +// +// if (StringUtils.isBlank(userName) && "0".equals(confValue)) { +// //姓名 不能为空 +// //错误消息对象 +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "姓名不能为空"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else if (CollectionUtils.isEmpty(employeeSameIds)) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "员工信息不存在"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else if (employeeSameIds.size() > 1) { +// //存在离职和在职状态取在职状态 +// employeeSameIds = employeeSameIds.stream() +// .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) +// .collect(Collectors.toList()); +// if (employeeSameIds.size() != 1) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else { +// Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; +// addUpDeduction.setEmployeeId(employeeId); +// } +// } else { +// Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; +// if (employeeId != null && employeeId > 0) { +// addUpDeduction.setEmployeeId(employeeId); +// } else { +// //姓名错误,系统内不存在该姓名 +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } // } -// // 表头 -// List headers = excelSheet.getHeader().stream() -// .map(m -> Util.null2String(m.get("key"))) -// .collect(Collectors.toList()); -// // 检查表头 -// boolean isCorrectHeader = checkHeader(message, headers, headerList); -// if (!isCorrectHeader) { -// return; -// } -// // 表头每一列的位置 -// Map columnIndexMap = Maps.newHashMap(); -// for (int i = 0; i < headers.size(); i++) { -// columnIndexMap.put(headers.get(i), i); -// } -// // 数据 -// List> data = excelSheet.getData(); -// if (CollectionUtils.isEmpty(data)) { -// continue; -// } -// // 错误提示信息 -// List excelComments = Lists.newArrayList(); -// // 存在错误的那行数据 -// List> errorData = Lists.newArrayList(); -// for (int i = 0; i < data.size(); i++) { -// Map map = data.get(i); -// // 数据是否存在错误 -// boolean isError = false; -// EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); -// for (String dataKey : getImportHeader(employeeId, tenantKey)) { -// Integer j = columnIndexMap.get(dataKey); -// String dataValue = Util.null2String(map.get(dataKey)); -// if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 86317, "工号"))) { -// if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 136250, "工号不能为空"), failRowIndex, failRowIndex, j, j); -// } -// employeeDeclareExcel.setJobNum(dataValue); -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 85429, "姓名"))) { -// if (StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 102838, "姓名不能为空"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setEmployeeName(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 105139, "证件类型"))) { -// employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 86318, "证件号码"))) { -// if (StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156386, "证件号码不能为空"), failRowIndex, failRowIndex, j, j); -// } else if (!SalaryCardUtil.checkIdNum(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156429, "证件号码格式不正确"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setCardNum(dataValue); -// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue()); -// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue)); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156394, "人员状态"))) { -// boolean legalDataValue = false; -// for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { -// if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { -// legalDataValue = true; -// employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); -// break; -// } -// } -// if (!legalDataValue) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156430, "人员状态只能填写正常或非正常"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156396, "任职受雇从业类型"))) { -// boolean legalDataValue = false; -// for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { -// if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { -// legalDataValue = true; -// employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); -// break; -// } -// } -// if (!legalDataValue) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156431, "任职受雇从业类型填写错误"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 187374, "入职年度就业情形"))) { -// employeeDeclareExcel.setEmploymentFirstYear(dataValue); -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 98621, "手机号码"))) { -// if (StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 106429, "手机号码不能为空"), failRowIndex, failRowIndex, j, j); -// } else if (!SalaryCardUtil.checkMobile(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160510, "手机号码格式不正确"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setMobile(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156409, "任职受雇从业日期"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160511, "任职受雇从业类型不为「其他」时,任职受雇从业日期为必填"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// if (!SalaryDateUtil.checkDay(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156432, "日期格式不正确"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue)); -// } -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 95228, "离职日期"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160512, "人员状态为非正常时,离职日期必填"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// if (!SalaryDateUtil.checkDay(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156432, "日期格式不正确"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue)); -// } -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156399, "是否残疾"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156433, "是否残疾只能填写是与否"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156412, "残疾证号"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160513, "「是否残疾」填「是」时,残疾证号必填"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// employeeDeclareExcel.setDisabilityCardNo(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 187385, "是否烈属"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156433, "是否烈属只能填写是与否"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156413, "烈属证号"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160514, "「是否烈属」填「是」时,烈属证号必填"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156400, "是否孤老"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156434, "是否孤老只能填写是与否"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156402, "是否扣除减除费用"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156435, "是否扣除减除费用只能填写是与否"), failRowIndex, failRowIndex, j, j); -// } +// +// +// // 数据是否存在错误 +// boolean isError = false; +// if (StringUtils.equals(employeeDeclareExcelDTO.getJobNum(), SalaryI18nUtil.getI18nLabel(86317, "工号"))) { +// if (StringUtils.isEmpty(employeeDeclareExcelDTO.getJobNum()) ) { +// isError = true; +// +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(136250, "工号不能为空"), failRowIndex, failRowIndex, j, j); +// } +// employeeDeclareExcel.setJobNum(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(85429, "姓名"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmployeeName(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(105139, "证件类型"))) { +// employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(86318, "证件号码"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156386, "证件号码不能为空"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkIdNum(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156429, "证件号码格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setCardNum(dataValue); +// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue()); +// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue)); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156394, "人员状态"))) { +// boolean legalDataValue = false; +// for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { +// if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); +// break; // } // } -// if (!isError) { -// if (StringUtils.equals(checkType, "jobNum")) { -// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); -// if (employeeDeclare == null) { -// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); -// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); -// if (extEmployee == null && simpleEmployee == null) { -// isError = true; -// String jobNumI18 = SalaryI18nUtil.getI18nLabel(employeeId, 86317, "工号"); -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156436, "系统内的人员不存在该工号"), failRowIndex, failRowIndex, headers.indexOf(jobNumI18), headers.indexOf(jobNumI18)); -// } else { -// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, -// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId, tenantKey)); -// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156430, "人员状态只能填写正常或非正常"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156396, "任职受雇从业类型"))) { +// boolean legalDataValue = false; +// for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { +// if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); +// break; +// } +// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156431, "任职受雇从业类型填写错误"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(187374, "入职年度就业情形"))) { +// employeeDeclareExcel.setEmploymentFirstYear(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(98621, "手机号码"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(106429, "手机号码不能为空"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkMobile(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160510, "手机号码格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setMobile(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156409, "任职受雇从业日期"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160511, "任职受雇从业类型不为「其他」时,任职受雇从业日期为必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156432, "日期格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(95228, "离职日期"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160512, "人员状态为非正常时,离职日期必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156432, "日期格式不正确"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156399, "是否残疾"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156433, "是否残疾只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156412, "残疾证号"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160513, "「是否残疾」填「是」时,残疾证号必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setDisabilityCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(187385, "是否烈属"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156433, "是否烈属只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156413, "烈属证号"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160514, "「是否烈属」填「是」时,烈属证号必填"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156400, "是否孤老"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156434, "是否孤老只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156402, "是否扣除减除费用"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156435, "是否扣除减除费用只能填写是与否"), failRowIndex, failRowIndex, j, j); +// } +// } +// if (!isError) { +// if (StringUtils.equals(checkType, "jobNum")) { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String jobNumI18 = SalaryI18nUtil.getI18nLabel(86317, "工号"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156436, "系统内的人员不存在该工号"), failRowIndex, failRowIndex, headers.indexOf(jobNumI18), headers.indexOf(jobNumI18)); // } else { -// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); -// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); -// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); -// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) -// .setUpdateTime(now); -// needUpdateEmployeeDeclares.add(newEmployeeDeclare); -// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { -// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// newEmployeeDeclare.setDeclareErrorMsg(""); -// } +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId)); // } // } else { -// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); -// if (employeeDeclare == null) { -// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); -// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); -// if (extEmployee == null && simpleEmployee == null) { -// isError = true; -// String cardNoI18 = SalaryI18nUtil.getI18nLabel(employeeId, 86318, "证件号码"); -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156437, "系统内的人员不存在该证件号码"), failRowIndex, failRowIndex, headers.indexOf(cardNoI18), headers.indexOf(cardNoI18)); -// } else { -// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, -// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId, tenantKey)); -// } -// } else { -// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); -// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); -// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); -// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) -// .setUpdateTime(now); -// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { -// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// newEmployeeDeclare.setDeclareErrorMsg(""); -// } -// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); // } // } +// } else { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String cardNoI18 = SalaryI18nUtil.getI18nLabel(86318, "证件号码"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156437, "系统内的人员不存在该证件号码"), failRowIndex, failRowIndex, headers.indexOf(cardNoI18), headers.indexOf(cardNoI18)); +// } else { +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId)); +// } +// } else { +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); +// } +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// } // } -// if (isError) { -// failCount++; -// failRowIndex++; -// errorData.add(map); -// continue; -// } -// successCount++; // } -// // 如果sheet包含错误数据 -// if (CollectionUtils.isNotEmpty(errorData)) { -// salaryBatchService.createErrorExcelSheet(excelSheet.getHeader(), errorData, excelSheet.getName(), excelComments, errorExcelSheets); +// if (isError) { +// errorCount++; +// failRowIndex++; +// errorData.add(map); +// continue; // } +// successCount++; // } +// // 如果sheet包含错误数据 +// if (CollectionUtils.isNotEmpty(errorData)) { +// salaryBatchService.createErrorExcelSheet(excelSheet.getHeader(), errorData, excelSheet.getName(), excelComments, errorExcelSheets); +// } +// // if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { // getEmployeeDeclareService(user).saveBatch(needAddEmployeeDeclares); // } @@ -533,16 +560,16 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // getEmployeeDeclareService(user).updateBatchById(needUpdateEmployeeDeclares); // } // // 发送导入回调信息 -// salaryBatchService.sendImportCallBackInfo(message, successCount, failCount, errorExcelSheets); +// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); // } catch (Exception e) { // log.error("人员报送信息导入失败:{}", e.getMessage(), e); -// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 156438, "人员报送信息导入失败:") + e.getMessage()); +// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(156438, "人员报送信息导入失败:") + e.getMessage()); // } // } // // private EmployeeDeclarePO buildEmployeeDeclare(ExtEmployeePO extEmployee, // EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, -// String taxCycle, LocalDateTime now, Long employeeId, String tenantKey) { +// String taxCycle, LocalDateTime now, Long String tenantKey) { // EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() // .setId(IdGenerator.generate()) // .setTaxAgentId(taxAgentId) @@ -563,49 +590,47 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // } // return employeeDeclare; // } -// -// private List getImportHeader(Long employeeId, String tenantKey) { -// return Lists.newArrayList( -// SalaryI18nUtil.getI18nLabel(employeeId, 86317, "工号"), -// SalaryI18nUtil.getI18nLabel(employeeId, 85429, "姓名"), -// SalaryI18nUtil.getI18nLabel(employeeId, 105139, "证件类型"), -// SalaryI18nUtil.getI18nLabel(employeeId, 86318, "证件号码"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156394, "人员状态"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156396, "任职受雇从业类型"), -// SalaryI18nUtil.getI18nLabel(employeeId, 187374, "入职年度就业情形"), -// SalaryI18nUtil.getI18nLabel(employeeId, 98621, "手机号码"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156409, "任职受雇从业日期"), -// SalaryI18nUtil.getI18nLabel(employeeId, 95228, "离职日期"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156399, "是否残疾"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156412, "残疾证号"), -// SalaryI18nUtil.getI18nLabel(employeeId, 187385, "是否烈属"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156413, "烈属证号"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156400, "是否孤老"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156402, "是否扣除减除费用")); -// } + + private List getImportHeader() { + List headers = new ArrayList<>(); + + headers.add(SalaryI18nUtil.getI18nLabel(86317, "工号")); + headers.add(SalaryI18nUtil.getI18nLabel(85429, "姓名")); + headers.add(SalaryI18nUtil.getI18nLabel(105139, "证件类型")); + headers.add(SalaryI18nUtil.getI18nLabel(86318, "证件号码")); + headers.add(SalaryI18nUtil.getI18nLabel(156394, "人员状态")); + headers.add(SalaryI18nUtil.getI18nLabel(156396, "任职受雇从业类型")); + headers.add(SalaryI18nUtil.getI18nLabel(187374, "入职年度就业情形")); + headers.add(SalaryI18nUtil.getI18nLabel(98621, "手机号码")); + headers.add(SalaryI18nUtil.getI18nLabel(156409, "任职受雇从业日期")); + headers.add(SalaryI18nUtil.getI18nLabel(95228, "离职日期")); + headers.add(SalaryI18nUtil.getI18nLabel(156399, "是否残疾")); + headers.add(SalaryI18nUtil.getI18nLabel(156412, "残疾证号")); + headers.add(SalaryI18nUtil.getI18nLabel(187385, "是否烈属")); + headers.add(SalaryI18nUtil.getI18nLabel(156413, "烈属证号")); + headers.add(SalaryI18nUtil.getI18nLabel(156400, "是否孤老")); + headers.add(SalaryI18nUtil.getI18nLabel(156402, "是否扣除减除费用")); + + return headers; + + } - -// /** -// * 检查表头 -// * -// * @param message -// * @param headers -// * @return -// */ -// private boolean checkHeader(BatchDocumentMessage message, List headers, List headerList) { -// Long employeeId = message.getUserId(); -// String tenantKey = message.getTenantKey(); -// // 缺少的列 -// List lackHeaders = headerList.stream() -// .filter(header -> !headers.contains(header)) -// .collect(Collectors.toList()); -// if (CollectionUtils.isNotEmpty(lackHeaders)) { -// // 发送导入回调信息 -// String errorMsg = SalaryI18nUtil.getI18nLabel(employeeId, 101850, "缺少如下列,请检查:") + Joiner.on(",").join(lackHeaders); -// salaryBatchService.sendImportCallBackInfo(message, errorMsg); -// return false; -// } -// return true; -// } + /** + * 检查表头 + * + * @param headers + * @return + */ + private String checkHeader(List headers, List headerList) { + // 缺少的列 + List lackHeaders = headerList.stream() + .filter(header -> !headers.contains(header)) + .collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(lackHeaders)) { + // 发送导入回调信息 + return SalaryI18nUtil.getI18nLabel(101850, "缺少如下列,请检查:") + Joiner.on(",").join((Iterable) lackHeaders); + } + return null; + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 8a7e8a3e3..72597d4f2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -138,7 +138,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar private ExcelSheetData getExcelSheetData(Class clazz, List dtoList) { // 导出的表头 - List headerList = Lists.newArrayList(); + List headerList = Lists.newArrayList(); List dataIndexList = Lists.newArrayList(); parseHeader(clazz, headerList, dataIndexList); // 导出的数据 @@ -165,14 +165,14 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar * @param dataIndexList * @param */ - private void parseHeader(Class clazz, List headerList, List dataIndexList) { + private void parseHeader(Class clazz, List headerList, List dataIndexList) { Field[] declaredFields = clazz.getDeclaredFields(); for (Field declaredField : declaredFields) { if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { continue; } SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); - headerList.add(SalaryI18nUtil.getI18nLabel((int) annotation.labelId(), annotation.text())); + headerList.add(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.text())); dataIndexList.add(declaredField.getName()); } } diff --git a/src/com/engine/salary/util/excel/ExcelSheetData.java b/src/com/engine/salary/util/excel/ExcelSheetData.java index f4cf615ea..87a827d55 100644 --- a/src/com/engine/salary/util/excel/ExcelSheetData.java +++ b/src/com/engine/salary/util/excel/ExcelSheetData.java @@ -8,7 +8,7 @@ import java.util.List; public class ExcelSheetData { private String sheetName; - private List headers; + private List headers; private List> rows; diff --git a/src/com/engine/salary/util/excel/ExcelUtil.java b/src/com/engine/salary/util/excel/ExcelUtil.java index 5126cfc96..b9a0c5d2c 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -274,7 +274,7 @@ public class ExcelUtil { public static XSSFWorkbook genWorkbook(ExcelSheetData excelSheetData) { List> list = new ArrayList<>(); - list.add(Collections.singletonList(excelSheetData.getHeaders())); + list.add(excelSheetData.getHeaders()); list.addAll(excelSheetData.getRows()); return genWorkbookV2(list, excelSheetData.getSheetName()); } diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 97f338abf..c2c2703e6 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -12,7 +12,6 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.EmployeeDeclareWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; -import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -272,6 +271,39 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getCompanyEmployee, param); } + /** + * 人员报送-下载导入模板 + * + * @param queryParam 导出参数 + * @return + */ + @POST + @Path("/exportTemplate") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).exportTemplate(queryParam); + 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; + } + } + /** * 人员报送-导出全部人员 * @@ -281,11 +313,11 @@ public class EmployeeDeclareController { @POST @Path("/export") @Produces(MediaType.APPLICATION_OCTET_STREAM) - public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { + public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam param) { try { User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(queryParam); + XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(param); String fileName = "人员信息采集-" + LocalDate.now(); try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 57dba6fb2..f3e0a89e5 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -218,7 +218,7 @@ public class TaxDeclarationController { } /** - * 人员报送-导出全部人员 + * 申报内置算税结果 * * @return */ diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 5c8fb6c19..399286e63 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -558,13 +558,23 @@ public class EmployeeDeclareWrapper extends Service { } /** - * 人员报送-导出本月全部的人员 + * 人员报送-下载导入模板 * - * @param queryParam + * @param param * @return */ - public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { - return getEmployeeDeclareExcelService(user).export(queryParam); + public XSSFWorkbook exportTemplate(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).exportTemplate(param); + } + + /** + * 人员报送-导出本月全部的人员 + * + * @param param + * @return + */ + public XSSFWorkbook export(EmployeeDeclareListQueryParam param) { + return getEmployeeDeclareExcelService(user).export(param); } // /** From a5ffe12509e26962e428f236b3220a596c0c1e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 13 Dec 2023 19:34:10 +0800 Subject: [PATCH 087/298] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=BD=8Dx=E8=BD=AC=E5=A4=A7=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/EmployeeDeclareRefresh.java | 2 +- .../impl/EmployeeDeclareExcelServiceImpl.java | 40 +++++++++---------- .../impl/EmployeeDeclareServiceImpl.java | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index 3ef2357b2..f3223479e 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -105,7 +105,7 @@ public class EmployeeDeclareRefresh { } EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId); DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId()); - String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo(); + String idNum = simpleUserInfo != null && simpleUserInfo.getIdNo() != null ? simpleUserInfo.getIdNo().toUpperCase() : ""; employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); employeeDeclare.setEmployeeName(hrmEmployeeComInfo.getUsername()); diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 15afa6d35..783e15511 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -63,8 +63,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee if (StringUtils.equalsIgnoreCase(importParam.getExportData(), "true")) { employeeDeclares = getEmployeeDeclareService(user).listByParam(importParam); } - String yesI18 = SalaryI18nUtil.getI18nLabel(84967, "是"); - String noI18 = SalaryI18nUtil.getI18nLabel(84968, "否"); + String yesI18 = SalaryI18nUtil.getI18nLabel(111111, "是"); + String noI18 = SalaryI18nUtil.getI18nLabel(111111, "否"); List> rows = Lists.newArrayList(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); @@ -90,7 +90,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } // 组装excel导出数据 ExcelSheetData excelSheetData = new ExcelSheetData(); - excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel(156425, "人员信息采集")); + excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel(111111, "人员信息采集")); excelSheetData.setHeaders(getImportHeader()); excelSheetData.setRows(rows); return ExcelUtil.genWorkbook(excelSheetData); @@ -594,22 +594,22 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee private List getImportHeader() { List headers = new ArrayList<>(); - headers.add(SalaryI18nUtil.getI18nLabel(86317, "工号")); - headers.add(SalaryI18nUtil.getI18nLabel(85429, "姓名")); - headers.add(SalaryI18nUtil.getI18nLabel(105139, "证件类型")); - headers.add(SalaryI18nUtil.getI18nLabel(86318, "证件号码")); - headers.add(SalaryI18nUtil.getI18nLabel(156394, "人员状态")); - headers.add(SalaryI18nUtil.getI18nLabel(156396, "任职受雇从业类型")); - headers.add(SalaryI18nUtil.getI18nLabel(187374, "入职年度就业情形")); - headers.add(SalaryI18nUtil.getI18nLabel(98621, "手机号码")); - headers.add(SalaryI18nUtil.getI18nLabel(156409, "任职受雇从业日期")); - headers.add(SalaryI18nUtil.getI18nLabel(95228, "离职日期")); - headers.add(SalaryI18nUtil.getI18nLabel(156399, "是否残疾")); - headers.add(SalaryI18nUtil.getI18nLabel(156412, "残疾证号")); - headers.add(SalaryI18nUtil.getI18nLabel(187385, "是否烈属")); - headers.add(SalaryI18nUtil.getI18nLabel(156413, "烈属证号")); - headers.add(SalaryI18nUtil.getI18nLabel(156400, "是否孤老")); - headers.add(SalaryI18nUtil.getI18nLabel(156402, "是否扣除减除费用")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "工号")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "姓名")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件类型")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件号码")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "人员状态")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业类型")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "入职年度就业情形")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "手机号码")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业日期")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "离职日期")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否残疾")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "残疾证号")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否烈属")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "烈属证号")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否孤老")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否扣除减除费用")); return headers; @@ -629,7 +629,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee .collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(lackHeaders)) { // 发送导入回调信息 - return SalaryI18nUtil.getI18nLabel(101850, "缺少如下列,请检查:") + Joiner.on(",").join((Iterable) lackHeaders); + return SalaryI18nUtil.getI18nLabel(111111, "缺少如下列,请检查:") + Joiner.on(",").join((Iterable) lackHeaders); } return null; } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 32bf9a06b..5559e5214 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -193,7 +193,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setEmployeeName(saveParam.getEmployeeName()); employeeDeclare.setJobNum(saveParam.getJobNum()); employeeDeclare.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); - employeeDeclare.setCardNum(saveParam.getCardNum()); + employeeDeclare.setCardNum(saveParam.getCardNum().toUpperCase()); employeeDeclare.setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()); employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))); employeeDeclare.setEmploymentStatus(saveParam.getEmploymentStatus().getValue()); From 0a54fe5f80b2abeb58a3e78f31864979161f402c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 14 Dec 2023 10:35:10 +0800 Subject: [PATCH 088/298] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaxDeclareRecordDetailSaveParam.java | 64 +++++++++++++++++++ .../taxdeclaration/po/TaxReportColumnPO.java | 28 ++++---- .../impl/TaxDeclareRecordServiceImpl.java | 10 ++- .../salary/web/TaxDeclarationController.java | 31 ++++++++- .../wrapper/TaxDeclareRecordWrapper.java | 40 ++++++++++-- 5 files changed, 151 insertions(+), 22 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java new file mode 100644 index 000000000..7744819ba --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java @@ -0,0 +1,64 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +import java.util.Map; + +/** + * 个税申报明细保存 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclareRecordDetailSaveParam { + + //主键id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //个税申报记录id") + private Long taxDeclareRecordId; + + //个税申报表id") + private Long taxDeclarationId; + + //人员id + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + private Integer employeeType; + + @SalaryTableColumn( + text = "工号", width = "10%", column = "jobNum" + ) + @TableTitle(title ="工号",dataIndex = "jobNum",key = "jobNum") + private String jobNum; + + @SalaryTableColumn( + text = "姓名", width = "10%", column = "username" + ) + @TableTitle(title ="姓名",dataIndex = "username",key = "username") + private String username; + + @SalaryTableColumn( + text = "证件类型", width = "10%", column = "cardType" + ) + @TableTitle(title ="证件类型",dataIndex = "cardType",key = "cardType") + private String cardType; + + @SalaryTableColumn( + text = "证件号码", width = "10%", column = "cardNum" + ) + @TableTitle(title ="证件号码",dataIndex = "cardNum",key = "cardNum") + private String cardNum; + + private Map taxReportColumnValues; + + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index 5e824dc48..a6591e714 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -20,34 +20,34 @@ import java.util.Date; @Builder @AllArgsConstructor @NoArgsConstructor -//hrsa_tax_report_column") +//hrsa_tax_report_column public class TaxReportColumnPO { - //name = "主键id") + //name = 主键id private Long id; - //name = "报表类型") + //name = 报表类型 private String taxReportType; - //name = "所得项目") + //name = 所得项目 private String incomeCategory; - //name = "申报表的列名") + //name = 申报表的列名 private String reportColumnName; - //name = "申报表的列名多语言标签") + //name = 申报表的列名多语言标签 private Integer reportColumnLabel; - //name = "申报表的列索引") + //name = 申报表的列索引 private String reportColumnDataIndex; - //name = "数值类型") + //name = 数值类型 private String dataType; - //name = "个税对接时的参数key") + //name = 个税对接时的参数key private String requestParamKey; - //name = "租户key", ignore = true) + //name = 租户key private String tenantKey; - //name = "创建人id", ignore = true) + //name = 创建人id private Long creator; - //name = "是否删除", ignore = true) + //name = 是否删除 private Integer deleteType; - //name = "创建时间", ignore = true) + //name = 创建时间 private Date createTime; - //name = "更新时间", ignore = true) + //name = 更新时间 private Date updateTime; Collection ids; diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index ac6829f00..23606e23e 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -414,7 +414,15 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 薪资核算结果 Set salaryAcctEmployeeIdSet = SalaryEntityUtil.properties(incomeCategoryEntry.getValue(), SalaryAcctEmployeePO::getId); List> resultValues = salaryAcctEmployeeIdSet.stream().map(salaryAcctResultValueMap::get).filter(Objects::nonNull).collect(Collectors.toList()); - TaxDeclareContext taxDeclareContext = new TaxDeclareContext().setSalaryAcctRecordMap(salaryAcctRecordMap).setSalaryAcctEmployees(incomeCategoryEntry.getValue()).setSalaryAcctResultValues(salaryAcctResultValues).setTaxDeclaration(taxDeclaration).setSalarySobTaxReportRuleMap(salarySobTaxReportRuleMap).setSalarySobAddUpRuleMap(salarySobAddUpRuleMap).setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())).setSalaryItems(salaryItems); + TaxDeclareContext taxDeclareContext = new TaxDeclareContext() + .setSalaryAcctRecordMap(salaryAcctRecordMap) + .setSalaryAcctEmployees(incomeCategoryEntry.getValue()) + .setSalaryAcctResultValues(salaryAcctResultValues) + .setTaxDeclaration(taxDeclaration) + .setSalarySobTaxReportRuleMap(salarySobTaxReportRuleMap) + .setSalarySobAddUpRuleMap(salarySobAddUpRuleMap) + .setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())) + .setSalaryItems(salaryItems); TaxDeclarationStrategy taxDeclarationStrategy = new TaxDeclarationCommon(); TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext, (long) user.getUID()); taxDeclarationValues.addAll(generateResult.getTaxDeclarationValues()); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index f3e0a89e5..64fba69e2 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -229,7 +229,7 @@ public class TaxDeclarationController { try { User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(id ,requestId); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(id, requestId); String fileName = "申报内置算税结果-" + LocalDate.now(); try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); @@ -334,6 +334,35 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::refreshData, taxDeclareRecordParam.getTaxDeclareRecordId()); } + /** + * 新增表单 + * + * @param incomeCategory + * @return + */ + @GET + @Path("/getAddForm") + @Produces(MediaType.APPLICATION_JSON) + public String getAddForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "IncomeCategoryEnum") IncomeCategoryEnum incomeCategory) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getAddForm, incomeCategory); + } + + /** + * 新增 + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/add") + @Produces(MediaType.APPLICATION_JSON) + public String add(@Context HttpServletRequest request, @Context HttpServletResponse response,TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::add, param); + } + /** * 个税申报表详情列表 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index edd3900df..96c8e6ee6 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -3,13 +3,11 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.dto.*; -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.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.entity.taxdeclaration.po.*; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; @@ -89,6 +87,11 @@ public class TaxDeclareRecordWrapper extends Service { return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); } + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + /** * 个税申报记录列表 * @@ -463,11 +466,11 @@ public class TaxDeclareRecordWrapper extends Service { public Object getDeclareTaxResultFeedback(Long id) { - return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); + return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); } - public XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id,String requestId) { + public XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id, String requestId) { return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(id, requestId); } @@ -660,4 +663,29 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclarationExcelService(user).exportEmployee4Fail(queryParam); } + public List getAddForm(IncomeCategoryEnum incomeCategoryEnum) { + // 查询个税申报表列 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + return taxReportColumns; + } + + public void add(TaxDeclareRecordDetailSaveParam param) { + + TaxDeclarationValuePO build = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclarationId(param.getTaxDeclarationId()) + .taxDeclareRecordId(param.getTaxDeclareRecordId()) + .employeeId(param.getEmployeeId()) + .employeeType(param.getEmployeeType()) + .resultValue(param.getTaxReportColumnValues()) + .createTime(new Date()) + .updateTime(new Date()) + .creator((long) user.getUID()) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + List objects = new ArrayList<>(); + objects.add(build); + getTaxDeclarationValueService(user).batchSave(objects); + } } From d9c952e80c66280f502b4033ec391e862a4329bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 14 Dec 2023 17:55:48 +0800 Subject: [PATCH 089/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=96=B0=E5=A2=9E=E3=80=81=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/EmployeeDeclareListQueryParam.java | 1 + .../bo/TaxDeclarationDetailBO.java | 26 ++++- .../dto/TaxDeclareRecordDetailFormDTO.java | 76 +++++++++++++++ .../TaxDeclareRecordDetailFormParam.java | 21 ++++ .../TaxDeclareRecordDetailSaveParam.java | 32 +------ .../employeedeclare/EmployeeDeclareMapper.xml | 3 + .../service/TaxDeclarationValueService.java | 8 ++ .../impl/TaxDeclarationValueServiceImpl.java | 57 +++++++++++ .../salary/web/TaxDeclarationController.java | 61 ++++++++---- .../wrapper/TaxDeclareRecordWrapper.java | 95 +++++++++++++++---- 10 files changed, 309 insertions(+), 71 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java index e569ecbf1..27222c08f 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java @@ -48,6 +48,7 @@ public class EmployeeDeclareListQueryParam extends BaseQueryParam { // 员工姓名/编号 private String keyword; + private Long employeeId; // 部门 private Collection departmentIds; diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java index 81010fb7b..5b8454a82 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java @@ -2,11 +2,9 @@ package com.engine.salary.entity.taxdeclaration.bo; import com.engine.salary.constant.TaxDeclarationDataIndexConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationEmployeeDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO; +import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -15,6 +13,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.util.*; +import java.util.stream.Collectors; /** * 个税申报表详情 @@ -177,4 +176,23 @@ public class TaxDeclarationDetailBO { } return taxDeclarationLaborListDTOS; } + + + public static List convert2ListTaxReportColumn(List pos) { + if (CollectionUtils.isEmpty(pos)) { + return Collections.emptyList(); + } + + List collect = pos.stream().map(po -> { + TaxDeclareRecordDetailFormDTO.TaxReportColumn taxReportColumn = new TaxDeclareRecordDetailFormDTO.TaxReportColumn(); + taxReportColumn.setReportColumnName(po.getReportColumnName()); + taxReportColumn.setReportColumnDataIndex(po.getReportColumnDataIndex()); + taxReportColumn.setTaxReportType(po.getTaxReportType()); + taxReportColumn.setIncomeCategory(po.getIncomeCategory()); + taxReportColumn.setDataType(po.getDataType()); + return taxReportColumn; + }).collect(Collectors.toList()); + + return collect; + } } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java new file mode 100644 index 000000000..a94811684 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java @@ -0,0 +1,76 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * 个税申报明细新增表单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclareRecordDetailFormDTO { + + /** + * 个税申报表id + */ + private Long taxDeclarationId; + + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + private String username; + + @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") + private String cardType; + + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + /** + * 收入所得项目 + */ + private String incomeCategory; + + /** + * 人员报送下拉选择 + */ + private List employeeDeclares; + + /** + * 当前申报类型可编辑字段 + */ + private List taxReportColumns; + private Map resultValue; + + + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class TaxReportColumn { + //报表类型 + private String taxReportType; + //所得项目 + private String incomeCategory; + //申报表列索引 + private String reportColumnDataIndex ; + //申报表的列名 + private String reportColumnName; + //数值类型 + private String dataType; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java new file mode 100644 index 000000000..3386119bf --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import lombok.Data; + +/** + * 个税申报明细保存 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclareRecordDetailFormParam { + + /** + * 个税申报表id + */ + private Long taxDeclarationId; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java index 7744819ba..0f60decd9 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java @@ -1,7 +1,5 @@ package com.engine.salary.entity.taxdeclaration.param; -import com.engine.salary.annotation.SalaryTableColumn; -import com.engine.salary.annotation.TableTitle; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -23,10 +21,7 @@ public class TaxDeclareRecordDetailSaveParam { @JsonSerialize(using = ToStringSerializer.class) private Long id; - //个税申报记录id") - private Long taxDeclareRecordId; - - //个税申报表id") + //个税申报表id private Long taxDeclarationId; //人员id @@ -34,31 +29,6 @@ public class TaxDeclareRecordDetailSaveParam { private Long employeeId; private Integer employeeType; - @SalaryTableColumn( - text = "工号", width = "10%", column = "jobNum" - ) - @TableTitle(title ="工号",dataIndex = "jobNum",key = "jobNum") - private String jobNum; - - @SalaryTableColumn( - text = "姓名", width = "10%", column = "username" - ) - @TableTitle(title ="姓名",dataIndex = "username",key = "username") - private String username; - - @SalaryTableColumn( - text = "证件类型", width = "10%", column = "cardType" - ) - @TableTitle(title ="证件类型",dataIndex = "cardType",key = "cardType") - private String cardType; - - @SalaryTableColumn( - text = "证件号码", width = "10%", column = "cardNum" - ) - @TableTitle(title ="证件号码",dataIndex = "cardNum",key = "cardNum") - private String cardNum; - private Map taxReportColumnValues; - } diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 890181735..33e2deec0 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -838,6 +838,9 @@ AND declare_status = #{param.declareStatus.value} + + AND employee_id=#{param.employeeId} + AND employment_status = #{param.employmentStatus.value} diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 8ec154857..ab129909c 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -2,6 +2,7 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; 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.util.page.PageInfo; @@ -58,10 +59,17 @@ public interface TaxDeclarationValueService { */ void batchSave(List taxDeclarationValues); + + void save(TaxDeclareRecordDetailSaveParam param); + void edit(TaxDeclareRecordDetailSaveParam param); + TaxDeclarationValuePO getById(Long id); + /** * 删除个税申报表明细 * * @param taxDeclareRecordIds */ void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index f7aaf17c9..e45ba18f2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -3,6 +3,7 @@ package com.engine.salary.service.impl; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -10,11 +11,13 @@ import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; 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.TaxReportColumnPO; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; @@ -24,6 +27,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; @@ -63,6 +67,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); } + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + @Override public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds) { List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); @@ -131,6 +139,55 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } } + @Override + public void save(TaxDeclareRecordDetailSaveParam param) { + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + if(taxDeclaration==null){ + throw new SalaryRunTimeException("个税申报表不存在!"); + } + + TaxDeclarationValuePO po = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclarationId(param.getTaxDeclarationId()) + .taxDeclareRecordId(taxDeclaration.getTaxDeclareRecordId()) + .employeeId(param.getEmployeeId()) + .employeeType(param.getEmployeeType()) + .resultValue(param.getTaxReportColumnValues()) + .resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())) + .createTime(new Date()) + .updateTime(new Date()) + .creator((long) user.getUID()) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + + getTaxDeclarationValueMapper().insertIgnoreNull(po); + + } + + @Override + public void edit(TaxDeclareRecordDetailSaveParam param) { + TaxDeclarationValuePO po = getById(param.getId()); + po.setResultValue(param.getTaxReportColumnValues()); + po.setResultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())); + po.setUpdateTime(new Date()); + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + getTaxDeclarationValueMapper().updateIgnoreNull(po); + } + + @Override + public TaxDeclarationValuePO getById(Long id) { + TaxDeclarationValuePO po = getTaxDeclarationValueMapper().getById(id); + if(po==null){ + throw new SalaryRunTimeException("个税申报明细不存在!"); + } + encryptUtil.decrypt(po,TaxDeclarationValuePO.class); + po.setResultValue(JsonUtil.parseMap(po.getResultValueJson(), String.class)); + + return po; + } + @Override public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 64fba69e2..0d6ad1e9e 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -337,19 +337,20 @@ public class TaxDeclarationController { /** * 新增表单 * - * @param incomeCategory + * @param param * @return */ - @GET + @POST @Path("/getAddForm") @Produces(MediaType.APPLICATION_JSON) - public String getAddForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "IncomeCategoryEnum") IncomeCategoryEnum incomeCategory) { + public String getAddForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailFormParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getAddForm, incomeCategory); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getAddForm, param); } /** * 新增 + * * @param request * @param response * @param param @@ -358,11 +359,45 @@ public class TaxDeclarationController { @POST @Path("/add") @Produces(MediaType.APPLICATION_JSON) - public String add(@Context HttpServletRequest request, @Context HttpServletResponse response,TaxDeclareRecordDetailSaveParam param) { + public String add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::add, param); } + + /** + * 编辑 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/edit") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::edit, param); + } + + /** + * 获取详细详细 + * + * @param request + * @param response + * @param id + * @return + */ + @GET + @Path("/detailInfo") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::detailInfo, id); + } + + /** * 个税申报表详情列表 * @@ -407,9 +442,7 @@ public class TaxDeclarationController { }; response.setContentType("application/octet-stream"); - return Response.ok(output) - .header("Content-disposition", "attachment;filename=" + fileName) - .header("Cache-Control", "no-cache").build(); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); } catch (Exception e) { log.error("个税申报表明细导出异常", e); throw e; @@ -544,9 +577,7 @@ public class TaxDeclarationController { }; response.setContentType("application/octet-stream"); - return Response.ok(output) - .header("Content-disposition", "attachment;filename=" + fileName) - .header("Cache-Control", "no-cache").build(); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); } catch (Exception e) { log.error("未报送的人员导出异常", e); throw e; @@ -581,9 +612,7 @@ public class TaxDeclarationController { }; response.setContentType("application/octet-stream"); - return Response.ok(output) - .header("Content-disposition", "attachment;filename=" + fileName) - .header("Cache-Control", "no-cache").build(); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); } catch (Exception e) { log.error("缺少申报数据的人员导出异常", e); throw e; @@ -617,9 +646,7 @@ public class TaxDeclarationController { }; response.setContentType("application/octet-stream"); - return Response.ok(output) - .header("Content-disposition", "attachment;filename=" + fileName) - .header("Cache-Control", "no-cache").build(); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); } catch (Exception e) { log.error("申报失败人员导出异常", e); throw e; diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 96c8e6ee6..17b58d8e1 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -3,12 +3,17 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; -import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO; import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; @@ -91,6 +96,10 @@ public class TaxDeclareRecordWrapper extends Service { return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); } + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + /** * 个税申报记录列表 @@ -663,29 +672,77 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclarationExcelService(user).exportEmployee4Fail(queryParam); } - public List getAddForm(IncomeCategoryEnum incomeCategoryEnum) { + public TaxDeclareRecordDetailFormDTO getAddForm(TaxDeclareRecordDetailFormParam param) { + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); // 查询个税申报表列 - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); - return taxReportColumns; + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory())); + //当前税款所属期报送成功且状态正常的人员 + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( + EmployeeDeclareListQueryParam + .builder() + .taxCycle(taxDeclaration.getTaxCycle()) + .taxAgentId(taxDeclaration.getTaxAgentId()) + .declareStatus(DeclareStatusEnum.DECLARE_SUCCESS) + .employmentStatus(EmploymentStatusEnum.NORMAL) + .build() + ); + + //过滤申报表中已存在的人员 + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationIds(Collections.singletonList(param.getTaxDeclarationId())); + Set empIds = SalaryEntityUtil.properties(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); + + employeeDeclarePOS = employeeDeclarePOS.stream().filter(emp -> !empIds.contains(emp.getEmployeeId())).collect(Collectors.toList()); + + return TaxDeclareRecordDetailFormDTO.builder() + .taxReportColumns(TaxDeclarationDetailBO.convert2ListTaxReportColumn(taxReportColumns)) + .employeeDeclares(employeeDeclarePOS) + .taxDeclarationId(taxDeclaration.getTaxAgentId()) + .build(); } + /** + * 新增 + * @param param + */ public void add(TaxDeclareRecordDetailSaveParam param) { + getTaxDeclarationValueService(user).save(param); + } - TaxDeclarationValuePO build = TaxDeclarationValuePO.builder() - .id(IdGenerator.generate()) - .taxDeclarationId(param.getTaxDeclarationId()) - .taxDeclareRecordId(param.getTaxDeclareRecordId()) - .employeeId(param.getEmployeeId()) - .employeeType(param.getEmployeeType()) - .resultValue(param.getTaxReportColumnValues()) - .createTime(new Date()) - .updateTime(new Date()) - .creator((long) user.getUID()) - .deleteType(0) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + /** + * 编辑 + * @param param + */ + public void edit(TaxDeclareRecordDetailSaveParam param) { + getTaxDeclarationValueService(user).edit(param); + } + + public TaxDeclareRecordDetailFormDTO detailInfo(Long id) { + TaxDeclarationValuePO declarationValuePO = getTaxDeclarationValueService(user).getById(id); + TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(declarationValuePO.getTaxDeclarationId()); + + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( + EmployeeDeclareListQueryParam + .builder() + .taxCycle(taxDeclarationPO.getTaxCycle()) + .taxAgentId(taxDeclarationPO.getTaxAgentId()) + .employeeId(declarationValuePO.getEmployeeId()) + .build() + ); + + if (CollectionUtils.isEmpty(employeeDeclarePOS)) { + throw new SalaryRunTimeException("当前人员未报送!"); + } + EmployeeDeclarePO employeeDeclarePO = employeeDeclarePOS.get(0); + // 查询个税申报表列 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory())); + return TaxDeclareRecordDetailFormDTO.builder() + .incomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getDefaultLabel()) + .cardNum(employeeDeclarePO.getCardNum()) + .cardType(SalaryEnumUtil.enumMatchByValue(employeeDeclarePO.getCardType(), CardTypeEnum.class).getDefaultLabel()) + .username(employeeDeclarePO.getEmployeeName()) + .jobNum(employeeDeclarePO.getJobNum()) + .taxReportColumns(TaxDeclarationDetailBO.convert2ListTaxReportColumn(taxReportColumns)) + .resultValue(declarationValuePO.getResultValue()) .build(); - List objects = new ArrayList<>(); - objects.add(build); - getTaxDeclarationValueService(user).batchSave(objects); } } From c581c8d74db7fa03dfd4472307d7d1363653a70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 20 Dec 2023 17:21:46 +0800 Subject: [PATCH 090/298] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/TaxDeclarationCommon.java | 5 +- .../enums/salarysob/IncomeCategoryEnum.java | 140 ++++- .../GetDeclareTaxResultFeedbackResponse.java | 523 ++++++++++-------- .../salary/service/TaxDeclarationService.java | 4 +- .../impl/TaxDeclarationServiceImpl.java | 15 +- .../impl/TaxDeclareRecordServiceImpl.java | 10 +- .../engine/salary/util/excel/ExcelUtil.java | 65 +++ 7 files changed, 490 insertions(+), 272 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index 88192ff3e..904e638e4 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -19,6 +19,7 @@ import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import dm.jdbc.util.IdGenerator; +import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Field; import java.math.BigDecimal; @@ -63,8 +64,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); - String defaultValue = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0" : ""; - String value = defaultValue; + String value = ""; if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { value = salaryAcctResultValue.stream() .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) @@ -72,6 +72,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { .orElse(new SalaryAcctResultPO()) .getResultValue(); } + value = StringUtils.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); } TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 762b3e581..71009b4e6 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,13 +1,12 @@ package com.engine.salary.enums.salarysob; import com.engine.salary.enums.BaseEnum; +import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Objects; +import java.util.*; /** * 应税项目 @@ -20,19 +19,123 @@ import java.util.Objects; public enum IncomeCategoryEnum implements BaseEnum { // todo 多语言 - WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487), - REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488), - ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489), - COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", 181936), - COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", 181937), - INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", 181938), - ANNUITY_RECEIPT(110, "0110", "年金领取", 181939), - INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", 181940), - INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", 181942), - REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", 181943), - REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", 175330), - REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", 181944), - ROYALTIES(600, "0600", "特许权使用费所得", 181945), + WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", 181936) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", 181937) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", 181938) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + ANNUITY_RECEIPT(110, "0110", "年金领取", 181939) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", 181940) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", 181942) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", 181943) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", 175330) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", 181944) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + ROYALTIES(600, "0600", "特许权使用费所得", 181945) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, ; @@ -51,6 +154,8 @@ public enum IncomeCategoryEnum implements BaseEnum { this.labelId = labelId; } + public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + @Override public Integer getValue() { return value; @@ -79,6 +184,7 @@ public enum IncomeCategoryEnum implements BaseEnum { } return null; } + public static List parseByValue(Collection values) { if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java index 47f9c42fe..1313ca083 100644 --- a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -58,10 +58,11 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { // * 限售股所得 必填:是 见限售股所得计算结果 // */ // private 对象 xsgsd; -// /** -// * 人员申报失败列表 必填:是 参考人员代报结果对象 -// */ -// private 数组 rysbsblb; + + /** + * 人员申报失败列表 必填:是 参考人员代报结果对象 + */ + private List rysbsblb; @Data public static class zhsd { @@ -73,66 +74,66 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { * 正常工资薪金算税结果对象 参考综合所得算税结果对象 */ private zcgzxj zcgzxj; -// /** -// * 全年一次性奖金收入算税结果对象 参考综合所得算税结果对象 -// */ -// private 对象 qnycxjjsslb; -// /** -// * 稿酬所得算税结果对象 参考综合所得算税结果对象 -// */ -// private 对象 gcsdlb; -// /** -// * 一般劳务报酬算税结果对象 参考综合所得算税结果对象 -// */ -// private 对象 lwbclb; -// /** -// * 解除劳动合同一次性补偿金列表 参考综合所得算税结果对象 -// */ -// private 对象 jcldhtycxbcjlb; -// /** -// * 保险营销员薪金算税结果对象 参考综合所得算税结果对象 -// */ -// private 对象 bxyxy; -// /** -// * 证券经纪人薪金算税结果对象 参考综合所得算税结果对象 -// */ -// private 对象 zqjjr; -// /** -// * 特许权算税结果对象 参考综合所得算税结果对象 -// */ -// private 对象 txq; -// /** -// * 个人股权激励结果对象 参考综合所得算税结果对象 -// */ -// private 对象 grgqjl; -// /** -// * 企业年金结果对象 参考综合所得算税结果对象 -// */ -// private 对象 qynj; -// /** -// * 内退一次性补偿金 参考综合所得算税结果对象 -// */ -// private 对象 ntycxbcjlb; -// /** -// * 其他连续劳务报酬 参考综合所得算税结果对象 -// */ -// private 对象 qtlxlwbc; -// /** -// * 其他非连续劳务报酬 参考综合所得算税结果对象 -// */ -// private 对象 qtflxlwbc; -// /** -// * 提前退休一次性补贴 参考综合所得算税结果对象 -// */ -// private 对象 tqtxycxbt; -// /** -// * 央企负责人绩效薪金延期兑现收入和任期奖励 参考综合所得算税结果对象 -// */ -// private 对象 yqfzrsrhjl; -// /** -// * 法律援助劳务报酬 参考综合所得算税结果对象 -// */ -// private 对象 flyzlwbclb; + /** + * 全年一次性奖金收入算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj qnycxjjsslb; + /** + * 稿酬所得算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj gcsdlb; + /** + * 一般劳务报酬算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj lwbclb; + /** + * 解除劳动合同一次性补偿金列表 参考综合所得算税结果对象 + */ + private zcgzxj jcldhtycxbcjlb; + /** + * 保险营销员薪金算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj bxyxy; + /** + * 证券经纪人薪金算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj zqjjr; + /** + * 特许权算税结果对象 参考综合所得算税结果对象 + */ + private zcgzxj txq; + /** + * 个人股权激励结果对象 参考综合所得算税结果对象 + */ + private zcgzxj grgqjl; + /** + * 企业年金结果对象 参考综合所得算税结果对象 + */ + private zcgzxj qynj; + /** + * 内退一次性补偿金 参考综合所得算税结果对象 + */ + private zcgzxj ntycxbcjlb; + /** + * 其他连续劳务报酬 参考综合所得算税结果对象 + */ + private zcgzxj qtlxlwbc; + /** + * 其他非连续劳务报酬 参考综合所得算税结果对象 + */ + private zcgzxj qtflxlwbc; + /** + * 提前退休一次性补贴 参考综合所得算税结果对象 + */ + private zcgzxj tqtxycxbt; + /** + * 央企负责人绩效薪金延期兑现收入和任期奖励 参考综合所得算税结果对象 + */ + private zcgzxj yqfzrsrhjl; + /** + * 法律援助劳务报酬 参考综合所得算税结果对象 + */ + private zcgzxj flyzlwbclb; /** @@ -234,7 +235,6 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 是否明细申报 必填:否 是或者否 */ - @SalaryTableColumn(text = "是否明细申报", width = "10%", column = "sfmxsb") private String sfmxsb; /** * 姓名 必填:null 如果是汇总申报返回空 @@ -264,133 +264,143 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 当期收入额 必填:是 不填写默认为0 */ - @SalaryTableColumn(text = "当期收入额", width = "10%", column = "sre") + @SalaryTableColumn(text = "本期收入", width = "10%", column = "sre") private BigDecimal sre; /** * 当期免税收入 必填:null */ - @SalaryTableColumn(text = "当期免税收入", width = "10%", column = "mssd") + @SalaryTableColumn(text = "本期免税收入", width = "10%", column = "mssd") private BigDecimal mssd; /** * 基本养老保险 必填:null */ - @SalaryTableColumn(text = "基本养老保险", width = "10%", column = "jbylaobxf") + @SalaryTableColumn(text = "本期基本养老保险费", width = "10%", column = "jbylaobxf") private BigDecimal jbylaobxf; /** * 基本医疗保险 必填:null */ - @SalaryTableColumn(text = "基本医疗保险", width = "10%", column = "jbylbxf") + @SalaryTableColumn(text = "本期基本医疗保险费", width = "10%", column = "jbylbxf") private BigDecimal jbylbxf; /** * 失业保险 必填:null */ - @SalaryTableColumn(text = "失业保险", width = "10%", column = "sybxf") + @SalaryTableColumn(text = "本期失业保险费", width = "10%", column = "sybxf") private BigDecimal sybxf; /** * 住房公积金 必填:null */ - @SalaryTableColumn(text = "住房公积金", width = "10%", column = "zfgjj") + @SalaryTableColumn(text = "本期住房公积金", width = "10%", column = "zfgjj") private BigDecimal zfgjj; - /** - * 子女教育支出 必填:null - */ - @SalaryTableColumn(text = "子女教育支出", width = "10%", column = "znjyzc") - private BigDecimal znjyzc; - /** - * 赡养老人支出 必填:null - */ - @SalaryTableColumn(text = "赡养老人支出", width = "10%", column = "sylrzc") - private BigDecimal sylrzc; - /** - * 住房贷款利息支出 必填:null - */ - @SalaryTableColumn(text = "住房贷款利息支出", width = "10%", column = "zfdklxzc") - private BigDecimal zfdklxzc; - /** - * 住房租金支出 必填:null - */ - @SalaryTableColumn(text = "住房租金支出", width = "10%", column = "zfzjzc") - private BigDecimal zfzjzc; - /** - * 继续教育支出 必填:null - */ - @SalaryTableColumn(text = "继续教育支出", width = "10%", column = "jxjyzc") - private BigDecimal jxjyzc; - /** - * 非学历继续教育支出 必填:null - */ - @SalaryTableColumn(text = "非学历继续教育支出", width = "10%", column = "fxljxjyzc") - private BigDecimal fxljxjyzc; - /** - * 3岁以下婴幼儿照护支出 必填:null - */ - @SalaryTableColumn(text = "3岁以下婴幼儿照护支出", width = "10%", column = "yyezhzc") - private BigDecimal yyezhzc; + /** * 年金 必填:null */ - @SalaryTableColumn(text = "年金", width = "10%", column = "nj") + @SalaryTableColumn(text = "本期企业(职业)年金", width = "10%", column = "nj") private BigDecimal nj; + /** * 商业健康保险 必填:null */ - @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "syjkbx") + @SalaryTableColumn(text = "本期商业健康保险费", width = "10%", column = "syjkbx") private BigDecimal syjkbx; /** * 税延养老保险 必填:null */ - @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "syylbx") + @SalaryTableColumn(text = "本期税延养老保险费", width = "10%", column = "syylbx") private BigDecimal syylbx; /** * 其他 必填:null 按法律规定可以在税前扣除的项目 */ - @SalaryTableColumn(text = "其他", width = "10%", column = "qt") + @SalaryTableColumn(text = "本期其他扣除(其他)", width = "10%", column = "qt") private BigDecimal qt; + /** - * 准予扣除的捐赠额 必填:null + * 累计收入额 必填:null */ - @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "zykcjze") - private BigDecimal zykcjze; + @SalaryTableColumn(text = "累计收入额", width = "10%", column = "ljsre") + private BigDecimal ljsre; /** - * 减免税额 必填:null + * 累计免税收入额 必填:null */ - @SalaryTableColumn(text = "减免税额", width = "10%", column = "jmse") - private BigDecimal jmse; + @SalaryTableColumn(text = "累计免税收入", width = "10%", column = "ljmssd") + private BigDecimal ljmssd; + /** - * 备注 必填:null + * 累计减除费用额 必填:null 正常工资薪金累计减除费用 对应保险营销员、证券经纪人累计费用 */ - @SalaryTableColumn(text = "备注", width = "10%", column = "bz") - private String bz; + @SalaryTableColumn(text = "累计减除费用", width = "10%", column = "ljjcfye") + private BigDecimal ljjcfye; + /** - * 减除费用 必填:null 正常工资薪金的减除费用。 对应保险营销员、证券经纪人的费用 + * 累计专项扣除额 必填:null 三险一金合计 */ - @SalaryTableColumn(text = "减除费用", width = "10%", column = "jcfy") - private BigDecimal jcfy; + @SalaryTableColumn(text = "累计专项扣除", width = "10%", column = "ljzxkce") + private BigDecimal ljzxkce; + /** - * 其他扣除合计 必填:null + * 累计子女教育支出 必填:null */ - @SalaryTableColumn(text = "其他扣除合计", width = "10%", column = "qtckhj") - private BigDecimal qtckhj; + @SalaryTableColumn(text = "累计子女教育支出扣除", width = "10%", column = "ljznjyzc") + private BigDecimal ljznjyzc; /** - * 应纳税所得额 必填:null 正常工资薪金返回Null + * 累计继续教育支出 必填:null */ - @SalaryTableColumn(text = "应纳税所得额", width = "10%", column = "ynssde") - private BigDecimal ynssde; + @SalaryTableColumn(text = "累计继续教育支出扣除", width = "10%", column = "ljjxjyzc") + private BigDecimal ljjxjyzc; /** - * 应纳税额 必填:null 正常工资薪金返回Null + * 累计非学历继续教育支持 必填:null */ - @SalaryTableColumn(text = "应纳税额", width = "10%", column = "ynse") - private BigDecimal ynse; + private BigDecimal ljfxljxjyzc; /** - * 已缴税额 必填:null 正常工资薪金返回Null + * 累计学历继续教育支持 必填:null */ - @SalaryTableColumn(text = "已缴税额", width = "10%", column = "ykjse") - private BigDecimal ykjse; + private BigDecimal ljxljxjyzc; /** - * 应扣缴税额 必填:null 正常工资薪金返回Null + * 累计住房租金支出 必填:null */ - @SalaryTableColumn(text = "应扣缴税额", width = "10%", column = "yingkjse") - private BigDecimal yingkjse; + @SalaryTableColumn(text = "累计住房租金支出扣除", width = "10%", column = "ljzfzjzc") + private BigDecimal ljzfzjzc; + /** + * 累计房屋贷款支出 必填:null + */ + @SalaryTableColumn(text = "累计房屋贷款支出扣除", width = "10%", column = "ljzfdklxzc") + private BigDecimal ljzfdklxzc; + /** + * 累计赡养老人支出 必填:null + */ + @SalaryTableColumn(text = "累计赡养老人支出扣除", width = "10%", column = "ljsylrzc") + private BigDecimal ljsylrzc; + /** + * 累计3岁以下婴幼儿照护支出 必填:null + */ + @SalaryTableColumn(text = "累计3岁以下婴幼儿照护", width = "10%", column = "ljyyezhzc") + private BigDecimal ljyyezhzc; + + + /** + * 累计个人养老金 必填:null + */ + @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "ljgrylj") + private BigDecimal ljgrylj; + + /** + * 累计其他扣除额 必填:null + */ + @SalaryTableColumn(text = "累计其他扣除", width = "10%", column = "ljqtkce") + private BigDecimal ljqtkce; + + /** + * 累计准予扣除的捐赠额 必填:null + */ + @SalaryTableColumn(text = "累计准予扣除的捐赠", width = "10%", column = "ljzykcjze") + private BigDecimal ljzykcjze; + + /** + * 累计应纳税所得额 必填:null + */ + @SalaryTableColumn(text = "累计应纳税所得额", width = "10%", column = "ljynssde") + private BigDecimal ljynssde; + /** * 税率 必填:null */ @@ -401,81 +411,19 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { */ @SalaryTableColumn(text = "速算扣除数", width = "10%", column = "sskcs") private BigDecimal sskcs; - /** - * 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬 - */ - @SalaryTableColumn(text = "所得项目名称", width = "10%", column = "sdxm") - private String sdxm; - /** - * 应补退税额 必填:null 应补退税额=累计应扣缴税额-累计已缴税额 - */ - @SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse") - private BigDecimal ybtse; - /** - * 累计收入额 必填:null - */ - @SalaryTableColumn(text = "累计收入额", width = "10%", column = "ljsre") - private BigDecimal ljsre; - /** - * 累计免税收入额 必填:null - */ - @SalaryTableColumn(text = "累计免税收入额", width = "10%", column = "ljmssd") - private BigDecimal ljmssd; - /** - * 累计专项扣除额 必填:null 三险一金合计 - */ - @SalaryTableColumn(text = "累计专项扣除额", width = "10%", column = "ljzxkce") - private BigDecimal ljzxkce; - /** - * 累计专项附加扣除额 必填:null 专项附加合计 - */ - @SalaryTableColumn(text = "累计专项附加扣除额", width = "10%", column = "ljzxfjkce") - private BigDecimal ljzxfjkce; - /** - * 累计其他扣除额 必填:null - */ - @SalaryTableColumn(text = "累计其他扣除额", width = "10%", column = "ljqtkce") - private BigDecimal ljqtkce; - /** - * 累计减免税额 必填:null - */ - @SalaryTableColumn(text = "累计减免税额", width = "10%", column = "ljjmse") - private BigDecimal ljjmse; - /** - * 累计减除费用额 必填:null 正常工资薪金累计减除费用 对应保险营销员、证券经纪人累计费用 - */ - @SalaryTableColumn(text = "累计减除费用额", width = "10%", column = "ljjcfye") - private BigDecimal ljjcfye; - /** - * 累计月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 - */ - @SalaryTableColumn(text = "累计月减除费用", width = "10%", column = "ljyjcfy") - private BigDecimal ljyjcfy; - /** - * 允许扣除税费 必填:null 保险营销员、证券经纪人 - */ - @SalaryTableColumn(text = "允许扣除税费", width = "10%", column = "yxkcsf") - private BigDecimal yxkcsf; - /** - * 展业成本 必填:null 保险营销员、证券经纪人 - */ - @SalaryTableColumn(text = "展业成本", width = "10%", column = "zycb") - private BigDecimal zycb; - /** - * 月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 - */ - @SalaryTableColumn(text = "月减除费用", width = "10%", column = "yjcfy") - private BigDecimal yjcfy; - /** - * 累计应纳税所得额 必填:null - */ - @SalaryTableColumn(text = "累计应纳税所得额", width = "10%", column = "ljynssde") - private BigDecimal ljynssde; + /** * 累计应纳税额 必填:null */ @SalaryTableColumn(text = "累计应纳税额", width = "10%", column = "ljynse") private BigDecimal ljynse; + + /** + * 累计减免税额 必填:null + */ + @SalaryTableColumn(text = "累计减免税额", width = "10%", column = "ljjmse") + private BigDecimal ljjmse; + /** * 累计应扣缴税额 必填:null 累计应扣缴税额 = 累计应纳税额 - 累计减免税额 */ @@ -487,59 +435,114 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { @SalaryTableColumn(text = "累计已缴税额", width = "10%", column = "ljykjse") private BigDecimal ljykjse; /** - * 累计子女教育支出 必填:null + * 已缴税额 必填:null 正常工资薪金返回Null */ - @SalaryTableColumn(text = "累计子女教育支出", width = "10%", column = "ljznjyzc") - private BigDecimal ljznjyzc; + @SalaryTableColumn(text = "已缴税额", width = "10%", column = "ykjse") + private BigDecimal ykjse; + /** - * 累计继续教育支出 必填:null + * 累计专项附加扣除额 必填:null 专项附加合计 */ - @SalaryTableColumn(text = "累计继续教育支出", width = "10%", column = "ljjxjyzc") - private BigDecimal ljjxjyzc; + @SalaryTableColumn(text = "累计专项附加扣除额", width = "10%", column = "ljzxfjkce") + private BigDecimal ljzxfjkce; + /** - * 累计非学历继续教育支持 必填:null + * 应补退税额 必填:null 应补退税额=累计应扣缴税额-累计已缴税额 */ - @SalaryTableColumn(text = "累计非学历继续教育支持", width = "10%", column = "ljfxljxjyzc") - private BigDecimal ljfxljxjyzc; + @SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse") + private BigDecimal ybtse; + /** - * 累计学历继续教育支持 必填:null + * 备注 必填:null */ - @SalaryTableColumn(text = "累计学历继续教育支持", width = "10%", column = "ljxljxjyzc") - private BigDecimal ljxljxjyzc; + @SalaryTableColumn(text = "备注", width = "10%", column = "bz") + private String bz; + /** - * 累计住房租金支出 必填:null + * 子女教育支出 必填:null */ - @SalaryTableColumn(text = "累计住房租金支出", width = "10%", column = "ljzfzjzc") - private BigDecimal ljzfzjzc; + private BigDecimal znjyzc; /** - * 累计房屋贷款支出 必填:null + * 赡养老人支出 必填:null */ - @SalaryTableColumn(text = "累计房屋贷款支出", width = "10%", column = "ljzfdklxzc") - private BigDecimal ljzfdklxzc; + private BigDecimal sylrzc; /** - * 累计赡养老人支出 必填:null + * 住房贷款利息支出 必填:null */ - @SalaryTableColumn(text = "累计赡养老人支出", width = "10%", column = "ljsylrzc") - private BigDecimal ljsylrzc; + private BigDecimal zfdklxzc; /** - * 累计3岁以下婴幼儿照护支出 必填:null + * 住房租金支出 必填:null */ - @SalaryTableColumn(text = "累计3岁以下婴幼儿照护支出", width = "10%", column = "ljyyezhzc") - private BigDecimal ljyyezhzc; + private BigDecimal zfzjzc; /** - * 累计准予扣除的捐赠额 必填:null + * 继续教育支出 必填:null */ - @SalaryTableColumn(text = "累计准予扣除的捐赠额", width = "10%", column = "ljzykcjze") - private BigDecimal ljzykcjze; + private BigDecimal jxjyzc; /** - * 累计个人养老金 必填:null + * 非学历继续教育支出 必填:null */ - @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "ljgrylj") - private BigDecimal ljgrylj; + private BigDecimal fxljxjyzc; + /** + * 3岁以下婴幼儿照护支出 必填:null + */ + private BigDecimal yyezhzc; + + /** + * 准予扣除的捐赠额 必填:null + */ + private BigDecimal zykcjze; + /** + * 减免税额 必填:null + */ + private BigDecimal jmse; + + /** + * 减除费用 必填:null 正常工资薪金的减除费用。 对应保险营销员、证券经纪人的费用 + */ + private BigDecimal jcfy; + /** + * 其他扣除合计 必填:null + */ + private BigDecimal qtckhj; + /** + * 应纳税所得额 必填:null 正常工资薪金返回Null + */ + private BigDecimal ynssde; + /** + * 应纳税额 必填:null 正常工资薪金返回Null + */ + private BigDecimal ynse; + + /** + * 应扣缴税额 必填:null 正常工资薪金返回Null + */ + private BigDecimal yingkjse; + + /** + * 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬 + */ + private String sdxm; + + /** + * 累计月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 + */ + private BigDecimal ljyjcfy; + /** + * 允许扣除税费 必填:null 保险营销员、证券经纪人 + */ + private BigDecimal yxkcsf; + /** + * 展业成本 必填:null 保险营销员、证券经纪人 + */ + private BigDecimal zycb; + /** + * 月减除费用 必填:null 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 + */ + private BigDecimal yjcfy; + /** * 累计个人养老金校验码 必填:null */ - @SalaryTableColumn(text = "累计个人养老金校验码", width = "10%", column = "ljgryljjym") private String ljgryljjym; /** * 企业上月是否已申报 必填:null 仅在两个月算税场景时使用,当前月分为N月: @@ -547,34 +550,28 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { * 1表示N-1月(上月)已申报 * 2表示N-2月(上上个月)未申报 */ - @SalaryTableColumn(text = "企业上月是否已申报", width = "10%", column = "qysysfysb") private String qysysfysb; /** * 员工在税局累计已扣缴的税额 必填:null 当前月分为N,如果N-1(上月)已申报,则返回N-1月员工在税局累计已扣缴的税额; * 如果N-1月未申报,则返回N-2月工在税局累计已扣缴的税额; */ - @SalaryTableColumn(text = "员工在税局累计已扣缴的税额", width = "10%", column = "ygzsjljykjse") private BigDecimal ygzsjljykjse; /** * 本月已累计扣除税额 必填:null 针对一月多次算税的场景字段 */ - @SalaryTableColumn(text = "本月已累计扣除税额", width = "10%", column = "byyljkjse") private BigDecimal byyljkjse; /** * 本次应扣缴税额 必填:null 针对一月多次算税的场景字段,本次应扣缴税额=本月应扣缴税额-本月已累计税额 */ - @SalaryTableColumn(text = "本次应扣缴税额", width = "10%", column = "bcykjse") private BigDecimal bcykjse; /** * 分摊年度数 必填:null */ - @SalaryTableColumn(text = "分摊年度数", width = "10%", column = "ftnds") private Integer ftnds; /** * 年减除费用 必填:null 默认为60000 */ - @SalaryTableColumn(text = "年减除费用", width = "10%", column = "njcfy") private BigDecimal njcfy; } @@ -622,6 +619,44 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { } + /** + * 4.4.1.3.1.1人员代报结果对象 + */ + @Data + public static class rydbjgdx { + /** + * 人员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; + } } diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 2731904a5..cb12aae30 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -23,6 +23,8 @@ public interface TaxDeclarationService { */ List listByTaxCycleAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds); + List listByTaxDeclareRecordId(Long taxDeclareRecordId); + PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam); List countByTaxDeclarationId(Collection taxAgentIds); @@ -33,7 +35,6 @@ public interface TaxDeclarationService { /** * 删除个税申报表 - * */ void delete(SalaryAcctRecordPO salaryAcctRecordPO); @@ -48,6 +49,7 @@ public interface TaxDeclarationService { /** * 撤回个税申报单 + * * @param taxDeclarationId */ void withDrawTaxDeclaration(Long taxDeclarationId); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 987eacf58..3c8391812 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -94,6 +94,15 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration return taxDeclarationPOS; } + @Override + public List listByTaxDeclareRecordId(Long taxDeclareRecordId) { + if (Objects.isNull(taxDeclareRecordId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).build(); + return getTaxDeclarationMapper().listSome(po); + } + @Override public PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam) { long currentEmployeeId = user.getUID(); @@ -205,7 +214,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration // 无薪资核算结果,不允许生成个税申报表 if (CollectionUtils.isEmpty(salaryAcctResultPOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}无可申报数据") - .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId); @@ -214,14 +223,14 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration boolean notArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报") - .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表 Date taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle(); boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0); if (differentTaxCycle) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}存在不同的税款所属期,无法正常生成个税申报表,请调整账套设置,重新核算后再生成个税申报表") - .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询薪资账套 Set salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 23606e23e..f84035722 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -35,6 +35,7 @@ import com.engine.salary.entity.taxdeclaration.response.DeclareTaxResponse; import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +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.*; @@ -942,12 +943,11 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? taxDeclareRecord.getRequestId() : requestId); - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); - // 需要导出的数据 - List> excelSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, sscglb); - - return ExcelUtil.genWorkbookV2(excelSheetData, "申报内置算税结果"); + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e->e.parseGetDeclareTaxResultFeedbackResponse(map,declareTaxResultFeedbackResponse)); + return ExcelUtil.genWorkbookV2(map); } diff --git a/src/com/engine/salary/util/excel/ExcelUtil.java b/src/com/engine/salary/util/excel/ExcelUtil.java index b9a0c5d2c..f0ac59837 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -272,6 +272,71 @@ public class ExcelUtil { return workbook; } + public static XSSFWorkbook genWorkbookV2(Map>> map) { + XSSFWorkbook workbook = new XSSFWorkbook(); + + map.entrySet().forEach(en->{ + + String sheetName = en.getKey(); + List> rowList = en.getValue(); + // 设置title样式 + XSSFCellStyle titleCellStyle = workbook.createCellStyle(); + XSSFFont titleFont = workbook.createFont(); + titleFont.setFontName("仿宋"); + titleFont.setFontHeightInPoints((short) 15); + titleCellStyle.setFont(titleFont); + titleCellStyle.setAlignment(HorizontalAlignment.CENTER); + titleCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());//背景色 + titleCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + + + // 设置主体样式 + XSSFCellStyle cellStyle = workbook.createCellStyle(); + XSSFFont font = workbook.createFont(); + font.setFontName("宋体"); + font.setFontHeightInPoints((short) 10);// 设置字体大小 + cellStyle.setFont(font);// 选择需要用到的字体格式 + cellStyle.setWrapText(true); + + XSSFSheet sheet = workbook.createSheet(sheetName); + //自适应宽度 + sheet.autoSizeColumn(0, true); + //默认列宽 + sheet.setDefaultColumnWidth(20); + //默认行高 + sheet.setDefaultRowHeightInPoints(18); + + for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) { + List infoList = rowList.get(rowIndex); + XSSFRow row = sheet.createRow(rowIndex); + for (int cellIndex = 0; cellIndex < infoList.size(); cellIndex++) { + XSSFCell cell = row.createCell(cellIndex); + if (rowIndex == 0) { + cell.setCellStyle(titleCellStyle); + } else { + cell.setCellStyle(cellStyle); + } + Object o = infoList.get(cellIndex); + if (o instanceof String) { + cell.setCellType(CellType.STRING); + cell.setCellValue(String.valueOf(o)); + } else if (o instanceof Boolean) { + cell.setCellType(CellType.BOOLEAN); + cell.setCellValue(String.valueOf(o)); + } else if (o instanceof Date) { + cell.setCellType(CellType.STRING); + cell.setCellValue(SalaryDateUtil.getFormatLocalDate((Date) o)); + } else { + cell.setCellType(CellType.STRING); + cell.setCellValue(o == null ? "" : o.toString()); + } + } + } + }); + + return workbook; + } + public static XSSFWorkbook genWorkbook(ExcelSheetData excelSheetData) { List> list = new ArrayList<>(); list.add(excelSheetData.getHeaders()); From 27977454488947ee1ac222413e22085f3058630d Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 26 Dec 2023 17:45:06 +0800 Subject: [PATCH 091/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81-=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/EmployeeDeclareExcelDTO.java | 21 + .../param/EmployeeDeclareImportParam.java | 10 + .../service/EmployeeDeclareExcelService.java | 9 + .../service/EmployeeDeclareService.java | 2 + .../impl/EmployeeDeclareExcelServiceImpl.java | 418 +++++++++++++++++- .../impl/EmployeeDeclareServiceImpl.java | 9 + .../salary/web/EmployeeDeclareController.java | 16 + .../wrapper/EmployeeDeclareWrapper.java | 10 + 8 files changed, 489 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java index 5e1c658d7..8880ce557 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java @@ -104,12 +104,33 @@ public class EmployeeDeclareExcelDTO { @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") private String employmentDate; + // 入职年度就业情形 + private String employmentFirstYear; + // 离职日期 @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") private String dismissDate; + // 是否残疾 + private Integer disability; + + // 残疾证号 + private String disabilityCardNo; + + // 是否孤老 + private Integer lonelyOld; + + // 是否是烈属 + private Integer martyrDependents; + + // 烈属证号 + private String martyrDependentsCardNo; + + // 是否扣除减除费用 + private Integer deductExpenses; + // 申报状态 private DeclareStatusEnum declareStatus; diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java index 72a7bd9f3..114013a90 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java @@ -15,4 +15,14 @@ public class EmployeeDeclareImportParam extends EmployeeDeclareListQueryParam { @ApiModelProperty("是否导出现有数据") private String exportData; + + //上传文件id + String imageId; + + // 校验字段 + private String checkType; + + // 个税扣义务人id + private Long taxAgentId; + } diff --git a/src/com/engine/salary/service/EmployeeDeclareExcelService.java b/src/com/engine/salary/service/EmployeeDeclareExcelService.java index f48aa1199..b4127377d 100644 --- a/src/com/engine/salary/service/EmployeeDeclareExcelService.java +++ b/src/com/engine/salary/service/EmployeeDeclareExcelService.java @@ -4,6 +4,8 @@ import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import java.util.Map; + /** * @description: 人员报送(人员)导入导出 * @author: xiajun @@ -21,6 +23,13 @@ public interface EmployeeDeclareExcelService { */ XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam); + /** + * 导入人员报送数据 + * @param param + * @return + */ + Map importData(EmployeeDeclareImportParam param); + /** * 导出人员信息采集-全部 * diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 0869a5869..ed184159a 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -182,4 +182,6 @@ public interface EmployeeDeclareService{ * @return */ String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param); + + void batchInsert(List insertList); } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 783e15511..4f51fed18 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -2,36 +2,58 @@ 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.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.service.EmployeeDeclareExcelService; import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.excel.ExcelSheetData; -import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.*; +import com.engine.salary.util.valid.SalaryCardUtil; import com.google.common.base.Joiner; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; +import weaver.file.ExcelSheet; +import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; +import java.io.InputStream; +import java.time.LocalDate; +import java.util.*; import java.util.stream.Collectors; +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; + /** * 人员报送(人员)导入导出 *

Copyright: Copyright (c) 2023

@@ -56,6 +78,10 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + @Override public XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam) { // 查询人员 @@ -96,6 +122,386 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee return ExcelUtil.genWorkbook(excelSheetData); } + @Override + public Map importData(EmployeeDeclareImportParam param) { + Map apidatas = new HashMap<>(); + InputStream fileInputStream = null; + try { + Date now = new Date(); + // 个税扣缴义务人id + Long taxAgentId = param.getTaxAgentId(); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); + if (taxAgent == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "参数错误,无法找到个税扣缴义务人")); + } + // 税款所属期 + String taxCycle = Util.null2String(param.getTaxCycle()); + Date taxCycleDate = param.getTaxCycle(); + if (!SalaryDateUtil.checkYearMonth(taxCycle)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "参数错误,税款所属期参数格式错误")); + } + + // 导出模板中的表头 + List headerList = getImportHeader().stream().map(header -> header.toString()).collect(Collectors.toList()); + // 查询所有的人员 + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); + // 查询所有的外部人员 + List extEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.EXT); + // 查询人员报送表的人员 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(SalaryDateUtil.dateStrToLocalDate(taxCycle), taxAgentId); + // 校验字段 + String checkType = param.getCheckType(); + Map extEmployeeMap = Maps.newHashMap(); + Map simpleEmployeeMap = Maps.newHashMap(); + Map employeeDeclareMap = Maps.newHashMapWithExpectedSize(employeeDeclares.size()); + if (Objects.equals(checkType, "jobNum")) { + extEmployeeMap = Collections.emptyMap(); + simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getWorkcode); + employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getJobNum); + } else { + // 查询所有人员的个人信息 + simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getIdNo); + extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, DataCollectionEmployee::getIdNo); + employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getCardNum); + } + // 需要新增的报送人员 + List needAddEmployeeDeclares = Lists.newArrayList(); + // 需要更新的报送人员 + List needUpdateEmployeeDeclares = Lists.newArrayList(); + // 索引(用于计算进度) + int index = 0; + // 失败的数量 + int failCount = 0; + // 成功的数量 + int successCount = 0; + // 错误行的索引 + int failRowIndex = 1; + // 包含错误提示信息的sheet页 + List errorExcelSheets = Lists.newArrayList(); + + String imageId = Util.null2String(param.getImageId()); + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + // 表头 + List headers = ExcelSupport.getSheetHeader(sheet, 0); + + // 检查表头 + String isCorrectHeader = checkHeader(headers, headerList); + if (isCorrectHeader != null) { + throw new SalaryRunTimeException(isCorrectHeader); + } + // 数据 + List> data = ExcelParseHelper.parse2Map(sheet, 1); + if (CollectionUtils.isEmpty(data)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "导入数据不能为空")); + } + // 错误提示信息 + List excelComments = Lists.newArrayList(); + List errorData = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + //行号 + String rowIndex = String.format("第%s行", i + 2); + + Map map = data.get(i); + // 数据是否存在错误 + boolean isError = false; + EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); + for (String dataKey : headerList) { + String dataValue = Util.null2String(map.get(dataKey)); + if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel( 0, "工号"))) { + if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "工号不能为空")); + errorData.add(errorMessageMap); + } + employeeDeclareExcel.setJobNum(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "姓名"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "姓名不能为空")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEmployeeName(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件类型"))) { + employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue().toString()); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件号码"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码不能为空")); + errorData.add(errorMessageMap); + } else if (!SalaryCardUtil.checkIdNum(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setCardNum(dataValue); + employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString()); + employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString()); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "人员状态"))) { + boolean legalDataValue = false; + for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { + if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { + legalDataValue = true; + employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue().toString()); + break; + } + } + if (!legalDataValue) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "人员状态只能填写正常或非正常")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型"))) { + boolean legalDataValue = false; + for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { + if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { + legalDataValue = true; + employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue().toString()); + break; + } + } + if (!legalDataValue) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型填写错误")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "入职年度就业情形"))) { + employeeDeclareExcel.setEmploymentFirstYear(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "手机号码"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "手机号码不能为空")); + errorData.add(errorMessageMap); + } else if (!SalaryCardUtil.checkMobile(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "手机号码格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setMobile(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业日期"))) { + if (StringUtils.isEmpty(dataValue)) { + if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型不为「其他」时,任职受雇从业日期为必填")); + errorData.add(errorMessageMap); + } + } else { + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue).toString()); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "离职日期"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "人员状态为非正常时,离职日期必填")); + errorData.add(errorMessageMap); + } + } else { + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue).toString()); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否残疾"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "是否残疾只能填写是与否")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "残疾证号"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "「是否残疾」填「是」时,残疾证号必填")); + errorData.add(errorMessageMap); + } + } else { + employeeDeclareExcel.setDisabilityCardNo(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否烈属"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "是否烈属只能填写是与否")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "烈属证号"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "「是否烈属」填「是」时,烈属证号必填")); + errorData.add(errorMessageMap); + } + } else { + employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否孤老"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "是否孤老只能填写是与否")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否扣除减除费用"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "是否扣除减除费用只能填写是与否")); + errorData.add(errorMessageMap); + } + } + } + if (!isError) { + if (StringUtils.equals(checkType, "jobNum")) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); + if (employeeDeclare == null) { + DataCollectionEmployee extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); + if (extEmployee == null && simpleEmployee == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "系统内的人员不存在该工号")); + errorData.add(errorMessageMap); + } else { + needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, + employeeDeclareExcel, taxAgentId, taxCycleDate, now)); + } + } else { + EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); + BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); + newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); + newEmployeeDeclare.setUpdateTime(now); + needUpdateEmployeeDeclares.add(newEmployeeDeclare); + if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { + newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + newEmployeeDeclare.setDeclareErrorMsg(""); + } + } + } else { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); + if (employeeDeclare == null) { + DataCollectionEmployee extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); + if (extEmployee == null && simpleEmployee == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "系统内的人员不存在该证件号码")); + errorData.add(errorMessageMap); + } else { + needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, + employeeDeclareExcel, taxAgentId, taxCycleDate, now)); + } + } else { + EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); + BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); + newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); + newEmployeeDeclare.setUpdateTime(now); + if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { + newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + newEmployeeDeclare.setDeclareErrorMsg(""); + } + needUpdateEmployeeDeclares.add(newEmployeeDeclare); + } + } + } + if (isError) { + failCount++; + failRowIndex++; + errorData.add(map); + continue; + } + successCount++; + } + + if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { + getEmployeeDeclareService(user).batchInsert(needAddEmployeeDeclares); + } + if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { + needUpdateEmployeeDeclares.stream().forEach(getEmployeeDeclareMapper()::update); + } + + apidatas.put("successCount", successCount); + apidatas.put("errorCount", failCount); + apidatas.put("errorNotice", excelComments); + // 发送导入回调信息 +// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); + + } catch (Exception e) { + log.error("人员报送信息导入失败:{}", e.getMessage(), e); + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; + } + + private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee, + EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, + Date taxCycle, Date now) { + EmployeeDeclarePO employeeDeclare = EmployeeDeclarePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentId) + .taxCycle(taxCycle) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(Long.valueOf(user.getUID())) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now).build(); + BeanUtils.copyProperties(employeeDeclareExcel, employeeDeclare); + if (extEmployee != null) { + employeeDeclare.setEmployeeId(extEmployee.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()); + } + if (simpleEmployee != null) { + employeeDeclare.setEmployeeId(simpleEmployee.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); + } + return employeeDeclare; + } + @Override public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { // 查询需要报送的人员 diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 5559e5214..1a18c8b3a 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -727,4 +727,13 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla return "执行完毕"; } + + @Override + public void batchInsert(List insertList) { + if (CollectionUtils.isEmpty(insertList)) { + return; + } + List> partition = Lists.partition(insertList, 100); + partition.forEach(getEmployeeDeclareMapper()::batchInsert); + } } diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index c2c2703e6..04e5fefaa 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -304,6 +304,22 @@ public class EmployeeDeclareController { } } + + /** + * 人员报送-导入 + * + * @param queryParam 导出参数 + * @return + */ + @POST + @Path("/importData") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public String importData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::importData, queryParam); + } + + /** * 人员报送-导出全部人员 * diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 399286e63..9b113d519 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -567,6 +567,16 @@ public class EmployeeDeclareWrapper extends Service { return getEmployeeDeclareExcelService(user).exportTemplate(param); } + /** + * 人员报送-导入数据 + * + * @param param + * @return + */ + public Map importData(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).importData(param); + } + /** * 人员报送-导出本月全部的人员 * From 14c97d8df96238f1a03134408d78de6453d21cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 27 Dec 2023 14:26:25 +0800 Subject: [PATCH 092/298] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/wrapper/TaxDeclareRecordWrapper.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 17b58d8e1..0de9131ea 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -36,7 +36,6 @@ import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Component; import weaver.general.Util; import weaver.hrm.User; @@ -52,7 +51,6 @@ import java.util.stream.Collectors; * @version 1.0 **/ @Slf4j -@Component public class TaxDeclareRecordWrapper extends Service { @@ -674,6 +672,11 @@ public class TaxDeclareRecordWrapper extends Service { public TaxDeclareRecordDetailFormDTO getAddForm(TaxDeclareRecordDetailFormParam param) { TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + + if (taxDeclaration == null) { + throw new SalaryRunTimeException("申报表不存在!"); + } + // 查询个税申报表列 List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory())); //当前税款所属期报送成功且状态正常的人员 @@ -702,6 +705,7 @@ public class TaxDeclareRecordWrapper extends Service { /** * 新增 + * * @param param */ public void add(TaxDeclareRecordDetailSaveParam param) { @@ -710,6 +714,7 @@ public class TaxDeclareRecordWrapper extends Service { /** * 编辑 + * * @param param */ public void edit(TaxDeclareRecordDetailSaveParam param) { From 2dc7e7f54180c9e43a54d10cc64765cc8ce91bad Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 27 Dec 2023 16:58:47 +0800 Subject: [PATCH 093/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../employeedeclare/bo/EmployeeDeclareBO.java | 47 +++++++++++++ .../employeedeclare/EmploymentStatusEnum.java | 15 ++++ .../employeedeclare/EmploymentTypeEnum.java | 15 ++++ .../enums/employeedeclare/GenderEnum.java | 15 ++++ .../service/EmployeeDeclareExcelService.java | 8 +++ .../impl/EmployeeDeclareExcelServiceImpl.java | 68 ++++++++++++++++--- .../salary/web/EmployeeDeclareController.java | 15 +++- .../wrapper/EmployeeDeclareWrapper.java | 10 +++ 8 files changed, 183 insertions(+), 10 deletions(-) create mode 100644 src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java new file mode 100644 index 000000000..d3d91e5f8 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java @@ -0,0 +1,47 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import org.apache.commons.lang3.StringUtils; + +/** + * @author Harryxzy + * @ClassName EmployeeDeclareBO + * @date 2023/12/27 14:13 + * @description + */ +public class EmployeeDeclareBO { + + public static EmployeeDeclarePO convert2PO(EmployeeDeclareExcelDTO dto) { + if (dto == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "参数错误")); + } + EmployeeDeclarePO po = EmployeeDeclarePO.builder() + .jobNum(dto.getJobNum()) + .employeeName(dto.getEmployeeName()) + .cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) + .cardNum(dto.getCardNum()) + .employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus())) + .employmentType(EmploymentTypeEnum.getValueByDefaultLabel(dto.getEmploymentType())) + .employmentFirstYear(dto.getEmploymentFirstYear()) + .mobile(dto.getMobile()) + .employmentDate(StringUtils.isBlank(dto.getEmploymentDate()) ? null : SalaryDateUtil.stringToDate(dto.getEmploymentDate()) ) + .dismissDate(StringUtils.isBlank(dto.getDismissDate()) ? null : SalaryDateUtil.stringToDate(dto.getDismissDate())) + .disability(dto.getDisability()) + .disabilityCardNo(dto.getDisabilityCardNo()) + .martyrDependents(dto.getMartyrDependents()) + .martyrDependentsCardNo(dto.getMartyrDependentsCardNo()) + .lonelyOld(dto.getLonelyOld()) + .deductExpenses(dto.getDeductExpenses()) + .gender(StringUtils.isBlank(dto.getGender()) ? null : new Integer(dto.getGender())) + .birthday(StringUtils.isBlank(dto.getBirthday()) ? null : SalaryDateUtil.stringToDate(dto.getBirthday())) + .build(); + return po; + } + +} diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java index 75a8901b6..88e40e0de 100644 --- a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Arrays; + /** * 人员状态 *

Copyright: Copyright (c) 2023

@@ -41,4 +43,17 @@ public enum EmploymentStatusEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + EmploymentStatusEnum[] enumAry = EmploymentStatusEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java index 609e7f8f8..08941637d 100644 --- a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Arrays; + /** * 任职受雇从业类型 *

Copyright: Copyright (c) 2023

@@ -44,4 +46,17 @@ public enum EmploymentTypeEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + EmploymentTypeEnum[] enumAry = EmploymentTypeEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java index 805afa7bd..a4849d129 100644 --- a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Arrays; + /** * 性别 *

Copyright: Copyright (c) 2023

@@ -41,4 +43,17 @@ public enum GenderEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + GenderEnum[] enumAry = GenderEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } } diff --git a/src/com/engine/salary/service/EmployeeDeclareExcelService.java b/src/com/engine/salary/service/EmployeeDeclareExcelService.java index b4127377d..cce2e72e9 100644 --- a/src/com/engine/salary/service/EmployeeDeclareExcelService.java +++ b/src/com/engine/salary/service/EmployeeDeclareExcelService.java @@ -23,6 +23,14 @@ public interface EmployeeDeclareExcelService { */ XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam); + + /** + * 导入预览 + * @param param + * @return + */ + Map preview(EmployeeDeclareImportParam param); + /** * 导入人员报送数据 * @param param diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 4f51fed18..4352be9cf 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -4,6 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareBO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; @@ -42,11 +43,14 @@ import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.BeanUtils; +import org.springframework.beans.BeanWrapper; +import org.springframework.beans.BeanWrapperImpl; import weaver.file.ExcelSheet; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; +import java.beans.PropertyDescriptor; import java.io.InputStream; import java.time.LocalDate; import java.util.*; @@ -104,8 +108,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee row.add(employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); row.add(employeeDeclare.getEmploymentFirstYear()); row.add(employeeDeclare.getMobile()); - row.add(Util.null2String(employeeDeclare.getEmploymentDate())); - row.add(Util.null2String(employeeDeclare.getDismissDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate())); row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); row.add(employeeDeclare.getDisabilityCardNo()); row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); @@ -122,6 +126,33 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee return ExcelUtil.genWorkbook(excelSheetData); } + @Override + public Map preview(EmployeeDeclareImportParam param) { + //1、参数校验 + String imageId = param.getImageId(); + if (StringUtils.isBlank(imageId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "文件id为空")); + } + Map map = new HashMap<>(); + + InputStream fileInputStream = null; + try { + + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); + + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + List headers = ExcelSupport.getSheetHeader(sheet, 0); + + map.put("headers", headers); + map.put("list", ExcelParseHelper.parse2List(sheet, 1)); + + return map; + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + } + @Override public Map importData(EmployeeDeclareImportParam param) { Map apidatas = new HashMap<>(); @@ -135,11 +166,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "参数错误,无法找到个税扣缴义务人")); } // 税款所属期 - String taxCycle = Util.null2String(param.getTaxCycle()); + String taxCycle = SalaryDateUtil.getFormatDate(param.getTaxCycle()); Date taxCycleDate = param.getTaxCycle(); - if (!SalaryDateUtil.checkYearMonth(taxCycle)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "参数错误,税款所属期参数格式错误")); - } // 导出模板中的表头 List headerList = getImportHeader().stream().map(header -> header.toString()).collect(Collectors.toList()); @@ -437,7 +465,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } else { EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); - BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); newEmployeeDeclare.setUpdateTime(now); if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { @@ -466,7 +495,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee apidatas.put("successCount", successCount); apidatas.put("errorCount", failCount); - apidatas.put("errorNotice", excelComments); + apidatas.put("errorNotice", errorData); // 发送导入回调信息 // salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); @@ -478,6 +507,25 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee return apidatas; } + + public static String[] getNullPropertyNames (Object source) { + final BeanWrapper src = new BeanWrapperImpl(source); + PropertyDescriptor[] pds = src.getPropertyDescriptors(); + + Set emptyNames = new HashSet<>(); + for(PropertyDescriptor pd : pds) { + Object srcValue = src.getPropertyValue(pd.getName()); + // 此处判断可根据需求修改 + if (srcValue == null) { + emptyNames.add(pd.getName()); + } + } + String[] result = new String[emptyNames.size()]; + return emptyNames.toArray(result); + } + + + private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee, EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, Date taxCycle, Date now) { @@ -490,7 +538,9 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .createTime(now) .updateTime(now).build(); - BeanUtils.copyProperties(employeeDeclareExcel, employeeDeclare); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + + BeanUtils.copyProperties(employeeDeclarePO, employeeDeclare, getNullPropertyNames(employeeDeclarePO)); if (extEmployee != null) { employeeDeclare.setEmployeeId(extEmployee.getEmployeeId()); employeeDeclare.setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()); diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 04e5fefaa..6c2979f97 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -304,6 +304,19 @@ public class EmployeeDeclareController { } } + /** + * 人员报送-导入预览 + * + * @param queryParam 导出参数 + * @return + */ + @POST + @Path("/preview") + @Produces(MediaType.APPLICATION_JSON) + public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::preview, queryParam); + } /** * 人员报送-导入 @@ -313,7 +326,7 @@ public class EmployeeDeclareController { */ @POST @Path("/importData") - @Produces(MediaType.APPLICATION_OCTET_STREAM) + @Produces(MediaType.APPLICATION_JSON) public String importData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::importData, queryParam); diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 9b113d519..39623bb5a 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -567,6 +567,16 @@ public class EmployeeDeclareWrapper extends Service { return getEmployeeDeclareExcelService(user).exportTemplate(param); } + /** + * 人员报送-导入数据 + * + * @param param + * @return + */ + public Map preview(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).preview(param); + } + /** * 人员报送-导入数据 * From 13f310e9e4cee60f8900cc87b18f94ee49889f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 27 Dec 2023 17:33:53 +0800 Subject: [PATCH 094/298] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312270603.sql | 5 + resource/sqlupgrade/GS/sql202312270603.sql | 5 + resource/sqlupgrade/JC/sql202312270603.sql | 5 + resource/sqlupgrade/Mysql/sql202312270603.sql | 2 + .../sqlupgrade/Oracle/sql202312270603.sql | 4 + resource/sqlupgrade/PG/sql202312270603.sql | 1 + .../sqlupgrade/SQLServer/sql202312270603.sql | 2 + resource/sqlupgrade/ST/sql202312270603.sql | 5 + .../bo/TaxDeclarationCommon.java | 8 +- .../po/TaxDeclarationValuePO.java | 7 ++ .../enums/taxdeclaration/SourceEnum.java | 48 ++++++++++ .../taxdeclaration/TaxDeclarationMapper.xml | 6 ++ .../TaxDeclarationValueMapper.java | 5 + .../TaxDeclarationValueMapper.xml | 20 ++++ .../salary/service/TaxDeclarationService.java | 1 + .../service/TaxDeclarationValueService.java | 8 ++ .../impl/TaxDeclarationServiceImpl.java | 9 ++ .../impl/TaxDeclarationValueServiceImpl.java | 93 ++++++++++++++++++- .../impl/TaxDeclareRecordServiceImpl.java | 5 +- 19 files changed, 231 insertions(+), 8 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202312270603.sql create mode 100644 resource/sqlupgrade/GS/sql202312270603.sql create mode 100644 resource/sqlupgrade/JC/sql202312270603.sql create mode 100644 resource/sqlupgrade/Mysql/sql202312270603.sql create mode 100644 resource/sqlupgrade/Oracle/sql202312270603.sql create mode 100644 resource/sqlupgrade/PG/sql202312270603.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202312270603.sql create mode 100644 resource/sqlupgrade/ST/sql202312270603.sql create mode 100644 src/com/engine/salary/enums/taxdeclaration/SourceEnum.java diff --git a/resource/sqlupgrade/DM/sql202312270603.sql b/resource/sqlupgrade/DM/sql202312270603.sql new file mode 100644 index 000000000..99adc68e5 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312270603.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + diff --git a/resource/sqlupgrade/GS/sql202312270603.sql b/resource/sqlupgrade/GS/sql202312270603.sql new file mode 100644 index 000000000..99adc68e5 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312270603.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + diff --git a/resource/sqlupgrade/JC/sql202312270603.sql b/resource/sqlupgrade/JC/sql202312270603.sql new file mode 100644 index 000000000..99adc68e5 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312270603.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312270603.sql b/resource/sqlupgrade/Mysql/sql202312270603.sql new file mode 100644 index 000000000..3b1e70e48 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312270603.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_tax_declaration_value +ADD COLUMN source int(0) NULL ; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312270603.sql b/resource/sqlupgrade/Oracle/sql202312270603.sql new file mode 100644 index 000000000..3865d0084 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312270603.sql @@ -0,0 +1,4 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270603.sql b/resource/sqlupgrade/PG/sql202312270603.sql new file mode 100644 index 000000000..2c6535f86 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312270603.sql @@ -0,0 +1 @@ +ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int NULL ; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312270603.sql b/resource/sqlupgrade/SQLServer/sql202312270603.sql new file mode 100644 index 000000000..a136431d3 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312270603.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_tax_declaration_value ADD source int NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312270603.sql b/resource/sqlupgrade/ST/sql202312270603.sql new file mode 100644 index 000000000..99adc68e5 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312270603.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index 904e638e4..2fb43ef1a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; @@ -42,11 +43,9 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { public TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId) { Date now = new Date(); // 薪资核算结果按照薪资核算人员id聚合分类 - Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map( - taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); // 薪资核算人员按照人员id聚合分类 - Map> employeeIdKeyMap = SalaryEntityUtil.group2Map( - taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); + Map> employeeIdKeyMap = SalaryEntityUtil.group2Map(taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { @@ -87,6 +86,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .createTime(now) .updateTime(now) + .source(SourceEnum.ACCT.getValue()) .build(); taxDeclarationValues.add(taxDeclarationValue); } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index 11b97036b..9c88986dd 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.taxdeclaration.po; import com.engine.salary.annotation.Encrypt; +import com.engine.salary.enums.taxdeclaration.SourceEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -88,6 +89,12 @@ public class TaxDeclarationValuePO implements Serializable { */ private Date updateTime; + /** + * 数据来源 + * @see SourceEnum + */ + private Integer source; + private Collection ids; private Collection taxDeclarationIds; diff --git a/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java b/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java new file mode 100644 index 000000000..999720d3f --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java @@ -0,0 +1,48 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 作废申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum SourceEnum implements BaseEnum { + + ACCT(0, "薪资核算", 160490), + AUTO(1, "自动补充", 160490), + ADD(2, "界面新增", 160491), + EDIT(3, "界面新增", 160491), + IMP(4, "界面导入", 160491); + + + SourceEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml index 5b9a8e1cc..8324daf64 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml @@ -75,6 +75,12 @@ AND tax_cycle = #{taxCycle} + + AND tax_declare_record_id = #{taxDeclareRecordId} + + + AND income_category = #{incomeCategory} + ORDER BY id DESC diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java index 1515f916c..fc5d0415f 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java @@ -120,4 +120,9 @@ public interface TaxDeclarationValueMapper { */ void batchInsert(@Param("collection") Collection taxDeclarationValues); + + List queryNotWagesEmpIds(@Param("taxDeclareRecordId")Long taxDeclareRecordId); + + List queryWagesEmpIds(@Param("taxDeclareRecordId")Long taxDeclareRecordId); + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index dfcaecaf1..5935df30e 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -428,4 +428,24 @@ + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index cb12aae30..91b38c3eb 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -24,6 +24,7 @@ public interface TaxDeclarationService { List listByTaxCycleAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds); List listByTaxDeclareRecordId(Long taxDeclareRecordId); + List listByTaxDeclareRecordId(Long taxDeclareRecordId,Integer incomeCategory); PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam); diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index ab129909c..70bd6f729 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -5,6 +5,7 @@ import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQuer 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 java.util.Collection; @@ -71,5 +72,12 @@ public interface TaxDeclarationValueService { */ void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + /** + * 因为单独申报年终奖不可行 + * 需要补充正常工资薪金的申报,按0申报 + * @param po + */ + void autoAddWagesDeclare(TaxDeclareRecordPO po); + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 3c8391812..d69513ae0 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -102,6 +102,15 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).build(); return getTaxDeclarationMapper().listSome(po); } + @Override + public List listByTaxDeclareRecordId(Long taxDeclareRecordId,Integer incomeCategory) { + if (Objects.isNull(taxDeclareRecordId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).incomeCategory(incomeCategory).build(); + return getTaxDeclarationMapper().listSome(po); + } + @Override public PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam) { diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index e45ba18f2..b8633e57b 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -14,9 +14,13 @@ import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQuer 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.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.service.*; @@ -27,6 +31,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -142,7 +147,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar @Override public void save(TaxDeclareRecordDetailSaveParam param) { TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); - if(taxDeclaration==null){ + if (taxDeclaration == null) { throw new SalaryRunTimeException("个税申报表不存在!"); } @@ -156,6 +161,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar .resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())) .createTime(new Date()) .updateTime(new Date()) + .source(SourceEnum.ADD.getValue()) .creator((long) user.getUID()) .deleteType(0) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) @@ -172,6 +178,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar po.setResultValue(param.getTaxReportColumnValues()); po.setResultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())); po.setUpdateTime(new Date()); + po.setSource(SourceEnum.EDIT.getValue()); encryptUtil.encrypt(po, TaxDeclarationValuePO.class); getTaxDeclarationValueMapper().updateIgnoreNull(po); } @@ -179,10 +186,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar @Override public TaxDeclarationValuePO getById(Long id) { TaxDeclarationValuePO po = getTaxDeclarationValueMapper().getById(id); - if(po==null){ + if (po == null) { throw new SalaryRunTimeException("个税申报明细不存在!"); } - encryptUtil.decrypt(po,TaxDeclarationValuePO.class); + encryptUtil.decrypt(po, TaxDeclarationValuePO.class); po.setResultValue(JsonUtil.parseMap(po.getResultValueJson(), String.class)); return po; @@ -207,4 +214,84 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar }); return taxDeclarationValues; } + + + @Override + public void autoAddWagesDeclare(TaxDeclareRecordPO taxDeclareRecord) { + + Long taxDeclareRecordId = taxDeclareRecord.getId(); + Date now = new Date(); + + //非正常薪资的人员 + List notWagesEmpIds = getTaxDeclarationValueMapper().queryNotWagesEmpIds(taxDeclareRecordId); + if (CollectionUtils.isEmpty(notWagesEmpIds)) { + return; + } + + //正常薪资人员 + List wagesEmpIds = getTaxDeclarationValueMapper().queryWagesEmpIds(taxDeclareRecordId); + + //比较差异 + List autoAddIds = notWagesEmpIds.stream().filter(id -> !wagesEmpIds.contains(id)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(autoAddIds)) { + return; + } + + //正常薪资的表头 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES); + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + String value = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; + valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); + } + + //当前申报表是否含正常申报 + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordId, IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()); + TaxDeclarationPO taxDeclarationPO; + if (CollectionUtils.isNotEmpty(list)) { + if (list.size() > 1) { + throw new SalaryRunTimeException("存在多条正常工资薪金申报表数据"); + } + taxDeclarationPO = list.get(0); + } else { + taxDeclarationPO = TaxDeclarationPO + .builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecordId) + .incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .salaryMonth(taxDeclareRecord.getSalaryMonth()) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .description(taxDeclareRecord.getRemark()) + .controlView(0) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + List taxList = new ArrayList<>(); + getTaxDeclarationService(user).saveBatch(taxList); + } + + //组装数据,自动补足 + List autoAddValuePOs = autoAddIds.stream().map((empId -> { + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclarationPO.getTaxDeclareRecordId()) + .taxDeclarationId(taxDeclarationPO.getId()) + .employeeType(0) + .employeeId(empId) + .resultValue(valueMap) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .source(SourceEnum.AUTO.getValue()) + .build(); + return taxDeclarationValue; + })).collect(Collectors.toList()); + batchSave(autoAddValuePOs); + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index f84035722..06a8da778 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -376,6 +376,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } + //艾志正常工资薪金补足年终奖人员 + getTaxDeclarationValueService(user).autoAddWagesDeclare(taxDeclareRecord); + //更新核算记录状态 getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); } @@ -946,7 +949,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map>> map = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e->e.parseGetDeclareTaxResultFeedbackResponse(map,declareTaxResultFeedbackResponse)); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); return ExcelUtil.genWorkbookV2(map); } From 7e561527ac4ce7c1f7cea16c80e0832c1cae31e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 27 Dec 2023 17:35:16 +0800 Subject: [PATCH 095/298] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=B7=A5=E8=B5=84=E8=96=AA=E9=87=91=E7=9A=84=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/TaxDeclareRecordServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 06a8da778..f68dee7eb 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -376,7 +376,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } - //艾志正常工资薪金补足年终奖人员 + //补充正常工资薪金的申报人员 getTaxDeclarationValueService(user).autoAddWagesDeclare(taxDeclareRecord); //更新核算记录状态 From 1c499ffd94ed04593d3c029e5a57362029b6d025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 28 Dec 2023 09:39:09 +0800 Subject: [PATCH 096/298] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=B7=A5=E8=B5=84=E8=96=AA=E9=87=91=E7=9A=84=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312270703.sql | 3 ++ resource/sqlupgrade/GS/sql202312270703.sql | 3 ++ resource/sqlupgrade/JC/sql202312270703.sql | 3 ++ resource/sqlupgrade/Mysql/sql202312270703.sql | 1 + .../sqlupgrade/Oracle/sql202312270703.sql | 2 ++ resource/sqlupgrade/PG/sql202312270703.sql | 1 + .../sqlupgrade/SQLServer/sql202312270703.sql | 2 ++ resource/sqlupgrade/ST/sql202312270703.sql | 3 ++ .../dto/TaxDeclareRecordDetailFormDTO.java | 11 ++++++ .../taxdeclaration/po/TaxDeclareRecordPO.java | 2 ++ .../TaxDeclarationValueMapper.xml | 35 +++++++++++++++---- .../wrapper/TaxDeclareRecordWrapper.java | 7 +++- 12 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202312270703.sql create mode 100644 resource/sqlupgrade/GS/sql202312270703.sql create mode 100644 resource/sqlupgrade/JC/sql202312270703.sql create mode 100644 resource/sqlupgrade/Mysql/sql202312270703.sql create mode 100644 resource/sqlupgrade/Oracle/sql202312270703.sql create mode 100644 resource/sqlupgrade/PG/sql202312270703.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202312270703.sql create mode 100644 resource/sqlupgrade/ST/sql202312270703.sql diff --git a/resource/sqlupgrade/DM/sql202312270703.sql b/resource/sqlupgrade/DM/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/GS/sql202312270703.sql b/resource/sqlupgrade/GS/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/JC/sql202312270703.sql b/resource/sqlupgrade/JC/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312270703.sql b/resource/sqlupgrade/Mysql/sql202312270703.sql new file mode 100644 index 000000000..099b6ab58 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312270703.sql @@ -0,0 +1 @@ +update hrsa_tax_declaration_value set source = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312270703.sql b/resource/sqlupgrade/Oracle/sql202312270703.sql new file mode 100644 index 000000000..e2477f553 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312270703.sql @@ -0,0 +1,2 @@ +update hrsa_tax_declaration_value set source = 0; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270703.sql b/resource/sqlupgrade/PG/sql202312270703.sql new file mode 100644 index 000000000..099b6ab58 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312270703.sql @@ -0,0 +1 @@ +update hrsa_tax_declaration_value set source = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312270703.sql b/resource/sqlupgrade/SQLServer/sql202312270703.sql new file mode 100644 index 000000000..0384f9313 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312270703.sql @@ -0,0 +1,2 @@ +update hrsa_tax_declaration_value set source = 0 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312270703.sql b/resource/sqlupgrade/ST/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java index a94811684..04e7d0bff 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java @@ -2,6 +2,8 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.TableTitle; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -29,6 +31,15 @@ public class TaxDeclareRecordDetailFormDTO { */ private Long taxDeclarationId; + //主键id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //人员id + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + private Integer employeeType; + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") private String jobNum; diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 6664f1985..8a88a15ee 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.po; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -50,6 +51,7 @@ public class TaxDeclareRecordPO implements Serializable { private Integer taxDeclareType; /** * 申报状态 + * @see TaxDeclareStatusEnum */ private Integer taxDeclareStatus; /** diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index 5935df30e..5eba618cb 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -13,6 +13,7 @@ + @@ -30,6 +31,7 @@ , t.employee_type , t.employee_id , t.result_value_json + , t.source @@ -88,6 +90,9 @@ AND result_value_json = #{resultValueJson} + + AND source = #{source} + AND id IN @@ -142,6 +147,9 @@ result_value_json, + + source, + @@ -177,6 +185,9 @@ #{resultValueJson}, + + #{source}, + @@ -195,7 +206,8 @@ tax_declaration_id, employee_type, employee_id, - result_value_json + result_value_json, + source ) VALUES ( @@ -210,7 +222,8 @@ #{item.taxDeclarationId}, #{item.employeeType}, #{item.employeeId}, - #{item.resultValueJson} + #{item.resultValueJson}, + #{item.source} ) @@ -228,7 +241,8 @@ tax_declaration_id, employee_type, employee_id, - result_value_json + result_value_json, + source ) @@ -243,7 +257,8 @@ #{item.taxDeclarationId,jdbcType=DOUBLE}, #{item.employeeType,jdbcType=INTEGER}, #{item.employeeId,jdbcType=DOUBLE}, - #{item.resultValueJson,jdbcType=VARCHAR} + #{item.resultValueJson,jdbcType=VARCHAR}, + #{item.source,jdbcType=INTEGER} from dual @@ -262,7 +277,8 @@ tax_declaration_id, employee_type, employee_id, - result_value_json + result_value_json, + source ) VALUES ( @@ -276,7 +292,8 @@ #{item.taxDeclarationId}, #{item.employeeType}, #{item.employeeId}, - #{item.resultValueJson} + #{item.resultValueJson}, + #{item.source} ) @@ -295,6 +312,7 @@ employee_type=#{employeeType}, employee_id=#{employeeId}, result_value_json=#{resultValueJson}, + source=#{source}, WHERE id = #{id} AND delete_type = 0 @@ -334,6 +352,9 @@ result_value_json=#{resultValueJson}, + + source=#{source}, + WHERE id = #{id} AND delete_type = 0 @@ -434,7 +455,7 @@ left join hrsa_tax_declaration_value b on a.id = b.tax_declaration_id where a.delete_type = 0 and b.delete_type = 0 - and a.income_category ]]> 1 + and a.income_category = 2 and a.tax_declare_record_id = #{taxDeclareRecordId} diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 17b58d8e1..28bcde42e 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -735,7 +735,12 @@ public class TaxDeclareRecordWrapper extends Service { EmployeeDeclarePO employeeDeclarePO = employeeDeclarePOS.get(0); // 查询个税申报表列 List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory())); - return TaxDeclareRecordDetailFormDTO.builder() + return TaxDeclareRecordDetailFormDTO + .builder() + .id(id) + .employeeId(employeeDeclarePO.getEmployeeId()) + .employeeType(employeeDeclarePO.getEmployeeType()) + .taxDeclarationId(taxDeclarationPO.getId()) .incomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getDefaultLabel()) .cardNum(employeeDeclarePO.getCardNum()) .cardType(SalaryEnumUtil.enumMatchByValue(employeeDeclarePO.getCardType(), CardTypeEnum.class).getDefaultLabel()) From 0f4d92f302ada3258313c769b734aa5f310b7741 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 28 Dec 2023 10:10:08 +0800 Subject: [PATCH 097/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E8=BA=AB=E4=BB=BD=E4=B8=AD=E5=8F=B7=E8=BD=AC?= =?UTF-8?q?=E4=B8=BA=E5=A4=A7=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/EmployeeDeclareExcelServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 4352be9cf..4bfb84b78 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -267,7 +267,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码格式不正确")); errorData.add(errorMessageMap); } else { - employeeDeclareExcel.setCardNum(dataValue); + // 身份证号全部转为大写 + employeeDeclareExcel.setCardNum(dataValue.toUpperCase()); employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString()); employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString()); } From 4e0a5b4b7f9936e1ac71f3432ab6c6eec848db86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 28 Dec 2023 14:09:34 +0800 Subject: [PATCH 098/298] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E7=AE=97=E7=A8=8E=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeclareTaxResultFeedbackQueryParam.java | 18 ++++++++++++++++ .../taxdeclaration/po/TaxDeclareRecordPO.java | 4 ++++ .../taxdeclaration/TaxDeclareRecordMapper.xml | 21 +++++++++++++++++++ .../service/TaxDeclareRecordService.java | 3 ++- .../impl/TaxDeclareRecordServiceImpl.java | 10 ++++++--- .../salary/web/TaxDeclarationController.java | 6 +++--- .../wrapper/TaxDeclareRecordWrapper.java | 4 ++-- 7 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java new file mode 100644 index 000000000..7ce6c69c7 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class DeclareTaxResultFeedbackQueryParam { + Long id; + + String requestId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 8a88a15ee..e65fff3d7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -62,6 +62,10 @@ public class TaxDeclareRecordPO implements Serializable { * 请求的requestId */ private String requestId; + /** + * 申报的requestId,用于下载申报过程 + */ + private String declareRequestId; /** * 备注 */ diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml index 7edc1e580..c6b660859 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -13,6 +13,7 @@ + @@ -38,6 +39,7 @@ , t.tax_cycle , t.remark , t.request_id + , t.declare_request_id , t.tax_declare_type , t.tax_declare_status , t.display_update_icon @@ -105,6 +107,9 @@ AND request_id = #{requestId} + + AND declare_request_id = #{declareRequestId} + AND tax_declare_type = #{taxDeclareType} @@ -189,6 +194,9 @@ request_id, + + declare_request_id, + tax_declare_type, @@ -248,6 +256,9 @@ #{requestId}, + + #{declareRequestId}, + #{taxDeclareType}, @@ -291,6 +302,7 @@ tax_cycle, remark, request_id, + declare_request_id, tax_declare_type, tax_declare_status, display_update_icon, @@ -314,6 +326,7 @@ #{item.taxCycle}, #{item.remark}, #{item.requestId}, + #{item.declareRequestId}, #{item.taxDeclareType}, #{item.taxDeclareStatus}, #{item.displayUpdateIcon}, @@ -340,6 +353,7 @@ tax_cycle, remark, request_id, + declare_request_id, tax_declare_type, tax_declare_status, display_update_icon, @@ -363,6 +377,7 @@ #{item.taxCycle,jdbcType=DATE}, #{item.remark,jdbcType=VARCHAR}, #{item.requestId,jdbcType=DOUBLE}, + #{item.declareRequestId,jdbcType=VARCHAR}, #{item.taxDeclareType,jdbcType=INTEGER}, #{item.taxDeclareStatus,jdbcType=INTEGER}, #{item.displayUpdateIcon,jdbcType=INTEGER}, @@ -390,6 +405,7 @@ tax_cycle, remark, request_id, + declare_request_id, tax_declare_type, tax_declare_status, display_update_icon, @@ -412,6 +428,7 @@ #{item.taxCycle}, #{item.remark}, #{item.requestId}, + #{item.declareRequestId}, #{item.taxDeclareType}, #{item.taxDeclareStatus}, #{item.displayUpdateIcon}, @@ -438,6 +455,7 @@ tax_cycle=#{taxCycle}, remark=#{remark}, request_id=#{requestId}, + declare_request_id=#{declareRequestId}, tax_declare_type=#{taxDeclareType}, tax_declare_status=#{taxDeclareStatus}, display_update_icon=#{displayUpdateIcon}, @@ -485,6 +503,9 @@ request_id=#{requestId}, + + declare_request_id=#{declareRequestId}, + tax_declare_type=#{taxDeclareType}, diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index a294e259d..aac9db48d 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -2,6 +2,7 @@ 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.po.TaxDeclarationPO; @@ -140,7 +141,7 @@ public interface TaxDeclareRecordService { */ Object getDeclareTaxResultFeedback(Long id); - XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id,String requestId); + XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param); /** * 作废 * diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index f68dee7eb..8fe875eb2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -26,6 +26,7 @@ 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.AbnormalEmployeeListQueryParam; +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.po.*; @@ -772,6 +773,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 申报类型 taxDeclareRecord.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); taxDeclareRecord.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); + taxDeclareRecord.setDeclareRequestId(taxDeclareRecord.getRequestId()); taxDeclareRecord.setRequestId(""); taxDeclareRecord.setUpdateTime(new Date()); BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); @@ -936,16 +938,18 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); - return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getRequestId()); + return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); } @Override - public XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id, String requestId) { + public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + Long id = param.getId(); + String requestId = param.getRequestId(); TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); - GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? taxDeclareRecord.getRequestId() : requestId); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? taxDeclareRecord.getDeclareRequestId() : requestId); Map>> map = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 0d6ad1e9e..e4746208c 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -222,14 +222,14 @@ public class TaxDeclarationController { * * @return */ - @GET + @POST @Path("/exportGetDeclareTaxResultFeedback") @Produces(MediaType.APPLICATION_OCTET_STREAM) - public Response exportGetDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id, @QueryParam(value = "requestId") String requestId) { + public Response exportGetDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeclareTaxResultFeedbackQueryParam param) { try { User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(id, requestId); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(param); String fileName = "申报内置算税结果-" + LocalDate.now(); try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 62e2ed562..18c81327d 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -477,8 +477,8 @@ public class TaxDeclareRecordWrapper extends Service { } - public XSSFWorkbook exportGetDeclareTaxResultFeedback(Long id, String requestId) { - return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(id, requestId); + public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(param); } /** From fefb8264c88963f4e1375f27b4667419b0764a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 28 Dec 2023 15:36:27 +0800 Subject: [PATCH 099/298] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/AbnormalEmployeeListDTO.java | 6 ++++ .../dto/FailEmployeeListDTO.java | 16 +++++++--- .../impl/TaxDeclarationExcelServiceImpl.java | 8 ++--- .../impl/TaxDeclarationValueServiceImpl.java | 18 +++++++++-- .../impl/TaxDeclareRecordServiceImpl.java | 6 ++++ .../salary/web/TaxDeclarationController.java | 31 +++++++++++++++++++ 6 files changed, 74 insertions(+), 11 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java index 7970724c7..88f0400cd 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -32,18 +33,22 @@ public class AbnormalEmployeeListDTO { //姓名") @TableTitle(title = "姓名",dataIndex = "employeeName",key = "employeeName") + @ExcelHead(title = "姓名",dataIndex = "employeeName") private String employeeName; //工号") @TableTitle(title = "工号",dataIndex = "jobNum",key = "jobNum") + @ExcelHead(title = "工号",dataIndex = "jobNum") private String jobNum; //证件类型") @TableTitle(title = "证件类型",dataIndex = "cardType",key = "cardType") + @ExcelHead(title = "证件类型",dataIndex = "cardType") private String cardType; //证件号码") @TableTitle(title = "证件号码",dataIndex = "cardNum",key = "cardNum") + @ExcelHead(title = "证件号码",dataIndex = "cardNum") private String cardNum; //报送状态") @@ -51,5 +56,6 @@ public class AbnormalEmployeeListDTO { //报送状态") @TableTitle(title = "报送状态",dataIndex = "declareStatusDesc",key = "declareStatusDesc") + @ExcelHead(title = "报送状态",dataIndex = "declareStatusDesc") private String declareStatusDesc; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index 7d2ae71d2..a6e79e5ec 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -23,7 +24,8 @@ public class FailEmployeeListDTO { private Long id; //姓名 - @TableTitle(title = "姓名",dataIndex = "employeeName",key = "employeeName") + @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName") + @ExcelHead(title = "姓名", dataIndex = "employeeName") private String employeeName; //个税扣缴义务人id @@ -31,18 +33,22 @@ public class FailEmployeeListDTO { private Long taxAgentId; //个税扣缴义务人名称 - @TableTitle(title = "个税扣缴义务人名称",dataIndex = "taxAgentName",key = "taxAgentName") + @TableTitle(title = "个税扣缴义务人名称", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelHead(title = "个税扣缴义务人名称", dataIndex = "taxAgentName") private String taxAgentName; //证件号码 - @TableTitle(title = "证件号码",dataIndex = "cardNum",key = "cardNum") + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "证件号码", dataIndex = "cardNum") private String cardNum; //失败原因 - @TableTitle(title = "失败原因",dataIndex = "errorMsg",key = "errorMsg") + @TableTitle(title = "失败原因", dataIndex = "errorMsg", key = "errorMsg") + @ExcelHead(title = "失败原因", dataIndex = "errorMsg") private String errorMsg; //所得项目 - @TableTitle(title = "所得项目",dataIndex = "incomeCategory",key = "incomeCategory") + @TableTitle(title = "所得项目", dataIndex = "incomeCategory", key = "incomeCategory") + @ExcelHead(title = "所得项目", dataIndex = "incomeCategory") private String incomeCategory; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 72597d4f2..6382be9b4 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -3,7 +3,6 @@ package com.engine.salary.service.impl; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; @@ -13,6 +12,7 @@ import com.engine.salary.entity.taxdeclaration.po.*; import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.excel.ExcelHead; import com.engine.salary.util.excel.ExcelSheetData; import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; @@ -168,11 +168,11 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar private void parseHeader(Class clazz, List headerList, List dataIndexList) { Field[] declaredFields = clazz.getDeclaredFields(); for (Field declaredField : declaredFields) { - if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { + if (!declaredField.isAnnotationPresent(ExcelHead.class)) { continue; } - SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); - headerList.add(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.text())); + ExcelHead annotation = declaredField.getAnnotation(ExcelHead.class); + headerList.add(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.title())); dataIndexList.add(declaredField.getName()); } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index b8633e57b..b5ddd14b4 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -23,6 +23,7 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; @@ -56,6 +57,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); } + private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); + } + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } @@ -151,10 +156,16 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar throw new SalaryRunTimeException("个税申报表不存在!"); } + Long taxDeclareRecordId = taxDeclaration.getTaxDeclareRecordId(); + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclareRecordId); + if (declareRecordPO == null) { + throw new SalaryRunTimeException("个税申报记录不存在!"); + } + TaxDeclarationValuePO po = TaxDeclarationValuePO.builder() .id(IdGenerator.generate()) .taxDeclarationId(param.getTaxDeclarationId()) - .taxDeclareRecordId(taxDeclaration.getTaxDeclareRecordId()) + .taxDeclareRecordId(taxDeclareRecordId) .employeeId(param.getEmployeeId()) .employeeType(param.getEmployeeType()) .resultValue(param.getTaxReportColumnValues()) @@ -167,9 +178,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); encryptUtil.encrypt(po, TaxDeclarationValuePO.class); - getTaxDeclarationValueMapper().insertIgnoreNull(po); + //新增年终奖 + if (IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue().equals(taxDeclaration.getIncomeCategory())) { + autoAddWagesDeclare(declareRecordPO); + } } @Override diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 8fe875eb2..7f388cf8f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -309,6 +309,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } + //补充正常工资薪金的申报人员 + newTaxDeclareRecords.forEach(taxDeclareRecordPO -> { + getTaxDeclarationValueService(user).autoAddWagesDeclare(taxDeclareRecordPO); + }); + + //更新核算记录状态 getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); // // 记录日志 diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index e4746208c..b6963b187 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -653,4 +653,35 @@ public class TaxDeclarationController { } } +// @POST +// @Path("/downloadTemplate") +// @Produces(MediaType.APPLICATION_OCTET_STREAM) +// public Response getAll(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody DownloadTemplateParam param) { +// try { +// User user = HrmUserVarify.getUser(request, response); +// +// +// XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).downloadTemplate(queryParam); +// +// String fileName = "往期累计情况导入模板" + LocalDate.now(); +// +// try { +// fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); +// } catch (UnsupportedEncodingException e) { +// log.error(e.getMessage(), e); +// } +// +// 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; +// } +// } + } From 622bd9ceb86030b53d05566ca5c432020c11ee98 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 28 Dec 2023 16:44:01 +0800 Subject: [PATCH 100/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/employeedeclare/bo/EmployeeDeclareBO.java | 3 +-- .../mapper/employeedeclare/EmployeeDeclareMapper.xml | 5 ++--- .../service/impl/EmployeeDeclareExcelServiceImpl.java | 11 +++++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java index d3d91e5f8..48898d83d 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java @@ -3,7 +3,6 @@ package com.engine.salary.entity.employeedeclare.bo; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.enums.employeedeclare.CardTypeEnum; -import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -27,7 +26,7 @@ public class EmployeeDeclareBO { .cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) .cardNum(dto.getCardNum()) .employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus())) - .employmentType(EmploymentTypeEnum.getValueByDefaultLabel(dto.getEmploymentType())) + .employmentType(StringUtils.isBlank(dto.getEmploymentType()) ? null : new Integer(dto.getEmploymentType())) .employmentFirstYear(dto.getEmploymentFirstYear()) .mobile(dto.getMobile()) .employmentDate(StringUtils.isBlank(dto.getEmploymentDate()) ? null : SalaryDateUtil.stringToDate(dto.getEmploymentDate()) ) diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 890181735..335d8ed7c 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -452,8 +452,7 @@ update_time ) VALUES - ( - + ( #{item.birthday}, #{item.cardNum}, #{item.cardType}, @@ -486,8 +485,8 @@ #{item.taxCycle}, #{item.tenantKey}, #{item.updateTime} - ) + diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 4bfb84b78..520dcc68a 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -105,7 +105,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); row.add(employeeDeclare.getCardNum()); row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); - row.add(employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); + row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel()); row.add(employeeDeclare.getEmploymentFirstYear()); row.add(employeeDeclare.getMobile()); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); @@ -327,6 +327,9 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee errorData.add(errorMessageMap); } } else { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0,10); + } if (!SalaryDateUtil.checkDay(dataValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); @@ -440,7 +443,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } else { EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); - BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); newEmployeeDeclare.setUpdateTime(now); needUpdateEmployeeDeclares.add(newEmployeeDeclare); @@ -481,7 +485,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee if (isError) { failCount++; failRowIndex++; - errorData.add(map); continue; } successCount++; @@ -496,7 +499,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee apidatas.put("successCount", successCount); apidatas.put("errorCount", failCount); - apidatas.put("errorNotice", errorData); + apidatas.put("errorData", errorData); // 发送导入回调信息 // salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); From 463e56d2cf2020eb8d6977beec47fc31f24bab19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 28 Dec 2023 18:12:38 +0800 Subject: [PATCH 101/298] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/DownloadTemplateParam.java | 26 ++ .../service/TaxDeclarationExcelService.java | 15 ++ .../service/TaxDeclarationValueService.java | 2 + .../impl/TaxDeclarationExcelServiceImpl.java | 254 ++++++++++++++++-- .../impl/TaxDeclarationValueServiceImpl.java | 22 +- .../salary/web/TaxDeclarationController.java | 75 +++--- .../wrapper/TaxDeclareRecordWrapper.java | 12 + 7 files changed, 352 insertions(+), 54 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java new file mode 100644 index 000000000..d9371b3fd --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DownloadTemplateParam { + /** + * 申报表id,下载模板 + */ + @DataCheck(require = true,message = "imageId为空") + Long taxDeclarationId; + + + + /** + * 导入文件id + */ + String imageId; +} diff --git a/src/com/engine/salary/service/TaxDeclarationExcelService.java b/src/com/engine/salary/service/TaxDeclarationExcelService.java index 15d6c81fd..e5e154fe7 100644 --- a/src/com/engine/salary/service/TaxDeclarationExcelService.java +++ b/src/com/engine/salary/service/TaxDeclarationExcelService.java @@ -1,9 +1,12 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import java.util.Map; + /** * 个税申报表导出 *

Copyright: Copyright (c) 2022

@@ -45,4 +48,16 @@ public interface TaxDeclarationExcelService { * @return */ XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam); + + XSSFWorkbook downloadTemplate(DownloadTemplateParam param); + /** + * 预览 + */ + Map preview(DownloadTemplateParam importParam); + + /** + * 导入数据 + */ + Map importData(DownloadTemplateParam importParam); + } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 70bd6f729..969292efb 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -36,6 +36,7 @@ public interface TaxDeclarationValueService { * @return */ List listByTaxDeclarationIds(Collection taxDeclarationIds); + List listByTaxDeclarationId(Long taxDeclarationIds); /** * 查询个税申报表明细 @@ -59,6 +60,7 @@ public interface TaxDeclarationValueService { * @param taxDeclarationValues */ void batchSave(List taxDeclarationValues); + void batchEdit(List taxDeclarationValues); void save(TaxDeclareRecordDetailSaveParam param); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 6382be9b4..8aac2c649 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -1,30 +1,53 @@ package com.engine.salary.service.impl; +import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; +import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.*; +import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.excel.ExcelHead; +import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSheetData; +import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; -import java.lang.reflect.Field; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.io.InputStream; +import java.util.*; +import java.util.stream.Collectors; + +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** * 个税申报表导出 @@ -57,6 +80,19 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalarySysConfMapper getSalarySysConfMapper() { + return SqlProxyHandle.getProxy(SalarySysConfMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + @Override public XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { // 查询个税申报表 @@ -140,7 +176,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar // 导出的表头 List headerList = Lists.newArrayList(); List dataIndexList = Lists.newArrayList(); - parseHeader(clazz, headerList, dataIndexList); + ExcelUtil.parseHeader(clazz, headerList, dataIndexList); // 导出的数据 List> rows = Lists.newArrayListWithExpectedSize(dtoList.size()); dtoList.forEach(dto -> { @@ -157,23 +193,195 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar return excelSheetData; } - /** - * 解析表头 - * - * @param clazz - * @param headerList - * @param dataIndexList - * @param - */ - private void parseHeader(Class clazz, List headerList, List dataIndexList) { - Field[] declaredFields = clazz.getDeclaredFields(); - for (Field declaredField : declaredFields) { - if (!declaredField.isAnnotationPresent(ExcelHead.class)) { - continue; - } - ExcelHead annotation = declaredField.getAnnotation(ExcelHead.class); - headerList.add(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.title())); - dataIndexList.add(declaredField.getName()); + @Override + public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { + TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + + + List heads = new ArrayList<>(); + heads.add(SalaryI18nUtil.getI18nLabel(85429, "姓名")); + heads.add(SalaryI18nUtil.getI18nLabel(86185, "部门")); + heads.add(SalaryI18nUtil.getI18nLabel(86186, "手机号")); + heads.add(SalaryI18nUtil.getI18nLabel(86317, "工号")); + heads.addAll(SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList())); + + List> rowList = new ArrayList<>(); + rowList.add(heads); + XSSFWorkbook book = ExcelUtil.genWorkbookV2(rowList, incomeCategoryEnum.getDefaultLabel()); + return book; + } + + @Override + public Map preview(DownloadTemplateParam importParam) { + //excel文件id + String imageId = Util.null2String(importParam.getImageId()); + Validate.notBlank(imageId, "imageId为空"); + + InputStream fileInputStream = null; + Map map = new HashMap<>(); + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(importParam.getImageId())); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + map.put("headers", ExcelSupport.getSheetHeader(sheet, 0)); + map.put("list", ExcelParseHelper.parse2List(sheet, 1, 0)); + return map; + } finally { + IOUtils.closeQuietly(fileInputStream); } } + + @Override + public Map importData(DownloadTemplateParam param) { + //查询对于人员信息导入筛选的全局配置 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + + + // 租户下所有的人员 + List salaryEmployees = getSalaryEmployeeService(user).listAllForReport(); + Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getUsername, DataCollectionEmployee::getEmployeeId); + Map emps = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getEmployeeId); + + + TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + Map nameColumnMap = SalaryEntityUtil.convert2Map(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName); + + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(declarationPO.getId()); + Map empDeclarationValueMap = SalaryEntityUtil.convert2Map(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); + + // 索引(用于计算进度) + int index = 0; + // 失败的数量 + int failCount = 0; + // 成功的数量 + int successCount = 0; + Date now = new Date(); + + List addList = Lists.newArrayList(); + List editList = Lists.newArrayList(); + + + InputStream fileInputStream = null; + try { + + + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + + // 错误提示信息 + List excelComments = Lists.newArrayList(); + // 存在错误的那行数据 + List> errorDatas = Lists.newArrayList(); + // 表头 + List headers; + headers = ExcelSupport.getSheetHeader(sheet, 0); + List> data = ExcelParseHelper.parse2Map(sheet, 1, 0); + + if (CollectionUtils.isEmpty(headers)) { + throw new RuntimeException("表头为空"); + } + if (CollectionUtils.isEmpty(data)) { + throw new RuntimeException("无数据"); + } + for (int i = 0; i < data.size(); i++) { + + String row = "第" + (i + 2) + "行"; + + boolean isError = false; + Map map = data.get(i); + Long employeeId = 0L; + + String username = (String) map.getOrDefault("姓名", ""); + String deparmentName = (String) map.getOrDefault("部门", ""); + String mobile = (String) map.getOrDefault("手机号", ""); + String workcode = (String) map.getOrDefault("工号", ""); + + if (StringUtils.isEmpty(username) && "0".equals(confValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空")); + excelComments.add(errorMessageMap); + } else { + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, username, deparmentName, mobile, workcode, null); + + if (CollectionUtils.isEmpty(employeeSameIds)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名")); + excelComments.add(errorMessageMap); + } else if (employeeSameIds.size() > 1) { + //存在离职和在职状态取在职状态 + employeeSameIds = employeeSameIds.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .collect(Collectors.toList()); + if (employeeSameIds.size() != 1) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + "员工信息不存在或者存在多个员工"); + excelComments.add(errorMessageMap); + } else { + employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; + } + } else { + employeeId = employeeSameIds.get(0).getEmployeeId(); + } + } + + if (isError) { + failCount++; + errorDatas.add(map); + continue; + } + + successCount++; + + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxReportColumnPOS) { + Object value = map.get(taxReportColumn.getReportColumnName()); + valueMap.put(taxReportColumn.getReportColumnDataIndex(), value != null ? value.toString() : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""); + } + + if (empDeclarationValueMap.containsKey(employeeId)) { + TaxDeclarationValuePO taxDeclarationValue =empDeclarationValueMap.get(employeeId); + taxDeclarationValue.setResultValue(valueMap); + taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(valueMap)); + taxDeclarationValue.setUpdateTime(new Date()); + taxDeclarationValue.setSource(SourceEnum.IMP.getValue()); + editList.add(taxDeclarationValue); + } else { + //新增 + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(declarationPO.getTaxDeclareRecordId()) + .taxDeclarationId(declarationPO.getId()) + .employeeType(EmployeeTypeEnum.ORGANIZATION.getValue()) + .employeeId(employeeId) + .resultValue(valueMap) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(employeeId) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .source(SourceEnum.IMP.getValue()) + .build(); + addList.add(taxDeclarationValue); + } + } + + getTaxDeclarationValueService(user).batchSave(addList); + getTaxDeclarationValueService(user).batchEdit(editList); + + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + return null; + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index b5ddd14b4..80e1c8209 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -94,6 +94,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return decryptBatch(taxDeclarationValues); } + @Override + public List listByTaxDeclarationId(Long taxDeclarationId) { + List taxDeclarationValues = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationId(taxDeclarationId).build()); + return decryptBatch(taxDeclarationValues); + } + @Override public List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds) { return getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); @@ -144,7 +150,21 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar List> partition = Lists.partition(taxDeclarationValues, 100); for (List subTaxDeclarationValues : partition) { subTaxDeclarationValues.forEach(getTaxDeclarationValueMapper()::insertIgnoreNull); -// getTaxDeclarationValueMapper().batchInsert(subTaxDeclarationValues); + } + } + } + + @Override + public void batchEdit(List taxDeclarationValues) { + if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { + // 加密 + taxDeclarationValues.forEach(taxDeclarationValue -> + taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues = encryptUtil.encryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + // 分批保存 + List> partition = Lists.partition(taxDeclarationValues, 100); + for (List subTaxDeclarationValues : partition) { + subTaxDeclarationValues.forEach(getTaxDeclarationValueMapper()::updateIgnoreNull); } } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index b6963b187..dc61a0458 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -653,35 +653,50 @@ public class TaxDeclarationController { } } -// @POST -// @Path("/downloadTemplate") -// @Produces(MediaType.APPLICATION_OCTET_STREAM) -// public Response getAll(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody DownloadTemplateParam param) { -// try { -// User user = HrmUserVarify.getUser(request, response); -// -// -// XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).downloadTemplate(queryParam); -// -// String fileName = "往期累计情况导入模板" + LocalDate.now(); -// -// try { -// fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); -// } catch (UnsupportedEncodingException e) { -// log.error(e.getMessage(), e); -// } -// -// 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; -// } -// } + @POST + @Path("/downloadTemplate") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response downloadTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam param) { + try { + User user = HrmUserVarify.getUser(request, response); + + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).downloadTemplate(param); + + String fileName = "申报表导入模板" + LocalDate.now(); + + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + log.error(e.getMessage(), e); + } + + 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; + } + } + + @POST + @Path("/preview") + @Produces(MediaType.APPLICATION_JSON) + public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam importParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::preview, importParam); + } + + @POST + @Path("/importData") + @Produces(MediaType.APPLICATION_JSON) + public String importAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam importParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::importData, importParam); + } } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 18c81327d..fed3fbe32 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -755,4 +755,16 @@ public class TaxDeclareRecordWrapper extends Service { .resultValue(declarationValuePO.getResultValue()) .build(); } + + public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).downloadTemplate(param); + } + + public Map preview(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).preview(param); + } + + public Map importData(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).importData(param); + } } From df16be5dd732970acc1a46a91171ad190554e4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 28 Dec 2023 18:45:52 +0800 Subject: [PATCH 102/298] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TaxDeclarationExcelServiceImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 8aac2c649..a4ac55966 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -241,14 +241,12 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar // 租户下所有的人员 List salaryEmployees = getSalaryEmployeeService(user).listAllForReport(); - Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getUsername, DataCollectionEmployee::getEmployeeId); - Map emps = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getEmployeeId); TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); - Map nameColumnMap = SalaryEntityUtil.convert2Map(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName); + List taxReportColumnNames = SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList()); List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(declarationPO.getId()); Map empDeclarationValueMap = SalaryEntityUtil.convert2Map(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); @@ -268,7 +266,6 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar InputStream fileInputStream = null; try { - fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); @@ -277,8 +274,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar // 存在错误的那行数据 List> errorDatas = Lists.newArrayList(); // 表头 - List headers; - headers = ExcelSupport.getSheetHeader(sheet, 0); + List headers = ExcelSupport.getSheetHeader(sheet, 0); List> data = ExcelParseHelper.parse2Map(sheet, 1, 0); if (CollectionUtils.isEmpty(headers)) { @@ -287,6 +283,12 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar if (CollectionUtils.isEmpty(data)) { throw new RuntimeException("无数据"); } + + Optional first = taxReportColumnNames.stream().filter(name -> !headers.contains(name)).findFirst(); + if (first.isPresent()) { + throw new RuntimeException("申报模板异常,缺失" + first.get() + "列"); + } + for (int i = 0; i < data.size(); i++) { String row = "第" + (i + 2) + "行"; @@ -347,7 +349,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar } if (empDeclarationValueMap.containsKey(employeeId)) { - TaxDeclarationValuePO taxDeclarationValue =empDeclarationValueMap.get(employeeId); + TaxDeclarationValuePO taxDeclarationValue = empDeclarationValueMap.get(employeeId); taxDeclarationValue.setResultValue(valueMap); taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(valueMap)); taxDeclarationValue.setUpdateTime(new Date()); From 7c50e388674b17657fc3675ccc3760600a79cc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 28 Dec 2023 19:19:09 +0800 Subject: [PATCH 103/298] =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312270603.sql | 5 +++++ resource/sqlupgrade/GS/sql202312270603.sql | 5 +++++ resource/sqlupgrade/JC/sql202312270603.sql | 5 +++++ resource/sqlupgrade/Mysql/sql202312270603.sql | 5 +++-- resource/sqlupgrade/Oracle/sql202312270603.sql | 5 +++++ resource/sqlupgrade/PG/sql202312270603.sql | 4 +++- resource/sqlupgrade/SQLServer/sql202312270603.sql | 3 +++ resource/sqlupgrade/ST/sql202312270603.sql | 5 +++++ 8 files changed, 34 insertions(+), 3 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202312270603.sql b/resource/sqlupgrade/DM/sql202312270603.sql index 99adc68e5..f9aba2b22 100644 --- a/resource/sqlupgrade/DM/sql202312270603.sql +++ b/resource/sqlupgrade/DM/sql202312270603.sql @@ -3,3 +3,8 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202312270603.sql b/resource/sqlupgrade/GS/sql202312270603.sql index 99adc68e5..f9aba2b22 100644 --- a/resource/sqlupgrade/GS/sql202312270603.sql +++ b/resource/sqlupgrade/GS/sql202312270603.sql @@ -3,3 +3,8 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202312270603.sql b/resource/sqlupgrade/JC/sql202312270603.sql index 99adc68e5..f9aba2b22 100644 --- a/resource/sqlupgrade/JC/sql202312270603.sql +++ b/resource/sqlupgrade/JC/sql202312270603.sql @@ -3,3 +3,8 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312270603.sql b/resource/sqlupgrade/Mysql/sql202312270603.sql index 3b1e70e48..52d95fada 100644 --- a/resource/sqlupgrade/Mysql/sql202312270603.sql +++ b/resource/sqlupgrade/Mysql/sql202312270603.sql @@ -1,2 +1,3 @@ -ALTER TABLE hrsa_tax_declaration_value -ADD COLUMN source int(0) NULL ; \ No newline at end of file +ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int(0) NULL ; + +ALTER TABLE hrsa_tax_declare_record ADD COLUMN declare_request_id varchar(100) NULL ; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312270603.sql b/resource/sqlupgrade/Oracle/sql202312270603.sql index 3865d0084..4aea94ab0 100644 --- a/resource/sqlupgrade/Oracle/sql202312270603.sql +++ b/resource/sqlupgrade/Oracle/sql202312270603.sql @@ -1,4 +1,9 @@ ALTER TABLE hrsa_tax_declaration_value add ( source number ) +/ + +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +) / \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270603.sql b/resource/sqlupgrade/PG/sql202312270603.sql index 2c6535f86..42b0d9089 100644 --- a/resource/sqlupgrade/PG/sql202312270603.sql +++ b/resource/sqlupgrade/PG/sql202312270603.sql @@ -1 +1,3 @@ -ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int NULL ; \ No newline at end of file +ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int NULL ; + +ALTER TABLE hrsa_salary_template ADD COLUMN declare_request_id varchar(200) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312270603.sql b/resource/sqlupgrade/SQLServer/sql202312270603.sql index a136431d3..6955742ff 100644 --- a/resource/sqlupgrade/SQLServer/sql202312270603.sql +++ b/resource/sqlupgrade/SQLServer/sql202312270603.sql @@ -1,2 +1,5 @@ ALTER TABLE hrsa_tax_declaration_value ADD source int NULL +GO + +ALTER TABLE hrsa_tax_declare_record ADD declare_request_id varchar(100) NULL GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312270603.sql b/resource/sqlupgrade/ST/sql202312270603.sql index 99adc68e5..f9aba2b22 100644 --- a/resource/sqlupgrade/ST/sql202312270603.sql +++ b/resource/sqlupgrade/ST/sql202312270603.sql @@ -3,3 +3,8 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + From 79ba7c754cb7ac00c98579b5795723e90fe8d42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 28 Dec 2023 20:59:13 +0800 Subject: [PATCH 104/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/TaxDeclarationInfoDTO.java | 4 +- .../impl/TaxDeclarationExcelServiceImpl.java | 47 ++++++++++++++----- .../salary/web/EmployeeDeclareController.java | 2 +- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java index 20a06d05a..c3d48af5b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java @@ -29,11 +29,11 @@ public class TaxDeclarationInfoDTO { @ApiModelProperty("薪资所属月") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date salaryMonth; @ApiModelProperty("税款所属期") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxCycle; @ApiModelProperty("个税扣缴义务人id") diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index a4ac55966..5f5796e39 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -234,6 +234,8 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar @Override public Map importData(DownloadTemplateParam param) { + Map apidatas = new HashMap<>(); + //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; @@ -251,10 +253,8 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(declarationPO.getId()); Map empDeclarationValueMap = SalaryEntityUtil.convert2Map(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); - // 索引(用于计算进度) - int index = 0; // 失败的数量 - int failCount = 0; + int errorCount = 0; // 成功的数量 int successCount = 0; Date now = new Date(); @@ -278,17 +278,36 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar List> data = ExcelParseHelper.parse2Map(sheet, 1, 0); if (CollectionUtils.isEmpty(headers)) { - throw new RuntimeException("表头为空"); + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "表头为空"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; } if (CollectionUtils.isEmpty(data)) { - throw new RuntimeException("无数据"); + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "无数据"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; } Optional first = taxReportColumnNames.stream().filter(name -> !headers.contains(name)).findFirst(); if (first.isPresent()) { - throw new RuntimeException("申报模板异常,缺失" + first.get() + "列"); + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "申报模板异常,缺失" + first.get() + "列,请检查是否为" + incomeCategoryEnum.getDefaultLabel() + "申报模板"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; } + for (int i = 0; i < data.size(); i++) { String row = "第" + (i + 2) + "行"; @@ -335,7 +354,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar } if (isError) { - failCount++; + errorCount++; errorDatas.add(map); continue; } @@ -344,8 +363,8 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar Map valueMap = Maps.newHashMap(); for (TaxReportColumnPO taxReportColumn : taxReportColumnPOS) { - Object value = map.get(taxReportColumn.getReportColumnName()); - valueMap.put(taxReportColumn.getReportColumnDataIndex(), value != null ? value.toString() : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""); + String value = (String) map.getOrDefault(taxReportColumn.getReportColumnName(), ""); + valueMap.put(taxReportColumn.getReportColumnDataIndex(), StringUtils.isNotBlank(value) ? value.toString() : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""); } if (empDeclarationValueMap.containsKey(employeeId)) { @@ -378,12 +397,18 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar getTaxDeclarationValueService(user).batchSave(addList); getTaxDeclarationValueService(user).batchEdit(editList); + if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordService(user).getById(declarationPO.getTaxDeclareRecordId()); + getTaxDeclarationValueService(user).autoAddWagesDeclare(declareRecordPO); + } + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); } finally { IOUtils.closeQuietly(fileInputStream); } - - return null; + return apidatas; } } diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 6c2979f97..fa54d79f3 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -336,7 +336,7 @@ public class EmployeeDeclareController { /** * 人员报送-导出全部人员 * - * @param queryParam 导出参数 + * @param param 导出参数 * @return */ @POST From bca7697d754298fe214dc24c4a73360ecedeebea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 29 Dec 2023 11:46:00 +0800 Subject: [PATCH 105/298] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=85=A8=E5=B9=B4?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E6=80=A7=E5=A5=96=E9=87=91=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/EmployeeDeclareListDTO.java | 16 ++++++++++++++++ .../impl/SalaryAcctRecordServiceImpl.java | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java index 93a06d3b5..76af21666 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelHead; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -42,72 +43,86 @@ public class EmployeeDeclareListDTO { // 姓名 @SalaryTableColumn(text = "姓名", width = "10%", column = "employeeName") @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName") + @ExcelHead(title = "姓名", dataIndex = "employeeName") private String employeeName; // 分部 @SalaryTableColumn(text = "分部", width = "10%", column = "subCompanyName") @TableTitle(title = "分部", dataIndex = "subCompanyName", key = "subCompanyName") + @ExcelHead(title = "分部", dataIndex = "subCompanyName") private String subCompanyName; // 部门 @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelHead(title = "部门", dataIndex = "departmentName") private String departmentName; // 个税扣缴义务人 @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelHead(title = "个税扣缴义务人", dataIndex = "taxAgentName") private String taxAgentName; // 工号 @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelHead(title = "工号", dataIndex = "jobNum") private String jobNum; // 证件类型 @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") + @ExcelHead(title = "证件类型", dataIndex = "cardType") private String cardType; // 证件号码 @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "证件号码", dataIndex = "cardNum") private String cardNum; // 性别 @SalaryTableColumn(text = "性别", width = "10%", column = "gender") @TableTitle(title = "性别", dataIndex = "gender", key = "gender") + @ExcelHead(title = "性别", dataIndex = "gender") private String gender; // 出生日期 @SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday") @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") + @ExcelHead(title = "出生日期", dataIndex = "birthday") private String birthday; // 人员状态 @SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus") @TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus") + @ExcelHead(title = "人员状态", dataIndex = "employmentStatus") private String employmentStatus; // 手机号码 @SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile") @TableTitle(title = "手机号码", dataIndex = "mobile", key = "mobile") + @ExcelHead(title = "手机号码", dataIndex = "mobile") private String mobile; // 任职受雇从业类型 @SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType") @TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType") + @ExcelHead(title = "任职受雇从业类型", dataIndex = "employmentType") private String employmentType; // 任职受雇从业日期 @SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate") @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") + @ExcelHead(title = "任职受雇从业日期", dataIndex = "employmentDate") private String employmentDate; // 离职日期 @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") + @ExcelHead(title = "离职日期", dataIndex = "dismissDate") private String dismissDate; // 申报状态 @@ -116,6 +131,7 @@ public class EmployeeDeclareListDTO { // 申报状态 @SalaryTableColumn(text = "申报状态", width = "10%", column = "declareStatusDesc") @TableTitle(title = "申报状态", dataIndex = "declareStatusDesc", key = "declareStatusDesc") + @ExcelHead(title = "申报状态", dataIndex = "declareStatusDesc") private String declareStatusDesc; // 申报失败原因 diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 79376b60d..c68b1dc9e 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -514,7 +514,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe .findAny() .orElse(null); if (diffTaxCycleSalaryAcctTaxAgent != null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160502, "全年一次性奖金收入一年内只能申报一次,所以税款所属期必须相同")); +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160502, "全年一次性奖金收入一年内只能申报一次,所以税款所属期必须相同")); } } } From ac2046a8e77ec5528ed8a85f3f8776f5cf5f4f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 29 Dec 2023 17:24:52 +0800 Subject: [PATCH 106/298] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=94=B3=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/TaxDeclarationAddParam.java | 36 +++++ .../param/TaxDeclarationDeleteParam.java | 29 +++++ .../param/TaxDeclareRecordParam.java | 1 + .../salary/service/TaxDeclarationService.java | 10 ++ .../service/TaxDeclarationValueService.java | 2 +- .../impl/TaxDeclarationServiceImpl.java | 94 ++++++++++++- .../impl/TaxDeclareRecordServiceImpl.java | 1 + .../salary/web/TaxDeclarationController.java | 32 ++++- .../salary/wrapper/TaxDeclarationWrapper.java | 123 ------------------ .../wrapper/TaxDeclareRecordWrapper.java | 14 ++ 10 files changed, 216 insertions(+), 126 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java new file mode 100644 index 000000000..7104856ff --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 新增个税申报表参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationAddParam { + + /** + * 个税申报记录id + */ + @DataCheck(require = true, message = "个税申报记录id为空") + private Long taxDeclareRecordId; + + /** + * 薪资类型 + */ + @DataCheck(require = true, message = "薪资类型为空") + private IncomeCategoryEnum incomeCategory; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java new file mode 100644 index 000000000..aac346fb1 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 删除个税申报表参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationDeleteParam { + + /** + * 个税申报表id + */ + @DataCheck(require = true, message = "个税申报表id为空") + private Long taxDeclarationId; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index 7e94fcc2e..673fd4aa8 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.util.valid.DataCheck; import lombok.Data; /** diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 91b38c3eb..ef4c71fd1 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -3,6 +3,8 @@ package com.engine.salary.service; import com.engine.salary.common.YearMonthRange; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationAddParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDeleteParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; @@ -73,4 +75,12 @@ public interface TaxDeclarationService { */ List listByTaxCycleRange(YearMonthRange yearMonthRange); + + /** + * 新增申报表 + * @param param + */ + void addTaxDeclaration(TaxDeclarationAddParam param); + + void deleteTaxDeclaration(TaxDeclarationDeleteParam param); } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 969292efb..3d12b5350 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -36,7 +36,7 @@ public interface TaxDeclarationValueService { * @return */ List listByTaxDeclarationIds(Collection taxDeclarationIds); - List listByTaxDeclarationId(Long taxDeclarationIds); + List listByTaxDeclarationId(Long taxDeclarationId); /** * 查询个税申报表明细 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index d69513ae0..34019ce42 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -4,16 +4,23 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.YearMonthRange; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationAddParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDeleteParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; 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.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper; @@ -25,6 +32,8 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; @@ -84,6 +93,16 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + + @Override public List listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds) { if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { @@ -102,8 +121,9 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).build(); return getTaxDeclarationMapper().listSome(po); } + @Override - public List listByTaxDeclareRecordId(Long taxDeclareRecordId,Integer incomeCategory) { + public List listByTaxDeclareRecordId(Long taxDeclareRecordId, Integer incomeCategory) { if (Objects.isNull(taxDeclareRecordId)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); } @@ -383,4 +403,76 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration .salaryMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) .build()); } + + + /** + * 新增申报表 + * + * @param param + */ + @Override + public void addTaxDeclaration(TaxDeclarationAddParam param) { + ValidUtil.doValidator(param); + + Long taxDeclareRecordId = param.getTaxDeclareRecordId(); + IncomeCategoryEnum incomeCategory = param.getIncomeCategory(); + + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(taxDeclareRecordId); + if (taxDeclareRecord == null) { + throw new SalaryRunTimeException("申报记录不存在!"); + } + + List taxDeclarations = listByTaxDeclareRecordId(taxDeclareRecordId); + Optional first = taxDeclarations.stream().filter(taxDeclarationPO -> incomeCategory.getValue().equals(taxDeclarationPO.getIncomeCategory())).findFirst(); + if (first.isPresent()) { + throw new SalaryRunTimeException("已存在" + incomeCategory.getDefaultLabel() + "申报表"); + } + + Date now = new Date(); + TaxDeclarationPO taxDeclaration = TaxDeclarationPO + .builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecord.getId()) + .incomeCategory(incomeCategory.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .salaryMonth(taxDeclareRecord.getSalaryMonth()) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .description(taxDeclareRecord.getRemark()) + .controlView(0) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + List objects = new ArrayList<>(); + objects.add(taxDeclaration); + getTaxDeclarationMapper().batchInsert(objects); + } + + + /** + * 新增申报表 + * + * @param param + */ + @Override + public void deleteTaxDeclaration(TaxDeclarationDeleteParam param) { + ValidUtil.doValidator(param); + Long taxDeclarationId = param.getTaxDeclarationId(); + TaxDeclarationPO declarationPO = getById(taxDeclarationId); + + if (declarationPO == null) { + throw new SalaryRunTimeException("申报表不存在!"); + } + + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(taxDeclarationId); + + if (CollectionUtils.isNotEmpty(taxDeclarationValuePOS)) { + throw new SalaryRunTimeException("存在申报明细不允许删除,请先删除申报表明细!"); + } + + getTaxDeclarationMapper().deleteByIdZj(taxDeclarationId); + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 7f388cf8f..29a6d6492 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1064,6 +1064,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); } + private TaxDeclareRequest buildTaxDeclareRequest(Long id) { // 查询供应商信息 TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index dc61a0458..c0d6944f9 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -134,7 +134,7 @@ public class TaxDeclarationController { } /** - * 删除个税申报表 + * 删除个税申报记录 * * @param ids 个税申报记录id * @return @@ -175,6 +175,36 @@ public class TaxDeclarationController { return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, id); } + /** + * 新增个税申报记录下的个税申报表TAB + * + * @param param 个税申报记录id + * @return + */ + @POST + @Path("/addTaxDeclaration") + @Produces(MediaType.APPLICATION_JSON) + public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response,TaxDeclarationAddParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::addTaxDeclaration, param); + } + + /** + * 删除申报表 + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/deleteTaxDeclaration") + @Produces(MediaType.APPLICATION_JSON) + public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response,TaxDeclarationDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteTaxDeclaration, param); + } + + /** * 在线申报 * diff --git a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java index aa39752db..d98b8a419 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -2,35 +2,14 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.component.WeaFormOption; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.page.PageInfo; -import com.google.common.collect.Lists; -import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - /** * 个税申报表 *

Copyright: Copyright (c) 2022

@@ -53,106 +32,4 @@ public class TaxDeclarationWrapper extends Service { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } - /** - * 个税申报表列表 - * - * @param queryParam 列表查询条件 - * @param - * @return - */ - public PageInfo listPage(TaxDeclarationListQueryParam queryParam) { - // 询个税申报表(分页) - PageInfo page = getTaxDeclarationService(user).listPageByParam(queryParam); - PageInfo dtoPage = new PageInfo(TaxDeclarationListDTO.class); - dtoPage.setPageNum(queryParam.getCurrent()); - dtoPage.setPageSize(queryParam.getPageSize()); - dtoPage.setTotal(page.getTotal()); - List list = page.getList(); - if (CollectionUtils.isNotEmpty(list)) { - // 查询人员 - List employeeIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getCreator, Collectors.toList()); - List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); - // 查询个税扣缴义务人 - Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getTaxAgentId); - List taxAgentPOS = getTaxDeclarationService(user).countByTaxDeclarationId(taxAgentIds); - // 转换成列表dto - List taxDeclarationListDTOS = TaxDeclarationBO.convert2ListDTO(list, employeeComInfos, taxAgentPOS); - dtoPage.setList(taxDeclarationListDTOS); - } - return dtoPage; - } - - - public TaxDeclarationFormDTO getForm(Long id) { - TaxDeclarationFormDTO formDTO = new TaxDeclarationFormDTO(); - if (Objects.nonNull(id)) { - // 查询个税申报表 - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id); - if (Objects.isNull(taxDeclaration)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); - } - // 查询个税扣缴义务人 - TaxAgentPO taxAgent = getTaxAgentService(user).getById(id); - //日期转换 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth()); - // 转换成个税申报表详情dto - formDTO = TaxDeclarationFormDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgent).map(TaxAgentPO::getName).orElse("")).description(taxDeclaration.getDescription()).build(); - } - // 转换成前端所需的数据格式 - // WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclarationFormDTO.class, formDTO); - - // 查询租户所有的个税扣缴义务人 - Collection taxAgentListDTOS = getTaxAgentService(user).listAll(); - // 表单中个税扣缴义务人的可选项 - List weaFormOptions = Lists.newArrayListWithExpectedSize(taxAgentListDTOS.size()); - for (TaxAgentPO taxAgent : taxAgentListDTOS) { - weaFormOptions.add(new WeaFormOption("" + taxAgent.getId(), taxAgent.getName())); - } -// weaForm.getItems().forEach((k, v) -> { -// if (StringUtils.equals("taxAgentId", k)) { -// v.setOptions(weaFormOptions); -// } -// if (StringUtils.equals("salaryMonth", k)) { -// Map otherParams = new HashMap<>(); -// otherParams.put("type", "month"); -// v.setOtherParams(otherParams); -// } -// }); - return formDTO; - } - - /** - * 查询个税申报表的基本信息 - * - * @param id 个税申报表id - * @return - */ - public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { - // 查询个税申报表 - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id); - if (Objects.isNull(taxDeclaration)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); - } - // 查询个税扣缴义务人 - TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId()); - return TaxDeclarationInfoDTO.builder().salaryMonth(taxDeclaration.getSalaryMonth()).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); - } - - /** - * 保存 - * - * @param saveParam 保存参数 - */ - public void save(TaxDeclarationSaveParam saveParam) { - getTaxDeclarationService(user).save(saveParam); - } - - /** - * 撤回个税申报 - * @param taxDeclarationId - */ - public void withDrawTaxDeclaration(Long taxDeclarationId) { - getTaxDeclarationService(user).withDrawTaxDeclaration(taxDeclarationId); - } } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index fed3fbe32..8c8f7be2b 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -310,6 +310,19 @@ public class TaxDeclareRecordWrapper extends Service { return tabs; } + /** + * 新增申报表 + * @param param + */ + public void addTaxDeclaration(TaxDeclarationAddParam param) { + getTaxDeclarationService(user).addTaxDeclaration(param); + } + + + public void deleteTaxDeclaration(TaxDeclarationDeleteParam param) { + getTaxDeclarationService(user).deleteTaxDeclaration(param); + } + /** * 查询个税申报表的基本信息 * @@ -767,4 +780,5 @@ public class TaxDeclareRecordWrapper extends Service { public Map importData(DownloadTemplateParam param) { return getTaxDeclarationExcelService(user).importData(param); } + } From dc3533d753a634984b62663cbc9dffd6b0ef2078 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 2 Jan 2024 09:41:30 +0800 Subject: [PATCH 107/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=AF=BC=E5=85=A5=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/EmployeeDeclareServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 1a18c8b3a..8143756ed 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -733,7 +733,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla if (CollectionUtils.isEmpty(insertList)) { return; } - List> partition = Lists.partition(insertList, 100); + List> partition = Lists.partition(insertList, 50); partition.forEach(getEmployeeDeclareMapper()::batchInsert); } } From 4cdd7616d9aa497476973595600ada8333f81333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 2 Jan 2024 10:18:25 +0800 Subject: [PATCH 108/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E5=89=8D=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/TaxDeclareRecordServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 29a6d6492..2f4f54b2b 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -679,6 +679,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); taxDeclareRecord.setUpdateTime(new Date()); + //清除之前的错误 + taxDeclareRecord.setTaxDeclareErrorMsg(""); getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 删除个税申报申报失败的数据 getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); From 4c233fb168e9b2efee85d3f59df4c1f502eb89b6 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 2 Jan 2024 13:44:57 +0800 Subject: [PATCH 109/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=AF=BC=E5=85=A5=EF=BC=8C=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/EmployeeDeclareExcelServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 520dcc68a..41401a94c 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -447,7 +447,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); newEmployeeDeclare.setUpdateTime(now); - needUpdateEmployeeDeclares.add(newEmployeeDeclare); if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); newEmployeeDeclare.setDeclareErrorMsg(""); @@ -541,7 +540,9 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee .creator(Long.valueOf(user.getUID())) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .createTime(now) - .updateTime(now).build(); + .updateTime(now) + .declareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .build(); EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); BeanUtils.copyProperties(employeeDeclarePO, employeeDeclare, getNullPropertyNames(employeeDeclarePO)); From dbcd6cc0b2aa3430e21b71483596a6747809c74d Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 2 Jan 2024 13:46:14 +0800 Subject: [PATCH 110/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=AF=BC=E5=85=A5=EF=BC=8C=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/EmployeeDeclareExcelServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 41401a94c..8b883769f 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -447,6 +447,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); newEmployeeDeclare.setUpdateTime(now); + needUpdateEmployeeDeclares.add(newEmployeeDeclare); if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); newEmployeeDeclare.setDeclareErrorMsg(""); From 4150948599bd8962dce5c68ded63479c0943ef4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 3 Jan 2024 10:40:55 +0800 Subject: [PATCH 111/298] =?UTF-8?q?=E6=92=A4=E9=94=80=E6=9B=B4=E6=AD=A3?= =?UTF-8?q?=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SzyhApiConstant.java | 5 ++ .../taxdeclaration/po/TaxDeclareRecordPO.java | 2 + .../taxdeclaration/TaxDeclareRecordMapper.xml | 6 +++ .../service/TaxDeclareRecordService.java | 11 +++- .../impl/TaxDeclareRecordServiceImpl.java | 54 +++++++++++++++++++ .../salary/web/TaxDeclarationController.java | 14 +++++ .../wrapper/TaxDeclareRecordWrapper.java | 31 +++++++++++ 7 files changed, 122 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index b4e04552a..608bf61a4 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -75,6 +75,11 @@ public class SzyhApiConstant { */ public static final String UPDATE_DECLARE = "/gateway/iit/report/correct"; + /** + * 撤销更正申报 + */ + public static final String CANCEL_CORRECT = "gateway/iit/report/cancelCorrect"; + /** * 税局端申报状态查询 */ diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index e65fff3d7..6a6440435 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.taxdeclaration.po; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -47,6 +48,7 @@ public class TaxDeclareRecordPO implements Serializable { private Date taxCycle; /** * 申报类型 + * @see TaxDeclareTypeEnum */ private Integer taxDeclareType; /** diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml index c6b660859..79b47b6fd 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -152,6 +152,12 @@ AND tax_cycle #{endDate} + + AND salary_month = ]]> #{salaryMonthStartDate} + + + AND salary_month #{salaryMonthEndDate} + ORDER BY tax_cycle DESC diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index aac9db48d..16478a170 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -22,7 +22,7 @@ import java.util.List; * @author qiantao * @version 1.0 **/ -public interface TaxDeclareRecordService { +public interface TaxDeclareRecordService { /** * 查询个税申报记录 @@ -136,12 +136,14 @@ public interface TaxDeclareRecordService { /** * 申报内置算税结果查询 + * * @param id * @return */ Object getDeclareTaxResultFeedback(Long id); XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param); + /** * 作废 * @@ -163,6 +165,13 @@ public interface TaxDeclareRecordService { */ void updateDeclare(Long id); + /** + * 撤销申报 + * + * @param id + */ + void cancelCorrect(Long id); + /** * 税局端申报状态查询 * diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 2f4f54b2b..29df68b25 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1017,6 +1017,60 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // taxDeclarationLoggerTemplate.write(loggerContext); } + + + + @Override + public void cancelCorrect(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); +// List taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); +// if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "对不起,只有申报成功后才允许更正申报")); +// } + // 供应商信息 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 注册的企业信息-->请求参数 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 申报类型 + requestParam.put("sblx", "1"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("撤销更正申报请求数据:" + reqJson); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_CORRECT; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("撤销更正申报返回数据:" + res); + UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class); + if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); + } + if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg()); + } +// taxDeclareRecord.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); +// taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); +// taxDeclareRecord.setRequestId(""); +// taxDeclareRecord.setUpdateTime(new Date()); +// getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + + // 记录日志 +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); +// taxDeclarationLoggerTemplate.write(loggerContext); + } + @Override public String queryDeclareStatus(Long id) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index c0d6944f9..c4e3a82a6 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -322,6 +322,20 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam.getTaxDeclareRecordId()); } + /** + * 撤销更正申报,税局存在逻辑问题。误更正申报,先再走申报处理 + * + * @param taxDeclareRecordParam 撤销更正申报参数 + * @return + */ + @POST + @Path("/cancelCorrect") + @Produces(MediaType.APPLICATION_JSON) + public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId()); + } + /** * 税局端申报状态查询 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 8c8f7be2b..d8c0b7072 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -585,6 +585,37 @@ public class TaxDeclareRecordWrapper extends Service { return taxDeclarationRate.getIndex(); } + /** + * 撤销更正申报 + * + * @param id + * @return + */ + public String cancelCorrect(Long id) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(177637, "撤销更正申报")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).cancelCorrect(id); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("撤销更正申报失败:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187269, "撤销更正申报失败:") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "cancelCorrect", localRunnable); + return taxDeclarationRate.getIndex(); + } + /** * 税局端申报状态查询 * From fcf04833653e67de8ce91e4001cc0a4ad48c6109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 3 Jan 2024 13:47:19 +0800 Subject: [PATCH 112/298] =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=9C=AA=E5=A1=AB=E5=86=99=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/enums/taxdeclaration/TaxDeclareStatusEnum.java | 1 + .../salary/service/impl/TaxDeclareRecordServiceImpl.java | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java index 27db64998..1335ff349 100644 --- a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java @@ -12,6 +12,7 @@ import com.engine.salary.enums.BaseEnum; **/ public enum TaxDeclareStatusEnum implements BaseEnum { + DECLARE_FAIL_UNFILLED(0, "未填写", 160495), NOT_DECLARE(1, "未申报", 160495), DECLARING(2, "申报中", 160496), DECLARE_FAIL(3, "申报失败", 160494), diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 29df68b25..2bd0b49ca 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -721,7 +721,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(declareTaxFeedbackResponse.getHead().getMsg()); } // 申报反馈状态 - Integer declareFeedbackStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("fkztbj"), 0); + Integer declareFeedbackStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("fkztbj"), -1); DeclareFeedBackStatusEnum declareFeedBackStatusEnum = SalaryEnumUtil.enumMatchByValue(declareFeedbackStatus, DeclareFeedBackStatusEnum.class); if (declareFeedBackStatusEnum == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); @@ -768,7 +768,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxDeclareErrorMsg(""); } // 申报状态 - Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), 0); + Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), -1); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(declareStatus, TaxDeclareStatusEnum.class); if (taxDeclareStatusEnum == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); @@ -1018,8 +1018,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } - - @Override public void cancelCorrect(Long id) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); From 482c461ce9e9666f3851ff4f9308305ca1f26ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 3 Jan 2024 15:36:53 +0800 Subject: [PATCH 113/298] =?UTF-8?q?fix=E4=BD=9C=E5=BA=9F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/TaxDeclareRecordServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 2bd0b49ca..00c26572a 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -851,7 +851,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 申报类型 requestParam.put("sblx", "1"); // 作废银联缴款凭证 - taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); +// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); // 是否清空所得 requestParam.put("sfqksd", "0"); // 请求 From f3fa6c6f3222c42d1aa31bec30a94b1f1e6111b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 4 Jan 2024 15:35:23 +0800 Subject: [PATCH 114/298] =?UTF-8?q?=E5=AF=B9=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaxDeclarationValueListQueryParam.java | 5 + .../taxdeclaration/po/TaxReportColumnPO.java | 70 ++++- .../taxdeclaration/TaxReportColumnMapper.java | 58 ---- .../taxdeclaration/TaxReportColumnMapper.xml | 296 +----------------- .../service/TaxDeclareRecordService.java | 20 +- .../service/TaxReportColumnService.java | 2 +- .../impl/TaxDeclarationExcelServiceImpl.java | 4 +- .../impl/TaxDeclarationValueServiceImpl.java | 24 +- .../impl/TaxDeclareRecordServiceImpl.java | 6 + .../impl/TaxReportColumnServiceImpl.java | 9 +- .../salary/web/TaxDeclarationController.java | 15 + .../wrapper/TaxDeclareRecordWrapper.java | 19 +- 12 files changed, 155 insertions(+), 373 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java index 864c4dac9..ff40cf181 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -26,4 +26,9 @@ public class TaxDeclarationValueListQueryParam extends BaseQueryParam { //导出excel时加密的密码") private String sharePassword; + + /** + * 姓名或者工号 + */ + private String keyword; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index a6591e714..f2b61a35e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -23,32 +23,76 @@ import java.util.Date; //hrsa_tax_report_column public class TaxReportColumnPO { - //name = 主键id + /** + * 主键id + */ private Long id; - //name = 报表类型 + + /** + * 报表类型 + */ private String taxReportType; - //name = 所得项目 + + /** + * 所得项目 + */ private String incomeCategory; - //name = 申报表的列名 + + /** + * 申报表的列名 + */ private String reportColumnName; - //name = 申报表的列名多语言标签 + + /** + * 申报表的列名多语言标签 + */ private Integer reportColumnLabel; - //name = 申报表的列索引 + + /** + * 申报表的列索引 + */ private String reportColumnDataIndex; - //name = 数值类型 + + /** + * 数值类型 + */ private String dataType; - //name = 个税对接时的参数key + + /** + * 个税对接时的参数key + */ private String requestParamKey; - //name = 租户key + + /** + * 是否是对比字段,1是0否 + */ + private Integer contrastType; + + /** + * 租户key + */ private String tenantKey; - //name = 创建人id + + /** + * 创建人id + */ private Long creator; - //name = 是否删除 + + /** + * 是否删除 + */ private Integer deleteType; - //name = 创建时间 + + /** + * 创建时间 + */ private Date createTime; - //name = 更新时间 + + /** + * 更新时间 + */ private Date updateTime; Collection ids; + Collection contrastTypes; } diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java index df8f8738a..1f767ca48 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java @@ -1,9 +1,7 @@ package com.engine.salary.mapper.taxdeclaration; import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; -import org.apache.ibatis.annotations.Param; -import java.util.Collection; import java.util.List; public interface TaxReportColumnMapper { @@ -21,60 +19,4 @@ public interface TaxReportColumnMapper { * @return 返回集合,没有返回空List */ List listSome(TaxReportColumnPO taxReportColumn); - - - /** - * 根据主键查询 - * - * @param id 主键 - * @return 返回记录,没有返回null - */ - TaxReportColumnPO getById(Long id); - - /** - * 新增,忽略null字段 - * - * @param taxReportColumn 新增的记录 - * @return 返回影响行数 - */ - int insertIgnoreNull(TaxReportColumnPO taxReportColumn); - - /** - * 批量插入 - * - * @param taxReportColumn - */ - void batchInsert(@Param("collection") List taxReportColumn); - - /** - * 修改,修改所有字段 - * - * @param taxReportColumn 修改的记录 - * @return 返回影响行数 - */ - int update(TaxReportColumnPO taxReportColumn); - - /** - * 修改,忽略null字段 - * - * @param taxReportColumn 修改的记录 - * @return 返回影响行数 - */ - int updateIgnoreNull(TaxReportColumnPO taxReportColumn); - - /** - * 删除记录 - * - * @param taxReportColumn 待删除的记录 - * @return 返回影响行数 - */ - int delete(TaxReportColumnPO taxReportColumn); - - /** - * 批量删除记录 - * - * @param ids 主键id集合 - */ - void deleteByIds(@Param("ids") Collection ids); - } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml index 1002208a0..7ce9c9fae 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml @@ -15,6 +15,7 @@ + @@ -34,6 +35,7 @@ , t.data_type , t.request_param_key , t.report_column_label + , t.contrast_type @@ -98,299 +100,23 @@ AND report_column_label = #{reportColumnLabel} + + AND contrast_type = #{contrastType} + AND id IN #{id} + + AND contrast_type IN + + #{contrastType} + + ORDER BY id - - - INSERT INTO hrsa_tax_report_column - - - - id, - - - create_time, - - - update_time, - - - creator, - - - delete_type, - - - tenant_key, - - - tax_report_type, - - - income_category, - - - report_column_name, - - - report_column_data_index, - - - data_type, - - - request_param_key, - - - report_column_label, - - - - - #{id}, - - - #{createTime}, - - - #{updateTime}, - - - #{creator}, - - - #{deleteType}, - - - #{tenantKey}, - - - #{taxReportType}, - - - #{incomeCategory}, - - - #{reportColumnName}, - - - #{reportColumnDataIndex}, - - - #{dataType}, - - - #{requestParamKey}, - - - #{reportColumnLabel}, - - - - - - - - INSERT INTO hrsa_tax_report_column - ( - id, - create_time, - update_time, - creator, - delete_type, - tenant_key, - tax_report_type, - income_category, - report_column_name, - report_column_data_index, - data_type, - request_param_key, - report_column_label - ) - VALUES - ( - - #{item.id}, - #{item.createTime}, - #{item.updateTime}, - #{item.creator}, - #{item.deleteType}, - #{item.tenantKey}, - #{item.taxReportType}, - #{item.incomeCategory}, - #{item.reportColumnName}, - #{item.reportColumnDataIndex}, - #{item.dataType}, - #{item.requestParamKey}, - #{item.reportColumnLabel} - - ) - - - - - INSERT INTO hrsa_tax_report_column ( - id, - create_time, - update_time, - creator, - delete_type, - tenant_key, - tax_report_type, - income_category, - report_column_name, - report_column_data_index, - data_type, - request_param_key, - report_column_label - ) - - - select - #{item.id,jdbcType=DOUBLE}, - #{item.createTime,jdbcType=DATE}, - #{item.updateTime,jdbcType=DATE}, - #{item.creator,jdbcType=DOUBLE}, - #{item.deleteType,jdbcType=INTEGER}, - #{item.tenantKey,jdbcType=VARCHAR}, - #{item.taxReportType,jdbcType=INTEGER}, - #{item.incomeCategory,jdbcType=INTEGER}, - #{item.reportColumnName,jdbcType=VARCHAR}, - #{item.reportColumnDataIndex,jdbcType=VARCHAR}, - #{item.dataType,jdbcType=VARCHAR}, - #{item.requestParamKey,jdbcType=VARCHAR}, - #{item.reportColumnLabel,jdbcType=INTEGER} - from dual - - - - - - - INSERT INTO hrsa_tax_report_column ( - id, - create_time, - update_time, - creator, - delete_type, - tenant_key, - tax_report_type, - income_category, - report_column_name, - report_column_data_index, - data_type, - request_param_key, - report_column_label - ) - VALUES - ( - #{item.id}, - #{item.createTime}, - #{item.updateTime}, - #{item.creator}, - #{item.deleteType}, - #{item.tenantKey}, - #{item.taxReportType}, - #{item.incomeCategory}, - #{item.reportColumnName}, - #{item.reportColumnDataIndex}, - #{item.dataType}, - #{item.requestParamKey}, - #{item.reportColumnLabel} - ) - - - - - UPDATE hrsa_tax_report_column - - create_time=#{createTime}, - update_time=#{updateTime}, - creator=#{creator}, - delete_type=#{deleteType}, - tenant_key=#{tenantKey}, - tax_report_type=#{taxReportType}, - income_category=#{incomeCategory}, - report_column_name=#{reportColumnName}, - report_column_data_index=#{reportColumnDataIndex}, - data_type=#{dataType}, - request_param_key=#{requestParamKey}, - report_column_label=#{reportColumnLabel}, - - WHERE id = #{id} AND delete_type = 0 - - - - - - UPDATE hrsa_tax_report_column - - - create_time=#{createTime}, - - - update_time=#{updateTime}, - - - creator=#{creator}, - - - delete_type=#{deleteType}, - - - tenant_key=#{tenantKey}, - - - tax_report_type=#{taxReportType}, - - - income_category=#{incomeCategory}, - - - report_column_name=#{reportColumnName}, - - - report_column_data_index=#{reportColumnDataIndex}, - - - data_type=#{dataType}, - - - request_param_key=#{requestParamKey}, - - - report_column_label=#{reportColumnLabel}, - - - WHERE id = #{id} AND delete_type = 0 - - - - - - UPDATE hrsa_tax_report_column - SET delete_type=1 - WHERE id = #{id} - AND delete_type = 0 - - - - UPDATE hrsa_tax_report_column - SET delete_type = 1 - WHERE delete_type = 0 - AND id IN - - #{id} - - - - \ No newline at end of file diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 16478a170..1d844978a 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -81,6 +81,19 @@ public interface TaxDeclareRecordService { */ void save(TaxDeclarationSaveParam saveParam); + /** + * 税局端申报明细查询 + * + * @param id + */ + String queryCompanyIncomes(Long id); + + /** + * 对比线上和线下算税 + * @param id + */ + void contrast(Long id); + /** * 刷新数据 @@ -179,12 +192,7 @@ public interface TaxDeclareRecordService { */ String queryDeclareStatus(Long id); - /** - * 税局端申报明细查询 - * - * @param id - */ - String queryCompanyIncomes(Long id); + void updateById(TaxDeclareRecordPO taxDeclareRecord); diff --git a/src/com/engine/salary/service/TaxReportColumnService.java b/src/com/engine/salary/service/TaxReportColumnService.java index c9f466e14..329cd697e 100644 --- a/src/com/engine/salary/service/TaxReportColumnService.java +++ b/src/com/engine/salary/service/TaxReportColumnService.java @@ -28,5 +28,5 @@ public interface TaxReportColumnService { * @param incomeCategory * @return */ - List listByIncomeCategory(IncomeCategoryEnum incomeCategory); + List listByIncomeCategory(IncomeCategoryEnum incomeCategory, Integer... contrastTypes); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 5f5796e39..f8a7db934 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -197,7 +197,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); - List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum,0); List heads = new ArrayList<>(); @@ -247,7 +247,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); - List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum,0); List taxReportColumnNames = SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList()); List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(declarationPO.getId()); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 80e1c8209..34191ae36 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -41,6 +41,8 @@ import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; +import static weaver.conn.ExternalDataSourceManager.list; + /** * 个税申报表 *

Copyright: Copyright (c) 2023

@@ -109,7 +111,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar public TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues) { // 查询个税申报表表头 IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); // 人员id Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); // 查询报送的人员 @@ -272,7 +274,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } //正常薪资的表头 - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES, 0); Map valueMap = Maps.newHashMap(); for (TaxReportColumnPO taxReportColumn : taxReportColumns) { String value = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; @@ -328,4 +330,22 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar })).collect(Collectors.toList()); batchSave(autoAddValuePOs); } + + public void contrast(Long taxDeclarationId) { + TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(taxDeclarationId); + if (declarationPO == null) { + throw new SalaryRunTimeException("无申报表"); + } + TaxDeclarationPO taxDeclarationPO; + + if (CollectionUtils.isNotEmpty(list)) { + if (list.size() > 1) { + throw new SalaryRunTimeException("存在多条正常工资薪金申报表数据"); + } + taxDeclarationPO = list.get(0); + } else { + + } + + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 00c26572a..61199ba8f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1113,6 +1113,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return res; } + @Override + public void contrast(Long id) { + + + } + @Override public void updateById(TaxDeclareRecordPO taxDeclareRecord) { getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); diff --git a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java index 1ddd88cdc..30ebbe9d5 100644 --- a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -7,6 +7,7 @@ import com.engine.salary.mapper.taxdeclaration.TaxReportColumnMapper; import com.engine.salary.service.TaxReportColumnService; import com.engine.salary.util.db.MapperProxyFactory; +import java.util.Arrays; import java.util.List; /** @@ -17,7 +18,7 @@ import java.util.List; * @author qiantao * @version 1.0 **/ -public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { +public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { private TaxReportColumnMapper getTaxReportColumnMapper() { return MapperProxyFactory.getProxy(TaxReportColumnMapper.class); @@ -26,11 +27,11 @@ public class TaxReportColumnServiceImpl extends Service implements TaxReportCol @Override public List listAll() { - return getTaxReportColumnMapper().listAll(); + return getTaxReportColumnMapper().listAll(); } @Override - public List listByIncomeCategory(IncomeCategoryEnum incomeCategory) { - return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().incomeCategory(incomeCategory.getValue().toString()).build()); + public List listByIncomeCategory(IncomeCategoryEnum incomeCategory, Integer... contrastTypes) { + return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().contrastTypes(Arrays.asList(contrastTypes)).incomeCategory(incomeCategory.getValue().toString()).build()); } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index c4e3a82a6..d7561a977 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -364,6 +364,21 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, taxDeclareRecordParam.getTaxDeclareRecordId()); } + /** + * 对比算税过程 + * @param request + * @param response + * @param taxDeclareRecordParam + * @return + */ + @POST + @Path("/contrast") + @Produces(MediaType.APPLICATION_JSON) + public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclareRecordParam.getTaxDeclareRecordId()); + } + /** * 刷新数据 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index d8c0b7072..621721de5 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -636,6 +636,11 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclareRecordService(user).queryCompanyIncomes(id); } + + public void contrast(Long id) { + getTaxDeclareRecordService(user).contrast(id); + } + /** * 刷新数据 * @@ -714,6 +719,11 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclarationExcelService(user).exportEmployee4Fail(queryParam); } + /** + * 新增表单 + * @param param + * @return + */ public TaxDeclareRecordDetailFormDTO getAddForm(TaxDeclareRecordDetailFormParam param) { TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); @@ -722,7 +732,7 @@ public class TaxDeclareRecordWrapper extends Service { } // 查询个税申报表列 - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory())); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()),0); //当前税款所属期报送成功且状态正常的人员 List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( EmployeeDeclareListQueryParam @@ -765,6 +775,11 @@ public class TaxDeclareRecordWrapper extends Service { getTaxDeclarationValueService(user).edit(param); } + /** + * 详细信息 + * @param id + * @return + */ public TaxDeclareRecordDetailFormDTO detailInfo(Long id) { TaxDeclarationValuePO declarationValuePO = getTaxDeclarationValueService(user).getById(id); TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(declarationValuePO.getTaxDeclarationId()); @@ -783,7 +798,7 @@ public class TaxDeclareRecordWrapper extends Service { } EmployeeDeclarePO employeeDeclarePO = employeeDeclarePOS.get(0); // 查询个税申报表列 - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory())); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()),0); return TaxDeclareRecordDetailFormDTO .builder() .id(id) From be25234e0e8b692169a034180202b1339e47e2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 4 Jan 2024 15:56:42 +0800 Subject: [PATCH 115/298] =?UTF-8?q?=E5=AF=B9=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TaxDeclarationValueServiceImpl.java | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 34191ae36..c569bbf0c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -41,8 +41,6 @@ import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; -import static weaver.conn.ExternalDataSourceManager.list; - /** * 个税申报表 *

Copyright: Copyright (c) 2023

@@ -332,20 +330,42 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } public void contrast(Long taxDeclarationId) { - TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(taxDeclarationId); - if (declarationPO == null) { + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(taxDeclarationId); + if (taxDeclaration == null) { throw new SalaryRunTimeException("无申报表"); } - TaxDeclarationPO taxDeclarationPO; - if (CollectionUtils.isNotEmpty(list)) { - if (list.size() > 1) { - throw new SalaryRunTimeException("存在多条正常工资薪金申报表数据"); - } - taxDeclarationPO = list.get(0); - } else { + List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); + + // 查询个税申报表表头 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); + // 人员id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 查询报送的人员 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 查询人员信息 + List simpleEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .distinct() + .collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询人员薪资(身份证号码等) + List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询外部人员 + List extEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .collect(Collectors.toList()); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); + + // 列表表头 + List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); + // 列表数据 + List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, + employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees); - } } } From 2670236f9c61da88f83d242762f3bb96edd22a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 8 Jan 2024 09:52:04 +0800 Subject: [PATCH 116/298] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/TaxDeclarationValueList.java | 26 ++-- .../GetDeclareTaxResultFeedbackResponse.java | 40 +++++++ .../service/TaxDeclarationValueService.java | 13 +- .../service/TaxDeclareRecordService.java | 6 - .../impl/TaxDeclarationValueServiceImpl.java | 111 +++++++++++++----- .../impl/TaxDeclareRecordServiceImpl.java | 12 +- .../engine/salary/util/excel/ExcelUtil.java | 15 +-- .../salary/web/TaxDeclarationController.java | 30 ++--- .../wrapper/TaxDeclareRecordWrapper.java | 7 +- 9 files changed, 176 insertions(+), 84 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index ee755aad5..e557e155e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -67,7 +67,7 @@ public class TaxDeclarationValueList { List employeeDeclares, List simpleEmployees, List simpleUserInfos, - List extEmployees) { + List extEmployees, boolean cnKey) { if (CollectionUtils.isEmpty(simpleEmployees)) { return Collections.emptyList(); } @@ -86,27 +86,27 @@ public class TaxDeclarationValueList { dataMap.put("employeeId", taxDeclarationValue.getEmployeeId() + ""); dataMap.put("incomeCategory", incomeCategoryEnum.getDefaultLabel()); for (TaxReportColumnPO taxReportColumn : taxReportColumns) { - dataMap.put(taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); + dataMap.put(cnKey ? taxReportColumn.getReportColumnName() : taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); } EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); if (employeeDeclare != null) { dataMap.put("jobNum", employeeDeclare.getJobNum()); - dataMap.put("username", employeeDeclare.getEmployeeName()); - dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); - dataMap.put("cardNum", employeeDeclare.getCardNum()); + dataMap.put(cnKey ? "姓名" : "username", employeeDeclare.getEmployeeName()); + dataMap.put(cnKey ? "证件类型" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "证件号码" : "cardNum", employeeDeclare.getCardNum()); } else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(taxDeclarationValue.getEmployeeId()); - dataMap.put("jobNum", simpleEmployee.getWorkcode()); - dataMap.put("username", simpleEmployee.getUsername()); - dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); - dataMap.put("cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); + dataMap.put(cnKey ? "工号" : "jobNum", simpleEmployee.getWorkcode()); + dataMap.put(cnKey ? "姓名" : "username", simpleEmployee.getUsername()); + dataMap.put(cnKey ? "证件类型" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "证件号码" : "cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); } else { ExtEmpPO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); - dataMap.put("jobNum", ""); - dataMap.put("username", extEmployee.getUsername()); - dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); - dataMap.put("cardNum", extEmployee.getIdNo()); + dataMap.put(cnKey ? "工号" : "jobNum", ""); + dataMap.put(cnKey ? "姓名" : "username", extEmployee.getUsername()); + dataMap.put(cnKey ? "证件类型" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "证件号码" : "cardNum", extEmployee.getIdNo()); } tableDataList.add(dataMap); } diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java index 1313ca083..5727d8c74 100644 --- a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -2,6 +2,7 @@ package com.engine.salary.remote.tax.response.employee; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.util.excel.ExcelHead; import lombok.Data; import lombok.EqualsAndHashCode; @@ -240,112 +241,133 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { * 姓名 必填:null 如果是汇总申报返回空 */ @SalaryTableColumn(text = "姓名", width = "10%", column = "xm") + @ExcelHead(title = "姓名", dataIndex = "xm") private String xm; /** * 证件类型 必填:null 见证件类型字典 */ @SalaryTableColumn(text = "证件类型", width = "10%", column = "zzlx") + @ExcelHead(title = "证件类型", dataIndex = "zzlx") private String zzlx; /** * 证件号码 必填:null 如果是汇总申报返回空 */ @SalaryTableColumn(text = "证件号码", width = "10%", column = "zzhm") + @ExcelHead(title = "证件号码", dataIndex = "zzhm") private String zzhm; /** * 任职受雇日期 必填:是 格式YYYY-MM-DD */ @SalaryTableColumn(text = "任职受雇日期", width = "10%", column = "rzsgrq") + @ExcelHead(title = "任职受雇日期", dataIndex = "rzsgrq") private String rzsgrq; /** * 离职日期 必填:否 格式YYYY-MM-DD */ @SalaryTableColumn(text = "离职日期", width = "10%", column = "lzrq") + @ExcelHead(title = "离职日期", dataIndex = "lzrq") private String lzrq; /** * 当期收入额 必填:是 不填写默认为0 */ @SalaryTableColumn(text = "本期收入", width = "10%", column = "sre") + @ExcelHead(title = "本期收入", dataIndex = "sre") private BigDecimal sre; /** * 当期免税收入 必填:null */ @SalaryTableColumn(text = "本期免税收入", width = "10%", column = "mssd") + @ExcelHead(title = "本期免税收入", dataIndex = "mssd") private BigDecimal mssd; /** * 基本养老保险 必填:null */ @SalaryTableColumn(text = "本期基本养老保险费", width = "10%", column = "jbylaobxf") + @ExcelHead(title = "本期基本养老保险费", dataIndex = "jbylaobxf") private BigDecimal jbylaobxf; /** * 基本医疗保险 必填:null */ @SalaryTableColumn(text = "本期基本医疗保险费", width = "10%", column = "jbylbxf") + @ExcelHead(title = "本期基本医疗保险费", dataIndex = "jbylbxf") private BigDecimal jbylbxf; /** * 失业保险 必填:null */ @SalaryTableColumn(text = "本期失业保险费", width = "10%", column = "sybxf") + @ExcelHead(title = "本期失业保险费", dataIndex = "sybxf") private BigDecimal sybxf; /** * 住房公积金 必填:null */ @SalaryTableColumn(text = "本期住房公积金", width = "10%", column = "zfgjj") + @ExcelHead(title = "本期住房公积金", dataIndex = "zfgjj") private BigDecimal zfgjj; /** * 年金 必填:null */ @SalaryTableColumn(text = "本期企业(职业)年金", width = "10%", column = "nj") + @ExcelHead(title = "本期企业(职业)年金", dataIndex = "nj") private BigDecimal nj; /** * 商业健康保险 必填:null */ @SalaryTableColumn(text = "本期商业健康保险费", width = "10%", column = "syjkbx") + @ExcelHead(title = "本期商业健康保险费", dataIndex = "syjkbx") private BigDecimal syjkbx; /** * 税延养老保险 必填:null */ @SalaryTableColumn(text = "本期税延养老保险费", width = "10%", column = "syylbx") + @ExcelHead(title = "本期税延养老保险费", dataIndex = "syylbx") private BigDecimal syylbx; /** * 其他 必填:null 按法律规定可以在税前扣除的项目 */ @SalaryTableColumn(text = "本期其他扣除(其他)", width = "10%", column = "qt") + @ExcelHead(title = "本期其他扣除(其他)", dataIndex = "qt") private BigDecimal qt; /** * 累计收入额 必填:null */ @SalaryTableColumn(text = "累计收入额", width = "10%", column = "ljsre") + @ExcelHead(title = "累计收入额", dataIndex = "ljsre") private BigDecimal ljsre; /** * 累计免税收入额 必填:null */ @SalaryTableColumn(text = "累计免税收入", width = "10%", column = "ljmssd") + @ExcelHead(title = "累计免税收入", dataIndex = "ljmssd") private BigDecimal ljmssd; /** * 累计减除费用额 必填:null 正常工资薪金累计减除费用 对应保险营销员、证券经纪人累计费用 */ @SalaryTableColumn(text = "累计减除费用", width = "10%", column = "ljjcfye") + @ExcelHead(title = "累计减除费用", dataIndex = "ljjcfye") private BigDecimal ljjcfye; /** * 累计专项扣除额 必填:null 三险一金合计 */ @SalaryTableColumn(text = "累计专项扣除", width = "10%", column = "ljzxkce") + @ExcelHead(title = "累计专项扣除", dataIndex = "ljzxkce") private BigDecimal ljzxkce; /** * 累计子女教育支出 必填:null */ @SalaryTableColumn(text = "累计子女教育支出扣除", width = "10%", column = "ljznjyzc") + @ExcelHead(title = "累计子女教育支出扣除", dataIndex = "ljznjyzc") private BigDecimal ljznjyzc; /** * 累计继续教育支出 必填:null */ @SalaryTableColumn(text = "累计继续教育支出扣除", width = "10%", column = "ljjxjyzc") + @ExcelHead(title = "累计继续教育支出扣除", dataIndex = "ljjxjyzc") private BigDecimal ljjxjyzc; /** * 累计非学历继续教育支持 必填:null @@ -359,21 +381,25 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { * 累计住房租金支出 必填:null */ @SalaryTableColumn(text = "累计住房租金支出扣除", width = "10%", column = "ljzfzjzc") + @ExcelHead(title = "累计住房租金支出扣除", dataIndex = "ljzfzjzc") private BigDecimal ljzfzjzc; /** * 累计房屋贷款支出 必填:null */ @SalaryTableColumn(text = "累计房屋贷款支出扣除", width = "10%", column = "ljzfdklxzc") + @ExcelHead(title = "累计房屋贷款支出扣除", dataIndex = "ljzfdklxzc") private BigDecimal ljzfdklxzc; /** * 累计赡养老人支出 必填:null */ @SalaryTableColumn(text = "累计赡养老人支出扣除", width = "10%", column = "ljsylrzc") + @ExcelHead(title = "累计赡养老人支出扣除", dataIndex = "ljsylrzc") private BigDecimal ljsylrzc; /** * 累计3岁以下婴幼儿照护支出 必填:null */ @SalaryTableColumn(text = "累计3岁以下婴幼儿照护", width = "10%", column = "ljyyezhzc") + @ExcelHead(title = "累计3岁以下婴幼儿照护", dataIndex = "ljyyezhzc") private BigDecimal ljyyezhzc; @@ -381,81 +407,95 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { * 累计个人养老金 必填:null */ @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "ljgrylj") + @ExcelHead(title = "累计个人养老金", dataIndex = "ljgrylj") private BigDecimal ljgrylj; /** * 累计其他扣除额 必填:null */ @SalaryTableColumn(text = "累计其他扣除", width = "10%", column = "ljqtkce") + @ExcelHead(title = "累计其他扣除", dataIndex = "ljqtkce") private BigDecimal ljqtkce; /** * 累计准予扣除的捐赠额 必填:null */ @SalaryTableColumn(text = "累计准予扣除的捐赠", width = "10%", column = "ljzykcjze") + @ExcelHead(title = "累计准予扣除的捐赠", dataIndex = "ljzykcjze") private BigDecimal ljzykcjze; /** * 累计应纳税所得额 必填:null */ @SalaryTableColumn(text = "累计应纳税所得额", width = "10%", column = "ljynssde") + @ExcelHead(title = "累计应纳税所得额", dataIndex = "ljynssde") private BigDecimal ljynssde; /** * 税率 必填:null */ @SalaryTableColumn(text = "税率", width = "10%", column = "sl") + @ExcelHead(title = "税率", dataIndex = "sl") private BigDecimal sl; /** * 速算扣除数 必填:null */ @SalaryTableColumn(text = "速算扣除数", width = "10%", column = "sskcs") + @ExcelHead(title = "速算扣除数", dataIndex = "sskcs") private BigDecimal sskcs; /** * 累计应纳税额 必填:null */ @SalaryTableColumn(text = "累计应纳税额", width = "10%", column = "ljynse") + @ExcelHead(title = "累计应纳税额", dataIndex = "ljynse") private BigDecimal ljynse; /** * 累计减免税额 必填:null */ @SalaryTableColumn(text = "累计减免税额", width = "10%", column = "ljjmse") + @ExcelHead(title = "累计减免税额", dataIndex = "ljjmse") private BigDecimal ljjmse; /** * 累计应扣缴税额 必填:null 累计应扣缴税额 = 累计应纳税额 - 累计减免税额 */ @SalaryTableColumn(text = "累计应扣缴税额", width = "10%", column = "ljyingkjse") + @ExcelHead(title = "累计应扣缴税额", dataIndex = "ljyingkjse") private BigDecimal ljyingkjse; /** * 累计已缴税额 必填:null */ @SalaryTableColumn(text = "累计已缴税额", width = "10%", column = "ljykjse") + @ExcelHead(title = "累计已缴税额", dataIndex = "ljykjse") private BigDecimal ljykjse; /** * 已缴税额 必填:null 正常工资薪金返回Null */ @SalaryTableColumn(text = "已缴税额", width = "10%", column = "ykjse") + @ExcelHead(title = "已缴税额", dataIndex = "ykjse") private BigDecimal ykjse; /** * 累计专项附加扣除额 必填:null 专项附加合计 */ @SalaryTableColumn(text = "累计专项附加扣除额", width = "10%", column = "ljzxfjkce") + @ExcelHead(title = "累计专项附加扣除额", dataIndex = "ljzxfjkce") private BigDecimal ljzxfjkce; /** * 应补退税额 必填:null 应补退税额=累计应扣缴税额-累计已缴税额 */ @SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse") + @ExcelHead(title = "应补退税额", dataIndex = "ybtse") private BigDecimal ybtse; /** * 备注 必填:null */ @SalaryTableColumn(text = "备注", width = "10%", column = "bz") + @ExcelHead(title = "备注", dataIndex = "bz") private String bz; /** diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 3d12b5350..773b6b9e9 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -27,7 +27,7 @@ public interface TaxDeclarationValueService { * @param taxDeclarationIds * @return */ - PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam,Collection taxDeclarationIds); + PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds); /** * 查询个税申报表明细 @@ -36,6 +36,7 @@ public interface TaxDeclarationValueService { * @return */ List listByTaxDeclarationIds(Collection taxDeclarationIds); + List listByTaxDeclarationId(Long taxDeclarationId); /** @@ -60,11 +61,14 @@ public interface TaxDeclarationValueService { * @param taxDeclarationValues */ void batchSave(List taxDeclarationValues); + void batchEdit(List taxDeclarationValues); void save(TaxDeclareRecordDetailSaveParam param); + void edit(TaxDeclareRecordDetailSaveParam param); + TaxDeclarationValuePO getById(Long id); /** @@ -77,9 +81,16 @@ public interface TaxDeclarationValueService { /** * 因为单独申报年终奖不可行 * 需要补充正常工资薪金的申报,按0申报 + * * @param po */ void autoAddWagesDeclare(TaxDeclareRecordPO po); + /** + * 对比 + * @param taxDeclareRecordId + */ + void contrast(Long taxDeclareRecordId); + } diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 1d844978a..25906560f 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -88,12 +88,6 @@ public interface TaxDeclareRecordService { */ String queryCompanyIncomes(Long id); - /** - * 对比线上和线下算税 - * @param id - */ - void contrast(Long id); - /** * 刷新数据 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index c569bbf0c..ddb3f26c4 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -24,6 +24,8 @@ import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; +import com.engine.salary.remote.tax.client.DeclareClient; +import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; @@ -36,6 +38,7 @@ import com.google.common.collect.Maps; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; import java.util.*; @@ -134,7 +137,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); // 列表数据 List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, - employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees); + employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, false); return new TaxDeclarationValueListDTO().setColumns(weaTableColumns).setData(data); } @@ -329,43 +332,87 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar batchSave(autoAddValuePOs); } - public void contrast(Long taxDeclarationId) { - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(taxDeclarationId); - if (taxDeclaration == null) { + @Override + public void contrast(Long taxDeclareRecordId) { + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclareRecordId); + if (taxDeclareRecordPO == null) { + throw new SalaryRunTimeException("申报记录不存在!"); + } + + List taxDeclarations = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordId); + if (CollectionUtils.isEmpty(taxDeclarations)) { throw new SalaryRunTimeException("无申报表"); } - List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); + Map>> localData = new HashMap<>(); + for (TaxDeclarationPO taxDeclaration : taxDeclarations) { + List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); - // 查询个税申报表表头 - IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); - // 人员id - Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); - // 查询报送的人员 - List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); - // 查询人员信息 - List simpleEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .distinct() - .collect(Collectors.toList()); - List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); - // 查询人员薪资(身份证号码等) - List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); - // 查询外部人员 - List extEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .collect(Collectors.toList()); - List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); + // 查询个税申报表表头 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + // 人员id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 查询报送的人员 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 查询人员信息 + List simpleEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .distinct() + .collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询人员薪资(身份证号码等) + List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询外部人员 + List extEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .collect(Collectors.toList()); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); - // 列表表头 - List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); - // 列表数据 - List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, - employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees); + // 列表数据 + List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, + employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); + localData.put(incomeCategoryEnum.getDefaultLabel(), data); + } + DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecordPO.getDeclareRequestId()); + + Map>> onlineDataMap = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); + + for (String incomeCategory : localData.keySet()) { + List> localMap = localData.get(incomeCategory); + + List> onlineData = onlineDataMap.get(incomeCategory); + List heads = onlineData.get(0); + List> data = onlineData.subList(1, onlineData.size()); + + List> onlineMap = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + List row = data.get(i); + Map 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); + } + } + } + + public static void main(String[] args) { + String a = "姓名, 证件类型, 证件号码, 本期收入, 本期免税收入, 基本养老保险费 , 基本医疗保险费, 失业保险费, 住房公积金, 企业(职业)年金, 商业健康保险, 税延养老保险, 累计收入额, 累计免税收入 , 累计减除费用, 累计专项扣除, 累计子女教育支出扣除, 累计继续教育 累计住房租金, 累计赡养老人支出扣除 , 累计3岁以下婴幼儿照护, 累计个人养老金, 累计其他扣除, 累计准予扣除的捐赠,累计应纳税所得额 ,税率, 速算扣除数, 累计应纳税额, 累计减免税额, 累计应扣缴税额, 已缴税额, 备注, incomeCategory, 证件号码,累计住房贷款利息, 累计子女教育, id, 减免税额, 累计3岁以下婴幼儿照护支出, jobNum, , employeeId, 其他, 应补(退)税额, 准予扣除的捐赠额, 累计住房贷款利息支出扣除, 累计住房租金支出扣除, 累计赡养老人, "; + String b = "姓名, 证件类型, 证件号码, 任职受雇日期, 离职日期, 本期收入, 本期免税收入, 本期基本养老保险费, 本期基本医疗保险费, 本期失业保险费, 本期住房公积金, 本期企业(职业)年金, 本期商业健康保险费, 本期税延养老保险费, 本期其他扣除(其他), 累计收入额, 累计免税收入, 累计减除费用, 累计专项扣除, 累计子女教育支出扣除, 累计继续教育支出扣除, 累计住房租金支出扣除, 累计房屋贷款支出扣除, 累计赡养老人支出扣除, 累计3岁以下婴幼儿照护, 累计个人养老金, 累计其他扣除, 累计准予扣除的捐赠, 累计应纳税所得额, 税率, 速算扣除数, 累计应纳税额, 累计减免税额, 累计应扣缴税额, 累计已缴税额, 已缴税额, 累计专项附加扣除额, 应补退税额, 备注"; + + List c = Arrays.stream(StringUtils.split(a, ",")).sorted(String::compareTo).collect(Collectors.toList()); + List d = Arrays.stream(StringUtils.split(b, ",")).sorted(String::compareTo).collect(Collectors.toList()); + + System.out.println(c); + System.out.println(d); } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 61199ba8f..f9ea9de2f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -59,7 +59,6 @@ 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 org.springframework.transaction.annotation.Transactional; import weaver.general.Util; import weaver.hrm.User; @@ -334,7 +333,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - @Transactional(rollbackFor = Exception.class) public void refreshData(Long id) { // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = getById(id); @@ -946,6 +944,11 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); + + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); } @@ -1113,11 +1116,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return res; } - @Override - public void contrast(Long id) { - - - } @Override public void updateById(TaxDeclareRecordPO taxDeclareRecord) { diff --git a/src/com/engine/salary/util/excel/ExcelUtil.java b/src/com/engine/salary/util/excel/ExcelUtil.java index b47077c33..53b79fba8 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -1,10 +1,9 @@ package com.engine.salary.util.excel; -import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryDateUtil; -import com.google.common.collect.Lists; import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.FillPatternType; @@ -14,10 +13,8 @@ import org.apache.poi.xssf.usermodel.*; import java.awt.*; import java.lang.reflect.Field; -import java.util.*; -import java.lang.reflect.Field; -import java.util.Date; import java.util.List; +import java.util.*; public class ExcelUtil { /** @@ -355,12 +352,12 @@ public class ExcelUtil { List dataIndexList = Lists.newArrayList(); Field[] declaredFields = clazz.getDeclaredFields(); for (Field declaredField : declaredFields) { - if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { + if (!declaredField.isAnnotationPresent(ExcelHead.class)) { continue; } - SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); - headerList.add(annotation.text()); - dataIndexList.add(annotation.column()); + ExcelHead annotation = declaredField.getAnnotation(ExcelHead.class); + headerList.add(annotation.title()); + dataIndexList.add(annotation.dataIndex()); } headerMap.put("header", headerList); headerMap.put("dataIndex", dataIndexList); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index d7561a977..694c7f679 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -279,6 +279,21 @@ public class TaxDeclarationController { } } + /** + * 对比算税过程 + * @param request + * @param response + * @param taxDeclareRecordParam + * @return + */ + @POST + @Path("/contrast") + @Produces(MediaType.APPLICATION_JSON) + public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclareRecordParam.getTaxDeclareRecordId()); + } + /** * 作废 @@ -364,20 +379,7 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, taxDeclareRecordParam.getTaxDeclareRecordId()); } - /** - * 对比算税过程 - * @param request - * @param response - * @param taxDeclareRecordParam - * @return - */ - @POST - @Path("/contrast") - @Produces(MediaType.APPLICATION_JSON) - public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclareRecordParam.getTaxDeclareRecordId()); - } + /** * 刷新数据 diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 621721de5..b822db00f 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -636,9 +636,12 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclareRecordService(user).queryCompanyIncomes(id); } - + /** + * 对比算税结果 + * @param id + */ public void contrast(Long id) { - getTaxDeclareRecordService(user).contrast(id); + getTaxDeclarationValueService(user).contrast(id); } /** From c54f9daa2deef7a4775fe972d3bbe2a4ac5d0397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 8 Jan 2024 16:00:15 +0800 Subject: [PATCH 117/298] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetDeclareTaxResultFeedbackResponse.java | 2 -- .../impl/TaxDeclarationValueServiceImpl.java | 34 +++++++++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java index 5727d8c74..93d834590 100644 --- a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -473,8 +473,6 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 已缴税额 必填:null 正常工资薪金返回Null */ - @SalaryTableColumn(text = "已缴税额", width = "10%", column = "ykjse") - @ExcelHead(title = "已缴税额", dataIndex = "ykjse") private BigDecimal ykjse; /** diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index ddb3f26c4..2e67d8973 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -31,6 +31,7 @@ import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; 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.google.common.collect.Lists; @@ -386,12 +387,17 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); for (String incomeCategory : localData.keySet()) { - List> localMap = localData.get(incomeCategory); + List> localList = localData.get(incomeCategory); + + Map> localMap = new HashMap<>(); + for (Map map : localList) { + String no = map.getOrDefault("证件号码", "").toString(); + localMap.put(no, map); + } List> onlineData = onlineDataMap.get(incomeCategory); List heads = onlineData.get(0); List> data = onlineData.subList(1, onlineData.size()); - List> onlineMap = new ArrayList<>(); for (int i = 0; i < data.size(); i++) { List row = data.get(i); @@ -402,11 +408,33 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } onlineMap.add(m); } + + Map> onlineNoMap = new HashMap<>(); + for (Map map : onlineMap) { + String no = map.getOrDefault("证件号码", "").toString(); + onlineNoMap.put(no, map); + } + + Map> header = ExcelUtil.getHeader(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class); + List list1 = header.get(header); + List> resultList = new ArrayList<>(); + + + + for (Map map : localList) { + String no = map.getOrDefault("证件号码", "").toString(); + Map d1 = localMap.get(no); + Map d2 = onlineNoMap.get(no); + + + } + + } } public static void main(String[] args) { - String a = "姓名, 证件类型, 证件号码, 本期收入, 本期免税收入, 基本养老保险费 , 基本医疗保险费, 失业保险费, 住房公积金, 企业(职业)年金, 商业健康保险, 税延养老保险, 累计收入额, 累计免税收入 , 累计减除费用, 累计专项扣除, 累计子女教育支出扣除, 累计继续教育 累计住房租金, 累计赡养老人支出扣除 , 累计3岁以下婴幼儿照护, 累计个人养老金, 累计其他扣除, 累计准予扣除的捐赠,累计应纳税所得额 ,税率, 速算扣除数, 累计应纳税额, 累计减免税额, 累计应扣缴税额, 已缴税额, 备注, incomeCategory, 证件号码,累计住房贷款利息, 累计子女教育, id, 减免税额, 累计3岁以下婴幼儿照护支出, jobNum, , employeeId, 其他, 应补(退)税额, 准予扣除的捐赠额, 累计住房贷款利息支出扣除, 累计住房租金支出扣除, 累计赡养老人, "; + String a = "姓名, 证件类型, 证件号码, 本期收入, 本期免税收入, 基本养老保险费 , 基本医疗保险费, 失业保险费, 住房公积金, 企业(职业)年金, 商业健康保险, 税延养老保险, 累计收入额, 累计免税收入 , 累计减除费用, 累计专项扣除, 累计子女教育支出扣除, 累计继续教育 累计住房租金, ,累计住房贷款利息 ,累计赡养老人 , 累计3岁以下婴幼儿照护, 累计个人养老金, 累计其他扣除, 累计准予扣除的捐赠,累计应纳税所得额 ,税率, 速算扣除数, 累计应纳税额, 累计减免税额, 累计应扣缴税额, 已缴税额, 备注, incomeCategory, 证件号码, 累计子女教育, id, 减免税额, jobNum, , employeeId, 其他, 应补(退)税额, 准予扣除的捐赠额 "; String b = "姓名, 证件类型, 证件号码, 任职受雇日期, 离职日期, 本期收入, 本期免税收入, 本期基本养老保险费, 本期基本医疗保险费, 本期失业保险费, 本期住房公积金, 本期企业(职业)年金, 本期商业健康保险费, 本期税延养老保险费, 本期其他扣除(其他), 累计收入额, 累计免税收入, 累计减除费用, 累计专项扣除, 累计子女教育支出扣除, 累计继续教育支出扣除, 累计住房租金支出扣除, 累计房屋贷款支出扣除, 累计赡养老人支出扣除, 累计3岁以下婴幼儿照护, 累计个人养老金, 累计其他扣除, 累计准予扣除的捐赠, 累计应纳税所得额, 税率, 速算扣除数, 累计应纳税额, 累计减免税额, 累计应扣缴税额, 累计已缴税额, 已缴税额, 累计专项附加扣除额, 应补退税额, 备注"; List c = Arrays.stream(StringUtils.split(a, ",")).sorted(String::compareTo).collect(Collectors.toList()); From e0d4820e2eb6499d69730cff379b421b2a8a0db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 9 Jan 2024 10:53:59 +0800 Subject: [PATCH 118/298] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetDeclareTaxResultFeedbackResponse.java | 2 - .../service/TaxDeclarationValueService.java | 3 +- .../impl/TaxDeclarationValueServiceImpl.java | 168 +++++++++--------- .../salary/web/TaxDeclarationController.java | 15 +- .../wrapper/TaxDeclareRecordWrapper.java | 12 +- 5 files changed, 105 insertions(+), 95 deletions(-) diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java index 93d834590..9949402a4 100644 --- a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -478,8 +478,6 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 累计专项附加扣除额 必填:null 专项附加合计 */ - @SalaryTableColumn(text = "累计专项附加扣除额", width = "10%", column = "ljzxfjkce") - @ExcelHead(title = "累计专项附加扣除额", dataIndex = "ljzxfjkce") private BigDecimal ljzxfjkce; /** diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 773b6b9e9..bee04130e 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -10,6 +10,7 @@ import com.engine.salary.util.page.PageInfo; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 个税申报表明细 @@ -90,7 +91,7 @@ public interface TaxDeclarationValueService { * 对比 * @param taxDeclareRecordId */ - void contrast(Long taxDeclareRecordId); + Map contrast(Long taxDeclareRecordId); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 2e67d8973..94d00a6b2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -31,7 +31,6 @@ import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; 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.google.common.collect.Lists; @@ -334,51 +333,21 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } @Override - public void contrast(Long taxDeclareRecordId) { - TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclareRecordId); + public Map contrast(Long taxDeclarationId) { + + + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(taxDeclarationId); + if (taxDeclaration == null) { + throw new SalaryRunTimeException("无申报表"); + } + + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclaration.getTaxDeclareRecordId()); if (taxDeclareRecordPO == null) { throw new SalaryRunTimeException("申报记录不存在!"); } - List taxDeclarations = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordId); - if (CollectionUtils.isEmpty(taxDeclarations)) { - throw new SalaryRunTimeException("无申报表"); - } - - Map>> localData = new HashMap<>(); - for (TaxDeclarationPO taxDeclaration : taxDeclarations) { - List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); - - // 查询个税申报表表头 - IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); - // 人员id - Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); - // 查询报送的人员 - List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); - // 查询人员信息 - List simpleEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .distinct() - .collect(Collectors.toList()); - List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); - // 查询人员薪资(身份证号码等) - List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); - // 查询外部人员 - List extEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .collect(Collectors.toList()); - List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); - - // 列表数据 - List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, - employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); - - localData.put(incomeCategoryEnum.getDefaultLabel(), data); - } + //线上数据 DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId()); GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecordPO.getDeclareRequestId()); @@ -386,51 +355,88 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); - for (String incomeCategory : localData.keySet()) { - List> localList = localData.get(incomeCategory); + Map resultList = new HashMap<>(); + List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); - Map> localMap = new HashMap<>(); - for (Map map : localList) { - String no = map.getOrDefault("证件号码", "").toString(); - localMap.put(no, map); - } + // 查询个税申报表表头 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList()); + // 人员id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 查询报送的人员 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 查询人员信息 + List simpleEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .distinct() + .collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询人员薪资(身份证号码等) + List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询外部人员 + List extEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .collect(Collectors.toList()); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); - List> onlineData = onlineDataMap.get(incomeCategory); - List heads = onlineData.get(0); - List> data = onlineData.subList(1, onlineData.size()); - List> onlineMap = new ArrayList<>(); - for (int i = 0; i < data.size(); i++) { - List row = data.get(i); - Map 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> onlineNoMap = new HashMap<>(); - for (Map map : onlineMap) { - String no = map.getOrDefault("证件号码", "").toString(); - onlineNoMap.put(no, map); - } - - Map> header = ExcelUtil.getHeader(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class); - List list1 = header.get(header); - List> resultList = new ArrayList<>(); - - - - for (Map map : localList) { - String no = map.getOrDefault("证件号码", "").toString(); - Map d1 = localMap.get(no); - Map d2 = onlineNoMap.get(no); - - - } + // 列表数据 + List> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, + employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); + Map> localMap = new HashMap<>(); + for (Map map : localList) { + String no = map.getOrDefault("证件号码", "").toString(); + localMap.put(no, map); } + + List> onlineData = onlineDataMap.get(incomeCategoryEnum.getDefaultLabel()); + List heads = onlineData.get(0); + List> data = onlineData.subList(1, onlineData.size()); + List> onlineMap = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + List row = data.get(i); + Map 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> onlineNoMap = new HashMap<>(); + for (Map map : onlineMap) { + String no = map.getOrDefault("证件号码", "").toString(); + onlineNoMap.put(no, map); + } + + List> oneResultList = new ArrayList<>(); + for (Map local : localList) { + Map result = new HashMap<>(); + result.put("姓名", local.get("姓名")); + result.put("证件类型", local.get("证件类型")); + result.put("证件号码", local.get("证件号码")); + String no = local.getOrDefault("证件号码", "").toString(); + Map online = onlineNoMap.get(no); + + taxReportColumns.stream().forEach(col -> { + Map temp = Maps.newHashMap(); + // 系统值 + Object localValue = local.getOrDefault(col.getReportColumnName(), ""); + // 线下值 + Object onlineValue = online.getOrDefault(col.getReportColumnName(), ""); + temp.put("local", localValue); + temp.put("online", onlineValue); + result.put(col.getReportColumnName(), temp); + }); + oneResultList.add(result); + } + resultList.put("columns", columns); + resultList.put("data", oneResultList); + return resultList; } public static void main(String[] args) { diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 694c7f679..c028ca7e2 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -184,13 +184,14 @@ public class TaxDeclarationController { @POST @Path("/addTaxDeclaration") @Produces(MediaType.APPLICATION_JSON) - public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response,TaxDeclarationAddParam param) { + public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationAddParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::addTaxDeclaration, param); } /** * 删除申报表 + * * @param request * @param response * @param param @@ -199,7 +200,7 @@ public class TaxDeclarationController { @POST @Path("/deleteTaxDeclaration") @Produces(MediaType.APPLICATION_JSON) - public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response,TaxDeclarationDeleteParam param) { + public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationDeleteParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteTaxDeclaration, param); } @@ -281,17 +282,18 @@ public class TaxDeclarationController { /** * 对比算税过程 + * * @param request * @param response - * @param taxDeclareRecordParam + * @param taxDeclarationId * @return */ - @POST + @GET @Path("/contrast") @Produces(MediaType.APPLICATION_JSON) - public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclareRecordParam.getTaxDeclareRecordId()); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclarationId); } @@ -380,7 +382,6 @@ public class TaxDeclarationController { } - /** * 刷新数据 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index b822db00f..a1dfa6579 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -312,6 +312,7 @@ public class TaxDeclareRecordWrapper extends Service { /** * 新增申报表 + * * @param param */ public void addTaxDeclaration(TaxDeclarationAddParam param) { @@ -638,10 +639,11 @@ public class TaxDeclareRecordWrapper extends Service { /** * 对比算税结果 + * * @param id */ - public void contrast(Long id) { - getTaxDeclarationValueService(user).contrast(id); + public Map contrast(Long id) { + return getTaxDeclarationValueService(user).contrast(id); } /** @@ -724,6 +726,7 @@ public class TaxDeclareRecordWrapper extends Service { /** * 新增表单 + * * @param param * @return */ @@ -735,7 +738,7 @@ public class TaxDeclareRecordWrapper extends Service { } // 查询个税申报表列 - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()),0); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()), 0); //当前税款所属期报送成功且状态正常的人员 List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( EmployeeDeclareListQueryParam @@ -780,6 +783,7 @@ public class TaxDeclareRecordWrapper extends Service { /** * 详细信息 + * * @param id * @return */ @@ -801,7 +805,7 @@ public class TaxDeclareRecordWrapper extends Service { } EmployeeDeclarePO employeeDeclarePO = employeeDeclarePOS.get(0); // 查询个税申报表列 - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()),0); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()), 0); return TaxDeclareRecordDetailFormDTO .builder() .id(id) From e71edd1a7b62d00b0d7ceaf17d3981fd31bec0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 18 Jan 2024 09:54:56 +0800 Subject: [PATCH 119/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetDeclareTaxResultFeedbackResponse.java | 91 ++++++++++--------- .../impl/TaxDeclarationValueServiceImpl.java | 33 +++---- 2 files changed, 65 insertions(+), 59 deletions(-) diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java index 9949402a4..43995fb0c 100644 --- a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -282,53 +282,73 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 基本养老保险 必填:null */ - @SalaryTableColumn(text = "本期基本养老保险费", width = "10%", column = "jbylaobxf") - @ExcelHead(title = "本期基本养老保险费", dataIndex = "jbylaobxf") + @SalaryTableColumn(text = "基本养老保险费", width = "10%", column = "jbylaobxf") + @ExcelHead(title = "基本养老保险费", dataIndex = "jbylaobxf") private BigDecimal jbylaobxf; /** * 基本医疗保险 必填:null */ - @SalaryTableColumn(text = "本期基本医疗保险费", width = "10%", column = "jbylbxf") - @ExcelHead(title = "本期基本医疗保险费", dataIndex = "jbylbxf") + @SalaryTableColumn(text = "基本医疗保险费", width = "10%", column = "jbylbxf") + @ExcelHead(title = "基本医疗保险费", dataIndex = "jbylbxf") private BigDecimal jbylbxf; /** * 失业保险 必填:null */ - @SalaryTableColumn(text = "本期失业保险费", width = "10%", column = "sybxf") - @ExcelHead(title = "本期失业保险费", dataIndex = "sybxf") + @SalaryTableColumn(text = "失业保险费", width = "10%", column = "sybxf") + @ExcelHead(title = "失业保险费", dataIndex = "sybxf") private BigDecimal sybxf; /** * 住房公积金 必填:null */ - @SalaryTableColumn(text = "本期住房公积金", width = "10%", column = "zfgjj") - @ExcelHead(title = "本期住房公积金", dataIndex = "zfgjj") + @SalaryTableColumn(text = "住房公积金", width = "10%", column = "zfgjj") + @ExcelHead(title = "住房公积金", dataIndex = "zfgjj") private BigDecimal zfgjj; /** * 年金 必填:null */ - @SalaryTableColumn(text = "本期企业(职业)年金", width = "10%", column = "nj") - @ExcelHead(title = "本期企业(职业)年金", dataIndex = "nj") + @SalaryTableColumn(text = "企业(职业)年金", width = "10%", column = "nj") + @ExcelHead(title = "企业(职业)年金", dataIndex = "nj") private BigDecimal nj; /** * 商业健康保险 必填:null */ - @SalaryTableColumn(text = "本期商业健康保险费", width = "10%", column = "syjkbx") - @ExcelHead(title = "本期商业健康保险费", dataIndex = "syjkbx") + @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "syjkbx") + @ExcelHead(title = "商业健康保险", dataIndex = "syjkbx") private BigDecimal syjkbx; /** * 税延养老保险 必填:null */ - @SalaryTableColumn(text = "本期税延养老保险费", width = "10%", column = "syylbx") - @ExcelHead(title = "本期税延养老保险费", dataIndex = "syylbx") + @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "syylbx") + @ExcelHead(title = "税延养老保险", dataIndex = "syylbx") private BigDecimal syylbx; /** * 其他 必填:null 按法律规定可以在税前扣除的项目 */ - @SalaryTableColumn(text = "本期其他扣除(其他)", width = "10%", column = "qt") - @ExcelHead(title = "本期其他扣除(其他)", dataIndex = "qt") + @SalaryTableColumn(text = "其他", width = "10%", column = "qt") + @ExcelHead(title = "其他", dataIndex = "qt") private BigDecimal qt; + /** + * 准予扣除的捐赠额 必填:null + */ + @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "zykcjze") + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "zykcjze") + private BigDecimal zykcjze; + + /** + * 减免税额 必填:null + */ + @SalaryTableColumn(text = "减免税额", width = "10%", column = "jmse") + @ExcelHead(title = "减免税额", dataIndex = "jmse") + private BigDecimal jmse; + + /** + * 备注 必填:null + */ + @SalaryTableColumn(text = "备注", width = "10%", column = "bz") + @ExcelHead(title = "备注", dataIndex = "bz") + private String bz; /** * 累计收入额 必填:null @@ -360,14 +380,14 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 累计子女教育支出 必填:null */ - @SalaryTableColumn(text = "累计子女教育支出扣除", width = "10%", column = "ljznjyzc") - @ExcelHead(title = "累计子女教育支出扣除", dataIndex = "ljznjyzc") + @SalaryTableColumn(text = "累计子女教育", width = "10%", column = "ljznjyzc") + @ExcelHead(title = "累计子女教育", dataIndex = "ljznjyzc") private BigDecimal ljznjyzc; /** * 累计继续教育支出 必填:null */ - @SalaryTableColumn(text = "累计继续教育支出扣除", width = "10%", column = "ljjxjyzc") - @ExcelHead(title = "累计继续教育支出扣除", dataIndex = "ljjxjyzc") + @SalaryTableColumn(text = "累计继续教育", width = "10%", column = "ljjxjyzc") + @ExcelHead(title = "累计继续教育", dataIndex = "ljjxjyzc") private BigDecimal ljjxjyzc; /** * 累计非学历继续教育支持 必填:null @@ -380,20 +400,20 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 累计住房租金支出 必填:null */ - @SalaryTableColumn(text = "累计住房租金支出扣除", width = "10%", column = "ljzfzjzc") - @ExcelHead(title = "累计住房租金支出扣除", dataIndex = "ljzfzjzc") + @SalaryTableColumn(text = "累计住房租金", width = "10%", column = "ljzfzjzc") + @ExcelHead(title = "累计住房租金", dataIndex = "ljzfzjzc") private BigDecimal ljzfzjzc; /** * 累计房屋贷款支出 必填:null */ - @SalaryTableColumn(text = "累计房屋贷款支出扣除", width = "10%", column = "ljzfdklxzc") - @ExcelHead(title = "累计房屋贷款支出扣除", dataIndex = "ljzfdklxzc") + @SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "ljzfdklxzc") + @ExcelHead(title = "累计住房贷款利息", dataIndex = "ljzfdklxzc") private BigDecimal ljzfdklxzc; /** * 累计赡养老人支出 必填:null */ - @SalaryTableColumn(text = "累计赡养老人支出扣除", width = "10%", column = "ljsylrzc") - @ExcelHead(title = "累计赡养老人支出扣除", dataIndex = "ljsylrzc") + @SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "ljsylrzc") + @ExcelHead(title = "累计赡养老人", dataIndex = "ljsylrzc") private BigDecimal ljsylrzc; /** * 累计3岁以下婴幼儿照护支出 必填:null @@ -483,17 +503,10 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 应补退税额 必填:null 应补退税额=累计应扣缴税额-累计已缴税额 */ - @SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse") - @ExcelHead(title = "应补退税额", dataIndex = "ybtse") + @SalaryTableColumn(text = "应补(退)税额", width = "10%", column = "ybtse") + @ExcelHead(title = "应补(退)税额", dataIndex = "ybtse") private BigDecimal ybtse; - /** - * 备注 必填:null - */ - @SalaryTableColumn(text = "备注", width = "10%", column = "bz") - @ExcelHead(title = "备注", dataIndex = "bz") - private String bz; - /** * 子女教育支出 必填:null */ @@ -523,14 +536,6 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { */ private BigDecimal yyezhzc; - /** - * 准予扣除的捐赠额 必填:null - */ - private BigDecimal zykcjze; - /** - * 减免税额 必填:null - */ - private BigDecimal jmse; /** * 减除费用 必填:null 正常工资薪金的减除费用。 对应保险营销员、证券经纪人的费用 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 94d00a6b2..4c875c2ce 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.util.NumberUtil; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; @@ -38,9 +39,10 @@ import com.google.common.collect.Maps; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; import weaver.hrm.User; +import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -422,14 +424,24 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar String no = local.getOrDefault("证件号码", "").toString(); Map online = onlineNoMap.get(no); - taxReportColumns.stream().forEach(col -> { + taxReportColumns.forEach(col -> { Map temp = Maps.newHashMap(); // 系统值 - Object localValue = local.getOrDefault(col.getReportColumnName(), ""); - // 线下值 - Object onlineValue = online.getOrDefault(col.getReportColumnName(), ""); + String localValue = Util.null2String(local.get(col.getReportColumnName())); + // 线上值 + String onlineValue = Util.null2String(online.get(col.getReportColumnName())); temp.put("local", localValue); temp.put("online", onlineValue); + if (NumberUtil.isNumber(localValue) && NumberUtil.isNumber(onlineValue)) { + BigDecimal diff = new BigDecimal(localValue).subtract(new BigDecimal(onlineValue)); + if (diff.compareTo(new BigDecimal(0)) != 0) { + temp.put("diff", diff); + } + } else { + if (!Objects.equals(localValue, onlineValue)) { + temp.put("diff", localValue); + } + } result.put(col.getReportColumnName(), temp); }); oneResultList.add(result); @@ -438,15 +450,4 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar resultList.put("data", oneResultList); return resultList; } - - public static void main(String[] args) { - String a = "姓名, 证件类型, 证件号码, 本期收入, 本期免税收入, 基本养老保险费 , 基本医疗保险费, 失业保险费, 住房公积金, 企业(职业)年金, 商业健康保险, 税延养老保险, 累计收入额, 累计免税收入 , 累计减除费用, 累计专项扣除, 累计子女教育支出扣除, 累计继续教育 累计住房租金, ,累计住房贷款利息 ,累计赡养老人 , 累计3岁以下婴幼儿照护, 累计个人养老金, 累计其他扣除, 累计准予扣除的捐赠,累计应纳税所得额 ,税率, 速算扣除数, 累计应纳税额, 累计减免税额, 累计应扣缴税额, 已缴税额, 备注, incomeCategory, 证件号码, 累计子女教育, id, 减免税额, jobNum, , employeeId, 其他, 应补(退)税额, 准予扣除的捐赠额 "; - String b = "姓名, 证件类型, 证件号码, 任职受雇日期, 离职日期, 本期收入, 本期免税收入, 本期基本养老保险费, 本期基本医疗保险费, 本期失业保险费, 本期住房公积金, 本期企业(职业)年金, 本期商业健康保险费, 本期税延养老保险费, 本期其他扣除(其他), 累计收入额, 累计免税收入, 累计减除费用, 累计专项扣除, 累计子女教育支出扣除, 累计继续教育支出扣除, 累计住房租金支出扣除, 累计房屋贷款支出扣除, 累计赡养老人支出扣除, 累计3岁以下婴幼儿照护, 累计个人养老金, 累计其他扣除, 累计准予扣除的捐赠, 累计应纳税所得额, 税率, 速算扣除数, 累计应纳税额, 累计减免税额, 累计应扣缴税额, 累计已缴税额, 已缴税额, 累计专项附加扣除额, 应补退税额, 备注"; - - List c = Arrays.stream(StringUtils.split(a, ",")).sorted(String::compareTo).collect(Collectors.toList()); - List d = Arrays.stream(StringUtils.split(b, ",")).sorted(String::compareTo).collect(Collectors.toList()); - - System.out.println(c); - System.out.println(d); - } } From 858ac8f00564a022227aee5a2299f2ab83fe1021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 18 Jan 2024 11:44:57 +0800 Subject: [PATCH 120/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=E5=8A=9F=E8=83=BDsql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312190103.sql | 65 +++++++++++++++++++ resource/sqlupgrade/GS/sql202312190103.sql | 65 +++++++++++++++++++ resource/sqlupgrade/JC/sql202312190103.sql | 65 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202312190103.sql | 47 ++++++++++++++ .../sqlupgrade/Oracle/sql202309050203.sql | 23 ------- .../sqlupgrade/Oracle/sql202312190103.sql | 64 ++++++++++++++++++ resource/sqlupgrade/PG/sql202312190103.sql | 47 ++++++++++++++ .../sqlupgrade/SQLServer/sql202312190103.sql | 64 ++++++++++++++++++ resource/sqlupgrade/ST/sql202312190103.sql | 65 +++++++++++++++++++ 9 files changed, 482 insertions(+), 23 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202312190103.sql create mode 100644 resource/sqlupgrade/GS/sql202312190103.sql create mode 100644 resource/sqlupgrade/JC/sql202312190103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202312190103.sql delete mode 100644 resource/sqlupgrade/Oracle/sql202309050203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202312190103.sql create mode 100644 resource/sqlupgrade/PG/sql202312190103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202312190103.sql create mode 100644 resource/sqlupgrade/ST/sql202312190103.sql diff --git a/resource/sqlupgrade/DM/sql202312190103.sql b/resource/sqlupgrade/DM/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/GS/sql202312190103.sql b/resource/sqlupgrade/GS/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/JC/sql202312190103.sql b/resource/sqlupgrade/JC/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312190103.sql b/resource/sqlupgrade/Mysql/sql202312190103.sql new file mode 100644 index 000000000..9cc0240c6 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312190103.sql @@ -0,0 +1,47 @@ +ALTER TABLE hrsa_tax_report_column ADD COLUMN contrast_type int(0) NULL; + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1); + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧'; + +update hrsa_tax_report_column set contrast_type = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql deleted file mode 100644 index 3caa7ac50..000000000 --- a/resource/sqlupgrade/Oracle/sql202309050203.sql +++ /dev/null @@ -1,23 +0,0 @@ -alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255) -/ -alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255) -/ -alter table hrsa_add_up_situation add tax_adjustment varchar2(255) -/ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5) -/ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6) -/ - -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ - -update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658 -/ - -update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658 -/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312190103.sql b/resource/sqlupgrade/Oracle/sql202312190103.sql new file mode 100644 index 000000000..14ad11e18 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312190103.sql @@ -0,0 +1,64 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1) +/ + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧' +/ + +update hrsa_tax_report_column set contrast_type = 0 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312190103.sql b/resource/sqlupgrade/PG/sql202312190103.sql new file mode 100644 index 000000000..f999dbbc3 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312190103.sql @@ -0,0 +1,47 @@ +ALTER TABLE hrsa_tax_report_column ADD COLUMN contrast_type int NULL; + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1); + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧'; + +update hrsa_tax_report_column set contrast_type = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312190103.sql b/resource/sqlupgrade/SQLServer/sql202312190103.sql new file mode 100644 index 000000000..1a0cd83fb --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312190103.sql @@ -0,0 +1,64 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1) +GO + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧' +GO + +update hrsa_tax_report_column set contrast_type = 0 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312190103.sql b/resource/sqlupgrade/ST/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ˰', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼר۳', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ۳', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼ׼۳ľ', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰ö', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '˰', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '۳', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'Ӧ()˰', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = 'ۼ3Ӥ׶ջ' where report_column_name = 'ۼ3Ӥ׶ջ֧'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + From a168aeef535743a23904c2687674d3478bf1aa13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 22 Jan 2024 14:15:36 +0800 Subject: [PATCH 121/298] =?UTF-8?q?=E5=AF=B9=E6=AF=94=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=EF=BC=8C=E5=88=86=E9=A1=B5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/ContrastQueryParam.java | 22 +++++ .../service/TaxDeclarationValueService.java | 5 +- .../impl/TaxDeclarationValueServiceImpl.java | 89 ++++--------------- .../salary/web/TaxDeclarationController.java | 8 +- .../wrapper/TaxDeclareRecordWrapper.java | 6 +- 5 files changed, 47 insertions(+), 83 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java new file mode 100644 index 000000000..95a4861af --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java @@ -0,0 +1,22 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.Data; + +/** + * 对比查询 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class ContrastQueryParam extends BaseQueryParam { + + /** + * 申报表id + */ + private Long taxDeclarationId; + +} diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index bee04130e..aa2758d20 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -1,6 +1,7 @@ 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; @@ -89,9 +90,9 @@ public interface TaxDeclarationValueService { /** * 对比 - * @param taxDeclareRecordId + * @param param */ - Map contrast(Long taxDeclareRecordId); + Map contrast(ContrastQueryParam param); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 4c875c2ce..fb671f6a5 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -11,6 +11,7 @@ import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; 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; @@ -120,26 +121,18 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 查询报送的人员 List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); // 查询人员信息 - List simpleEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .distinct() - .collect(Collectors.toList()); + List simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList()); List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); // 查询人员薪资(身份证号码等) List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); // 查询外部人员 - List extEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .collect(Collectors.toList()); + List extEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())).map(TaxDeclarationValuePO::getEmployeeId).collect(Collectors.toList()); List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); // 列表表头 List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); // 列表数据 - List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, - employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, false); + List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, false); return new TaxDeclarationValueListDTO().setColumns(weaTableColumns).setData(data); } @@ -148,8 +141,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar public void batchSave(List taxDeclarationValues) { if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { // 加密 - taxDeclarationValues.forEach(taxDeclarationValue -> - taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues.forEach(taxDeclarationValue -> taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); taxDeclarationValues = encryptUtil.encryptList(taxDeclarationValues, TaxDeclarationValuePO.class); // 分批保存 List> partition = Lists.partition(taxDeclarationValues, 100); @@ -163,8 +155,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar public void batchEdit(List taxDeclarationValues) { if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { // 加密 - taxDeclarationValues.forEach(taxDeclarationValue -> - taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues.forEach(taxDeclarationValue -> taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); taxDeclarationValues = encryptUtil.encryptList(taxDeclarationValues, TaxDeclarationValuePO.class); // 分批保存 List> partition = Lists.partition(taxDeclarationValues, 100); @@ -187,21 +178,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar throw new SalaryRunTimeException("个税申报记录不存在!"); } - TaxDeclarationValuePO po = TaxDeclarationValuePO.builder() - .id(IdGenerator.generate()) - .taxDeclarationId(param.getTaxDeclarationId()) - .taxDeclareRecordId(taxDeclareRecordId) - .employeeId(param.getEmployeeId()) - .employeeType(param.getEmployeeType()) - .resultValue(param.getTaxReportColumnValues()) - .resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())) - .createTime(new Date()) - .updateTime(new Date()) - .source(SourceEnum.ADD.getValue()) - .creator((long) user.getUID()) - .deleteType(0) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); + TaxDeclarationValuePO po = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclarationId(param.getTaxDeclarationId()).taxDeclareRecordId(taxDeclareRecordId).employeeId(param.getEmployeeId()).employeeType(param.getEmployeeType()).resultValue(param.getTaxReportColumnValues()).resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())).createTime(new Date()).updateTime(new Date()).source(SourceEnum.ADD.getValue()).creator((long) user.getUID()).deleteType(0).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); encryptUtil.encrypt(po, TaxDeclarationValuePO.class); getTaxDeclarationValueMapper().insertIgnoreNull(po); @@ -293,52 +270,24 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } taxDeclarationPO = list.get(0); } else { - taxDeclarationPO = TaxDeclarationPO - .builder() - .id(IdGenerator.generate()) - .taxDeclareRecordId(taxDeclareRecordId) - .incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) - .taxAgentId(taxDeclareRecord.getTaxAgentId()) - .salaryMonth(taxDeclareRecord.getSalaryMonth()) - .taxCycle(taxDeclareRecord.getTaxCycle()) - .description(taxDeclareRecord.getRemark()) - .controlView(0) - .creator((long) user.getUID()) - .createTime(now) - .updateTime(now) - .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); + taxDeclarationPO = TaxDeclarationPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecordId).incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()).taxAgentId(taxDeclareRecord.getTaxAgentId()).salaryMonth(taxDeclareRecord.getSalaryMonth()).taxCycle(taxDeclareRecord.getTaxCycle()).description(taxDeclareRecord.getRemark()).controlView(0).creator((long) user.getUID()).createTime(now).updateTime(now).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); List taxList = new ArrayList<>(); getTaxDeclarationService(user).saveBatch(taxList); } //组装数据,自动补足 List autoAddValuePOs = autoAddIds.stream().map((empId -> { - TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() - .id(IdGenerator.generate()) - .taxDeclareRecordId(taxDeclarationPO.getTaxDeclareRecordId()) - .taxDeclarationId(taxDeclarationPO.getId()) - .employeeType(0) - .employeeId(empId) - .resultValue(valueMap) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .creator((long) user.getUID()) - .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .createTime(now) - .updateTime(now) - .source(SourceEnum.AUTO.getValue()) - .build(); + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclarationPO.getTaxDeclareRecordId()).taxDeclarationId(taxDeclarationPO.getId()).employeeType(0).employeeId(empId).resultValue(valueMap).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).creator((long) user.getUID()).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).createTime(now).updateTime(now).source(SourceEnum.AUTO.getValue()).build(); return taxDeclarationValue; })).collect(Collectors.toList()); batchSave(autoAddValuePOs); } @Override - public Map contrast(Long taxDeclarationId) { + public Map contrast(ContrastQueryParam param) { - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(taxDeclarationId); + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); if (taxDeclaration == null) { throw new SalaryRunTimeException("无申报表"); } @@ -369,24 +318,16 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 查询报送的人员 List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); // 查询人员信息 - List simpleEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .distinct() - .collect(Collectors.toList()); + List simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList()); List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); // 查询人员薪资(身份证号码等) List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); // 查询外部人员 - List extEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .collect(Collectors.toList()); + List extEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())).map(TaxDeclarationValuePO::getEmployeeId).collect(Collectors.toList()); List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); // 列表数据 - List> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, - employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); + List> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); Map> localMap = new HashMap<>(); @@ -447,7 +388,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar oneResultList.add(result); } resultList.put("columns", columns); - resultList.put("data", oneResultList); + resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList)); return resultList; } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index c028ca7e2..9569e60cb 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -285,15 +285,15 @@ public class TaxDeclarationController { * * @param request * @param response - * @param taxDeclarationId + * @param ContrastQueryParam * @return */ - @GET + @POST @Path("/contrast") @Produces(MediaType.APPLICATION_JSON) - public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { + public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody ContrastQueryParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclarationId); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param); } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index a1dfa6579..26391d5b0 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -640,10 +640,10 @@ public class TaxDeclareRecordWrapper extends Service { /** * 对比算税结果 * - * @param id + * @param param */ - public Map contrast(Long id) { - return getTaxDeclarationValueService(user).contrast(id); + public Map contrast(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).contrast(param); } /** From ce5c106845662fbcef51787006acb40239137f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 23 Jan 2024 11:23:50 +0800 Subject: [PATCH 122/298] =?UTF-8?q?=E5=AF=B9=E6=AF=94=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=9B=E9=80=89=E6=98=AF=E5=90=A6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B7=AE=E5=BC=82=E4=BA=BA=E5=91=98=E5=92=8C=E5=B7=AE?= =?UTF-8?q?=E5=BC=82=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxdeclaration/dto/ContrastListDTO.java | 20 +++++++++++ .../param/ContrastQueryParam.java | 9 +++++ .../impl/TaxDeclarationValueServiceImpl.java | 36 +++++++++++++------ .../salary/web/TaxDeclarationController.java | 2 +- 4 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java new file mode 100644 index 000000000..0d8fa7f8b --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java @@ -0,0 +1,20 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import lombok.Data; + +/** + * 个税申报表详情列表(劳务报酬所得) + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class ContrastListDTO { + private String local; + + private String online; + + private Object diff; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java index 95a4861af..e1a24429e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java @@ -19,4 +19,13 @@ public class ContrastQueryParam extends BaseQueryParam { */ private Long taxDeclarationId; + /** + * 是否只显示差异人员 + */ + private boolean onlyShowDiffEmp; + + /** + * 是否只显示差异项 + */ + private boolean onlyShowDiffItem; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index fb671f6a5..76743eb72 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; +import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; @@ -45,6 +46,7 @@ import weaver.hrm.User; import java.math.BigDecimal; import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; /** @@ -356,8 +358,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar onlineNoMap.put(no, map); } + Set onlyShowColumns = new HashSet<>(); List> oneResultList = new ArrayList<>(); for (Map local : localList) { + AtomicBoolean hasDiff = new AtomicBoolean(false); Map result = new HashMap<>(); result.put("姓名", local.get("姓名")); result.put("证件类型", local.get("证件类型")); @@ -365,29 +369,39 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar String no = local.getOrDefault("证件号码", "").toString(); Map online = onlineNoMap.get(no); - taxReportColumns.forEach(col -> { - Map temp = Maps.newHashMap(); + taxReportColumns.stream().map(TaxReportColumnPO::getReportColumnName).forEach(col -> { + ContrastListDTO dto = new ContrastListDTO(); // 系统值 - String localValue = Util.null2String(local.get(col.getReportColumnName())); + String localValue = Util.null2String(local.get(col)); // 线上值 - String onlineValue = Util.null2String(online.get(col.getReportColumnName())); - temp.put("local", localValue); - temp.put("online", onlineValue); + 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) { - temp.put("diff", diff); + dto.setDiff(diff); + onlyShowColumns.add(col); + hasDiff.set(true); } } else { if (!Objects.equals(localValue, onlineValue)) { - temp.put("diff", localValue); + dto.setDiff(localValue); + onlyShowColumns.add(col); + hasDiff.set(true); } } - result.put(col.getReportColumnName(), temp); + result.put(col, dto); }); - oneResultList.add(result); + if (param.isOnlyShowDiffEmp()) { + if (hasDiff.get()) { + oneResultList.add(result); + } + } else { + oneResultList.add(result); + } } - resultList.put("columns", columns); + resultList.put("columns", param.isOnlyShowDiffItem() ? onlyShowColumns : columns); resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList)); return resultList; } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 9569e60cb..65a96bf26 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -285,7 +285,7 @@ public class TaxDeclarationController { * * @param request * @param response - * @param ContrastQueryParam + * @param param * @return */ @POST From cfeaa4fa7378b81bbed394481ec8268898020fc2 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 1 Feb 2024 12:03:24 +0800 Subject: [PATCH 123/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E6=97=A5=E6=9C=9F=E6=94=AF=E6=8C=81yyyy/mm/d?= =?UTF-8?q?d=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EmployeeDeclareExcelServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 8b883769f..805bbf910 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -52,7 +52,6 @@ import weaver.hrm.User; import java.beans.PropertyDescriptor; import java.io.InputStream; -import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -320,7 +319,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业日期"))) { if (StringUtils.isEmpty(dataValue)) { - if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { + if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue().toString())) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型不为「其他」时,任职受雇从业日期为必填")); @@ -336,25 +335,28 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); errorData.add(errorMessageMap); } else { - employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue).toString()); + employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); } } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "离职日期"))) { if (StringUtils.isEmpty(dataValue)) { - if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { + if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue().toString())) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "人员状态为非正常时,离职日期必填")); errorData.add(errorMessageMap); } } else { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0,10); + } if (!SalaryDateUtil.checkDay(dataValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); errorData.add(errorMessageMap); } else { - employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue).toString()); + employeeDeclareExcel.setDismissDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); } } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否残疾"))) { From a4e598dc95d31919473aacd25e0ad8becfc499e0 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 2 Feb 2024 14:48:01 +0800 Subject: [PATCH 124/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/TaxDeclarationValueService.java | 5 +++++ .../impl/TaxDeclarationValueServiceImpl.java | 5 +++++ .../salary/web/TaxDeclarationController.java | 18 ++++++++++++++++++ .../wrapper/TaxDeclareRecordWrapper.java | 9 +++++++++ 4 files changed, 37 insertions(+) diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index aa2758d20..69b4acdb2 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -95,4 +95,9 @@ public interface TaxDeclarationValueService { Map contrast(ContrastQueryParam param); + /** + * 根据主键删除 + * @param deleteId + */ + void deleteById(Long deleteId); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 76743eb72..65e927c19 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -405,4 +405,9 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList)); return resultList; } + + @Override + public void deleteById(Long deleteId) { + getTaxDeclarationValueMapper().deleteByIds(Collections.singletonList(deleteId)); + } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 65a96bf26..d584782ed 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -459,6 +459,24 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::detailInfo, id); } + /** + * 删除详细详细 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/deleteInfo") + @Produces(MediaType.APPLICATION_JSON) + public String deleteInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteInfo, param.getId()); + } + + + /** * 个税申报表详情列表 diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 26391d5b0..4613a52e0 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -33,6 +33,7 @@ import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -834,4 +835,12 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclarationExcelService(user).importData(param); } + public void deleteInfo(Long deleteId) { + TaxDeclarationValuePO declarationValuePO = getTaxDeclarationValueService(user).getById(deleteId); + if (ObjectUtils.isEmpty(declarationValuePO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该明细不存在或已被删除!")); + } + getTaxDeclarationValueService(user).deleteById(deleteId); + + } } From 3dd1c44459d77a4c170e198de2b15241eb0ef158 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Sun, 4 Feb 2024 10:55:40 +0800 Subject: [PATCH 125/298] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=B6=E6=A0=B8?= =?UTF-8?q?=E7=AE=97=E6=A0=A1=E9=AA=8Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/taxdeclaration/po/TaxDeclarationPO.java | 10 +++++++++- .../mapper/taxdeclaration/TaxDeclarationMapper.xml | 6 ++++++ .../salary/service/impl/TaxDeclarationServiceImpl.java | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java index 682f1a87b..101b6dd52 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java @@ -94,10 +94,18 @@ public class TaxDeclarationPO { */ private Integer controlView; - //税款所属期 + /** + * 薪资所属月 + */ LocalDateRange salaryMonths; + /** + * 税款所属期 + */ + LocalDateRange taxMonths; + + private Collection taxAgentIds; } diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml index 8324daf64..3b84589f3 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml @@ -63,6 +63,12 @@ AND salary_month #{salaryMonths.endDate} + + AND tax_cycle = ]]> #{taxMonths.fromDate} + + + AND tax_cycle #{taxMonths.endDate} + AND tax_agent_id IN diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 34019ce42..9ba7b8237 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -400,7 +400,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration @Override public List listByTaxCycleRange(YearMonthRange yearMonthRange) { return getTaxDeclarationMapper().listSome(TaxDeclarationPO.builder() - .salaryMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) + .taxMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) .build()); } From 9824a70cce54d2b476431dedfb83af6dca53ce5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Sun, 18 Feb 2024 09:50:32 +0800 Subject: [PATCH 126/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312270603.sql | 2 +- resource/sqlupgrade/GS/sql202312270603.sql | 2 +- resource/sqlupgrade/JC/sql202312270603.sql | 2 +- resource/sqlupgrade/Oracle/sql202312270603.sql | 2 +- resource/sqlupgrade/PG/sql202312270603.sql | 2 +- resource/sqlupgrade/ST/sql202312270603.sql | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202312270603.sql b/resource/sqlupgrade/DM/sql202312270603.sql index f9aba2b22..d239eb43a 100644 --- a/resource/sqlupgrade/DM/sql202312270603.sql +++ b/resource/sqlupgrade/DM/sql202312270603.sql @@ -3,7 +3,7 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / -ALTER TABLE declare_request_id add ( +ALTER TABLE hrsa_tax_declare_record add ( declare_request_id varchar2(100) ); / diff --git a/resource/sqlupgrade/GS/sql202312270603.sql b/resource/sqlupgrade/GS/sql202312270603.sql index f9aba2b22..d239eb43a 100644 --- a/resource/sqlupgrade/GS/sql202312270603.sql +++ b/resource/sqlupgrade/GS/sql202312270603.sql @@ -3,7 +3,7 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / -ALTER TABLE declare_request_id add ( +ALTER TABLE hrsa_tax_declare_record add ( declare_request_id varchar2(100) ); / diff --git a/resource/sqlupgrade/JC/sql202312270603.sql b/resource/sqlupgrade/JC/sql202312270603.sql index f9aba2b22..d239eb43a 100644 --- a/resource/sqlupgrade/JC/sql202312270603.sql +++ b/resource/sqlupgrade/JC/sql202312270603.sql @@ -3,7 +3,7 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / -ALTER TABLE declare_request_id add ( +ALTER TABLE hrsa_tax_declare_record add ( declare_request_id varchar2(100) ); / diff --git a/resource/sqlupgrade/Oracle/sql202312270603.sql b/resource/sqlupgrade/Oracle/sql202312270603.sql index 4aea94ab0..8a7c248cf 100644 --- a/resource/sqlupgrade/Oracle/sql202312270603.sql +++ b/resource/sqlupgrade/Oracle/sql202312270603.sql @@ -3,7 +3,7 @@ ALTER TABLE hrsa_tax_declaration_value add ( ) / -ALTER TABLE declare_request_id add ( +ALTER TABLE hrsa_tax_declare_record add ( declare_request_id varchar2(100) ) / \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270603.sql b/resource/sqlupgrade/PG/sql202312270603.sql index 42b0d9089..79861df5e 100644 --- a/resource/sqlupgrade/PG/sql202312270603.sql +++ b/resource/sqlupgrade/PG/sql202312270603.sql @@ -1,3 +1,3 @@ ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int NULL ; -ALTER TABLE hrsa_salary_template ADD COLUMN declare_request_id varchar(200) NULL; \ No newline at end of file +ALTER TABLE hrsa_tax_declare_record ADD COLUMN declare_request_id varchar(200) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312270603.sql b/resource/sqlupgrade/ST/sql202312270603.sql index f9aba2b22..d239eb43a 100644 --- a/resource/sqlupgrade/ST/sql202312270603.sql +++ b/resource/sqlupgrade/ST/sql202312270603.sql @@ -3,7 +3,7 @@ ALTER TABLE hrsa_tax_declaration_value add ( ); / -ALTER TABLE declare_request_id add ( +ALTER TABLE hrsa_tax_declare_record add ( declare_request_id varchar2(100) ); / From 079b7de258805f9e00215c36e57337a9535dc4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 21 Feb 2024 15:35:08 +0800 Subject: [PATCH 127/298] =?UTF-8?q?=E5=90=88=E5=B9=B6240101?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/datacollection/bo/DataCollectionBO.java | 2 +- .../entity/employeedeclare/bo/EmployeeDeclareRefresh.java | 2 +- .../engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java | 2 +- src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java | 2 +- .../salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java | 2 +- .../service/impl/AbstractTaxAgentTaxReturnCheckService.java | 2 +- .../engine/salary/service/impl/AbstractTaxPaymentService.java | 2 +- .../engine/salary/service/impl/AddUpDeductionServiceImpl.java | 2 +- .../salary/service/impl/EmployeeDeclareExcelServiceImpl.java | 2 +- .../engine/salary/service/impl/EmployeeDeclareServiceImpl.java | 2 +- .../salary/service/impl/SalarySobAddUpRuleServiceImpl.java | 2 +- .../engine/salary/service/impl/SalarySobInitServiceImpl.java | 2 +- .../salary/service/impl/SalarySobTaxReportRuleServiceImpl.java | 2 +- .../service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java | 2 +- .../service/impl/TaxDeclarationApiFlowWarnServiceImpl.java | 2 +- .../salary/service/impl/TaxDeclarationExcelServiceImpl.java | 2 +- .../engine/salary/service/impl/TaxDeclarationServiceImpl.java | 2 +- .../salary/service/impl/TaxDeclarationValueServiceImpl.java | 2 +- .../engine/salary/service/impl/TaxDeclareRecordServiceImpl.java | 2 +- src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java index 46cd04e6d..b2908091e 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -17,7 +17,7 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; import com.engine.salary.service.impl.AddUpDeductionServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index f3223479e..3b195d0d0 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -17,7 +17,7 @@ import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.valid.SalaryCardUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java index b14674d76..e49e5bef2 100644 --- a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -9,7 +9,7 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.util.Sm4Utils; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import java.util.Date; import java.util.HashMap; diff --git a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java index 8ee8ba3e6..0c17d73e1 100644 --- a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java +++ b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java @@ -13,7 +13,7 @@ import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEnumUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.lang3.StringUtils; import java.util.Date; diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index 2fb43ef1a..e870f624e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -17,9 +17,9 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.IdGenerator; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Field; diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java index f5d2422e6..e4a5fba05 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -22,7 +22,7 @@ import com.engine.salary.service.TaxAgentTaxReturnService; import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index 47647f058..cad15ebc3 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -27,7 +27,7 @@ import com.engine.salary.mapper.taxpayment.TaxPaymentRequestMapper; import com.engine.salary.service.*; import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.AllArgsConstructor; import lombok.Data; import lombok.extern.slf4j.Slf4j; diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index d25f8f864..125979c55 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -71,7 +71,7 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 805bbf910..fa23d3cdb 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -35,7 +35,7 @@ import com.engine.salary.util.valid.SalaryCardUtil; import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 8143756ed..82410a3c4 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -48,7 +48,7 @@ import com.engine.salary.util.valid.SalaryCardUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; diff --git a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java index ce9280183..ead78218b 100644 --- a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java @@ -22,7 +22,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java index e2dec0af8..a8aaf7787 100644 --- a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -20,7 +20,7 @@ import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import weaver.hrm.User; diff --git a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java index 4a1882e96..92b6fa9e3 100644 --- a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java @@ -21,7 +21,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java index 7d09f19f1..71af06009 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java @@ -22,7 +22,7 @@ import com.engine.salary.util.*; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 0dd420668..97833c197 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -31,7 +31,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.transaction.annotation.Transactional; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index f8a7db934..ec524ab28 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -31,7 +31,7 @@ import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 9ba7b8237..dc4c57e84 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -33,7 +33,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 65e927c19..b907cf199 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -38,7 +38,7 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import weaver.general.Util; diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index f9ea9de2f..5e8d7b062 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -54,7 +54,7 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 4613a52e0..d9a7a45fa 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -29,7 +29,7 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; From 3a9b772cb92107d778cb97f236ef4bc303389235 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 27 Feb 2024 15:16:13 +0800 Subject: [PATCH 128/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=A2=9E=E5=8A=A0=E6=A8=A1=E7=B3=8A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datacollection/EmployMapper.java | 7 +++ .../mapper/datacollection/EmployMapper.xml | 49 +++++++++++++++++++ .../mapper/extemp/ExternalEmployeeMapper.java | 7 +++ .../mapper/extemp/ExternalEmployeeMapper.xml | 46 +++++++++++++++++ .../engine/salary/service/ExtEmpService.java | 2 + .../salary/service/SalaryEmployeeService.java | 7 +++ .../service/TaxDeclarationValueService.java | 2 +- .../service/impl/ExtEmpServiceImpl.java | 8 +++ .../impl/SalaryEmployeeServiceImpl.java | 20 +++++++- .../impl/TaxDeclarationValueServiceImpl.java | 9 +++- .../wrapper/TaxDeclareRecordWrapper.java | 2 +- 11 files changed, 155 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.java b/src/com/engine/salary/mapper/datacollection/EmployMapper.java index 4f3aa8ed4..fb8856030 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.java +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.java @@ -110,4 +110,11 @@ public interface EmployMapper { * @return */ List listByDismissDate(String dismissDate); + + /** + * 根据用户名和工号模糊查询 + * @param keyword + * @return + */ + List listByKeyword(@Param("keyword") String keyword); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml index 29ce5fcbe..36a2a87be 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -446,4 +446,53 @@ ) + + + + + + + + AND + ( + e.lastname like CONCAT('%',#{keyword},'%') + OR + e.workcode like CONCAT('%',#{keyword},'%') + ) + + + + + AND + ( + e.lastname like '%'||#{keyword}||'%' + OR + e.workcode like '%'||#{keyword}||'%' + ) + + + + + AND + ( + e.lastname like '%'+#{keyword}+'%' + OR + e.workcode like '%'+#{keyword}+'%' + ) + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java index 455eb8adf..81999b0ba 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java @@ -86,4 +86,11 @@ public interface ExternalEmployeeMapper { * @return */ Collection listAllForReport(); + + /** + * 根据姓名、工号模糊查询 + * @param keyword + * @return + */ + List listByKeyword(@Param("keyword") String keyword); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index e04017e35..dfe1f119c 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -292,6 +292,52 @@ left join hrmdepartment d on e.department_id = d.id + + + + + + AND + ( + e.username like CONCAT('%',#{keyword},'%') + OR + e.workcode like CONCAT('%',#{keyword},'%') + ) + + + + + AND + ( + e.username like '%'||#{keyword}||'%' + OR + e.workcode like '%'||#{keyword}||'%' + ) + + + + + AND + ( + e.username like '%'+#{keyword}+'%' + OR + e.workcode like '%'+#{keyword}+'%' + ) + + diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 8eef60d3e..f9456c904 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -58,4 +58,6 @@ public interface ExtEmpService { Map previewImportExtEmp(ExtEmpImportParam param); Map importExtEmp(ExtEmpImportParam param); + + List listByKeyword(String keyword); } \ No newline at end of file diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 437f99e45..7e1dbc6a9 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -133,4 +133,11 @@ public interface SalaryEmployeeService { */ Map mapByEmployeeIds(Collection employeeIds); + /** + * 根据姓名工号模糊查看 + * @param keyword + * @return + */ + List listByKeyword(String keyword); + } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 69b4acdb2..89de2d361 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -29,7 +29,7 @@ public interface TaxDeclarationValueService { * @param taxDeclarationIds * @return */ - PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds); + PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds, String keyWord); /** * 查询个税申报表明细 diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 7a0566a43..331af286a 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -572,4 +572,12 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { resultPo.setModifier((long) user.getUID()); return resultPo; } + + @Override + public List listByKeyword(String keyword) { + if (StringUtils.isBlank(keyword)) { + return Collections.emptyList(); + } + return getExternalEmployeeMapper().listByKeyword(keyword); + } } diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 670d44700..0dc26a080 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -19,6 +19,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.ExtEmpService; @@ -27,8 +28,8 @@ import com.engine.salary.service.SalarySobExtRangeService; import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.SalaryEntityUtil; -import com.google.common.collect.Lists; import com.engine.salary.util.db.IdGenerator; +import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -66,6 +67,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } + private EmployMapper getEmployMapper() { + return SqlProxyHandle.getProxy(EmployMapper.class); + } + + private ExtEmpService getExtEmpService(User user) { return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } @@ -427,4 +433,16 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee }); return result; } + + @Override + public List listByKeyword(String keyword) { + if (StringUtils.isBlank(keyword)) { + return Collections.emptyList(); + } + List result = getEmployMapper().listByKeyword(keyword); + if (openExtEmp) { + result.addAll(getExtEmpService(user).listByKeyword(keyword)); + } + return result; + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index b907cf199..913dfdf7b 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -41,6 +41,7 @@ import com.google.common.collect.Maps; import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import weaver.general.Util; import weaver.hrm.User; @@ -90,8 +91,14 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } @Override - public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds) { + public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds, String keyword) { List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + // 根据关键词查人员信息 + if (StringUtils.isNotBlank(keyword)) { + List employeeList = getSalaryEmployeeService(user).listByKeyword(keyword); + List empIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList()); + taxDeclarationValuePOS = taxDeclarationValuePOS.stream().filter(po -> empIds.contains(po.getEmployeeId())).collect(Collectors.toList()); + } taxDeclarationValuePOS = decryptBatch(taxDeclarationValuePOS); return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationValuePOS, TaxDeclarationValuePO.class); } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index d9a7a45fa..8e6e13663 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -164,7 +164,7 @@ public class TaxDeclareRecordWrapper extends Service { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看")); } // 查询个税申报表详情 - PageInfo page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam, Collections.singleton(queryParam.getTaxDeclarationId())); + PageInfo page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam, Collections.singleton(queryParam.getTaxDeclarationId()), queryParam.getKeyword()); TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclaration, page.getList()); PageInfo> dtoPage = new PageInfo<>( page.getPageNum(), From 54823f2fbddd075cb56a4b2813e64b61da85f79b Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 29 Feb 2024 18:09:58 +0800 Subject: [PATCH 129/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5-?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=AF=B9=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SalaryItemConstant.java | 5 + .../dto/TaxReportColumnDTO.java | 37 +++++ .../param/ContrastQueryParam.java | 7 + .../service/TaxDeclarationValueService.java | 19 +++ .../impl/TaxDeclarationValueServiceImpl.java | 90 +++++++++- .../salary/util/excel/ExcelUtilPlus.java | 156 +++++++++++++++++- .../salary/web/TaxDeclarationController.java | 65 ++++++++ .../wrapper/TaxDeclareRecordWrapper.java | 26 +++ 8 files changed, 396 insertions(+), 9 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxReportColumnDTO.java diff --git a/src/com/engine/salary/constant/SalaryItemConstant.java b/src/com/engine/salary/constant/SalaryItemConstant.java index 26bac736b..a1f0d9a1b 100644 --- a/src/com/engine/salary/constant/SalaryItemConstant.java +++ b/src/com/engine/salary/constant/SalaryItemConstant.java @@ -25,5 +25,10 @@ public class SalaryItemConstant { */ public static final String RESULT_EXPORT_FIELD_SIGN="_salaryAcctResultExportFieldSign"; + /** + * 个税申报在线对比缓存表头字段key + */ + public static final String TAX_DECLARE_CONTRAST_FIELD_SIGN="_taxDeclareContrastFieldSign"; + } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxReportColumnDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxReportColumnDTO.java new file mode 100644 index 000000000..aa55a89f0 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxReportColumnDTO.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 个税申报表表头 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaxReportColumnDTO { + + /** + * 主键id + */ + private Long id; + + /** + * 申报表的列名 + */ + private String reportColumnName; + + /** + * 申报表的列索引 + */ + private String reportColumnDataIndex; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java index e1a24429e..7fa470450 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java @@ -3,6 +3,8 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.common.BaseQueryParam; import lombok.Data; +import java.util.List; + /** * 对比查询 *

Copyright: Copyright (c) 2023

@@ -28,4 +30,9 @@ public class ContrastQueryParam extends BaseQueryParam { * 是否只显示差异项 */ private boolean onlyShowDiffItem; + + /** + * 筛选对比项目 + */ + private List columns; } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 89de2d361..8fabdd5d7 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -1,6 +1,7 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxReportColumnDTO; import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; @@ -8,6 +9,7 @@ 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; @@ -94,10 +96,27 @@ public interface TaxDeclarationValueService { */ Map contrast(ContrastQueryParam param); + /** + * 在线对比表头列表 + * @param param + */ + Map> contrastHeaderList(ContrastQueryParam param); + + /** + * 缓存在线对比表头列表 + * @param columnIndex + */ + void cacheContrastHeader(List columnIndex); + + /** + * 导出在线对比 + */ + XSSFWorkbook exportContrast(ContrastQueryParam param); /** * 根据主键删除 * @param deleteId */ void deleteById(Long deleteId); + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 913dfdf7b..9465f88c8 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -1,10 +1,12 @@ package com.engine.salary.service.impl; import cn.hutool.core.util.NumberUtil; +import com.cloudstore.dev.api.util.Util_DataCache; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SalaryItemConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -12,6 +14,7 @@ import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxReportColumnDTO; import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; @@ -33,15 +36,17 @@ import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.engine.salary.util.db.IdGenerator; 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; @@ -321,6 +326,22 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 查询个税申报表表头 IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + // 筛选表头 + // 获取缓存中保存的设置 + String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; + String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); + List selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); + if (CollectionUtils.isNotEmpty(selectedItems)) { + Map columnMap = SalaryEntityUtil.convert2Map(taxReportColumns, TaxReportColumnPO::getReportColumnDataIndex); + List finalColumn = new ArrayList<>(); + selectedItems.stream().forEach(index -> { + TaxReportColumnPO c = columnMap.get(index); + if (c!=null) { + finalColumn.add(c); + } + }); + taxReportColumns = finalColumn; + } List columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList()); // 人员id Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); @@ -370,6 +391,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar for (Map local : localList) { AtomicBoolean hasDiff = new AtomicBoolean(false); Map result = new HashMap<>(); + result.put("工号", local.get("jobNum")); result.put("姓名", local.get("姓名")); result.put("证件类型", local.get("证件类型")); result.put("证件号码", local.get("证件号码")); @@ -413,6 +435,72 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return resultList; } + @Override + public Map> contrastHeaderList(ContrastQueryParam param) { + Map> resultMap = new HashMap<>(); + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + if (taxDeclaration == null) { + throw new SalaryRunTimeException("无申报表"); + } + // 查询个税申报表表头 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List defaultDtoList = new ArrayList<>(); + taxReportColumns.stream().forEach(po -> {defaultDtoList.add(TaxReportColumnDTO.builder().id(po.getId()).reportColumnName(po.getReportColumnName()).reportColumnDataIndex(po.getReportColumnDataIndex()).build());}); + resultMap.put("defaultList",defaultDtoList); + // 获取缓存中保存的设置 + String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; + String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); + List selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); + if (CollectionUtils.isEmpty(selectedItems)) { + // 默认全选 + resultMap.put("selectedList", defaultDtoList); + resultMap.put("unSelectedList", Collections.emptyList()); + } else { + Map columnMap = SalaryEntityUtil.convert2Map(defaultDtoList, TaxReportColumnDTO::getReportColumnDataIndex); + List selectedColumn = new ArrayList<>(); + selectedItems.stream().forEach(index -> { + TaxReportColumnDTO taxReportColumnDTO = columnMap.get(index); + if (taxReportColumnDTO != null) { + // 已选择的项目 + selectedColumn.add(taxReportColumnDTO); + } + }); + // 过滤出未选择的项目 + List unSelectedList = defaultDtoList.stream().filter(po -> !selectedItems.contains(po.getReportColumnDataIndex())).collect(Collectors.toList()); + resultMap.put("selectedList", selectedColumn); + resultMap.put("unSelectedList", unSelectedList); + } + + return resultMap; + } + + @Override + public void cacheContrastHeader(List columnIndex) { + String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; + Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(columnIndex)); + } + + @Override + public XSSFWorkbook exportContrast(ContrastQueryParam param) { + param.setPageSize(1000000000); + param.setCurrent(1); + // 获取线下对比结果 + Map contrastMap = contrast(param); + List header = (List)contrastMap.get("columns"); + PageInfo> pageInfo = (PageInfo>)contrastMap.get("pageInfo"); + List> list = pageInfo.getList(); + + List 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")); + + return ExcelUtilPlus.genWorkbook4TaxDeclareContrast(empInfoColumns, header, list, "在线对比结果"); + + } + @Override public void deleteById(Long deleteId) { getTaxDeclarationValueMapper().deleteByIds(Collections.singletonList(deleteId)); diff --git a/src/com/engine/salary/util/excel/ExcelUtilPlus.java b/src/com/engine/salary/util/excel/ExcelUtilPlus.java index b9aee0531..cdf73e282 100644 --- a/src/com/engine/salary/util/excel/ExcelUtilPlus.java +++ b/src/com/engine/salary/util/excel/ExcelUtilPlus.java @@ -1,8 +1,11 @@ package com.engine.salary.util.excel; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.salary.component.WeaTableColumnGroup; +import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; import com.engine.salary.util.SalaryDateUtil; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.usermodel.*; @@ -10,6 +13,7 @@ import org.springframework.beans.BeanUtils; import java.awt.Color; import java.math.BigDecimal; +import java.util.List; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -691,23 +695,29 @@ public class ExcelUtilPlus { } public static float getFinalHeight(Object o, int width, float finalHeight, float height) { - if (o != null && getStrlength(o.toString()) > width) { - float remainder = getStrlength(o.toString()) % width; - int multiple = getStrlength(o.toString()) / width; - int finalMultiple = remainder > 0 ? (multiple + 1) : multiple; - float compareHeight = height * finalMultiple; - finalHeight = Math.max(finalHeight, compareHeight); + if (o != null) { + if (getStrlength(o.toString()) > width || o.toString().contains("\n")) { + float remainder = getStrlength(o.toString()) % width; + int multiple = getStrlength(o.toString()) / width; + int finalMultiple = remainder > 0 ? (multiple + 1) : multiple; + // 处理换行符 + int leastMultiple = StringUtils.countMatches(o.toString(), "\n") + 1; + finalMultiple = Math.max(leastMultiple, finalMultiple); + float compareHeight = height * finalMultiple; + finalHeight = Math.max(finalHeight, compareHeight); + } } return finalHeight; } public static int getStrlength(String str) { int strLength = 0; + String finalStr = str.replace("\n", ""); String chinese = "[\u0391-\uFFE5]"; /* 获取字段值的长度,如果含中文字符,则每个中文字符长度为2,否则为1 */ - for (int i = 0; i < str.length(); i++) { + for (int i = 0; i < finalStr.length(); i++) { /* 从字符串中获取一个字符 */ - String temp = str.substring(i, i + 1); + String temp = finalStr.substring(i, i + 1); /* 判断是否为中文字符 */ if (temp.matches(chinese)) { /* 中文字符长度为2 */ @@ -720,4 +730,134 @@ public class ExcelUtilPlus { return strLength; } + + public static XSSFWorkbook genWorkbook4TaxDeclareContrast(List empInfoColumns, List header, List> rowList, String sheetName) { + XSSFWorkbook workbook = new XSSFWorkbook(); + + // 设置title样式 + XSSFCellStyle titleCellStyle = workbook.createCellStyle(); + XSSFFont titleFont = workbook.createFont(); + titleFont.setBold(true); + titleFont.setFontName("仿宋"); + titleFont.setFontHeightInPoints((short) 15); + titleCellStyle.setFont(titleFont); + titleCellStyle.setAlignment(HorizontalAlignment.CENTER); + titleCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());//背景色 + titleCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + titleCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + titleCellStyle.setBorderLeft(BorderStyle.THIN); + titleCellStyle.setBorderRight(BorderStyle.THIN); + titleCellStyle.setBorderTop(BorderStyle.THIN); + titleCellStyle.setBorderBottom(BorderStyle.THIN); + + // 设置主体样式 + XSSFCellStyle cellStyle = workbook.createCellStyle(); + XSSFFont font = workbook.createFont(); + font.setFontName("宋体"); + font.setFontHeightInPoints((short) 10);// 设置字体大小 + cellStyle.setFont(font);// 选择需要用到的字体格式 + cellStyle.setWrapText(true); + cellStyle.setAlignment(HorizontalAlignment.CENTER); + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + cellStyle.setBorderLeft(BorderStyle.THIN); + cellStyle.setBorderRight(BorderStyle.THIN); + cellStyle.setBorderTop(BorderStyle.THIN); + cellStyle.setBorderBottom(BorderStyle.THIN); + + XSSFFont fontRed = workbook.createFont(); + fontRed.setFontName("宋体"); + fontRed.setFontHeightInPoints((short) 10);// 设置字体大小 + fontRed.setColor(IndexedColors.RED.getIndex()); + + + + XSSFSheet sheet = workbook.createSheet(sheetName); + //自适应宽度 + sheet.autoSizeColumn(0, true); + //默认列宽 + sheet.setDefaultColumnWidth(20); + //默认行高 + sheet.setDefaultRowHeightInPoints(18); + + //处理合并单元格 + XSSFRow row0 = sheet.createRow(0); + + int startIndex = 0; + // 设置表头人员信息 + for (int i = 0; i < empInfoColumns.size(); i++) { + WeaTableColumn empColumn = empInfoColumns.get(i); + XSSFCell rowZeroCell = row0.createCell(startIndex, CellType.STRING); + rowZeroCell.setCellValue(empColumn.getText()); + rowZeroCell.setCellStyle(titleCellStyle); + //设置列宽 + sheet.setColumnWidth(startIndex, Math.max(19, empColumn.getText().length() * 4) * 256); + startIndex++; + } + + // 设置表头项目字段 + for (int i = 0; i < header.size(); i++) { + String h = header.get(i); + XSSFCell rowZeroCell = row0.createCell(startIndex, CellType.STRING); + rowZeroCell.setCellValue(h); + rowZeroCell.setCellStyle(titleCellStyle); + //设置列宽 + sheet.setColumnWidth(startIndex, Math.max(19, h.length() * 4) * 256); + startIndex++; + } + + // 设置行内容 + for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) { + Map rowMap = rowList.get(rowIndex); + XSSFRow row = sheet.createRow(rowIndex + 1); + float height = 18; + float finalHeight = 18; + float maxHeight = 0; + // 设置人员信息 + for (int j = 0; j < empInfoColumns.size(); j++) { + String column = empInfoColumns.get(j).getText(); + XSSFCell cell = row.createCell(j); + String cellValue = rowMap.get(column) == null ? "" : rowMap.get(column).toString(); + cell.setCellStyle(cellStyle); + cell.setCellType(CellType.STRING); + cell.setCellValue(cellValue); + //判断是否要调整高度 + int width = sheet.getColumnWidth(j) / 256; + finalHeight = getFinalHeight(cellValue, width, finalHeight, height); + maxHeight = Math.max(finalHeight, maxHeight); + } + // 列索引 + int cellIndex = empInfoColumns.size(); + // 设置项目信息 + for (int i = 0; i < header.size(); i++) { + String h = header.get(i); + XSSFCell cell = row.createCell(cellIndex); + cell.setCellStyle(cellStyle); + + cell.setCellType(CellType.STRING); + ContrastListDTO contrastListDTO = rowMap.get(h) != null ? (ContrastListDTO)rowMap.get(h) : new ContrastListDTO(); + String local = StringUtils.isBlank(contrastListDTO.getLocal()) ? "系统值:" : "系统值:" + contrastListDTO.getLocal(); + String online = StringUtils.isBlank(contrastListDTO.getOnline()) ? "线上值:" : "线上值:" + contrastListDTO.getOnline(); + Object diff = contrastListDTO.getDiff(); + if (diff == null) { + cell.setCellValue(local + "\n" + online); + } else { + String value = local + "\n" + online + "\n差值:" + diff; + XSSFRichTextString textString = new XSSFRichTextString(value); + textString.applyFont(0, value.indexOf("差值:"), font); + textString.applyFont(value.indexOf("差值:"), value.length(), fontRed); + cell.setCellValue(textString); + } + + //判断是否要调整高度 + int width = sheet.getColumnWidth(i) / 256; + finalHeight = getFinalHeight(cell.getStringCellValue(), width, finalHeight, height); + maxHeight = Math.max(finalHeight, maxHeight); + cellIndex++; + } + + row.setHeightInPoints(maxHeight); + } + return workbook; + } + } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index d584782ed..c3e87f616 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -296,6 +296,71 @@ public class TaxDeclarationController { return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param); } + /** + * 在线对比表头列表 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/contrastHeaderList") + @Produces(MediaType.APPLICATION_JSON) + public String contrastHeaderList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>>(user).run(getTaxDeclareRecordWrapper(user)::contrastHeaderList, param); + } + + + /** + * 缓存在线对比表头列表 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/cacheContrastHeader") + @Produces(MediaType.APPLICATION_JSON) + public String cacheContrastHeader(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, Void>(user).run(getTaxDeclareRecordWrapper(user)::cacheContrastHeader, param.getColumns()); + } + + /** + * 导出在线对比 + * + * @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; + } + } + /** * 作废 diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 8e6e13663..bec6d0d4f 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -647,6 +647,32 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclarationValueService(user).contrast(param); } + + /** + * 在线对比表头列表 + * @param param + */ + public Map> contrastHeaderList(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).contrastHeaderList(param); + } + + /** + * 在线对比表头列表 + * @param columnIndex + */ + public void cacheContrastHeader(List columnIndex) { + getTaxDeclarationValueService(user).cacheContrastHeader(columnIndex); + } + + /** + * 导出在线对比 + * @param param + * @return + */ + public XSSFWorkbook exportContrast(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).exportContrast(param); + } + /** * 刷新数据 * From bcfcd1de9afcbf993713cabd26ec1caf214c8cce Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 1 Mar 2024 13:52:27 +0800 Subject: [PATCH 130/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5-?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=AF=B9=E6=AF=94=E6=98=BE=E7=A4=BA=E5=88=97?= =?UTF-8?q?=E5=AE=9A=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/TaxDeclarationValueList.java | 4 +- .../dto/TaxDeclarationValueListDTO.java | 3 + .../service/TaxDeclarationValueService.java | 3 +- .../impl/TaxDeclarationValueServiceImpl.java | 147 +++++++++++++----- .../salary/web/TaxDeclarationController.java | 14 +- .../wrapper/TaxDeclareRecordWrapper.java | 6 +- 6 files changed, 120 insertions(+), 57 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index e557e155e..fd5a44593 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -90,7 +90,7 @@ public class TaxDeclarationValueList { } EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); if (employeeDeclare != null) { - dataMap.put("jobNum", employeeDeclare.getJobNum()); + dataMap.put(cnKey ? "工号" : "jobNum", employeeDeclare.getJobNum()); dataMap.put(cnKey ? "姓名" : "username", employeeDeclare.getEmployeeName()); dataMap.put(cnKey ? "证件类型" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); dataMap.put(cnKey ? "证件号码" : "cardNum", employeeDeclare.getCardNum()); @@ -103,7 +103,7 @@ public class TaxDeclarationValueList { dataMap.put(cnKey ? "证件号码" : "cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); } else { ExtEmpPO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); - dataMap.put(cnKey ? "工号" : "jobNum", ""); + dataMap.put(cnKey ? "工号" : "jobNum", extEmployee.getWorkcode()); dataMap.put(cnKey ? "姓名" : "username", extEmployee.getUsername()); dataMap.put(cnKey ? "证件类型" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); dataMap.put(cnKey ? "证件号码" : "cardNum", extEmployee.getIdNo()); diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java index 7090bddfa..a546652f1 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java @@ -1,6 +1,8 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.cloudstore.eccom.pc.table.WeaTableType; +import com.engine.salary.annotation.SalaryTable; import lombok.Data; import lombok.experimental.Accessors; @@ -17,6 +19,7 @@ import java.util.Map; **/ @Data @Accessors(chain = true) +@SalaryTable(pageId = "34h8e2r7-9ee6-4d11-adn9-7t0ge54d6rj8", tableType = WeaTableType.CHECKBOX) public class TaxDeclarationValueListDTO { /** diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 8fabdd5d7..481126b75 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -1,7 +1,6 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxReportColumnDTO; import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; @@ -100,7 +99,7 @@ public interface TaxDeclarationValueService { * 在线对比表头列表 * @param param */ - Map> contrastHeaderList(ContrastQueryParam param); + // Map contrastHeaderList(ContrastQueryParam param); /** * 缓存在线对比表头列表 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 9465f88c8..cf7805b01 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -5,16 +5,17 @@ import com.cloudstore.dev.api.util.Util_DataCache; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SalaryItemConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxReportColumnDTO; import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; @@ -36,6 +37,7 @@ import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtilPlus; @@ -43,6 +45,7 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.wbi.core.entity.WeaResultMsg; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -391,7 +394,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar for (Map local : localList) { AtomicBoolean hasDiff = new AtomicBoolean(false); Map result = new HashMap<>(); - result.put("工号", local.get("jobNum")); + result.put("工号", local.get("工号")); result.put("姓名", local.get("姓名")); result.put("证件类型", local.get("证件类型")); result.put("证件号码", local.get("证件号码")); @@ -430,50 +433,102 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar oneResultList.add(result); } } - resultList.put("columns", param.isOnlyShowDiffItem() ? onlyShowColumns : columns); + List headerList = new ArrayList<>(); + headerList.add("工号"); + headerList.add("姓名"); + headerList.add("证件类型"); + headerList.add("证件号码"); + headerList.addAll((param.isOnlyShowDiffItem() ? onlyShowColumns : columns).stream().collect(Collectors.toList())); + resultList.put("columns", headerList); resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList)); + + // 显示定制列 + List 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 table = new SalaryWeaTable(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 Map> contrastHeaderList(ContrastQueryParam param) { - Map> resultMap = new HashMap<>(); - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); - if (taxDeclaration == null) { - throw new SalaryRunTimeException("无申报表"); - } - // 查询个税申报表表头 - IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); - List defaultDtoList = new ArrayList<>(); - taxReportColumns.stream().forEach(po -> {defaultDtoList.add(TaxReportColumnDTO.builder().id(po.getId()).reportColumnName(po.getReportColumnName()).reportColumnDataIndex(po.getReportColumnDataIndex()).build());}); - resultMap.put("defaultList",defaultDtoList); - // 获取缓存中保存的设置 - String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; - String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); - List selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); - if (CollectionUtils.isEmpty(selectedItems)) { - // 默认全选 - resultMap.put("selectedList", defaultDtoList); - resultMap.put("unSelectedList", Collections.emptyList()); - } else { - Map columnMap = SalaryEntityUtil.convert2Map(defaultDtoList, TaxReportColumnDTO::getReportColumnDataIndex); - List selectedColumn = new ArrayList<>(); - selectedItems.stream().forEach(index -> { - TaxReportColumnDTO taxReportColumnDTO = columnMap.get(index); - if (taxReportColumnDTO != null) { - // 已选择的项目 - selectedColumn.add(taxReportColumnDTO); - } - }); - // 过滤出未选择的项目 - List unSelectedList = defaultDtoList.stream().filter(po -> !selectedItems.contains(po.getReportColumnDataIndex())).collect(Collectors.toList()); - resultMap.put("selectedList", selectedColumn); - resultMap.put("unSelectedList", unSelectedList); - } - - return resultMap; - } + // @Override + // public Map contrastHeaderList(ContrastQueryParam param) { + // TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + // if (taxDeclaration == null) { + // throw new SalaryRunTimeException("无申报表"); + // } + // // 查询个税申报表表头 + // IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + // List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + // + // SalaryWeaTable table = new SalaryWeaTable(user, TaxDeclarationValueListDTO.class); + // + // + // List columns = new ArrayList<>(); + // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "工号")); + // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "姓名")); + // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件类型"), "证件类型")); + // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件号码"), "证件号码")); + // for (TaxReportColumnPO columnPO : taxReportColumns) { + // columns.add(new WeaTableColumn("100px", columnPO.getReportColumnName(), columnPO.getReportColumnName())); + // } + // table.setColumns(columns); + // WeaResultMsg result = new WeaResultMsg(false); + // result.putAll(table.makeDataResult()); + // result.success(); + // + // + // Map datas = new HashMap<>(); + // datas.put("dataKey", result.getResultMap()); + // return datas; + // // + // // + // // + // // + // // + // // + // // + // // List defaultDtoList = new ArrayList<>(); + // // taxReportColumns.stream().forEach(po -> {defaultDtoList.add(TaxReportColumnDTO.builder().id(po.getId()).reportColumnName(po.getReportColumnName()).reportColumnDataIndex(po.getReportColumnDataIndex()).build());}); + // // resultMap.put("defaultList",defaultDtoList); + // // // 获取缓存中保存的设置 + // // String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; + // // String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); + // // List selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); + // // if (CollectionUtils.isEmpty(selectedItems)) { + // // // 默认全选 + // // resultMap.put("selectedList", defaultDtoList); + // // resultMap.put("unSelectedList", Collections.emptyList()); + // // } else { + // // Map columnMap = SalaryEntityUtil.convert2Map(defaultDtoList, TaxReportColumnDTO::getReportColumnDataIndex); + // // List selectedColumn = new ArrayList<>(); + // // selectedItems.stream().forEach(index -> { + // // TaxReportColumnDTO taxReportColumnDTO = columnMap.get(index); + // // if (taxReportColumnDTO != null) { + // // // 已选择的项目 + // // selectedColumn.add(taxReportColumnDTO); + // // } + // // }); + // // // 过滤出未选择的项目 + // // List unSelectedList = defaultDtoList.stream().filter(po -> !selectedItems.contains(po.getReportColumnDataIndex())).collect(Collectors.toList()); + // // resultMap.put("selectedList", selectedColumn); + // // resultMap.put("unSelectedList", unSelectedList); + // // } + // + // return resultMap; + // } @Override public void cacheContrastHeader(List columnIndex) { @@ -487,7 +542,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar param.setCurrent(1); // 获取线下对比结果 Map contrastMap = contrast(param); - List header = (List)contrastMap.get("columns"); + List header = ((List) contrastMap.get("columns")); PageInfo> pageInfo = (PageInfo>)contrastMap.get("pageInfo"); List> list = pageInfo.getList(); @@ -497,6 +552,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar empInfoColumns.add(new WeaTableColumn("100px", "证件类型", "cardType")); empInfoColumns.add(new WeaTableColumn("100px", "证件号码", "cardNum")); + List 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())) { + header = header.stream().filter(h -> param.getColumns().contains(h)).collect(Collectors.toList()); + } + return ExcelUtilPlus.genWorkbook4TaxDeclareContrast(empInfoColumns, header, list, "在线对比结果"); } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index c3e87f616..bab38d66b 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -304,13 +304,13 @@ public class TaxDeclarationController { * @param param * @return */ - @POST - @Path("/contrastHeaderList") - @Produces(MediaType.APPLICATION_JSON) - public String contrastHeaderList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>>(user).run(getTaxDeclareRecordWrapper(user)::contrastHeaderList, param); - } + // @POST + // @Path("/contrastHeaderList") + // @Produces(MediaType.APPLICATION_JSON) + // public String contrastHeaderList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { + // User user = HrmUserVarify.getUser(request, response); + // return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrastHeaderList, param); + // } /** diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index bec6d0d4f..8b6be1711 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -652,9 +652,9 @@ public class TaxDeclareRecordWrapper extends Service { * 在线对比表头列表 * @param param */ - public Map> contrastHeaderList(ContrastQueryParam param) { - return getTaxDeclarationValueService(user).contrastHeaderList(param); - } + // public Map contrastHeaderList(ContrastQueryParam param) { + // return getTaxDeclarationValueService(user).contrastHeaderList(param); + // } /** * 在线对比表头列表 From 15b6c80cdc68fc9195481b1e59d12804c40be849 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 4 Mar 2024 14:07:51 +0800 Subject: [PATCH 131/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/TaxDeclarationValueService.java | 11 -- .../impl/TaxDeclarationValueServiceImpl.java | 100 ++---------------- .../salary/web/TaxDeclarationController.java | 33 ------ .../wrapper/TaxDeclareRecordWrapper.java | 17 --- 4 files changed, 6 insertions(+), 155 deletions(-) diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 481126b75..f961dbc6f 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -95,17 +95,6 @@ public interface TaxDeclarationValueService { */ Map contrast(ContrastQueryParam param); - /** - * 在线对比表头列表 - * @param param - */ - // Map contrastHeaderList(ContrastQueryParam param); - - /** - * 缓存在线对比表头列表 - * @param columnIndex - */ - void cacheContrastHeader(List columnIndex); /** * 导出在线对比 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index cf7805b01..202d6da3e 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -1,13 +1,11 @@ package com.engine.salary.service.impl; import cn.hutool.core.util.NumberUtil; -import com.cloudstore.dev.api.util.Util_DataCache; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.constant.SalaryItemConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -329,22 +327,6 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 查询个税申报表表头 IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); - // 筛选表头 - // 获取缓存中保存的设置 - String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; - String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); - List selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); - if (CollectionUtils.isNotEmpty(selectedItems)) { - Map columnMap = SalaryEntityUtil.convert2Map(taxReportColumns, TaxReportColumnPO::getReportColumnDataIndex); - List finalColumn = new ArrayList<>(); - selectedItems.stream().forEach(index -> { - TaxReportColumnPO c = columnMap.get(index); - if (c!=null) { - finalColumn.add(c); - } - }); - taxReportColumns = finalColumn; - } List columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList()); // 人员id Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); @@ -389,7 +371,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar onlineNoMap.put(no, map); } - Set onlyShowColumns = new HashSet<>(); + List onlyShowColumns = new ArrayList<>(); List> oneResultList = new ArrayList<>(); for (Map local : localList) { AtomicBoolean hasDiff = new AtomicBoolean(false); @@ -433,12 +415,14 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar oneResultList.add(result); } } + + List finalOnlyShowColumns = onlyShowColumns.stream().distinct().collect(Collectors.toList()); List headerList = new ArrayList<>(); headerList.add("工号"); headerList.add("姓名"); headerList.add("证件类型"); headerList.add("证件号码"); - headerList.addAll((param.isOnlyShowDiffItem() ? onlyShowColumns : columns).stream().collect(Collectors.toList())); + headerList.addAll((param.isOnlyShowDiffItem() ? finalOnlyShowColumns : columns).stream().collect(Collectors.toList())); resultList.put("columns", headerList); resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList)); @@ -463,79 +447,6 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } - // @Override - // public Map contrastHeaderList(ContrastQueryParam param) { - // TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); - // if (taxDeclaration == null) { - // throw new SalaryRunTimeException("无申报表"); - // } - // // 查询个税申报表表头 - // IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - // List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); - // - // SalaryWeaTable table = new SalaryWeaTable(user, TaxDeclarationValueListDTO.class); - // - // - // List columns = new ArrayList<>(); - // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "工号")); - // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "姓名")); - // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件类型"), "证件类型")); - // columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件号码"), "证件号码")); - // for (TaxReportColumnPO columnPO : taxReportColumns) { - // columns.add(new WeaTableColumn("100px", columnPO.getReportColumnName(), columnPO.getReportColumnName())); - // } - // table.setColumns(columns); - // WeaResultMsg result = new WeaResultMsg(false); - // result.putAll(table.makeDataResult()); - // result.success(); - // - // - // Map datas = new HashMap<>(); - // datas.put("dataKey", result.getResultMap()); - // return datas; - // // - // // - // // - // // - // // - // // - // // - // // List defaultDtoList = new ArrayList<>(); - // // taxReportColumns.stream().forEach(po -> {defaultDtoList.add(TaxReportColumnDTO.builder().id(po.getId()).reportColumnName(po.getReportColumnName()).reportColumnDataIndex(po.getReportColumnDataIndex()).build());}); - // // resultMap.put("defaultList",defaultDtoList); - // // // 获取缓存中保存的设置 - // // String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; - // // String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); - // // List selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); - // // if (CollectionUtils.isEmpty(selectedItems)) { - // // // 默认全选 - // // resultMap.put("selectedList", defaultDtoList); - // // resultMap.put("unSelectedList", Collections.emptyList()); - // // } else { - // // Map columnMap = SalaryEntityUtil.convert2Map(defaultDtoList, TaxReportColumnDTO::getReportColumnDataIndex); - // // List selectedColumn = new ArrayList<>(); - // // selectedItems.stream().forEach(index -> { - // // TaxReportColumnDTO taxReportColumnDTO = columnMap.get(index); - // // if (taxReportColumnDTO != null) { - // // // 已选择的项目 - // // selectedColumn.add(taxReportColumnDTO); - // // } - // // }); - // // // 过滤出未选择的项目 - // // List unSelectedList = defaultDtoList.stream().filter(po -> !selectedItems.contains(po.getReportColumnDataIndex())).collect(Collectors.toList()); - // // resultMap.put("selectedList", selectedColumn); - // // resultMap.put("unSelectedList", unSelectedList); - // // } - // - // return resultMap; - // } - - @Override - public void cacheContrastHeader(List columnIndex) { - String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN; - Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(columnIndex)); - } - @Override public XSSFWorkbook exportContrast(ContrastQueryParam param) { param.setPageSize(1000000000); @@ -555,7 +466,8 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar List 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())) { - header = header.stream().filter(h -> param.getColumns().contains(h)).collect(Collectors.toList()); + List finalHeader = header; + header = param.getColumns().stream().filter(col -> finalHeader.contains(col)).collect(Collectors.toList()); } return ExcelUtilPlus.genWorkbook4TaxDeclareContrast(empInfoColumns, header, list, "在线对比结果"); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index bab38d66b..bc0eb3f65 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -296,39 +296,6 @@ public class TaxDeclarationController { return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param); } - /** - * 在线对比表头列表 - * - * @param request - * @param response - * @param param - * @return - */ - // @POST - // @Path("/contrastHeaderList") - // @Produces(MediaType.APPLICATION_JSON) - // public String contrastHeaderList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { - // User user = HrmUserVarify.getUser(request, response); - // return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrastHeaderList, param); - // } - - - /** - * 缓存在线对比表头列表 - * - * @param request - * @param response - * @param param - * @return - */ - @POST - @Path("/cacheContrastHeader") - @Produces(MediaType.APPLICATION_JSON) - public String cacheContrastHeader(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult, Void>(user).run(getTaxDeclareRecordWrapper(user)::cacheContrastHeader, param.getColumns()); - } - /** * 导出在线对比 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 8b6be1711..fbb881460 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -647,23 +647,6 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclarationValueService(user).contrast(param); } - - /** - * 在线对比表头列表 - * @param param - */ - // public Map contrastHeaderList(ContrastQueryParam param) { - // return getTaxDeclarationValueService(user).contrastHeaderList(param); - // } - - /** - * 在线对比表头列表 - * @param columnIndex - */ - public void cacheContrastHeader(List columnIndex) { - getTaxDeclarationValueService(user).cacheContrastHeader(columnIndex); - } - /** * 导出在线对比 * @param param From 4196a8c59683b1416664e79e68c3a506cfc2de8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Mar 2024 16:05:55 +0800 Subject: [PATCH 132/298] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AddUpSituationServiceImpl.java | 4 +- .../impl/TaxDeclarationExcelServiceImpl.java | 38 ++----------------- 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index cc8fc53fa..6e57a095e 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -10,8 +10,8 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.AddUpSituationBiz; import com.engine.salary.config.SalaryElogConfig; -import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -26,10 +26,10 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index f039f208e..19e1fb3d1 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -4,15 +4,6 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.config.SalaryElogConfig; -import com.engine.salary.elog.entity.dto.LoggerContext; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; @@ -31,22 +22,16 @@ import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; -import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.TaxDeclarationDetailService; -import com.engine.salary.service.TaxDeclarationExcelService; -import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.util.JsonUtil; -import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSheetData; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -216,7 +201,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); - List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum,0); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); List heads = new ArrayList<>(); @@ -249,21 +234,6 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar } finally { IOUtils.closeQuietly(fileInputStream); } - - // 查询个税扣缴义务人名称 - String bar = "_"; - TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclarationPO.getTaxAgentId()); - String targetName = SalaryDateUtil.getFormatYearMonth(taxDeclarationPO.getSalaryMonth()) + bar + taxAgentPO.getName() + bar + IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getDefaultLabel(); - // 记录日志 - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(taxDeclarationId.toString()); - loggerContext.setTargetName(targetName); - loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "导出个税申报表")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "导出个税申报表")); - SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); - return ExcelUtil.genWorkbookV2(rows, sheetName); } @Override @@ -281,7 +251,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); - List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum,0); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); List taxReportColumnNames = SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList()); List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(declarationPO.getId()); @@ -362,7 +332,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar excelComments.add(errorMessageMap); } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, username, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, username, deparmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; From a52788aa1ba974620cec53dc154b3d1b0f207135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Mar 2024 16:12:15 +0800 Subject: [PATCH 133/298] =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/datacollection/AddUpSituation.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index 05ee70bd8..e2daff6ab 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -98,7 +98,6 @@ public class AddUpSituation { /** * 累计子女教育 */ - @ElogTransform(name = "累计子女教育") @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number") @Encrypt @Deprecated @@ -107,7 +106,6 @@ public class AddUpSituation { /** * 累计继续教育 */ - @ElogTransform(name = "累计继续教育") @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number") @Encrypt @Deprecated @@ -116,7 +114,6 @@ public class AddUpSituation { /** * 累计住房贷款利息 */ - @ElogTransform(name = "累计住房贷款利息") @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number") @Encrypt @Deprecated @@ -125,7 +122,6 @@ public class AddUpSituation { /** * 累计住房租金 */ - @ElogTransform(name = "累计住房租金") @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number") @Encrypt @Deprecated @@ -134,7 +130,6 @@ public class AddUpSituation { /** * 累计赡养老人 */ - @ElogTransform(name = "累计赡养老人") @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number") @Encrypt @Deprecated @@ -143,7 +138,6 @@ public class AddUpSituation { /** * 累计大病医疗 */ - @ElogTransform(name = "累计大病医疗") @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number") @Encrypt @Deprecated @@ -152,7 +146,6 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ - @ElogTransform(name = "累计婴幼儿照护") @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number") @Encrypt @Deprecated @@ -161,7 +154,6 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ - @ElogTransform(name = "累计个人养老金") @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number") @Encrypt @Deprecated @@ -218,6 +210,7 @@ public class AddUpSituation { /** * 实际累计已预扣预缴税额 */ + @ElogTransform(name = "实际累计已预扣预缴税额") @SalaryFormulaVar(defaultLabel = "实际累计已预扣预缴税额", labelId = 233557, dataType = "number") @Encrypt private String actualAddUpAdvanceTax; @@ -225,6 +218,7 @@ public class AddUpSituation { /** * 个税调差 */ + @ElogTransform(name = "个税调差") @SalaryFormulaVar(defaultLabel = "个税调差", labelId = 233559, dataType = "number") @Encrypt private String taxAdjustment; @@ -232,6 +226,7 @@ public class AddUpSituation { /** * 累计应纳税所得额 */ + @ElogTransform(name = "累计应纳税所得额") @SalaryFormulaVar(defaultLabel = "累计应纳税所得额", labelId = 85371, dataType = "number") @Encrypt private String addUpTaxableIncome; From 381c705cf835de2b4b7a988f69bd175f705307ce Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 7 Mar 2024 09:29:59 +0800 Subject: [PATCH 134/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E3=80=81=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EmployeeDeclareServiceImpl.java | 113 +++++----- .../impl/TaxDeclarationExcelServiceImpl.java | 20 +- .../impl/TaxDeclarationServiceImpl.java | 5 +- .../impl/TaxDeclareRecordServiceImpl.java | 202 +++++++++--------- 4 files changed, 182 insertions(+), 158 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 82410a3c4..d2b5384a5 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -6,8 +6,10 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh; @@ -26,6 +28,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryCycleTypeEnum; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; @@ -41,6 +44,7 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.service.*; import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -48,7 +52,6 @@ import com.engine.salary.util.valid.SalaryCardUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; -import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; @@ -223,14 +226,15 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setUpdateTime(now); getEmployeeDeclareMapper().insertIgnoreNull(employeeDeclare); // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); -// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName()); -// loggerContext.setNewValues(employeeDeclare); -// employeeDeclareLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); + loggerContext.setTargetName(employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增报送人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增报送人员:") + employeeDeclare.getEmployeeName()); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } else { EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId()); if (Objects.isNull(originEmployeeDeclare)) { @@ -256,15 +260,16 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } getEmployeeDeclareMapper().update(employeeDeclare); // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); -// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员:") + employeeDeclare.getEmployeeName()); -// loggerContext.setOldValues(originEmployeeDeclare); -// loggerContext.setNewValues(employeeDeclare); -// employeeDeclareLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); + loggerContext.setTargetName(employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员:") + employeeDeclare.getEmployeeName()); + loggerContext.setOldValues(originEmployeeDeclare); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } } @@ -385,16 +390,17 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } getEmployeeDeclareMapper().deleteByIds(ids, new Date()); // 记录日志 -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); -// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员:") + employeeDeclare.getEmployeeName()); -// loggerContext.setNewValues(employeeDeclare); -// employeeDeclareLoggerTemplate.write(loggerContext); -// } + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); + loggerContext.setTargetName(employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员:") + employeeDeclare.getEmployeeName()); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } } @Override @@ -514,15 +520,16 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla result.getEmployeeDeclares().forEach(getEmployeeDeclareMapper()::updateIgnoreNull); // updateBatchById(result.getEmployeeDeclares()); } -// // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); -// employeeDeclareLoggerTemplate.write(loggerContext); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString())); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } @Override @@ -603,14 +610,14 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla .setUpdateTime(now); getEmployeeDeclareRecordService(user).save(employeeDeclareRecord); // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156450, "全部报送")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156450, "全部报送")); -// employeeDeclareLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "全部报送")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "全部报送")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } @Override @@ -685,14 +692,14 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 删除原来的人员报送记录 getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈")); -// employeeDeclareLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "获取结果反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "获取结果反馈")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); // 更新流量统计 getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); // 报送失败的 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 19e1fb3d1..68ac9e277 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -2,10 +2,14 @@ package com.engine.salary.service.impl; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.common.util.LogUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; @@ -13,6 +17,7 @@ import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryPa import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; @@ -22,9 +27,7 @@ import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; -import com.engine.salary.util.JsonUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSheetData; @@ -128,6 +131,17 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar String sheetName = SalaryI18nUtil.getI18nLabel(100090, "个税申报表"); + // 记录日志 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclarationPO.getTaxAgentId()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.taxDeclarationLoggerTemplate, + taxDeclarationPO.getTaxDeclareRecordId(), + SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclarationPO.getTaxCycle())), + "导出个税申报表", + "导出个税申报表", + user); + return ExcelUtil.genWorkbook(rows, sheetName); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 50e9a0568..7490af8d5 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -4,8 +4,8 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.YearMonthRange; -import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; @@ -24,7 +24,6 @@ import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; -import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper; @@ -33,11 +32,11 @@ import com.engine.salary.service.*; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; -import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 5e8d7b062..88cbf4316 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -4,8 +4,10 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.YearMonthRange; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -34,6 +36,7 @@ import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackRes import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; 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.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; @@ -47,6 +50,7 @@ import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbac 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; @@ -54,7 +58,6 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -316,20 +319,20 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe //更新核算记录状态 getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); -// // 记录日志 -// for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(99815, "生成个税申报表")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(99815, "生成个税申报表")); -// loggerContext.setNewValues(taxDeclareRecord); -// taxDeclarationLoggerTemplate.write(loggerContext); -// } + // 记录日志 + for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表")); + loggerContext.setNewValues(taxDeclareRecord); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } } @Override @@ -593,25 +596,26 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe }); // 记录日志 -// writeDeleteLog(taxDeclareRecords); + writeDeleteLog(taxDeclareRecords); } -// private void writeDeleteLog(List taxDeclareRecords) { -// // 记录日志 -// List taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); -// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); -// for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), com.baomidou.mybatisplus.core.toolkit.StringUtils.EMPTY)) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); -// taxDeclarationLoggerTemplate.write(loggerContext); -// } -// } + private void writeDeleteLog(List taxDeclareRecords) { + // 记录日志 + List taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + } @Override public void declare(Long id) { @@ -684,17 +688,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 记录日志 -// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgent.getName()) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); -// taxDeclarationLoggerTemplate.write(loggerContext); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @Override @@ -815,17 +819,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); // 记录日志 -// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgent.getName()) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperator(Util.null2String(currentEmployeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156455, "申报反馈")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156455, "申报反馈")); -// taxDeclarationLoggerTemplate.write(loggerContext); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报反馈")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @Override @@ -872,18 +876,18 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setUpdateTime(new Date()); getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); -// // 记录日志 -// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgent.getName()) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); -// taxDeclarationLoggerTemplate.write(loggerContext); + // 记录日志 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报作废")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报作废")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @Override @@ -924,17 +928,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 记录日志 -// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgent.getName()) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); -// taxDeclarationLoggerTemplate.write(loggerContext); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @@ -1007,17 +1011,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 记录日志 -// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgent.getName()) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); -// taxDeclarationLoggerTemplate.write(loggerContext); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更正申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更正申报")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @@ -1059,17 +1063,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 记录日志 -// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") -// .replace("{0}", taxAgent.getName()) -// .replace("{1}", taxDeclareRecord.getTaxCycle())); -// loggerContext.setOperator(Util.null2String(employeeId)); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); -// taxDeclarationLoggerTemplate.write(loggerContext); + // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + // LoggerContext loggerContext = new LoggerContext<>(); + // loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + // loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + // .replace("{0}", taxAgent.getName()) + // .replace("{1}", taxDeclareRecord.getTaxCycle())); + // loggerContext.setOperator(Util.null2String(employeeId)); + // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + // loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); + // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); + // taxDeclarationLoggerTemplate.write(loggerContext); } @Override From 427ce223e72dfc92610b721c822190a28d9cf9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 7 Mar 2024 09:43:22 +0800 Subject: [PATCH 135/298] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=97=AD=E7=8E=AF?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryacct/bo/SalaryCalcItemGraph.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java index 52baba1db..ecfad44da 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java @@ -5,6 +5,7 @@ import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; @@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; import java.util.*; import java.util.concurrent.LinkedTransferQueue; +import java.util.stream.Collectors; /** * 对薪资核算时涉及的薪资项目进行排序 @@ -25,6 +27,7 @@ import java.util.concurrent.LinkedTransferQueue; public class SalaryCalcItemGraph { private List nodes; + private Map items; /** * 根据薪资账套的薪资项目、公式详情构建实例 @@ -51,7 +54,7 @@ public class SalaryCalcItemGraph { SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemCode); if (salaryItemPO == null) { continue; - }else { + } else { subSalarySobItem = SalarySobItemPO.builder().salaryItemId(salaryItemPO.getId()).salaryItemCode(salaryItemPO.getCode()).build(); } } @@ -63,6 +66,7 @@ public class SalaryCalcItemGraph { } } this.nodes = Lists.newArrayList(nodeMap.values()); + this.items = SalaryEntityUtil.convert2Map(salaryItemPOS, SalaryItemPO::getId, SalaryItemPO::getName); } /** @@ -130,6 +134,18 @@ public class SalaryCalcItemGraph { // 倒序 Collections.reverse(result); + if (!Objects.equals(result.size(), nodes.size())) { + + List resultIds = SalaryEntityUtil.properties(result, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + String errItemName = nodes.stream() + .map(SalaryCalcItemGraphNode::getSalaryCalcItem) + .map(SalaryCalcItem::getSalaryItemId) + .filter(itemId -> !resultIds.contains(itemId)) + .map(itemId -> items.getOrDefault(itemId, "")) + .collect((Collectors.joining(",", "[", "]"))); + + throw new SalaryRunTimeException("薪资项目:" + errItemName + "存在闭环!"); + } // 返回结果列表 return result; } From e851944e8f39f92062f93fe2e4e858fad1bb13a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 7 Mar 2024 11:11:24 +0800 Subject: [PATCH 136/298] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E8=B4=A6=E5=A5=97=E9=A1=B9=E7=9B=AE=E4=BF=9D=E5=AD=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalarySobItemServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 53ec67638..584a8425f 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -8,9 +8,9 @@ import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; -import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -36,7 +36,6 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.valid.ValidUtil; -import com.engine.salary.util.db.IdGenerator; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; From 8516a23bba2f5ba9c517c11643dcac1560f48b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 7 Mar 2024 21:12:09 +0800 Subject: [PATCH 137/298] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=88=B7=E6=96=B0=E9=80=BB=E8=BE=91=20?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E4=BA=BA=E5=91=98=E4=BC=9A=E9=9B=86=E6=88=90?= =?UTF-8?q?=E4=B8=8A=E6=9C=88=E6=89=80=E6=9C=89=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../employeedeclare/bo/EmployeeDeclareRefresh.java | 6 +++--- .../param/EmployeeDeclareAddListQueryParam.java | 2 ++ .../service/impl/EmployeeDeclareServiceImpl.java | 13 +++++++------ .../impl/SpecialAddDeductionServiceImpl.java | 9 ++++++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index 3b195d0d0..cccd8520e 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -40,9 +40,9 @@ public class EmployeeDeclareRefresh { // 对已有人员处理「人员状态」、「离职日期」、「任职受雇从业类型」 for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) { SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); - if (salaryArchive != null && - (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) - || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { + if (salaryArchive != null + && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { if (Objects.equals(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue()) || Objects.equals(Util.null2String(employeeDeclare.getDismissDate()), Util.null2String(salaryArchive.getPayEndDate()))) { employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java index 116623339..7847ea4f5 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java @@ -55,6 +55,8 @@ public class EmployeeDeclareAddListQueryParam extends BaseQueryParam { // 员工姓名/编号 private String keyword; + private Long employeeId; + // 部门 private Collection departmentIds; diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 82410a3c4..953ea3cbf 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -439,12 +439,13 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla public void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId) { // 查询本月已有的需要报送的人员 List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); - // 查询上月已有的需要报送的人员(只需要正常的) - List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()) - .stream() - .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) - && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) - .collect(Collectors.toList()); + // 查询上月已有报送的人员 + List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()); + //只需要正常的 +// .stream() +// .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) +// && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) +// .collect(Collectors.toList()); // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId()); // 根据税款所属期计算出薪资周期 diff --git a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java index 149d31fb3..9268317a8 100644 --- a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; @@ -692,9 +693,11 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd @Override public SpecialAddDeductionRecordDTO getRecordById(Long id) { - return getSpecialAddDeductionBiz() - .listDTOByParam(SpecialAddDeductionQueryParam.builder().specialAddDeductionId(id).build()) - .stream().findFirst().orElse(null); + List specialAddDeductionRecordDTOList = getSpecialAddDeductionBiz().listDTOByParam(SpecialAddDeductionQueryParam.builder().specialAddDeductionId(id).build()); + if(CollUtil.isNotEmpty(specialAddDeductionRecordDTOList)){ + return specialAddDeductionRecordDTOList.get(0); + } + return null; } private List> queryInfoForExcel(SpecialAddDeductionQueryParam param, List> rowList) { From 6aef2856e805076bf6d98c8bd17f5322157868ea Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 8 Mar 2024 11:14:00 +0800 Subject: [PATCH 138/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../employeedeclare/po/EmployeeDeclarePO.java | 34 +++++++++++ .../po/TaxDeclarationValuePO.java | 17 +++++- .../impl/EmployeeDeclareExcelServiceImpl.java | 32 ++++++++-- .../impl/EmployeeDeclareServiceImpl.java | 58 ++++++++++--------- .../impl/TaxDeclarationExcelServiceImpl.java | 3 - .../impl/TaxDeclarationServiceImpl.java | 26 +++++++++ .../impl/TaxDeclarationValueServiceImpl.java | 51 ++++++++++++++-- .../impl/TaxDeclareRecordServiceImpl.java | 13 +++++ .../wrapper/TaxDeclareRecordWrapper.java | 18 ++++++ 9 files changed, 212 insertions(+), 40 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index b589d29c5..7c71b79c1 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.employeedeclare.po; +import com.engine.salary.elog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,122 +23,146 @@ import java.util.Date; @Builder @AllArgsConstructor @NoArgsConstructor +@ElogTransform(name = "人员信息报送") //hrsa_employee_declare public class EmployeeDeclarePO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 个税扣缴义务人 */ + @ElogTransform(name = "个税扣缴义务人") private Long taxAgentId; /** * 税款所属期 */ + @ElogTransform(name = "税款所属期") private Date taxCycle; /** * 人员id */ + @ElogTransform(name = "人员id") private Long employeeId; /** * 人员类型 */ + @ElogTransform(name = "人员类型") private Integer employeeType; /** * 人员名称 */ + @ElogTransform(name = "人员名称") private String employeeName; /** * 工号 */ + @ElogTransform(name = "工号") private String jobNum; /** * 证件类型 */ + @ElogTransform(name = "证件类型") private Integer cardType; /** * 证件号码 */ + @ElogTransform(name = "证件号码") private String cardNum; /** * 性别 */ + @ElogTransform(name = "性别") private Integer gender; /** * 出生日期 */ + @ElogTransform(name = "出生日期") private Date birthday; /** * 状态 */ + @ElogTransform(name = "状态") private Integer employmentStatus; /** * 手机号码 */ + @ElogTransform(name = "手机号码") private String mobile; /** * 任职受雇从业类型 */ + @ElogTransform(name = "任职受雇从业类型") private Integer employmentType; /** * 入职年度就业情形 */ + @ElogTransform(name = "入职年度就业情形") private String employmentFirstYear; /** * 任职受雇从业日期 */ + @ElogTransform(name = "任职受雇从业日期") private Date employmentDate; /** * 离职日期 */ + @ElogTransform(name = "离职日期") private Date dismissDate; /** * 是否残疾 */ + @ElogTransform(name = "是否残疾") private Integer disability; /** * 残疾证号 */ + @ElogTransform(name = "残疾证号") private String disabilityCardNo; /** * 是否孤老 */ + @ElogTransform(name = "是否孤老") private Integer lonelyOld; /** * 是否是烈属 */ + @ElogTransform(name = "是否是烈属") private Integer martyrDependents; /** * 烈属证号 */ + @ElogTransform(name = "烈属证号") private String martyrDependentsCardNo; /** * 是否扣除减除费用 */ + @ElogTransform(name = "是否扣除减除费用") private Integer deductExpenses; /** @@ -145,47 +170,56 @@ public class EmployeeDeclarePO { * 注意:不仅仅是针对某一个月 * 0:从未报送成功过、1:报送成功过 */ + @ElogTransform(name = "是否成功报送过") private Integer successfullyDeclared; /** * 员工信息是否发生变动: * 0:本月未改动、1:本月有改动 */ + @ElogTransform(name = "员工信息是否发生变动") private Integer newEmployeeInfo; /** * 申报状态 */ + @ElogTransform(name = "申报状态") private Integer declareStatus; /** * 申报失败的错误信息 */ + @ElogTransform(name = "申报失败的错误信息") private String declareErrorMsg; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index 9c88986dd..addea959b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -1,12 +1,12 @@ package com.engine.salary.entity.taxdeclaration.po; import com.engine.salary.annotation.Encrypt; +import com.engine.salary.elog.annotation.ElogTransform; import com.engine.salary.enums.taxdeclaration.SourceEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import java.io.Serializable; import java.util.Collection; @@ -22,77 +22,90 @@ import java.util.Map; * @version 1.0 **/ @Data -@Accessors(chain = true) @Builder @AllArgsConstructor @NoArgsConstructor //hrsa_tax_declaration_value") +@ElogTransform( name ="个税申报表的值" ) public class TaxDeclarationValuePO implements Serializable { /** * 主键id */ + @ElogTransform( name ="主键id" ) private Long id; /** * 个税申报表id */ + @ElogTransform( name ="个税申报表id" ) private Long taxDeclarationId; /** * 个税申报记录id */ + @ElogTransform( name ="个税申报记录id" ) private Long taxDeclareRecordId; /** * 人员类型 */ + @ElogTransform( name ="人员类型" ) private Integer employeeType; /** * 人员id */ + @ElogTransform( name ="人员id" ) private Long employeeId; /** * 薪资核算结果 */ + @ElogTransform( name ="薪资核算结果" ) private Map resultValue; /** * 薪资核算结果(只在加密解密中使用) */ @Encrypt + @ElogTransform( name ="薪资核算结果" ) private String resultValueJson; /** * 租户key */ + @ElogTransform( name ="租户key" ) private String tenantKey; /** * 创建人id */ + @ElogTransform( name ="创建人id" ) private Long creator; /** * 是否删除 */ + @ElogTransform( name ="是否删除" ) private Integer deleteType; /** * 创建时间 */ + @ElogTransform( name ="创建时间" ) private Date createTime; /** * 更新时间 */ + @ElogTransform( name ="更新时间" ) private Date updateTime; /** * 数据来源 * @see SourceEnum */ + @ElogTransform( name ="数据来源" ) private Integer source; private Collection ids; diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index fa23d3cdb..bab047dc1 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -2,7 +2,9 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareBO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; @@ -11,6 +13,7 @@ import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum; @@ -25,10 +28,7 @@ import com.engine.salary.service.EmployeeDeclareExcelService; import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryEnumUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.*; import com.engine.salary.util.valid.SalaryCardUtil; @@ -499,6 +499,20 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee needUpdateEmployeeDeclares.stream().forEach(getEmployeeDeclareMapper()::update); } + // 记录日志 + needAddEmployeeDeclares.addAll(needUpdateEmployeeDeclares); + if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(taxAgentId)); + loggerContext.setTargetName(taxAgent.getName() + "-" + SalaryDateUtil.getFormatYearMonth(param.getTaxCycle())); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入人员信息报送")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入人员信息报送:") + taxAgent.getName()); + loggerContext.setNewValueList(needAddEmployeeDeclares); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } + apidatas.put("successCount", successCount); apidatas.put("errorCount", failCount); apidatas.put("errorData", errorData); @@ -569,6 +583,16 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // 需要导出的数据 List> excelSheetData = ExcelUtil.getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); + // 记录日志 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(queryParam.getTaxAgentId()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.employeeDeclareLoggerTemplate, + queryParam.getTaxAgentId(), + SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(queryParam.getTaxCycle())), + "导出人员信息报送", + "导出人员信息报送", + user); return ExcelUtil.genWorkbookV2(excelSheetData, "人员信息采集"); } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 148e973ae..a613fb398 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -215,6 +215,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setNewEmployeeInfo(0); employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); employeeDeclare.setDeclareErrorMsg(""); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(saveParam.getTaxAgentId()); if (Objects.isNull(saveParam.getId())) { employeeDeclare.setId(IdGenerator.generate()); employeeDeclare.setEmployeeId(saveParam.getEmployeeId()); @@ -226,15 +227,15 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setUpdateTime(now); getEmployeeDeclareMapper().insertIgnoreNull(employeeDeclare); // 记录日志 - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); - loggerContext.setTargetName(employeeDeclare.getEmployeeName()); - loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增报送人员")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增报送人员:") + employeeDeclare.getEmployeeName()); - loggerContext.setNewValues(employeeDeclare); - SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); + loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增报送人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增报送人员:") + employeeDeclare.getEmployeeName()); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } else { EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId()); if (Objects.isNull(originEmployeeDeclare)) { @@ -263,7 +264,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setUser(user); loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); - loggerContext.setTargetName(employeeDeclare.getEmployeeName()); + loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员")); loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员:") + employeeDeclare.getEmployeeName()); @@ -390,16 +391,19 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } getEmployeeDeclareMapper().deleteByIds(ids, new Date()); // 记录日志 - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); - loggerContext.setTargetName(employeeDeclare.getEmployeeName()); - loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员:") + employeeDeclare.getEmployeeName()); - loggerContext.setNewValues(employeeDeclare); - SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + TaxAgentPO taxAgent = taxAgentMap.get(employeeDeclare.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); + loggerContext.setTargetName((taxAgent == null ? "" :taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除报送人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除报送人员:") + employeeDeclare.getEmployeeName()); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } } @@ -525,8 +529,8 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 记录日志 LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setUser(user); - loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString())); + loggerContext.setTargetId(refreshParam.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(refreshParam.getTaxCycle()))); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); @@ -613,12 +617,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 记录日志 LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setUser(user); - loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); + loggerContext.setTargetId(param.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()))); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "全部报送")); loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "全部报送")); - SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } @Override @@ -695,8 +699,8 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 记录日志 LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setUser(user); - loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); + loggerContext.setTargetId(param.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()))); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "获取结果反馈")); loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "获取结果反馈")); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 68ac9e277..e72ae6f09 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -2,12 +2,10 @@ package com.engine.salary.service.impl; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.eccom.pc.table.WeaTableColumn; -import com.engine.common.util.LogUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; @@ -17,7 +15,6 @@ import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryPa import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.po.*; -import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 7490af8d5..c1359a47b 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -480,6 +480,20 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration List objects = new ArrayList<>(); objects.add(taxDeclaration); getTaxDeclarationMapper().batchInsert(objects); + + + // 记录日志 + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」申报表类型「{2}」") + .replace("{0}", taxAgentPO.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())) + .replace("{2}", incomeCategory.getDefaultLabel())); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增个税申报表")); } @@ -505,6 +519,18 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration } getTaxDeclarationMapper().deleteByIdZj(taxDeclarationId); + // 记录日志 + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(declarationPO.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(declarationPO.getTaxDeclareRecordId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」申报表类型「{2}」") + .replace("{0}", taxAgentPO.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(declarationPO.getTaxCycle())) + .replace("{2}", IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()).getDefaultLabel())); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除个税申报表")); } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 202d6da3e..d1373f49b 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -5,12 +5,15 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; @@ -21,6 +24,7 @@ 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.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; @@ -32,10 +36,7 @@ import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.remote.tax.client.DeclareClient; import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.service.*; -import com.engine.salary.util.JsonUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryEnumUtil; -import com.engine.salary.util.SalaryI18nUtil; +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.ExcelUtilPlus; @@ -48,6 +49,7 @@ 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 org.springframework.beans.BeanUtils; import weaver.general.Util; import weaver.hrm.User; @@ -96,6 +98,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + @Override public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds, String keyword) { List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); @@ -194,9 +200,26 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } TaxDeclarationValuePO po = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclarationId(param.getTaxDeclarationId()).taxDeclareRecordId(taxDeclareRecordId).employeeId(param.getEmployeeId()).employeeType(param.getEmployeeType()).resultValue(param.getTaxReportColumnValues()).resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())).createTime(new Date()).updateTime(new Date()).source(SourceEnum.ADD.getValue()).creator((long) user.getUID()).deleteType(0).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); + TaxDeclarationValuePO po4log = new TaxDeclarationValuePO(); + BeanUtils.copyProperties(po,po4log); encryptUtil.encrypt(po, TaxDeclarationValuePO.class); getTaxDeclarationValueMapper().insertIgnoreNull(po); + // 记录日志 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(po.getTaxDeclareRecordId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」,税款所属期「{1}」,人员id「{3}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(declareRecordPO.getTaxCycle())) + .replace("{2}", po.getEmployeeId().toString())); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增人员")); + loggerContext.setNewValues(po4log); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + //新增年终奖 if (IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue().equals(taxDeclaration.getIncomeCategory())) { autoAddWagesDeclare(declareRecordPO); @@ -206,12 +229,32 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar @Override public void edit(TaxDeclareRecordDetailSaveParam param) { TaxDeclarationValuePO po = getById(param.getId()); + TaxDeclarationValuePO oldPo = new TaxDeclarationValuePO(); + BeanUtils.copyProperties(po, oldPo); po.setResultValue(param.getTaxReportColumnValues()); po.setResultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())); po.setUpdateTime(new Date()); po.setSource(SourceEnum.EDIT.getValue()); encryptUtil.encrypt(po, TaxDeclarationValuePO.class); getTaxDeclarationValueMapper().updateIgnoreNull(po); + TaxDeclarationValuePO po4log = getTaxDeclarationValueMapper().getById(po.getId()); + + // 记录日志 + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(po.getTaxDeclareRecordId()); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecordPO.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(po.getTaxDeclareRecordId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」人员id「{3}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecordPO.getTaxCycle())) + .replace("{2}", po.getEmployeeId().toString())); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "修改个税申报数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "修改个税申报数据")); + loggerContext.setOldValues(oldPo); + loggerContext.setNewValues(po4log); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @Override diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 88cbf4316..4824b3467 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -389,6 +389,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe //更新核算记录状态 getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); + + // 记录日志 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxDeclareRecord.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "刷新个税申报数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "刷新个税申报数据")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } private TaxDeclarationResult generateReportPerRecord(TaxDeclareRecordPO taxDeclareRecord, List salaryAcctEmployees) { diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index fbb881460..0ecc8c72f 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -3,6 +3,8 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -11,6 +13,7 @@ import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO; import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; @@ -851,5 +854,20 @@ public class TaxDeclareRecordWrapper extends Service { } getTaxDeclarationValueService(user).deleteById(deleteId); + // 记录日志 + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordService(user).getById(declarationValuePO.getTaxDeclareRecordId()); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecordPO.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxDeclareRecordPO.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」,税款所属期「{1}」,人员id「{3}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecordPO.getTaxCycle())) + .replace("{2}", declarationValuePO.getEmployeeId().toString())); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "删除个税申报数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "删除个税申报数据")); + loggerContext.setOldValues(declarationValuePO); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } } From ddc9188cd97bd273fd2d786cc4067721c28598bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 8 Mar 2024 15:09:42 +0800 Subject: [PATCH 139/298] =?UTF-8?q?=E5=8F=AA=E8=8E=B7=E5=8F=96=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E4=B8=94=E6=8A=A5=E9=80=81=E6=88=90=E5=8A=9F=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EmployeeDeclareServiceImpl.java | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index a613fb398..794ef5676 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -261,15 +261,15 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } getEmployeeDeclareMapper().update(employeeDeclare); // 记录日志 - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); - loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员:") + employeeDeclare.getEmployeeName()); - loggerContext.setOldValues(originEmployeeDeclare); - loggerContext.setNewValues(employeeDeclare); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); + loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑报送人员:") + employeeDeclare.getEmployeeName()); + loggerContext.setOldValues(originEmployeeDeclare); + loggerContext.setNewValues(employeeDeclare); SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } } @@ -398,13 +398,13 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setUser(user); loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); - loggerContext.setTargetName((taxAgent == null ? "" :taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); + loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除报送人员")); loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除报送人员:") + employeeDeclare.getEmployeeName()); loggerContext.setNewValues(employeeDeclare); SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); - } + } } @Override @@ -450,12 +450,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 查询本月已有的需要报送的人员 List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); // 查询上月已有报送的人员 - List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()); - //只需要正常的 -// .stream() -// .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) -// && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) -// .collect(Collectors.toList()); + List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()) + //只需要正常的 + .stream() + .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) + && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) + .collect(Collectors.toList()); // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId()); // 根据税款所属期计算出薪资周期 @@ -526,15 +526,15 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // updateBatchById(result.getEmployeeDeclares()); } - // 记录日志 - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(refreshParam.getTaxAgentId().toString()); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(refreshParam.getTaxCycle()))); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); - SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(refreshParam.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(refreshParam.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "刷新数据")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } @Override @@ -615,14 +615,14 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla .setUpdateTime(now); getEmployeeDeclareRecordService(user).save(employeeDeclareRecord); // 记录日志 - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(param.getTaxAgentId().toString()); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()))); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "全部报送")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "全部报送")); - SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "全部报送")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "全部报送")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); } @Override From a7b3b7578f5b6f72647c58c1f0ee2bd906f47aa2 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 8 Mar 2024 16:33:34 +0800 Subject: [PATCH 140/298] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/TaxDeclarationServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index c1359a47b..f44155e65 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -494,6 +494,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增个税申报表")); loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增个税申报表")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @@ -531,6 +532,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除个税申报表")); loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除个税申报表")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } } From 1d8a1b91c0fca4d1a1c4bd8b5d4b56202f52bbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 12 Mar 2024 18:58:36 +0800 Subject: [PATCH 141/298] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/employeedeclare/po/EmployeeDeclarePO.java | 2 +- .../salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java | 2 +- .../salary/service/impl/EmployeeDeclareExcelServiceImpl.java | 2 +- .../engine/salary/service/impl/EmployeeDeclareServiceImpl.java | 2 +- .../salary/service/impl/TaxDeclarationValueServiceImpl.java | 2 +- .../engine/salary/service/impl/TaxDeclareRecordServiceImpl.java | 2 +- src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index 7c71b79c1..780eb90db 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -1,7 +1,7 @@ package com.engine.salary.entity.employeedeclare.po; -import com.engine.salary.elog.annotation.ElogTransform; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index addea959b..c2d08e3c3 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -1,7 +1,7 @@ package com.engine.salary.entity.taxdeclaration.po; import com.engine.salary.annotation.Encrypt; -import com.engine.salary.elog.annotation.ElogTransform; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.taxdeclaration.SourceEnum; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index bab047dc1..de5a7a82a 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -4,7 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.elog.entity.dto.LoggerContext; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareBO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 794ef5676..96546a952 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -4,12 +4,12 @@ package com.engine.salary.service.impl; import cn.hutool.core.map.MapUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SzyhApiConstant; -import com.engine.salary.elog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index d1373f49b..706a31334 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -7,7 +7,7 @@ import com.engine.core.impl.Service; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.elog.entity.dto.LoggerContext; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 4824b3467..96e4456e2 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -7,7 +7,7 @@ import com.engine.salary.common.YearMonthRange; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SzyhApiConstant; -import com.engine.salary.elog.entity.dto.LoggerContext; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 0ecc8c72f..9e115aa32 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -4,7 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.config.SalaryElogConfig; -import com.engine.salary.elog.entity.dto.LoggerContext; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; From 2a692b13b412190f4d2c393821d5f07af1287e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 29 Mar 2024 10:44:55 +0800 Subject: [PATCH 142/298] =?UTF-8?q?=E5=A4=96=E7=B1=8D=E4=BA=BA=E5=91=98v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202403193303.sql | 12 + resource/sqlupgrade/GS/sql202403193303.sql | 12 + resource/sqlupgrade/JC/sql202403193303.sql | 12 + resource/sqlupgrade/Mysql/sql202403193303.sql | 8 + .../sqlupgrade/Oracle/sql202403193303.sql | 11 + resource/sqlupgrade/PG/sql202403193303.sql | 8 + .../sqlupgrade/SQLServer/sql202403193303.sql | 10 + resource/sqlupgrade/ST/sql202403193303.sql | 12 + resource/wiki/待添加sql | 5 + .../bo/EmployeeDeclareList.java | 1 + .../bo/EmployeeDeclareRefresh.java | 41 +- .../bo/EmployeeDeclareRequest.java | 22 +- .../dto/EmployeeDeclareFromDTO.java | 30 ++ .../dto/EmployeeDeclareListDTO.java | 6 + .../param/EmployeeDeclareSaveParam.java | 68 ++- .../employeedeclare/po/EmployeeDeclarePO.java | 54 +++ .../taxagent/po/TaxAgentTaxReturnPO.java | 2 +- .../bo/TaxDeclarationRequest.java | 50 ++- .../bo/TaxDeclarationValueList.java | 2 +- .../bo/TaxDeclareEmployeeBO.java | 2 +- .../param/TaxDeclareRecordParam.java | 6 +- .../taxdeclaration/po/TaxDeclareRecordPO.java | 10 + .../taxdeclaration/po/TaxDeclareStatusPO.java | 75 ++++ .../enums/employeedeclare/CardTypeEnum.java | 14 +- .../enums/employeedeclare/TaxReasonEnum.java | 58 +++ .../salarysob/DeclareReportTypeEnum.java | 58 +++ .../enums/salarysob/IncomeCategoryEnum.java | 76 +++- .../employeedeclare/EmployeeDeclareMapper.xml | 99 ++++- .../taxagent/TaxAgentTaxReturnMapper.xml | 6 +- .../TaxDeclareStatusMapper.java | 74 ++++ .../taxdeclaration/TaxDeclareStatusMapper.xml | 311 +++++++++++++ .../remote/tax/client/DeclareClient.java | 2 +- .../remote/tax/client/PaymentClient.java | 62 +++ .../payment/QueryArrearageRequest.java | 64 +++ .../GetDeclareTaxResultFeedbackResponse.java | 4 +- .../service/TaxDeclareRecordService.java | 16 +- .../impl/EmployeeDeclareServiceImpl.java | 17 +- .../impl/TaxDeclarationValueServiceImpl.java | 2 +- .../impl/TaxDeclareRecordServiceImpl.java | 376 +++++++++------- .../salary/util/valid/SalaryCardUtil.java | 410 +++++++++++++++++- .../salary/web/TaxDeclarationController.java | 14 +- .../wrapper/EmployeeDeclareWrapper.java | 8 +- .../wrapper/TaxDeclareRecordWrapper.java | 44 +- test/ParseTaxApi.java | 4 +- 44 files changed, 1860 insertions(+), 318 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202403193303.sql create mode 100644 resource/sqlupgrade/GS/sql202403193303.sql create mode 100644 resource/sqlupgrade/JC/sql202403193303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202403193303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202403193303.sql create mode 100644 resource/sqlupgrade/PG/sql202403193303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202403193303.sql create mode 100644 resource/sqlupgrade/ST/sql202403193303.sql create mode 100644 resource/wiki/待添加sql create mode 100644 src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java create mode 100644 src/com/engine/salary/enums/employeedeclare/TaxReasonEnum.java create mode 100644 src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.java create mode 100644 src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.xml create mode 100644 src/com/engine/salary/remote/tax/client/PaymentClient.java create mode 100644 src/com/engine/salary/remote/tax/request/payment/QueryArrearageRequest.java rename src/com/engine/salary/remote/tax/response/{employee => declare}/GetDeclareTaxResultFeedbackResponse.java (99%) diff --git a/resource/sqlupgrade/DM/sql202403193303.sql b/resource/sqlupgrade/DM/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = 'й' where nationality is null; +/ + diff --git a/resource/sqlupgrade/GS/sql202403193303.sql b/resource/sqlupgrade/GS/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = 'й' where nationality is null; +/ + diff --git a/resource/sqlupgrade/JC/sql202403193303.sql b/resource/sqlupgrade/JC/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = 'й' where nationality is null; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202403193303.sql b/resource/sqlupgrade/Mysql/sql202403193303.sql new file mode 100644 index 000000000..8a2735c24 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202403193303.sql @@ -0,0 +1,8 @@ +ALTER TABLE hrsa_employee_declare +ADD COLUMN nationality varchar(255) NULL, +ADD COLUMN birthplace varchar(255) NULL, +ADD COLUMN tax_reasons varchar(255) NULL, +ADD COLUMN entry_date date NULL, +ADD COLUMN departure_date date NULL ; + +update hrsa_employee_declare set nationality = 'й' where nationality is null; diff --git a/resource/sqlupgrade/Oracle/sql202403193303.sql b/resource/sqlupgrade/Oracle/sql202403193303.sql new file mode 100644 index 000000000..d8a365183 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202403193303.sql @@ -0,0 +1,11 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = 'й' where nationality is null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202403193303.sql b/resource/sqlupgrade/PG/sql202403193303.sql new file mode 100644 index 000000000..2e000d661 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202403193303.sql @@ -0,0 +1,8 @@ +ALTER TABLE hrsa_employee_declare +ADD COLUMN nationality varchar(255) NULL , +ADD COLUMN birthplace varchar(255) NULL , +ADD COLUMN tax_reasons varchar(255) NULL , +ADD COLUMN entry_date timestamp NULL DEFAULT NULL , +ADD COLUMN departure_date timestamp NULL DEFAULT NULL ; + +update hrsa_employee_declare set nationality = 'й' where nationality is null; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202403193303.sql b/resource/sqlupgrade/SQLServer/sql202403193303.sql new file mode 100644 index 000000000..a1f345591 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202403193303.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_employee_declare +ADD nationality varchar(255) NULL , +ADD birthplace varchar(255) NULL , +ADD tax_reasons varchar(255) NULL , +entry_date datetime NULL , +departure_date datetime NULL +GO + +update hrsa_employee_declare set nationality = 'й' where nationality is null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202403193303.sql b/resource/sqlupgrade/ST/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = 'й' where nationality is null; +/ + diff --git a/resource/wiki/待添加sql b/resource/wiki/待添加sql new file mode 100644 index 000000000..44d2fbec2 --- /dev/null +++ b/resource/wiki/待添加sql @@ -0,0 +1,5 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000001, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '当期收入额', 'royaltiesIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000002, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '免税收入', 'royaltiesTaxFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000003, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '其他', 'royaltiesOther', 'number', 'qt', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000004, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '备注', 'royaltiesRemark', 'string', 'bz', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000005, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '减免税额', 'royaltiesTaxDeduction', 'number', 'jmse', NULL, 0); diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java index c63a55817..84cdfddff 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java @@ -55,6 +55,7 @@ public class EmployeeDeclareList { .setEmployeeName(employeeDeclare.getEmployeeName()) .setJobNum(employeeDeclare.getJobNum()) .setTaxAgentName(taxAgentNameMap.get(employeeDeclare.getTaxAgentId())) + .setNationality(employeeDeclare.getNationality()) .setCardType(cardTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(cardTypeEnum.getLabelId(), cardTypeEnum.getDefaultLabel())) .setCardNum(employeeDeclare.getCardNum()) .setGender(genderEnum == null ? "" : genderEnum.getDefaultLabel()) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index cccd8520e..78d1f5874 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -15,9 +15,9 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.valid.SalaryCardUtil; import com.google.common.collect.Lists; -import com.engine.salary.util.db.IdGenerator; import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -30,8 +30,6 @@ public class EmployeeDeclareRefresh { Result result = new Result(); // 本月已有的需要报送的人员 Set employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId); - // 员工的个人信息 - Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(dto.getHrmEmployeeComInfos(), DataCollectionEmployee::getEmployeeId); // 薪资档案的数据(任职受雇从业类型、起始发薪日期、最后发薪日期) Map salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId); // 非系统人员的数据(任职受雇从业类型) @@ -103,26 +101,35 @@ public class EmployeeDeclareRefresh { if (employeeIds.contains(hrmEmployeeComInfo.getEmployeeId())) { continue; } - EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId); - DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId()); - String idNum = simpleUserInfo != null && simpleUserInfo.getIdNo() != null ? simpleUserInfo.getIdNo().toUpperCase() : ""; + //是否为外籍人员,通过证件号码判断 + String idNum = hrmEmployeeComInfo.getIdNo() != null ? hrmEmployeeComInfo.getIdNo().toUpperCase() : ""; + CardTypeEnum cardType = CardTypeEnum.RESIDENT_IDENTITY_CARDS; + if (!SalaryCardUtil.checkIdNum(idNum)) { + cardType = CardTypeEnum.FOREIGN_PASSPORT; + } + EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), employeeId); employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); employeeDeclare.setEmployeeName(hrmEmployeeComInfo.getUsername()); employeeDeclare.setJobNum(hrmEmployeeComInfo.getWorkcode()); + employeeDeclare.setCardType(cardType.getValue()); employeeDeclare.setCardNum(idNum); - employeeDeclare.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()); - employeeDeclare.setBirthday(simpleUserInfo == null || simpleUserInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday())); + employeeDeclare.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.getValue().toString()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()); + employeeDeclare.setBirthday(hrmEmployeeComInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(hrmEmployeeComInfo.getBirthday())); employeeDeclare.setMobile(hrmEmployeeComInfo.getMobile()); if (StringUtils.isEmpty(idNum)) { employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); - employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); - } else if (!SalaryCardUtil.checkIdNum(idNum)) { - employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); - employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); - } else { + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "证件号码不能为空")); + } + if (cardType == CardTypeEnum.RESIDENT_IDENTITY_CARDS) { employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue()); employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum))); + employeeDeclare.setNationality("中国"); + } else { + // fixme 阿富汗 +// employeeDeclare.setNationality("阿富汗"); +// employeeDeclare.setEntryDate(); +// employeeDeclare.setDepartureDate(); } // 对人员处理「人员状态」、「离职日期」 SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); @@ -167,13 +174,11 @@ public class EmployeeDeclareRefresh { return result; } - private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, Date taxCycle, Date now, Long employeeId) { + private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, Date taxCycle, Long employeeId) { EmployeeDeclarePO employeeDeclarePO = new EmployeeDeclarePO(); employeeDeclarePO.setId(IdGenerator.generate()); employeeDeclarePO.setTaxAgentId(taxAgentId); employeeDeclarePO.setTaxCycle(taxCycle); - employeeDeclarePO.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); - employeeDeclarePO.setGender(GenderEnum.MALE.getValue()); employeeDeclarePO.setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue()); employeeDeclarePO.setEmploymentType(EmploymentTypeEnum.EMPLOYEE.getValue()); employeeDeclarePO.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); @@ -190,8 +195,8 @@ public class EmployeeDeclareRefresh { employeeDeclarePO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); employeeDeclarePO.setCreator(employeeId); employeeDeclarePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); - employeeDeclarePO.setCreateTime(now); - employeeDeclarePO.setUpdateTime(now); + employeeDeclarePO.setCreateTime(new Date()); + employeeDeclarePO.setUpdateTime(new Date()); return employeeDeclarePO; } diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java index c40bcae9d..b7a08373e 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -10,6 +10,7 @@ import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEnumUtil; import lombok.Data; import org.apache.commons.compress.utils.Lists; +import weaver.general.Util; import java.util.HashMap; import java.util.List; @@ -41,17 +42,20 @@ public class EmployeeDeclareRequest { // *姓名 employeeInfoMap.put("xm", employeeDeclare.getEmployeeName()); // *证件类型 - CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); - employeeInfoMap.put("zzlx", cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel()); + CardTypeEnum cardTypeEnum = CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()); + employeeInfoMap.put("zzlx", cardTypeEnum.getDefaultLabel()); // *证件号码 employeeInfoMap.put("zzhm", employeeDeclare.getCardNum()); // *国籍 - employeeInfoMap.put("gj", "中国"); + String nationality = employeeDeclare.getNationality(); + employeeInfoMap.put("gj", nationality); + // 人员地区 + employeeInfoMap.put("rydq", cardTypeEnum == CardTypeEnum.RESIDENT_IDENTITY_CARDS ? "境内" : "境外"); // *性别 GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class); employeeInfoMap.put("xb", genderEnum == null ? "" : genderEnum.getDefaultLabel()); // *出生日期 - employeeInfoMap.put("csny", employeeDeclare.getBirthday()); + employeeInfoMap.put("csny", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getBirthday())); // *人员状态 EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); employeeInfoMap.put("nsrzt", employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); @@ -88,18 +92,16 @@ public class EmployeeDeclareRequest { employeeInfoMap.put("grgbbl", ""); // 备注 employeeInfoMap.put("bz", ""); - // 人员地区 - employeeInfoMap.put("rydq", "境内"); // 中文名 employeeInfoMap.put("xmzw", ""); // 出生地: - employeeInfoMap.put("csd", ""); + employeeInfoMap.put("csd", Util.null2String(employeeDeclare.getBirthplace())); // 涉税事由 - employeeInfoMap.put("sssx", ""); + employeeInfoMap.put("sssx", Util.null2String(employeeDeclare.getTaxReasons())); // 首次入境时间 - employeeInfoMap.put("scrjsj", ""); + employeeInfoMap.put("scrjsj", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEntryDate())); // 预计离境时间 - employeeInfoMap.put("yjljsj", ""); + employeeInfoMap.put("yjljsj", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDepartureDate())); // 其他证件类型 employeeInfoMap.put("qtzzlx", ""); // 其他证件号码 diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java index 21aedf5d9..3abbb76d7 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -67,6 +67,23 @@ public class EmployeeDeclareFromDTO { @TableTitle(title = "性别", dataIndex = "gender", key = "gender") private GenderEnum gender; + /** + * 涉税事由, + * 任职受雇 + * 提供临时劳务 + * 转让财产 + * 从事投资和经营活动 + * 其他 + */ + @TableTitle(title = "涉税事由", dataIndex = "taxReasons", key = "taxReasons") + private String taxReasons; + + /** + * 出生地 + */ + @TableTitle(title = "出生地", dataIndex = "birthplace", key = "birthplace") + private String birthplace; + // 出生日期 @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @@ -94,6 +111,19 @@ public class EmployeeDeclareFromDTO { @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date dismissDate; + + // 首次入境时间 + @TableTitle(title = "首次入境时间", dataIndex = "entryDate", key = "entryDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date entryDate; + + // 预计离境时间 + @TableTitle(title = "预计离境时间", dataIndex = "departureDate", key = "departureDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date departureDate; + + + // 是否残疾 @TableTitle(title = "是否残疾", dataIndex = "disability", key = "disability") private SalaryOnOffEnum disability; diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java index 76af21666..c56d8db93 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -70,6 +70,12 @@ public class EmployeeDeclareListDTO { @ExcelHead(title = "工号", dataIndex = "jobNum") private String jobNum; + // 国籍 + @SalaryTableColumn(text = "国籍", width = "10%", column = "nationality") + @TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality") + @ExcelHead(title = "国籍", dataIndex = "nationality") + private String nationality; + // 证件类型 @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java index b61c2e713..02df109dd 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -22,75 +22,99 @@ import java.util.Date; @Data public class EmployeeDeclareSaveParam { - //主键id") + //主键id private Long id; /** * 参数错误,个税扣缴义务人id不能为空 */ - //个税扣缴义务人id") + //个税扣缴义务人id private Long taxAgentId; /** * 参数错误,税款所属期参数格式错误 */ - //税款所属期") + //税款所属期 private Date taxCycle; - //员工id") + //员工id private Long employeeId; - //员工类型") + //员工类型 private EmployeeTypeEnum employeeType; - //姓名") + //姓名 private String employeeName; - //工号") + //工号 private String jobNum; - //证件类型") + //国籍 + private String nationality; + + /** + * 出生地 + */ + private String birthplace; + + /** + * 涉税事由, + * 任职受雇 + * 提供临时劳务 + * 转让财产 + * 从事投资和经营活动 + * 其他 + */ + private String taxReasons; + + //证件类型 private CardTypeEnum cardType; - //证件号码") + //证件号码 private String cardNum; - //性别") + //性别 private GenderEnum gender; - //出生日期") + //出生日期 private LocalDate birthday; - //状态") + //状态 private EmploymentStatusEnum employmentStatus; - //手机号码") + //手机号码 private String mobile; - //任职受雇从业类型") + //任职受雇从业类型 private EmploymentTypeEnum employmentType; - //任职受雇从业日期") + //任职受雇从业日期 private LocalDate employmentDate; - //离职日期") + //离职日期 private LocalDate dismissDate; - //是否残疾") + //首次入境时间 + private LocalDate entryDate; + + //预计离境时间 + private LocalDate departureDate; + + //是否残疾 private SalaryOnOffEnum disability; - //残疾证号") + //残疾证号 private String disabilityCardNo; - //是否孤老") + //是否孤老 private SalaryOnOffEnum lonelyOld; - //是否是烈属") + //是否是烈属 private SalaryOnOffEnum martyrDependents; - //烈属证号") + //烈属证号 private String martyrDependentsCardNo; - //是否扣除减除费用") + //是否扣除减除费用 private SalaryOnOffEnum deductExpenses; } diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index 780eb90db..6e954de8f 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -63,6 +63,13 @@ public class EmployeeDeclarePO { @ElogTransform(name = "人员名称") private String employeeName; + /** + * 国籍 + */ + @ElogTransform(name = "国籍") + private String nationality; + + /** * 工号 */ @@ -80,6 +87,18 @@ public class EmployeeDeclarePO { */ @ElogTransform(name = "证件号码") private String cardNum; +// +// /** +// * 其他证件类型 +// */ +// @ElogTransform(name = "其他证件类型") +// private Integer otherCardType; +// +// /** +// * 其他证件号码 +// */ +// @ElogTransform(name = "其他证件号码") +// private String otherCardNum; /** * 性别 @@ -93,6 +112,23 @@ public class EmployeeDeclarePO { @ElogTransform(name = "出生日期") private Date birthday; + /** + * 出生地 + */ + @ElogTransform(name = "出生地") + private String birthplace; + + /** + * 涉税事由, + * 任职受雇 + * 提供临时劳务 + * 转让财产 + * 从事投资和经营活动 + * 其他 + */ + @ElogTransform(name = "涉税事由") + private String taxReasons; + /** * 状态 */ @@ -129,6 +165,19 @@ public class EmployeeDeclarePO { @ElogTransform(name = "离职日期") private Date dismissDate; + + /** + * 首次入境时间 + */ + @ElogTransform(name = "首次入境时间") + private Date entryDate; + + /** + * 预计离境时间 + */ + @ElogTransform(name = "预计离境时间") + private Date departureDate; + /** * 是否残疾 */ @@ -231,17 +280,22 @@ public class EmployeeDeclarePO { ", employeeId=" + employeeId + ", employeeType=" + employeeType + ", employeeName='" + employeeName + '\'' + + ", nationality='" + nationality + '\'' + ", jobNum='" + jobNum + '\'' + ", cardType=" + cardType + ", cardNum='" + cardNum + '\'' + ", gender=" + gender + ", birthday=" + birthday + + ", birthplace='" + birthplace + '\'' + + ", taxReasons='" + taxReasons + '\'' + ", employmentStatus=" + employmentStatus + ", mobile='" + mobile + '\'' + ", employmentType=" + employmentType + ", employmentFirstYear='" + employmentFirstYear + '\'' + ", employmentDate=" + employmentDate + ", dismissDate=" + dismissDate + + ", entryDate=" + entryDate + + ", departureDate=" + departureDate + ", disability=" + disability + ", disabilityCardNo='" + disabilityCardNo + '\'' + ", lonelyOld=" + lonelyOld + diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java index b20fd8d43..ccbf1716c 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -41,7 +41,7 @@ public class TaxAgentTaxReturnPO implements Serializable { /** * 企业名称 */ - private Long taxAgentName; + private String taxAgentName; /** * 税号 diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 4879c1abb..8e1cf9c1a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -6,7 +6,7 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; 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.report.enums.IncomeCategoryEnum; +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; @@ -146,7 +146,7 @@ public class TaxDeclarationRequest { // 姓名 requestParam.put("xm", employeeDeclare.getEmployeeName()); // 证件类型 - requestParam.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + requestParam.put("zzlx", CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel()); // 证件号码 requestParam.put("zzhm", employeeDeclare.getCardNum()); // 所得项目 @@ -162,4 +162,50 @@ public class TaxDeclarationRequest { } return requestParam; } + + + public static Map convert2fjmsdRequestParam(List taxReportColumns, + List taxDeclarations, + List taxDeclarationValues, + List employeeDeclares) { + Map> objRequestParam = Maps.newHashMap(); + Map>> listRequestParam = Maps.newHashMap(); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + for (TaxDeclarationPO taxDeclaration : taxDeclarations) { + List values = taxDeclarationValueMap.get(taxDeclaration.getId()); + for (TaxDeclarationValuePO taxDeclarationValue : values) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); + if (employeeDeclare == null || incomeCategoryEnum == null) { + continue; + } + List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); + Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); + if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_WAGES_AND_SALARIES) { + // 无住所个人正常工资薪金 + List> employeeRequestParams = listRequestParam.computeIfAbsent("wjgzxjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_MONTHLY_BONUS) { + // 全年一次性奖金收入 + List> employeeRequestParams = listRequestParam.computeIfAbsent("wjrysyjjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR) { + // 内退一次性补偿金 + List> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS) { + // 解除劳动合同一次性补偿金 + List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + } + } + + Map requestParam = Maps.newHashMap(); + requestParam.putAll(objRequestParam); + requestParam.putAll(listRequestParam); + return requestParam; + } } diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index fd5a44593..8208035b4 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -92,7 +92,7 @@ public class TaxDeclarationValueList { if (employeeDeclare != null) { dataMap.put(cnKey ? "工号" : "jobNum", employeeDeclare.getJobNum()); dataMap.put(cnKey ? "姓名" : "username", employeeDeclare.getEmployeeName()); - dataMap.put(cnKey ? "证件类型" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "证件类型" : "cardType",CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel() ); dataMap.put(cnKey ? "证件号码" : "cardNum", employeeDeclare.getCardNum()); } else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java index 709b797df..46bd2cf8b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -56,7 +56,7 @@ public class TaxDeclareEmployeeBO { abnormalEmployeeListDTO .setEmployeeName(employeeDeclare.getEmployeeName()) .setJobNum(employeeDeclare.getJobNum()) - .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) + .setCardType(CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel()) .setCardNum(employeeDeclare.getCardNum()) .setDeclareStatus(declareStatusEnum) .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index 673fd4aa8..6e1104507 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.taxdeclaration.param; -import com.engine.salary.util.valid.DataCheck; import lombok.Data; /** @@ -16,4 +15,9 @@ public class TaxDeclareRecordParam { //个税申报记录id") private Long taxDeclareRecordId; + + /** + * 申报类型 + */ + private Integer reportType; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 6a6440435..78707ce84 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -48,21 +48,27 @@ public class TaxDeclareRecordPO implements Serializable { private Date taxCycle; /** * 申报类型 + * * @see TaxDeclareTypeEnum */ + @Deprecated private Integer taxDeclareType; /** * 申报状态 + * * @see TaxDeclareStatusEnum */ + @Deprecated private Integer taxDeclareStatus; /** * 申报失败的错误信息 */ + @Deprecated private String taxDeclareErrorMsg; /** * 请求的requestId */ + @Deprecated private String requestId; /** * 申报的requestId,用于下载申报过程 @@ -74,15 +80,19 @@ public class TaxDeclareRecordPO implements Serializable { private String remark; //应缴金额 + @Deprecated private String taxPayAmount; //实缴总额 + @Deprecated private String taxPaidAmount; //实缴税额(不含滞纳金等) + @Deprecated private String taxPurePaidAmount; //申报人数 + @Deprecated private Integer personNum; /** diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java new file mode 100644 index 000000000..d138cc23e --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java @@ -0,0 +1,75 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclareStatusPO { + /** + * ID + */ + private Long id; + /** + * 申报记录id + */ + private Long taxDeclareRecordId; + /** + * 申报类型 1:综合所得; 2: 分类所得;3:非居民所得;4:限售股所得 + */ + private Integer reportType; + /** + * 供应商第三方系统返回的requestid + */ + private String requestId; + /** + * 申报类型 + */ + private Integer taxDeclareType; + /** + * 申报状态 + */ + private Integer taxDeclareStatus; + /** + * 刷新标识 + */ + private Integer displayUpdateIcon; + /** + * 错误信息 + */ + private String taxDeclareErrorMsg; + /** + * 申报人数 + */ + private Integer personNum; + /** + * 应缴 + */ + private String taxPayAmount; + /** + * 实缴总额 + */ + private String taxPaidAmount; + /** + * 实缴(不含滞纳金) + */ + private String taxPurePaidAmount; + /** + * 记录申报业务id,用于下载内置算税过程 + */ + private String declareRequestId; + /** + * 是否删除 + */ + private Integer deleteType; + + //主键id集合 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java index a7f0de9d3..0378a49ba 100644 --- a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Objects; + /** * 证件类型 *

Copyright: Copyright (c) 2023

@@ -12,7 +14,8 @@ import com.engine.salary.enums.BaseEnum; **/ public enum CardTypeEnum implements BaseEnum { - RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564); + RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564), + FOREIGN_PASSPORT(1, "外国护照", 105564); CardTypeEnum(int value, String defaultLabel, int labelId) { this.value = value; @@ -40,4 +43,13 @@ public enum CardTypeEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static CardTypeEnum getDefaultLabelByValue(Integer value) { + for (CardTypeEnum e : CardTypeEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return RESIDENT_IDENTITY_CARDS; + } } diff --git a/src/com/engine/salary/enums/employeedeclare/TaxReasonEnum.java b/src/com/engine/salary/enums/employeedeclare/TaxReasonEnum.java new file mode 100644 index 000000000..26dc055d8 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/TaxReasonEnum.java @@ -0,0 +1,58 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 涉税事由 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxReasonEnum implements BaseEnum { + + Employment("任职受雇", "任职受雇", 105564), + PROVIDE_TEMPORARY_LABOR_SERVICES("提供临时劳务", "提供临时劳务", 105564), + TRANSFER_OF_PROPERTY("转让财产", "转让财产", 105564), + ENGAGE_IN_INVESTMENT_AND_BUSINESS_ACTIVITIES("从事投资和经营活动", "从事投资和经营活动", 105564), + OTHER("其他", "其他", 105564); + + TaxReasonEnum(String value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private String value; + + private String defaultLabel; + + private int labelId; + + @Override + public String getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static TaxReasonEnum getDefaultLabelByValue(Integer value) { + for (TaxReasonEnum e : TaxReasonEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return Employment; + } +} diff --git a/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java b/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java new file mode 100644 index 000000000..2d99b4ebc --- /dev/null +++ b/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java @@ -0,0 +1,58 @@ +package com.engine.salary.enums.salarysob; + + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 申报类型 1:综合所得; 2: 分类所得;3:非居民所得;4:限售股所得 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum DeclareReportTypeEnum implements BaseEnum { + COMPREHENSIVE_INCOME(1, "综合所得", 100133), + CLASSIFIED_INCOME(2, "分类所得", 86185), + NONRESIDENT_INCOME(3, "非居民所得", 107369), + RESTRICTED_SHARES_INCOME(4, "限售股所得", 90633); + + private int value; + + private String defaultLabel; + + private int labelId; + + DeclareReportTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + + @Override + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + public static DeclareReportTypeEnum parseByValue(Integer value) { + for (DeclareReportTypeEnum targetTypeEnum : DeclareReportTypeEnum.values()) { + if (Objects.equals(targetTypeEnum.getValue(), value)) { + return targetTypeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 71009b4e6..f0564f27c 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,7 +1,7 @@ package com.engine.salary.enums.salarysob; import com.engine.salary.enums.BaseEnum; -import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; @@ -19,7 +19,7 @@ import java.util.*; public enum IncomeCategoryEnum implements BaseEnum { // todo 多语言 - WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487) { + WAGES_AND_SALARIES(1, "0101", "正常工资薪金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); @@ -28,7 +28,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488) { + REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); @@ -37,7 +37,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489) { + ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); @@ -46,7 +46,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", 181936) { + COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); @@ -55,7 +55,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", 181937) { + COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); @@ -64,7 +64,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", 181938) { + INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); @@ -73,7 +73,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - ANNUITY_RECEIPT(110, "0110", "年金领取", 181939) { + ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); @@ -82,7 +82,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", 181940) { + INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); @@ -91,7 +91,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", 181942) { + INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); @@ -100,7 +100,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", 181943) { + REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); @@ -109,7 +109,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", 175330) { + REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); @@ -118,7 +118,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", 181944) { + REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); @@ -127,7 +127,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - ROYALTIES(600, "0600", "特许权使用费所得", 181945) { + ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); @@ -136,25 +136,63 @@ public enum IncomeCategoryEnum implements BaseEnum { return result; } }, - ; + NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { +// List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); +// List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); +// result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }; private int value; private String code; + private DeclareReportTypeEnum reportType; + private String defaultLabel; private int labelId; - IncomeCategoryEnum(int value, String code, String defaultLabel, int labelId) { + IncomeCategoryEnum(int value, String code, String defaultLabel, DeclareReportTypeEnum reportType, int labelId) { this.value = value; this.code = code; this.defaultLabel = defaultLabel; + this.reportType = reportType; this.labelId = labelId; } - public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); @Override public Integer getValue() { @@ -175,6 +213,10 @@ public enum IncomeCategoryEnum implements BaseEnum { return defaultLabel; } + public DeclareReportTypeEnum getReportType() { + return reportType; + } + public static IncomeCategoryEnum parseByValue(Integer value) { for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 008deae95..53f28f353 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -9,6 +9,7 @@ + @@ -20,6 +21,8 @@ + + @@ -34,6 +37,8 @@ + + @@ -47,6 +52,7 @@ , t.employee_type , t.employee_name , t.job_num + , t.nationality , t.card_type , t.card_num , t.gender @@ -57,6 +63,8 @@ , t.employment_first_year , t.employment_date , t.dismiss_date + , t.entry_date + , t.departure_date , t.disability , t.disability_card_no , t.lonely_old @@ -72,6 +80,8 @@ , t.delete_type , t.create_time , t.update_time + , t.birthplace + , t.tax_reasons @@ -118,6 +128,9 @@ AND job_num = #{jobNum} + + AND nationality = #{nationality} + AND card_type = #{cardType} @@ -238,6 +251,9 @@ job_num, + + nationality, + card_type, @@ -268,6 +284,12 @@ dismiss_date, + + entry_date, + + + departure_date, + disability, @@ -313,6 +335,12 @@ update_time, + + birthplace, + + + tax_reasons, + @@ -336,6 +364,9 @@ #{jobNum}, + + #{nationality}, + #{cardType}, @@ -366,6 +397,12 @@ #{dismissDate}, + + #{entryDate}, + + + #{departureDate}, + #{disability}, @@ -411,6 +448,12 @@ #{updateTime}, + + #{birthplace}, + + + #{tax_reasons}, + @@ -420,6 +463,7 @@ ( birthday, card_num, + nationality, card_type, create_time, creator, @@ -430,6 +474,8 @@ disability, disability_card_no, dismiss_date, + entry_date, + departure_date, employee_id, employee_name, employee_type, @@ -449,12 +495,15 @@ tax_agent_id, tax_cycle, tenant_key, - update_time + update_time, + birthplace, + tax_reasons ) VALUES ( #{item.birthday}, #{item.cardNum}, + #{item.nationality}, #{item.cardType}, #{item.createTime}, #{item.creator}, @@ -465,6 +514,8 @@ #{item.disability}, #{item.disabilityCardNo}, #{item.dismissDate}, + #{item.entryDate}, + #{item.departureDate}, #{item.employeeId}, #{item.employeeName}, #{item.employeeType}, @@ -484,7 +535,9 @@ #{item.taxAgentId}, #{item.taxCycle}, #{item.tenantKey}, - #{item.updateTime} + #{item.updateTime}, + #{item.birthplace}, + #{item.taxReasons} ) @@ -494,6 +547,7 @@ INSERT INTO hrsa_employee_declare ( birthday, card_num, + nationality, card_type, create_time, creator, @@ -504,6 +558,8 @@ disability, disability_card_no, dismiss_date, + entry_date, + departure_date, employee_id, employee_name, employee_type, @@ -523,14 +579,17 @@ tax_agent_id, tax_cycle, tenant_key, - update_time + update_time, + birthplace, + tax_reasons ) select #{item.birthday,jdbcType=DATE}, #{item.cardNum,jdbcType=VARCHAR}, - #{item.cardType,jdbcType=}, + #{item.nationality,jdbcType=VARCHAR}, + #{item.cardType,jdbcType=INTEGER}, #{item.createTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, #{item.declareErrorMsg,jdbcType=VARCHAR}, @@ -540,6 +599,8 @@ #{item.disability,jdbcType=INTEGER}, #{item.disabilityCardNo,jdbcType=VARCHAR}, #{item.dismissDate,jdbcType=DATE}, + #{item.entryDate,jdbcType=DATE}, + #{item.departureDate,jdbcType=DATE}, #{item.employeeId,jdbcType=DOUBLE}, #{item.employeeName,jdbcType=VARCHAR}, #{item.employeeType,jdbcType=INTEGER}, @@ -559,7 +620,9 @@ #{item.taxAgentId,jdbcType=DOUBLE}, #{item.taxCycle,jdbcType=DATE}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.updateTime,jdbcType=DATE} + #{item.updateTime,jdbcType=DATE}, + #{item.birthplace,jdbcType=VARCHAR}, + #{item.taxReasons,jdbcType=VARCHAR} from dual @@ -570,6 +633,7 @@ INSERT INTO hrsa_employee_declare ( birthday, card_num, + nationality, card_type, create_time, creator, @@ -580,6 +644,8 @@ disability, disability_card_no, dismiss_date, + entry_date, + departure_date, employee_id, employee_name, employee_type, @@ -599,12 +665,15 @@ tax_agent_id, tax_cycle, tenant_key, - update_time + update_time, + birthplace, + tax_reasons ) VALUES ( #{item.birthday}, #{item.cardNum}, + #{item.nationality}, #{item.cardType}, #{item.createTime}, #{item.creator}, @@ -615,6 +684,8 @@ #{item.disability}, #{item.disabilityCardNo}, #{item.dismissDate}, + #{item.entryDate}, + #{item.departureDate}, #{item.employeeId}, #{item.employeeName}, #{item.employeeType}, @@ -634,7 +705,9 @@ #{item.taxAgentId}, #{item.taxCycle}, #{item.tenantKey}, - #{item.updateTime} + #{item.updateTime}, + #{item.birthplace}, + #{item.taxReasons} ) @@ -650,6 +723,7 @@ employee_type=#{employeeType}, employee_name=#{employeeName}, job_num=#{jobNum}, + nationality=#{nationality}, card_type=#{cardType}, card_num=#{cardNum}, gender=#{gender}, @@ -660,6 +734,8 @@ employment_first_year=#{employmentFirstYear}, employment_date=#{employmentDate}, dismiss_date=#{dismissDate}, + entry_date=#{entryDate}, + departure_date=#{departureDate}, disability=#{disability}, disability_card_no=#{disabilityCardNo}, lonely_old=#{lonelyOld}, @@ -675,6 +751,8 @@ delete_type=#{deleteType}, create_time=#{createTime}, update_time=#{updateTime}, + birthplace=#{birthplace}, + tax_reasons=#{taxReasons}, WHERE id = #{id} AND delete_type = 0 @@ -702,6 +780,9 @@ job_num=#{jobNum}, + + nationality=#{nationality}, + card_type=#{cardType}, @@ -730,6 +811,10 @@ employment_date=#{employmentDate}, dismiss_date=#{dismissDate}, + entry_date=#{entryDate}, + departure_date=#{departureDate}, + birthplace=#{birthplace}, + tax_reasons=#{taxReasons}, disability=#{disability}, diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml index d5ecfdbe5..59ce83251 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -19,6 +19,7 @@ + @@ -401,8 +402,11 @@ diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.java new file mode 100644 index 000000000..21c269d52 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareStatusMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxDeclareStatusPO taxDeclareStatus); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclareStatusPO getById(Long id); + + TaxDeclareStatusPO getDeclareStatus(@Param("taxDeclareRecordId")Long taxDeclareRecordId,@Param("reportType")Integer reportType); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareStatus 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareStatus 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 修改,忽略null字段 + * + * @param taxDeclareStatus 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 删除记录 + * + * @param taxDeclareStatus 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.xml new file mode 100644 index 000000000..8257acf88 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.xml @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.tax_declare_record_id + , t.report_type + , t.request_id + , t.tax_declare_type + , t.tax_declare_status + , t.display_update_icon + , t.tax_declare_error_msg + , t.person_num + , t.tax_pay_amount + , t.tax_paid_amount + , t.tax_pure_paid_amount + , t.declare_request_id + , t.delete_type + + + + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_status + + + + id, + + + tax_declare_record_id, + + + report_type, + + + request_id, + + + tax_declare_type, + + + tax_declare_status, + + + display_update_icon, + + + tax_declare_error_msg, + + + person_num, + + + tax_pay_amount, + + + tax_paid_amount, + + + tax_pure_paid_amount, + + + declare_request_id, + + + delete_type, + + + + + #{id}, + + + #{taxDeclareRecordId}, + + + #{reportType}, + + + #{requestId}, + + + #{taxDeclareType}, + + + #{taxDeclareStatus}, + + + #{displayUpdateIcon}, + + + #{taxDeclareErrorMsg}, + + + #{personNum}, + + + #{taxPayAmount}, + + + #{taxPaidAmount}, + + + #{taxPurePaidAmount}, + + + #{declareRequestId}, + + + #{deleteType}, + + + + + + + + + UPDATE hrsa_tax_declare_status + + tax_declare_record_id=#{taxDeclareRecordId}, + report_type=#{reportType}, + request_id=#{requestId}, + tax_declare_type=#{taxDeclareType}, + tax_declare_status=#{taxDeclareStatus}, + display_update_icon=#{displayUpdateIcon}, + tax_declare_error_msg=#{taxDeclareErrorMsg}, + person_num=#{personNum}, + tax_pay_amount=#{taxPayAmount}, + tax_paid_amount=#{taxPaidAmount}, + tax_pure_paid_amount=#{taxPurePaidAmount}, + declare_request_id=#{declareRequestId}, + delete_type=#{deleteType}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_status + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + report_type=#{reportType}, + + + request_id=#{requestId}, + + + tax_declare_type=#{taxDeclareType}, + + + tax_declare_status=#{taxDeclareStatus}, + + + display_update_icon=#{displayUpdateIcon}, + + + tax_declare_error_msg=#{taxDeclareErrorMsg}, + + + person_num=#{personNum}, + + + tax_pay_amount=#{taxPayAmount}, + + + tax_paid_amount=#{taxPaidAmount}, + + + tax_pure_paid_amount=#{taxPurePaidAmount}, + + + declare_request_id=#{declareRequestId}, + + + delete_type=#{deleteType}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_status + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_status + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index bd7a500da..532affabd 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -1,6 +1,6 @@ package com.engine.salary.remote.tax.client; -import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; +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; diff --git a/src/com/engine/salary/remote/tax/client/PaymentClient.java b/src/com/engine/salary/remote/tax/client/PaymentClient.java new file mode 100644 index 000000000..8c9571071 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/PaymentClient.java @@ -0,0 +1,62 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.remote.tax.request.payment.QueryArrearageRequest; +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SingnatureData; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +@Slf4j +public class PaymentClient extends TaxBaseClient { + public PaymentClient(Long taxAgentId) { + super(taxAgentId); + } + + public void queryArrearage(String taxCycle) { + QueryArrearageRequest queryArrearageRequest = new QueryArrearageRequest(); + queryArrearageRequest.setNsrsbh(returnPO.getTaxCode()); + queryArrearageRequest.setQymc(returnPO.getTaxAgentName()); + queryArrearageRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + queryArrearageRequest.setAreaid(returnPO.getAreaCode()); + queryArrearageRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + queryArrearageRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + queryArrearageRequest.setJmsbmm("0"); + queryArrearageRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + queryArrearageRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + queryArrearageRequest.setJmsmmm("0"); + queryArrearageRequest.setMmlx("" + returnPO.getPasswordType()); + + queryArrearageRequest.setBizNo(UUID.randomUUID().toString()); + queryArrearageRequest.setSkssq(taxCycle); + + + String reqJson = JsonUtil.toJsonString(queryArrearageRequest); + + String url = super.apiConfig.getHost() + "/gateway/iit/payment/queryArrearage"; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + System.out.println(res); + + getArrearageQueryFeedback(""); + } + + public void getArrearageQueryFeedback(String requestId) { + Map params = new HashMap<>(1); + params.put("requestId", "43dd5abf686946f59cfea50a51f8183a"); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String url = super.apiConfig.getHost() + "/gateway/iit/payment/getArrearageQueryFeedback"; + String res = HttpUtil.getRequest(url, header, params); + + System.out.println(res); + } + +} diff --git a/src/com/engine/salary/remote/tax/request/payment/QueryArrearageRequest.java b/src/com/engine/salary/remote/tax/request/payment/QueryArrearageRequest.java new file mode 100644 index 000000000..e61c59ec2 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/payment/QueryArrearageRequest.java @@ -0,0 +1,64 @@ +package com.engine.salary.remote.tax.request.payment; + +import lombok.Data; + +@Data +public class QueryArrearageRequest { + /** + * 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID + */ + private String bizNo; + /** + * 企业名称 必填:是 代报企业全称 + */ + private String qymc; + /** + * 密码类型 必填:否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码 + */ + private String mmlx; + /** + * 实名账号 必填:选择必填 当mmlx=2时,必填 + */ + private String smzh; + /** + * 实名密码 必填:选择必填 当mmlx=2时,必填 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明 + */ + private String jmsmmm; + + /** + * 登记序号 必填:否 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 税款所属期 必填:是 默认为当前月份,格式YYYYMM + */ + private String skssq; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:否 分部门代报时必传 + */ + private String bmbh; + /** + * 部门名称 必填:否 + */ + private String bmmc; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; +} diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java similarity index 99% rename from src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java rename to src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java index 43995fb0c..3abdd210b 100644 --- a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java @@ -1,4 +1,4 @@ -package com.engine.salary.remote.tax.response.employee; +package com.engine.salary.remote.tax.response.declare; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.entity.taxpayment.response.BaseResponse; @@ -54,7 +54,7 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { // /** // * 非居民所得 必填:是 见非居民所得计算结果 // */ -// private 对象 fjmsd; +// private fjmsd fjmsd; // /** // * 限售股所得 必填:是 见限售股所得计算结果 // */ diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 25906560f..0a78b5421 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -7,6 +7,7 @@ import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryPara import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -131,14 +132,18 @@ public interface TaxDeclareRecordService { * * @param id */ - void declare(Long id); + void declare(Long id, Integer reportType); + + TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType); + + List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId); /** * 个税申报获取反馈 * * @param id */ - void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate); + void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate); /** @@ -156,21 +161,21 @@ public interface TaxDeclareRecordService { * * @param id */ - void cancelDeclare(Long id); + void cancelDeclare(Long id, Integer reportType); /** * 获取作废反馈 * * @param id */ - void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate); + void getCancelFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate); /** * 更正申报 * * @param id */ - void updateDeclare(Long id); + void updateDeclare(Long id, Integer reportType); /** * 撤销申报 @@ -187,7 +192,6 @@ public interface TaxDeclareRecordService { String queryDeclareStatus(Long id); - void updateById(TaxDeclareRecordPO taxDeclareRecord); } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 96546a952..a418082d6 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -48,7 +48,6 @@ import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; -import com.engine.salary.util.valid.SalaryCardUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -56,7 +55,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.transaction.annotation.Transactional; import weaver.general.Util; import weaver.hrm.User; @@ -195,16 +193,19 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setTaxCycle(saveParam.getTaxCycle()); employeeDeclare.setEmployeeName(saveParam.getEmployeeName()); employeeDeclare.setJobNum(saveParam.getJobNum()); - employeeDeclare.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); + employeeDeclare.setNationality(saveParam.getNationality()); + employeeDeclare.setCardType(saveParam.getCardType().getValue()); employeeDeclare.setCardNum(saveParam.getCardNum().toUpperCase()); - employeeDeclare.setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()); - employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))); + employeeDeclare.setGender(saveParam.getGender().getValue()); + employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(saveParam.getBirthday())); employeeDeclare.setEmploymentStatus(saveParam.getEmploymentStatus().getValue()); employeeDeclare.setMobile(saveParam.getMobile()); employeeDeclare.setEmploymentType(saveParam.getEmploymentType().getValue()); employeeDeclare.setEmploymentFirstYear(""); employeeDeclare.setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate())); employeeDeclare.setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate())); + employeeDeclare.setEntryDate(SalaryDateUtil.localDateToDate(saveParam.getEntryDate())); + employeeDeclare.setDepartureDate(SalaryDateUtil.localDateToDate(saveParam.getDepartureDate())); employeeDeclare.setDisability(saveParam.getDisability().getValue()); employeeDeclare.setDisabilityCardNo(saveParam.getDisabilityCardNo()); employeeDeclare.setLonelyOld(saveParam.getLonelyOld().getValue()); @@ -445,7 +446,6 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } @Override - @Transactional(rollbackFor = Exception.class) public void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId) { // 查询本月已有的需要报送的人员 List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); @@ -510,20 +510,15 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla .setEmployeeDeclares(employeeDeclares) .setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares) .setSalaryArchives(salaryArchivePOS) -// .setEmployeeInfos(employeeInfos) .setHrmEmployeeComInfos(employeeInfos); -// .setSimpleUserInfos(newSimpleUserInfos) -// .setExtEmployees(newExtEmployees) EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId); // 保存新增的人员 if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) { result.getNewEmployeeDeclares().forEach(getEmployeeDeclareMapper()::insertIgnoreNull); -// getEmployeeDeclareMapper().batchInsert((result.getNewEmployeeDeclares())); } // 更新已有人员 if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) { result.getEmployeeDeclares().forEach(getEmployeeDeclareMapper()::updateIgnoreNull); -// updateBatchById(result.getEmployeeDeclares()); } // 记录日志 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 706a31334..69d9ecb89 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -34,7 +34,7 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.remote.tax.client.DeclareClient; -import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.service.*; import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 96e4456e2..89a7fa3c0 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -2,12 +2,12 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.YearMonthRange; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SzyhApiConstant; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -39,14 +39,16 @@ import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; 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.employee.GetDeclareTaxResultFeedbackResponse; +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.*; @@ -86,6 +88,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); } + private TaxDeclareStatusMapper getTaxDeclareStatusMapper() { + return MapperProxyFactory.getProxy(TaxDeclareStatusMapper.class); + } + private TaxDeclarationService getTaxDeclarationService(User user) { return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } @@ -319,20 +325,20 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe //更新核算记录状态 getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); - // 记录日志 - for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); - loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表")); - loggerContext.setNewValues(taxDeclareRecord); - SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); - } + // 记录日志 + for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "生成个税申报表")); + loggerContext.setNewValues(taxDeclareRecord); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } } @Override @@ -399,8 +405,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .replace("{0}", taxAgent.getName()) .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "刷新个税申报数据")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "刷新个税申报数据")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "刷新个税申报数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "刷新个税申报数据")); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @@ -609,35 +615,56 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe }); // 记录日志 - writeDeleteLog(taxDeclareRecords); + writeDeleteLog(taxDeclareRecords); } - private void writeDeleteLog(List taxDeclareRecords) { - // 记录日志 - List taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); - Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); - for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); - loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); - SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); - } - } + private void writeDeleteLog(List taxDeclareRecords) { + // 记录日志 + List taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + } @Override - public void declare(Long id) { + public void declare(Long id, Integer reportType) { + + DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType); + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + if (declareStatus == null) { + declareStatus = TaxDeclareStatusPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(id) + .reportType(reportType) + .taxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) + .taxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()) + .taxDeclareErrorMsg("") + .personNum(0) + .taxPayAmount("") + .taxPaidAmount("") + .taxPurePaidAmount("") + .deleteType(0) + .build(); + getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); + } + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { + if (StringUtils.isNotEmpty(declareStatus.getRequestId()) && Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160526, "目前正处于申报中,请稍后片刻再点击「申报反馈」获取结果")); } - if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) { + if (StringUtils.isNotEmpty(declareStatus.getRequestId()) && Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160527, "目前正处于作废申报中,请稍后片刻再点击「作废反馈」获取结果")); } @@ -674,9 +701,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 人员列表 List> employeeDeclareParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); requestParam.put("rylb", employeeDeclareParam); - // 综合所得 - Map taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); - requestParam.put("zhsd", taxDeclarationParam); + + if (declareReportType == DeclareReportTypeEnum.COMPREHENSIVE_INCOME) { + // 综合所得 + Map taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); + requestParam.put("zhsd", taxDeclarationParam); + } + + if (declareReportType == DeclareReportTypeEnum.NONRESIDENT_INCOME) { + //非居民所得代扣代缴 fjmsd + Map fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); + requestParam.put("fjmsd", fjmsdRequestParam); + } + String reqJson = JsonUtil.toJsonString(requestParam); String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX; Map params = new HashMap<>(1); @@ -690,44 +727,57 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); } - // 更新个税申报记录 - taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); - taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); - taxDeclareRecord.setUpdateTime(new Date()); - //清除之前的错误 - taxDeclareRecord.setTaxDeclareErrorMsg(""); - getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + // 删除个税申报申报失败的数据 getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + //更新个税申报状态 + declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); + declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); + declareStatus.setTaxDeclareErrorMsg(""); + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); - loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); - SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @Override - public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) { + public TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType) { + return getTaxDeclareStatusMapper().getDeclareStatus(taxDeclareRecordId, reportType); + } + + @Override + public List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) { + return getTaxDeclareStatusMapper().listSome(TaxDeclareStatusPO.builder().taxDeclareRecordId(taxDeclareRecordId).build()); + } + + @Override + public void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - if (StringUtils.isEmpty(taxDeclareRecord.getRequestId()) || !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + + if (StringUtils.isEmpty(declareStatus.getRequestId()) || !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156496, "请先点击「在线申报」后再点击「申报反馈」获取申报结果")); } TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX_FEEDBACK; - ImmutableMap requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); + ImmutableMap requestParam = ImmutableMap.of("requestId", declareStatus.getRequestId(), "reportType", reportType + ""); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, requestParam); - log.info("申报反馈返回数据: {}, taxDeclareRecord: {}", res, JsonUtil.toJsonString(taxDeclareRecord)); + log.info("申报反馈返回数据: {}, taxDeclareRecord: {},declareStatus :{}", res, JsonUtil.toJsonString(taxDeclareRecord), JsonUtil.toJsonString(declareStatus)); DeclareTaxFeedbackResponse declareTaxFeedbackResponse = JsonUtil.parseObject(res, DeclareTaxFeedbackResponse.class); if (Objects.isNull(declareTaxFeedbackResponse) || Objects.isNull(declareTaxFeedbackResponse.getHead())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); @@ -777,14 +827,13 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } } - taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg)); + declareStatus.setTaxDeclareErrorMsg(String.join(",", errorMsg)); } else { //清除之前的错误 - taxDeclareRecord.setTaxDeclareErrorMsg(""); + declareStatus.setTaxDeclareErrorMsg(""); } // 申报状态 - Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), -1); - TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(declareStatus, TaxDeclareStatusEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), -1), TaxDeclareStatusEnum.class); if (taxDeclareStatusEnum == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } @@ -792,33 +841,33 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { taxDeclareStatusEnum = TaxDeclareStatusEnum.DECLARE_FAIL; } - taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); // 申报类型 - taxDeclareRecord.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); - taxDeclareRecord.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); - taxDeclareRecord.setDeclareRequestId(taxDeclareRecord.getRequestId()); - taxDeclareRecord.setRequestId(""); - taxDeclareRecord.setUpdateTime(new Date()); - BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); - BigDecimal payAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); + declareStatus.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); + declareStatus.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); + declareStatus.setDeclareRequestId(declareStatus.getRequestId()); + declareStatus.setRequestId(""); + BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount()); + BigDecimal payAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount()); if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) { // 如果是已缴纳状态,则更新已缴纳金额,判断是否需要线下退税 if (purePaidAmount.compareTo(payAmount) > 0) { - taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); - BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()); + declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount()); taxDeclarationRate.setMsg(String.format(SalaryI18nUtil.getI18nLabel(183789, "应缴税额(不含滞纳金等):%s元,已缴金额(可能含滞纳金等):%s元,当前已缴款金额大于应缴纳金额,请线下前往办税大厅办理退款。"), payAmount, paidAmount)); taxDeclarationRate.setMsgPersist(true); } else if (purePaidAmount.compareTo(payAmount) == 0) { - taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString()); + declareStatus.setTaxPayAmount(BigDecimal.ZERO.toString()); } else { throw new SalaryRunTimeException("缴款数据异常,请处理后重试"); } } else if (TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.equals(taxDeclareStatusEnum)) { // 如果不是已缴纳状态,则减掉之前的已缴纳金额去更新应缴纳金额 - taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); } - // 更新个税申报记录 - getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + //更新申报状态 + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + // 如果申报失败 if (CollectionUtils.isNotEmpty(taxDeclareFails)) { getTaxDeclareFailService(user).saveBatch(taxDeclareFails); @@ -832,29 +881,31 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); - loggerContext.setUser(user); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报反馈")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报反馈")); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报反馈")); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @Override - public void cancelDeclare(Long id) { + public void cancelDeclare(Long id, Integer reportType) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); // 更正申报成功后不能作废 - if (Objects.equals(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) { + if (Objects.equals(declareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182701, "更正申报后不允许作废")); } // 只有申报成功,无需缴款/申报成功,未缴款的状态才能作废 - if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { + if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废")); } // 供应商信息 @@ -864,7 +915,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 税款所属期 requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 申报类型 - requestParam.put("sblx", "1"); + requestParam.put("sblx", reportType + ""); // 作废银联缴款凭证 // taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); // 是否清空所得 @@ -883,37 +934,41 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); } - // 更新个税申报记录 - taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); - taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); - taxDeclareRecord.setUpdateTime(new Date()); - getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + // 更新个税申报状态 + declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); + declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); - // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报作废")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报作废")); + // 记录日志 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "申报作废")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "申报作废")); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @Override - public void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) { + public void getCancelFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(taxDeclareRecord.getRequestId())) { + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + + + if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(declareStatus.getRequestId())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156500, "请先点击「作废申报」后再来点击「申报反馈」按钮获取结果")); } + // 供应商信息 TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK; - ImmutableMap requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); + ImmutableMap requestParam = ImmutableMap.of("requestId", declareStatus.getRequestId(), "reportType", reportType + ""); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, requestParam); log.info("作废反馈返回数据:" + res); @@ -935,22 +990,23 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (taxDeclareStatusEnum == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } - taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); - taxDeclareRecord.setRequestId(""); - taxDeclareRecord.setUpdateTime(new Date()); - getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + + //更新个税申报状态 + declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + declareStatus.setRequestId(""); + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); - loggerContext.setUser(user); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈")); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "获取申报作废的反馈")); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @@ -987,11 +1043,14 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe @Override - public void updateDeclare(Long id) { + public void updateDeclare(Long id, Integer reportType) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + + List taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); - if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) { + if (!taxDeclareStatusEnumValueList.contains(declareStatus.getTaxDeclareStatus())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "对不起,只有申报成功后才允许更正申报")); } // 供应商信息 @@ -1001,7 +1060,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 税款所属期 requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 申报类型 - requestParam.put("sblx", "1"); + requestParam.put("sblx", reportType + ""); // 请求 String reqJson = JsonUtil.toJsonString(requestParam); log.info("更正申报请求数据:" + reqJson); @@ -1017,23 +1076,24 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg()); } - taxDeclareRecord.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); - taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); - taxDeclareRecord.setRequestId(""); - taxDeclareRecord.setUpdateTime(new Date()); - getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + + //更新申报状态 + declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); + declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); + declareStatus.setRequestId(""); + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); // 记录日志 - TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") - .replace("{0}", taxAgent.getName()) - .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); - loggerContext.setUser(user); - loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更正申报")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更正申报")); + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人「{0}」税款所属期「{1}」") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更正申报")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更正申报")); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } @@ -1076,17 +1136,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 记录日志 - // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); - // LoggerContext loggerContext = new LoggerContext<>(); - // loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); - // loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") - // .replace("{0}", taxAgent.getName()) - // .replace("{1}", taxDeclareRecord.getTaxCycle())); - // loggerContext.setOperator(Util.null2String(employeeId)); - // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - // loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); - // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); - // taxDeclarationLoggerTemplate.write(loggerContext); + // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + // LoggerContext loggerContext = new LoggerContext<>(); + // loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + // loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") + // .replace("{0}", taxAgent.getName()) + // .replace("{1}", taxDeclareRecord.getTaxCycle())); + // loggerContext.setOperator(Util.null2String(employeeId)); + // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + // loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); + // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); + // taxDeclarationLoggerTemplate.write(loggerContext); } @Override diff --git a/src/com/engine/salary/util/valid/SalaryCardUtil.java b/src/com/engine/salary/util/valid/SalaryCardUtil.java index d8794ecf4..d0dc2bf9e 100644 --- a/src/com/engine/salary/util/valid/SalaryCardUtil.java +++ b/src/com/engine/salary/util/valid/SalaryCardUtil.java @@ -4,7 +4,11 @@ import com.engine.salary.enums.employeedeclare.GenderEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.util.SalaryI18nUtil; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.LocalDate; +import java.util.Calendar; +import java.util.Date; import java.util.regex.Pattern; /** @@ -16,34 +20,11 @@ import java.util.regex.Pattern; * @version 1.0 **/ public class SalaryCardUtil { - - /** - * 15位的身份证长度 - */ - public static final String CARD_15 = "^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}$"; - /** - * 18位的身份证长度 - */ - public static final String CARD_18 = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$"; /** * 手机号码 */ public static final String MOBILE = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$"; - /** - * 校验身份证号码 - * - * @param idNumber - */ - public static boolean checkIdNum(String idNumber) { - Pattern pattern_15 = Pattern.compile(CARD_15); - Pattern pattern_18 = Pattern.compile(CARD_18); - if (!pattern_15.matcher(idNumber).find() && !pattern_18.matcher(idNumber).find()) { - return false; - } - return true; - } - /** * 校验手机号码 * @@ -107,4 +88,387 @@ public class SalaryCardUtil { } return LocalDate.parse(year + "-" + month + "-" + day); } + + + /** + *
+     * 省、直辖市代码表:
+     *     11 : 北京  12 : 天津  13 : 河北       14 : 山西  15 : 内蒙古
+     *     21 : 辽宁  22 : 吉林  23 : 黑龙江  31 : 上海  32 : 江苏
+     *     33 : 浙江  34 : 安徽  35 : 福建       36 : 江西  37 : 山东
+     *     41 : 河南  42 : 湖北  43 : 湖南       44 : 广东  45 : 广西      46 : 海南
+     *     50 : 重庆  51 : 四川  52 : 贵州       53 : 云南  54 : 西藏
+     *     61 : 陕西  62 : 甘肃  63 : 青海       64 : 宁夏  65 : 新疆
+     *     71 : 台湾
+     *     81 : 香港  82 : 澳门
+     *     91 : 国外
+     * 
+ */ + private static String[] cityCode = { "11", "12", "13", "14", "15", "21", + "22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42", + "43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62", + "63", "64", "65", "71", "81", "82", "91" }; + + /** + * 每位加权因子 + */ + private static int power[] = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, + 8, 4, 2 }; + + /** + * 验证所有的身份证的合法性 + * + * @param idcard + * 身份证 + * @return 合法返回true,否则返回false + */ + public static boolean checkIdNum(String idcard) { + if (idcard == null || "".equals(idcard)) { + return false; + } + if (idcard.length() == 15) { + return validate15IDCard(idcard); + } + if(idcard.length()==18) { + return validate18Idcard(idcard); + } + return false; + + } + + /** + *

+ * 判断18位身份证的合法性 + *

+ * 根据〖中华人民共和国国家标准GB11643-1999〗中有关公民身份号码的规定,公民身份号码是特征组合码,由十七位数字本体码和一位数字校验码组成。 + * 排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。 + *

+ * 顺序码: 表示在同一地址码所标识的区域范围内,对同年、同月、同 日出生的人编定的顺序号,顺序码的奇数分配给男性,偶数分配 给女性。 + *

+ *

+ * 1.前1、2位数字表示:所在省份的代码; 2.第3、4位数字表示:所在城市的代码; 3.第5、6位数字表示:所在区县的代码; + * 4.第7~14位数字表示:出生年、月、日; 5.第15、16位数字表示:所在地的派出所的代码; + * 6.第17位数字表示性别:奇数表示男性,偶数表示女性; + * 7.第18位数字是校检码:也有的说是个人信息码,一般是随计算机的随机产生,用来检验身份证的正确性。校检码可以是0~9的数字,有时也用x表示。 + *

+ *

+ * 第十八位数字(校验码)的计算方法为: 1.将前面的身份证号码17位数分别乘以不同的系数。从第一位到第十七位的系数分别为:7 9 10 5 8 4 + * 2 1 6 3 7 9 10 5 8 4 2 + *

+ *

+ * 2.将这17位数字和系数相乘的结果相加。 + *

+ *

+ * 3.用加出来和除以11,看余数是多少 + *

+ * 4.余数只可能有0 1 2 3 4 5 6 7 8 9 10这11个数字。其分别对应的最后一位身份证的号码为1 0 X 9 8 7 6 5 4 3 + * 2。 + *

+ * 5.通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2。 + *

+ * + * @param idcard + * @return + */ + public static boolean validate18Idcard(String idcard) { + if (idcard == null) { + return false; + } + + // 非18位为假 + int s=18; + if (idcard.length() != s) { + return false; + } + // 获取前17位 + String idcard17 = idcard.substring(0, 17); + + // 前17位全部为数字 + if (!isDigital(idcard17)) { + return false; + } + + String provinceid = idcard.substring(0, 2); + // 校验省份 + if (!checkProvinceid(provinceid)) { + return false; + } + + // 校验出生日期 + String birthday = idcard.substring(6, 14); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + + try { + Date birthDate = sdf.parse(birthday); + String tmpDate = sdf.format(birthDate); + // 出生年月日不正确 + if (!tmpDate.equals(birthday)) { + return false; + } + + } catch (ParseException e1) { + + return false; + } + + // 获取第18位 + String idcard18Code = idcard.substring(17, 18); + + char c[] = idcard17.toCharArray(); + + int bit[] = converCharToInt(c); + + int sum17 = 0; + + sum17 = getPowerSum(bit); + + // 将和值与11取模得到余数进行校验码判断 + String checkCode = getCheckCodeBySum(sum17); + if (null == checkCode) { + return false; + } + // 将身份证的第18位与算出来的校码进行匹配,不相等就为假 + if (!idcard18Code.equalsIgnoreCase(checkCode)) { + return false; + } + //System.out.println("正确"); + return true; + } + + /** + * 校验15位身份证 + * + *
+     * 只校验省份和出生年月日
+     * 
+ * + * @param idcard + * @return + */ + public static boolean validate15IDCard(String idcard) { + if (idcard == null) { + return false; + } + // 非15位为假 + int s=15; + if (idcard.length() != s) { + return false; + } + + // 15全部为数字 + if (!isDigital(idcard)) { + return false; + } + + String provinceid = idcard.substring(0, 2); + // 校验省份 + if (!checkProvinceid(provinceid)) { + return false; + } + + String birthday = idcard.substring(6, 12); + + SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); + + try { + Date birthDate = sdf.parse(birthday); + String tmpDate = sdf.format(birthDate); + // 身份证日期错误 + if (!tmpDate.equals(birthday)) { + return false; + } + + } catch (ParseException e1) { + + return false; + } + + return true; + } + + /** + * 将15位的身份证转成18位身份证 + * + * @param idcard + * @return + */ + public static String convertIdcarBy15bit(String idcard) { + if (idcard == null) { + return null; + } + + // 非15位身份证 + int s=15; + if (idcard.length() != s) { + return null; + } + + // 15全部为数字 + if (!isDigital(idcard)) { + return null; + } + + String provinceid = idcard.substring(0, 2); + // 校验省份 + if (!checkProvinceid(provinceid)) { + return null; + } + + String birthday = idcard.substring(6, 12); + + SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); + + Date birthdate = null; + try { + birthdate = sdf.parse(birthday); + String tmpDate = sdf.format(birthdate); + // 身份证日期错误 + if (!tmpDate.equals(birthday)) { + return null; + } + + } catch (ParseException e1) { + return null; + } + + Calendar cday = Calendar.getInstance(); + cday.setTime(birthdate); + String year = String.valueOf(cday.get(Calendar.YEAR)); + + String idcard17 = idcard.substring(0, 6) + year + idcard.substring(8); + + char c[] = idcard17.toCharArray(); + String checkCode = ""; + + // 将字符数组转为整型数组 + int bit[] = converCharToInt(c); + + int sum17 = 0; + sum17 = getPowerSum(bit); + + // 获取和值与11取模得到余数进行校验码 + checkCode = getCheckCodeBySum(sum17); + + // 获取不到校验位 + if (null == checkCode) { + return null; + } + // 将前17位与第18位校验码拼接 + idcard17 += checkCode; + return idcard17; + } + + /** + * 校验省份 + * + * @param provinceid + * @return 合法返回TRUE,否则返回FALSE + */ + private static boolean checkProvinceid(String provinceid) { + for (String id : cityCode) { + if (id.equals(provinceid)) { + return true; + } + } + return false; + } + + /** + * 数字验证 + * + * @param str + * @return + */ + private static boolean isDigital(String str) { + return str.matches("^[0-9]*$"); + } + + /** + * 将身份证的每位和对应位的加权因子相乘之后,再得到和值 + * + * @param bit + * @return + */ + private static int getPowerSum(int[] bit) { + + int sum = 0; + + if (power.length != bit.length) { + return sum; + } + + for (int i = 0; i < bit.length; i++) { + for (int j = 0; j < power.length; j++) { + if (i == j) { + sum = sum + bit[i] * power[j]; + } + } + } + return sum; + } + + /** + * 将和值与11取模得到余数进行校验码判断 + * + * @param sum17 + * @param sum17 + * @return 校验位 + */ + private static String getCheckCodeBySum(int sum17) { + String checkCode = null; + switch (sum17 % 11) { + case 10: + checkCode = "2"; + break; + case 9: + checkCode = "3"; + break; + case 8: + checkCode = "4"; + break; + case 7: + checkCode = "5"; + break; + case 6: + checkCode = "6"; + break; + case 5: + checkCode = "7"; + break; + case 4: + checkCode = "8"; + break; + case 3: + checkCode = "9"; + break; + case 2: + checkCode = "x"; + break; + case 1: + checkCode = "0"; + break; + case 0: + checkCode = "1"; + break; + default: + } + return checkCode; + } + + /** + * 将字符数组转为整型数组 + * + * @param c + * @return + * @throws NumberFormatException + */ + private static int[] converCharToInt(char[] c) throws NumberFormatException { + int[] a = new int[c.length]; + int k = 0; + for (char temp : c) { + a[k++] = Integer.parseInt(String.valueOf(temp)); + } + return a; + } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index bc0eb3f65..3586123dd 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -217,7 +217,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::declare, taxDeclareRecordParam.getTaxDeclareRecordId()); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::declare, taxDeclareRecordParam); } /** @@ -231,7 +231,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam.getTaxDeclareRecordId()); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam); } /** @@ -291,7 +291,7 @@ public class TaxDeclarationController { @POST @Path("/contrast") @Produces(MediaType.APPLICATION_JSON) - public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody ContrastQueryParam param) { + public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param); } @@ -340,7 +340,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String cancel(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelDeclare, taxDeclareRecordParam.getTaxDeclareRecordId()); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelDeclare, taxDeclareRecordParam); } /** @@ -354,7 +354,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String getCancelFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getCancelFeedback, taxDeclareRecordParam.getTaxDeclareRecordId()); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getCancelFeedback, taxDeclareRecordParam); } /** @@ -368,7 +368,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String updateDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam.getTaxDeclareRecordId()); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam); } /** @@ -508,8 +508,6 @@ public class TaxDeclarationController { } - - /** * 个税申报表详情列表 * diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 39623bb5a..65ad5b8ef 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -279,8 +279,12 @@ public class EmployeeDeclareWrapper extends Service { .setEmployee(Collections.singletonList(employeeMap)) .setEmployeeName(employeeDeclare.getEmployeeName()) .setJobNum(employeeDeclare.getJobNum()) - .setNationality(SalaryI18nUtil.getI18nLabel(94731, "中国")) - .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS) + .setNationality(employeeDeclare.getNationality()) + .setNationality(employeeDeclare.getNationality()) + .setNationality(employeeDeclare.getNationality()) + .setEntryDate(employeeDeclare.getEntryDate()) + .setDepartureDate(employeeDeclare.getDepartureDate()) + .setCardType(CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType())) .setCardNum(employeeDeclare.getCardNum()) .setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class)) .setBirthday(employeeDeclare.getBirthday()) diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 9e115aa32..41f17f5e5 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -2,9 +2,9 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.config.SalaryElogConfig; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -27,12 +27,12 @@ import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; -import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; @@ -354,6 +354,7 @@ public class TaxDeclareRecordWrapper extends Service { TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); + return TaxDeclarationInfoDTO.builder() .salaryMonth(taxDeclareRecord.getSalaryMonth()) .taxCycle(taxDeclareRecord.getTaxCycle()) @@ -432,9 +433,10 @@ public class TaxDeclareRecordWrapper extends Service { /** * 申报 * - * @param id + * @param */ - public String declare(Long id) { + public String declare(TaxDeclareRecordParam taxDeclareRecordParam) { + Long id = taxDeclareRecordParam.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); @@ -443,7 +445,7 @@ public class TaxDeclareRecordWrapper extends Service { @Override public void execute() { try { - getTaxDeclareRecordService(user).declare(id); + getTaxDeclareRecordService(user).declare(id, taxDeclareRecordParam.getReportType()); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -461,10 +463,9 @@ public class TaxDeclareRecordWrapper extends Service { /** * 获取申报反馈 - * - * @param id */ - public String getDeclareFeedback(Long id) { + public String getDeclareFeedback(TaxDeclareRecordParam param) { + Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(182680, "获取申报反馈")); @@ -473,7 +474,7 @@ public class TaxDeclareRecordWrapper extends Service { @Override public void execute() { try { - getTaxDeclareRecordService(user).getDeclareFeedback(id, taxDeclarationRate); + getTaxDeclareRecordService(user).getDeclareFeedback(id, param.getReportType(), taxDeclarationRate); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -501,10 +502,9 @@ public class TaxDeclareRecordWrapper extends Service { /** * 作废 - * - * @param id */ - public String cancelDeclare(Long id) { + public String cancelDeclare(TaxDeclareRecordParam param) { + Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(158842, "作废申报")); @@ -513,7 +513,7 @@ public class TaxDeclareRecordWrapper extends Service { @Override public void execute() { try { - getTaxDeclareRecordService(user).cancelDeclare(id); + getTaxDeclareRecordService(user).cancelDeclare(id, param.getReportType()); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -531,10 +531,9 @@ public class TaxDeclareRecordWrapper extends Service { /** * 获取作废反馈 - * - * @param id */ - public String getCancelFeedback(Long id) { + public String getCancelFeedback(TaxDeclareRecordParam param) { + Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(182681, "获取作废申报反馈")); @@ -543,7 +542,7 @@ public class TaxDeclareRecordWrapper extends Service { @Override public void execute() { try { - getTaxDeclareRecordService(user).getCancelFeedback(id, taxDeclarationRate); + getTaxDeclareRecordService(user).getCancelFeedback(id, param.getReportType(), taxDeclarationRate); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -562,10 +561,10 @@ public class TaxDeclareRecordWrapper extends Service { /** * 更正申报 * - * @param id * @return */ - public String updateDeclare(Long id) { + public String updateDeclare(TaxDeclareRecordParam param) { + Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) .setMsg(SalaryI18nUtil.getI18nLabel(177637, "更正申报")); @@ -574,7 +573,7 @@ public class TaxDeclareRecordWrapper extends Service { @Override public void execute() { try { - getTaxDeclareRecordService(user).updateDeclare(id); + getTaxDeclareRecordService(user).updateDeclare(id, param.getReportType()); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); @@ -652,6 +651,7 @@ public class TaxDeclareRecordWrapper extends Service { /** * 导出在线对比 + * * @param param * @return */ @@ -865,8 +865,8 @@ public class TaxDeclareRecordWrapper extends Service { .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecordPO.getTaxCycle())) .replace("{2}", declarationValuePO.getEmployeeId().toString())); loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "删除个税申报数据")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "删除个税申报数据")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除个税申报数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除个税申报数据")); loggerContext.setOldValues(declarationValuePO); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java index 3e4b45d9d..56bb4a986 100644 --- a/test/ParseTaxApi.java +++ b/test/ParseTaxApi.java @@ -7,9 +7,9 @@ import java.util.List; public class ParseTaxApi { public static void main(String[] args) { -// readExcel("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); + readExcel("H:\\code\\salary\\test\\ApiDes.xlsx"); - readExcel2("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); +// readExcel2("H:\\code\\salary\\test\\ApiDes.xlsx"); } From 8e2ff975a93c85fb28988adcf7bba6561af0698c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 29 Mar 2024 14:01:12 +0800 Subject: [PATCH 143/298] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/TaxDeclarationReportDTO.java | 33 +++++++++++++++ .../service/TaxDeclareRecordService.java | 1 + .../impl/TaxDeclareRecordServiceImpl.java | 41 +++++++++++++++++++ .../salary/web/TaxDeclarationController.java | 15 +++++++ .../wrapper/TaxDeclareRecordWrapper.java | 4 ++ 5 files changed, 94 insertions(+) create mode 100644 src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationReportDTO.java diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationReportDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationReportDTO.java new file mode 100644 index 000000000..dbebb32bb --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationReportDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 个税申报类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationReportDTO { + + private DeclareReportTypeEnum reportType; + + private TaxDeclareStatusPO status; + + private List taxDeclarations; + +} diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 0a78b5421..00a082ecf 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -194,4 +194,5 @@ public interface TaxDeclareRecordService { void updateById(TaxDeclareRecordPO taxDeclareRecord); + void getTaxReportType(Long id); } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 89a7fa3c0..6bb017d88 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1199,6 +1199,47 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); } + @Override + public void getTaxReportType(Long id) { + List taxDeclareStatusByTaxDeclareRecordId = getTaxDeclareStatusByTaxDeclareRecordId(id); + + DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType); + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + if (declareStatus == null) { + declareStatus = TaxDeclareStatusPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(id) + .reportType(reportType) + .taxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) + .taxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()) + .taxDeclareErrorMsg("") + .personNum(0) + .taxPayAmount("") + .taxPaidAmount("") + .taxPurePaidAmount("") + .deleteType(0) + .build(); + getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); + } + + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getById(id); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); + } + + // 查询个税申报表 + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); + if (CollectionUtils.isEmpty(taxDeclarations)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据")); + } + + taxDeclarations.forEach(taxDeclarationPO -> { + + }); + } + private TaxDeclareRequest buildTaxDeclareRequest(Long id) { // 查询供应商信息 diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 3586123dd..1608703d6 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -90,6 +90,21 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getForm, id); } + + /** + * 个税申报左侧分类 + * + * @param id 个税申报记录id + * @return + */ + @GET + @Path("/getTaxReportType") + @Produces(MediaType.APPLICATION_JSON) + public String getTaxReportType(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxReportType, id); + } + /** * 个税申报表相关信息 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 41f17f5e5..7cb884858 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -870,4 +870,8 @@ public class TaxDeclareRecordWrapper extends Service { loggerContext.setOldValues(declarationValuePO); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } + + public void getTaxReportType(Long id) { + getTaxDeclareRecordService(user).getTaxReportType(id); + } } From b3cde42f319566ea560e63cf7cda20d8bb6659e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 29 Mar 2024 14:41:31 +0800 Subject: [PATCH 144/298] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalaryEmployeeServiceImpl.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index b485fc96e..41f0f9875 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -19,7 +19,6 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; -import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper; @@ -73,12 +72,6 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return SqlProxyHandle.getProxy(ExpandFieldSettingsMapper.class); } - - private EmployMapper getEmployMapper() { - return SqlProxyHandle.getProxy(EmployMapper.class); - } - - private ExtEmpService getExtEmpService(User user) { return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } From 57a0030cc8c9e46a010ff44f40912c8f56b6f989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 1 Apr 2024 17:07:36 +0800 Subject: [PATCH 145/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=A4=96=E7=B1=8D?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/TaxDeclareRecordParam.java | 2 + .../service/TaxDeclareRecordService.java | 2 +- .../impl/TaxDeclareRecordServiceImpl.java | 72 +++++++++---------- .../salary/web/TaxDeclarationController.java | 23 +++--- .../wrapper/TaxDeclareRecordWrapper.java | 33 +++++---- 5 files changed, 65 insertions(+), 67 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index 6e1104507..d0fe52a80 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; import lombok.Data; /** @@ -18,6 +19,7 @@ public class TaxDeclareRecordParam { /** * 申报类型 + * @see DeclareReportTypeEnum */ private Integer reportType; } diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 00a082ecf..c4cbeca10 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -194,5 +194,5 @@ public interface TaxDeclareRecordService { void updateById(TaxDeclareRecordPO taxDeclareRecord); - void getTaxReportType(Long id); + List getTaxReports(Long id); } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 6bb017d88..c8da3fde0 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -642,22 +642,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType); TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); - if (declareStatus == null) { - declareStatus = TaxDeclareStatusPO.builder() - .id(IdGenerator.generate()) - .taxDeclareRecordId(id) - .reportType(reportType) - .taxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) - .taxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()) - .taxDeclareErrorMsg("") - .personNum(0) - .taxPayAmount("") - .taxPaidAmount("") - .taxPurePaidAmount("") - .deleteType(0) - .build(); - getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); - } + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); @@ -757,7 +742,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - public List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) { + public List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) { return getTaxDeclareStatusMapper().listSome(TaxDeclareStatusPO.builder().taxDeclareRecordId(taxDeclareRecordId).build()); } @@ -1200,28 +1185,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - public void getTaxReportType(Long id) { - List taxDeclareStatusByTaxDeclareRecordId = getTaxDeclareStatusByTaxDeclareRecordId(id); - - DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType); - - TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); - if (declareStatus == null) { - declareStatus = TaxDeclareStatusPO.builder() - .id(IdGenerator.generate()) - .taxDeclareRecordId(id) - .reportType(reportType) - .taxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) - .taxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()) - .taxDeclareErrorMsg("") - .personNum(0) - .taxPayAmount("") - .taxPaidAmount("") - .taxPurePaidAmount("") - .deleteType(0) - .build(); - getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); - } + public List getTaxReports(Long id) { // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = getById(id); @@ -1235,9 +1199,37 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据")); } - taxDeclarations.forEach(taxDeclarationPO -> { + Set reportTypes = new HashSet<>(); + taxDeclarations.forEach(taxDeclarationPO -> { + reportTypes.add(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getReportType().getValue()); }); + + List statuses = new ArrayList<>(); + + reportTypes.forEach(reportType -> { + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + if (declareStatus == null) { + declareStatus = TaxDeclareStatusPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(id) + .reportType(reportType) + .taxDeclareType(taxDeclareRecord.getTaxDeclareType()) + .taxDeclareStatus(taxDeclareRecord.getTaxDeclareStatus()) + .taxDeclareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) + .personNum(taxDeclareRecord.getPersonNum()) + .taxPayAmount(taxDeclareRecord.getTaxPayAmount()) + .taxPaidAmount(taxDeclareRecord.getTaxPaidAmount()) + .taxPurePaidAmount(taxDeclareRecord.getTaxPaidAmount()) + .deleteType(0) + .build(); + getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); + } + + statuses.add(declareStatus); + }); + + return statuses; } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 1608703d6..d1a9ea2c1 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -3,6 +3,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.param.*; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; @@ -98,25 +99,24 @@ public class TaxDeclarationController { * @return */ @GET - @Path("/getTaxReportType") + @Path("/getTaxReports") @Produces(MediaType.APPLICATION_JSON) public String getTaxReportType(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxReportType, id); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxReports, id); } /** * 个税申报表相关信息 * - * @param id 个税申报记录id * @return */ - @GET + @POST @Path("/getTaxDeclarationInfo") @Produces(MediaType.APPLICATION_JSON) - public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, id); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, param); } /** @@ -179,15 +179,14 @@ public class TaxDeclarationController { /** * 获取个税申报记录下的个税申报表TAB * - * @param id 个税申报记录id * @return */ - @GET + @POST @Path("/getTaxDeclarationTab") @Produces(MediaType.APPLICATION_JSON) - public String getTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + public String getTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, id); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, param); } /** @@ -199,7 +198,7 @@ public class TaxDeclarationController { @POST @Path("/addTaxDeclaration") @Produces(MediaType.APPLICATION_JSON) - public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationAddParam param) { + public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationAddParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::addTaxDeclaration, param); } @@ -215,7 +214,7 @@ public class TaxDeclarationController { @POST @Path("/deleteTaxDeclaration") @Produces(MediaType.APPLICATION_JSON) - public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationDeleteParam param) { + public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationDeleteParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteTaxDeclaration, param); } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 7cb884858..67bb280e7 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -17,6 +17,7 @@ import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; @@ -287,18 +288,20 @@ public class TaxDeclareRecordWrapper extends Service { /** * 获取个税申报记录下的个税申报表TAB * - * @param id * @return */ - public List getTaxDeclarationTab(Long id) { + public List getTaxDeclarationTab(TaxDeclareRecordParam param) { // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + // 查询个税申报记录下的个税申报表 List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); -// taxDeclarations = taxDeclarations.stream() -// .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), (long)user.getUID())) -// .collect(Collectors.toList()); + + //筛选申报类型 + DeclareReportTypeEnum declareReportTypeEnum = DeclareReportTypeEnum.parseByValue(param.getReportType()); + taxDeclarations = taxDeclarations.stream().filter(po -> IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getReportType() == declareReportTypeEnum).collect(Collectors.toList()); + Map taxDeclarationMap = SalaryEntityUtil.convert2Map(taxDeclarations, TaxDeclarationPO::getIncomeCategory); List tabs = Lists.newArrayList(); for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { @@ -331,12 +334,12 @@ public class TaxDeclareRecordWrapper extends Service { /** * 查询个税申报表的基本信息 * - * @param id 个税申报表id * @return */ - public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { + public TaxDeclarationInfoDTO getTaxDeclarationInfoById(TaxDeclareRecordParam param) { // 查询个税申报表 - TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id); + Long taxDeclareRecordId = param.getTaxDeclareRecordId(); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(taxDeclareRecordId); if (Objects.isNull(taxDeclareRecord)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); } @@ -352,8 +355,10 @@ public class TaxDeclareRecordWrapper extends Service { List taxDeclareFails = getTaxDeclareFailService(user).listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); // 查询个税扣缴义务人 TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); - TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); - TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); + + TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareRecordService(user).getTaxDeclareStatus(taxDeclareRecordId, param.getReportType()); + TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); return TaxDeclarationInfoDTO.builder() .salaryMonth(taxDeclareRecord.getSalaryMonth()) @@ -364,7 +369,7 @@ public class TaxDeclareRecordWrapper extends Service { .declareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel())) .declareStatus(taxDeclareStatusEnum) .declareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel())) - .declareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) + .declareErrorMsg(taxDeclareStatus.getTaxDeclareErrorMsg()) .displayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)) .declareFailSize(taxDeclareFails.size()) .abnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size()) @@ -871,7 +876,7 @@ public class TaxDeclareRecordWrapper extends Service { SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } - public void getTaxReportType(Long id) { - getTaxDeclareRecordService(user).getTaxReportType(id); + public List getTaxReports(Long id) { + return getTaxDeclareRecordService(user).getTaxReports(id); } } From 7f965c41c9de3e029b8e0aba759272515f7ba974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 2 Apr 2024 15:50:33 +0800 Subject: [PATCH 146/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9B=B4=E6=96=B0=E4=B8=BB=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxdeclaration/po/TaxDeclareStatusPO.java | 2 + .../impl/TaxDeclareRecordServiceImpl.java | 41 ++++++++++++++----- .../wrapper/TaxDeclareRecordWrapper.java | 2 +- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java index d138cc23e..5e9d93e88 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.po; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -34,6 +35,7 @@ public class TaxDeclareStatusPO { private Integer taxDeclareType; /** * 申报状态 + * @see TaxDeclareStatusEnum */ private Integer taxDeclareStatus; /** diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index c8da3fde0..23f2b4799 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -72,6 +72,8 @@ import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; +import static com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum.NOT_DECLARE; + /** * 个税申报 *

Copyright: Copyright (c) 2022

@@ -278,12 +280,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO oldTaxDeclareRecord = taxDeclareRecordMap.get(taxCycleEntry.getKey() + "-" + taxAgentIdEntry.getKey()); // 如果已经生成了个税申报表,并且个税申报表已经申报过了,就跳过 if (oldTaxDeclareRecord != null) { - if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))) { + if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), NOT_DECLARE.getValue()))) { continue; } needDeleteTaxDeclareRecordIds.add(oldTaxDeclareRecord.getId()); } - TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(saveParam.getSalaryMonth()).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now); + TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(saveParam.getSalaryMonth()).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now); newTaxDeclareRecords.add(taxDeclareRecord); // 生成个税申报表 TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue()); @@ -348,7 +350,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (Objects.isNull(taxDeclareRecord)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); } - if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) { + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), NOT_DECLARE.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182700, "对不起,只有未申报状态下可以刷新数据")); } // 查询税款所属期下的薪资核算人员 @@ -488,7 +490,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe for (Map.Entry> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) { Set archivedTaxAgentIds = SalaryEntityUtil.properties(taxCycleEntry.getValue(), SalaryAcctTaxAgentPO::getTaxAgentId); List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(saveParam.getSalaryMonth(), archivedTaxAgentIds); - TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream().filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null); + TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream().filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null); // 已经申报成功了的个税申报表的个税扣缴义务人不允许重新生成 if (Objects.nonNull(declareSuccessTaxDeclareRecord)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成").replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())).replace("{1}", SalaryDateUtil.getFormatYearMonth(declareSuccessTaxDeclareRecord.getTaxCycle()))); @@ -589,7 +591,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (CollectionUtils.isEmpty(taxDeclareRecords)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160524, "个税申报表不存在或已被删除")); } - List cantDeleteTaxDeclareRecords = taxDeclareRecords.stream().filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(e.getTaxDeclareStatus(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()))).collect(Collectors.toList()); + List cantDeleteTaxDeclareRecords = taxDeclareRecords.stream().filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(e.getTaxDeclareStatus(), NOT_DECLARE.getValue()))).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(cantDeleteTaxDeclareRecords)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177854, "个税申报表已经申报,无法删除")); } @@ -1064,7 +1066,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe //更新申报状态 declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); - declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); + declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue()); declareStatus.setRequestId(""); getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); @@ -1200,14 +1202,19 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } Set reportTypes = new HashSet<>(); - taxDeclarations.forEach(taxDeclarationPO -> { reportTypes.add(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getReportType().getValue()); }); List statuses = new ArrayList<>(); - reportTypes.forEach(reportType -> { + + int personNum = 0; + BigDecimal taxPayAmount = new BigDecimal(0); + BigDecimal taxPaidAmount = new BigDecimal(0); + BigDecimal taxPurePaidAmount = new BigDecimal(0); + + for (Integer reportType : reportTypes) { TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); if (declareStatus == null) { declareStatus = TaxDeclareStatusPO.builder() @@ -1225,9 +1232,23 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .build(); getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); } - statuses.add(declareStatus); - }); + + personNum += declareStatus.getPersonNum(); + taxPayAmount = taxPayAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount())); + taxPaidAmount = taxPaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount())); + taxPurePaidAmount = taxPurePaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount())); + } + + //更新记录的状态,各个报表状态一致则采纳,否则取最小的进度状态 + Integer declareStatusEnum = statuses.stream().map(TaxDeclareStatusPO::getTaxDeclareStatus).min(Comparator.comparing(Integer::valueOf)).orElse(NOT_DECLARE.getValue()); + + taxDeclareRecord.setPersonNum(personNum); + taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString()); + taxDeclareRecord.setTaxPaidAmount(taxPaidAmount.toString()); + taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.toString()); + taxDeclareRecord.setTaxDeclareStatus(declareStatusEnum); + updateById(taxDeclareRecord); return statuses; } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 67bb280e7..74cf1999c 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -373,7 +373,7 @@ public class TaxDeclareRecordWrapper extends Service { .displayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)) .declareFailSize(taxDeclareFails.size()) .abnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size()) - .taxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPaidAmount())) + .taxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareStatus.getTaxPaidAmount())) .build(); } From fbc9c1a1878f46e530cc782f77d70c069181265a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Sun, 7 Apr 2024 11:29:09 +0800 Subject: [PATCH 147/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9B=B4=E6=96=B0=E4=B8=BB=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/TaxDeclareRecordParam.java | 7 +- .../taxdeclaration/po/TaxDeclareStatusPO.java | 2 + .../param/TaxPaymentQueryParam.java | 3 + .../service/TaxDeclareRecordService.java | 9 +- .../impl/TaxDeclareRecordServiceImpl.java | 29 +++-- .../TaxPaymentWithheldVoucherServiceImpl.java | 17 ++- .../TaxPaymentWithholdingServiceImpl.java | 112 ++++++++++++------ .../salary/web/TaxDeclarationController.java | 16 +-- .../wrapper/TaxDeclareRecordWrapper.java | 7 +- 9 files changed, 134 insertions(+), 68 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index d0fe52a80..54b1ee11a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.util.valid.DataCheck; import lombok.Data; /** @@ -14,12 +15,16 @@ import lombok.Data; @Data public class TaxDeclareRecordParam { - //个税申报记录id") + /** + * 个税申报记录id + */ + @DataCheck(require = true,message = "个税申报记录id不能为空!") private Long taxDeclareRecordId; /** * 申报类型 * @see DeclareReportTypeEnum */ + @DataCheck(require = true,message = "申报类型不能为空!") private Integer reportType; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java index 5e9d93e88..8919ed2f1 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.po; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import lombok.AllArgsConstructor; import lombok.Builder; @@ -23,6 +24,7 @@ public class TaxDeclareStatusPO { private Long taxDeclareRecordId; /** * 申报类型 1:综合所得; 2: 分类所得;3:非居民所得;4:限售股所得 + * @see DeclareReportTypeEnum */ private Integer reportType; /** diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index 6338da065..8e3fbbfef 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -44,4 +44,7 @@ public class TaxPaymentQueryParam { //是否为反馈校验 0否 1是") private Integer checkFeedback; + + //申报表类型 + private Integer reportType; } diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index c4cbeca10..911752afe 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -5,6 +5,7 @@ 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.entity.taxdeclaration.po.TaxDeclareStatusPO; @@ -85,9 +86,8 @@ public interface TaxDeclareRecordService { /** * 税局端申报明细查询 * - * @param id */ - String queryCompanyIncomes(Long id); + String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam); /** @@ -194,5 +194,8 @@ public interface TaxDeclareRecordService { void updateById(TaxDeclareRecordPO taxDeclareRecord); - List getTaxReports(Long id); + List getOrInitTaxReports(Long id); + + + void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus); } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 23f2b4799..afec5e507 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -27,10 +27,7 @@ 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.AbnormalEmployeeListQueryParam; -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.*; import com.engine.salary.entity.taxdeclaration.po.*; import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; @@ -57,6 +54,7 @@ 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; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -1068,7 +1066,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue()); declareStatus.setRequestId(""); - getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -1084,6 +1082,14 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } + @Override + public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus) { + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + + //更新主记录 + getOrInitTaxReports(declareStatus.getTaxDeclareRecordId()); + } + @Override public void cancelCorrect(Long id) { @@ -1144,8 +1150,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); - // 申报类型 - requestParam.put("sblx", "1"); // 请求 String reqJson = JsonUtil.toJsonString(requestParam); String url = apiConfig.getHost() + SzyhApiConstant.QUERY_DECLARE_STATUS; @@ -1157,15 +1161,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - public String queryCompanyIncomes(Long id) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + public String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam) { + ValidUtil.doValidator(taxDeclareRecordParam); + + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(taxDeclareRecordParam.getTaxDeclareRecordId()); TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 报表类型 - requestParam.put("reportType", "1"); + requestParam.put("reportType", taxDeclareRecordParam.getReportType()); // 页码 requestParam.put("pageNo", "1"); // 每页数量 @@ -1187,7 +1193,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - public List getTaxReports(Long id) { + public List getOrInitTaxReports(Long id) { // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = getById(id); @@ -1208,7 +1214,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe List statuses = new ArrayList<>(); - int personNum = 0; BigDecimal taxPayAmount = new BigDecimal(0); BigDecimal taxPaidAmount = new BigDecimal(0); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java index eb977a7b7..22a5c0015 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; import com.engine.salary.entity.taxpayment.response.BaseResponse; import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.util.SalaryDateUtil; @@ -49,10 +50,20 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ param, tempWrapper.getApiConfigPO(), WithheldVoucherResponse.class); // 校验请求结果 String responseCode = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); - WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(WithheldVoucherResponse.Body::getZhsd).orElse(null); + WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(body -> { + if (DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue().equals(param.getReportType())) { + return body.getZhsd(); + } else if (DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue().equals(param.getReportType())) { + return body.getFlsd(); + } else if (DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue().equals(param.getReportType())) { + return body.getFjmsd(); + } else { + return body.getXsgsd(); + } + }).orElse(null); if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(feedback)) { log.info("getWithheldVoucher code error:{}", JSON.toJSONString(queryResponse)); - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 95828, "税局接口异常,请稍后重试")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "税局接口异常,请稍后重试")); } Integer status = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); if (status.equals(1)) { @@ -61,7 +72,7 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ } List vouchers = new ArrayList<>(); for (int i = 1; i <= feedback.getWszmlb().size(); i++) { - vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel( 184013, "完税证明") + i, feedback.getWszmlb().get(i - 1))); + vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel(184013, "完税证明") + i, feedback.getWszmlb().get(i - 1))); } return new TaxWithheldVoucherResultDTO().setVouchers(vouchers); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index eab790615..a0c6d5139 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.entity.taxpayment.dto.TaxAgreementFeedbackResultDTO; import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; @@ -16,6 +17,8 @@ import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; import com.engine.salary.entity.taxpayment.response.BaseResponse; import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse; import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -23,8 +26,7 @@ import com.engine.salary.util.*; import lombok.extern.slf4j.Slf4j; import java.math.BigDecimal; -import java.util.Map; -import java.util.Optional; +import java.util.*; /** * 三方缴款 @@ -52,30 +54,66 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); throw new SalaryRunTimeException(msg); } - WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) - .map(WithholdingFeedbackResponse::getBody) - .map(WithholdingFeedbackResponse.Body::getZhsdjk) - .orElse(null); - if (feedback == null) { - log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); - } + + List statuses = getTaxDeclareRecordService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId()); + statuses.forEach(status -> { + WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) + .map(WithholdingFeedbackResponse::getBody) + .map(body -> { + if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue())) { + return body.getZhsdjk(); + } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue())) { + return body.getFlsdjk(); + } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue())) { + return body.getFjmsdjk(); + } else { + return body.getXsgsdjk(); + } + + }) + .orElse(null); + if (feedback == null) { + log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); + } + // 判断缴款状态是否成功 + Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); + TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); + if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { + throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt())); + } + // 累计实缴金额 + BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); + + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(status.getTaxDeclareStatus())) { + throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态"); + } + BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(status.getTaxPayAmount()); + BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(status.getTaxPurePaidAmount()); + if (SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).equals(totalPaid) + && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) { + throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态"); + } + status.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue()); + status.setTaxPaidAmount(totalPaid.toString()); + status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); + status.setTaxPayAmount(BigDecimal.ZERO.toString()); + getTaxDeclareRecordService(user).updateTaxDeclareStatus(status); + }); + TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param); - // 判断缴款状态是否成功 - Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); - TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); - if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { - throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt())); - } - // 累计实缴金额 - BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); - // 更新个税申报记录状态为已缴款 - TaxDeclareRecordPO taxDeclareRecord = updateTaxDeclareRecord(param, totalPaid); + +// // 更新个税申报记录状态为已缴款 +// TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO(); +// updateTaxDeclareRecord(param, totalPaid); // 更新缴款请求为已反馈 updateTaxPaymentRequest(param); - BigDecimal otherAmount = totalPaid.subtract(SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount())); + + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + BigDecimal otherAmount = SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).subtract(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPurePaidAmount())); + return new TaxAgreementFeedbackResultDTO() - .setPayAmount(SalaryEntityUtil.thousandthConvert(totalPaid.toString())) + .setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).toString())) .setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString())) .setPersonNum(taxAmountFormDTO.getPersonNum()); } @@ -94,8 +132,8 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING; Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); requestParam.put("sfxyh", param.getProtocolNumber()); - requestParam.put("ynse", param.getTaxAmount()); - requestParam.put("sblx", "1"); +// requestParam.put("ynse", param.getTaxAmount()); +// requestParam.put("sblx", "1"); return postRequest(apiConfig, url, requestParam, clazz); } @@ -118,20 +156,20 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService .build()); // if (paymentRequestPO != null) { - String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; - QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); - SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) - .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); - SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) - || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) + .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) + || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); - getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO - .builder() - .feedback(SalaryOnOffEnum.ON.getValue()) - .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) - .taxAgentId(taxDeclareRecord.getTaxAgentId()) - .taxYearMonth(taxDeclareRecord.getTaxCycle()) - .build()); + getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO + .builder() + .feedback(SalaryOnOffEnum.ON.getValue()) + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .build()); // } } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index d1a9ea2c1..f5c92256f 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -391,13 +391,13 @@ public class TaxDeclarationController { * @param taxDeclareRecordParam 撤销更正申报参数 * @return */ - @POST - @Path("/cancelCorrect") - @Produces(MediaType.APPLICATION_JSON) - public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId()); - } +// @POST +// @Path("/cancelCorrect") +// @Produces(MediaType.APPLICATION_JSON) +// public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId()); +// } /** * 税局端申报状态查询 @@ -424,7 +424,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String queryCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, taxDeclareRecordParam.getTaxDeclareRecordId()); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes,taxDeclareRecordParam); } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 74cf1999c..7e0af4b9f 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -638,11 +638,10 @@ public class TaxDeclareRecordWrapper extends Service { /** * 税局端申报明细查询 * - * @param id * @return */ - public String queryCompanyIncomes(Long id) { - return getTaxDeclareRecordService(user).queryCompanyIncomes(id); + public String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam) { + return getTaxDeclareRecordService(user).queryCompanyIncomes(taxDeclareRecordParam); } /** @@ -877,6 +876,6 @@ public class TaxDeclareRecordWrapper extends Service { } public List getTaxReports(Long id) { - return getTaxDeclareRecordService(user).getTaxReports(id); + return getTaxDeclareRecordService(user).getOrInitTaxReports(id); } } From be85c47a6834746a5ed7a42f4805260cb6e3809c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Sun, 7 Apr 2024 15:59:36 +0800 Subject: [PATCH 148/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9B=B4=E6=96=B0=E4=B8=BB=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/TaxDeclareRecordService.java | 10 +++++++++- .../service/impl/TaxDeclareRecordServiceImpl.java | 11 ++++++----- .../salary/wrapper/TaxDeclareRecordWrapper.java | 12 ++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 911752afe..8d3c1fcba 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -194,8 +194,16 @@ public interface TaxDeclareRecordService { void updateById(TaxDeclareRecordPO taxDeclareRecord); + /** + * 获取申报记录状态列表 + * @param id + * @return + */ List getOrInitTaxReports(Long id); - + /** + * 更新申报状态,同时更新主记录 + * @param declareStatus + */ void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus); } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index afec5e507..822d12102 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -720,7 +720,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); declareStatus.setTaxDeclareErrorMsg(""); - getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -851,7 +851,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); } //更新申报状态 - getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + updateTaxDeclareStatus(declareStatus); // 如果申报失败 if (CollectionUtils.isNotEmpty(taxDeclareFails)) { @@ -922,7 +922,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 更新个税申报状态 declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); - getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -979,7 +979,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe //更新个税申报状态 declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); declareStatus.setRequestId(""); - getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -1084,6 +1084,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe @Override public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus) { + //更新申报表状态 getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); //更新主记录 @@ -1239,7 +1240,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } statuses.add(declareStatus); - personNum += declareStatus.getPersonNum(); + personNum += declareStatus.getPersonNum() == null ? 0 : declareStatus.getPersonNum(); taxPayAmount = taxPayAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount())); taxPaidAmount = taxPaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount())); taxPurePaidAmount = taxPurePaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount())); diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 7e0af4b9f..2ad459aa5 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -31,6 +31,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; @@ -291,6 +292,8 @@ public class TaxDeclareRecordWrapper extends Service { * @return */ public List getTaxDeclarationTab(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); @@ -337,6 +340,8 @@ public class TaxDeclareRecordWrapper extends Service { * @return */ public TaxDeclarationInfoDTO getTaxDeclarationInfoById(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + // 查询个税申报表 Long taxDeclareRecordId = param.getTaxDeclareRecordId(); TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(taxDeclareRecordId); @@ -441,6 +446,8 @@ public class TaxDeclareRecordWrapper extends Service { * @param */ public String declare(TaxDeclareRecordParam taxDeclareRecordParam) { + ValidUtil.doValidator(taxDeclareRecordParam); + Long id = taxDeclareRecordParam.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) @@ -470,6 +477,8 @@ public class TaxDeclareRecordWrapper extends Service { * 获取申报反馈 */ public String getDeclareFeedback(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) @@ -509,6 +518,7 @@ public class TaxDeclareRecordWrapper extends Service { * 作废 */ public String cancelDeclare(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) @@ -538,6 +548,7 @@ public class TaxDeclareRecordWrapper extends Service { * 获取作废反馈 */ public String getCancelFeedback(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) @@ -569,6 +580,7 @@ public class TaxDeclareRecordWrapper extends Service { * @return */ public String updateDeclare(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); Long id = param.getTaxDeclareRecordId(); checkBefore(id); TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) From e994a61037894e26c3ce277b300e66bc7aab0433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 8 Apr 2024 14:40:47 +0800 Subject: [PATCH 149/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeclareTaxResultFeedbackQueryParam.java | 6 + .../taxdeclaration/po/TaxDeclareRecordPO.java | 1 + .../service/TaxDeclareRecordService.java | 15 -- .../service/TaxDeclareStatusService.java | 37 +++++ .../impl/AbstractTaxPaymentService.java | 3 + .../impl/TaxDeclarationValueServiceImpl.java | 14 +- .../impl/TaxDeclareRecordServiceImpl.java | 111 +++----------- .../impl/TaxDeclareStatusServiceImpl.java | 135 ++++++++++++++++++ .../TaxPaymentWithholdingServiceImpl.java | 2 +- .../wrapper/TaxDeclareRecordWrapper.java | 8 +- 10 files changed, 215 insertions(+), 117 deletions(-) create mode 100644 src/com/engine/salary/service/TaxDeclareStatusService.java create mode 100644 src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java index 7ce6c69c7..dbcdfccc8 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.util.valid.DataCheck; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,7 +13,12 @@ import lombok.experimental.Accessors; @NoArgsConstructor @AllArgsConstructor public class DeclareTaxResultFeedbackQueryParam { + + @DataCheck(require = true, message = "个税申报记录id不能为空!") Long id; + @DataCheck(require = true, message = "申报类型不能为空!") + Integer reportType; + String requestId; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 78707ce84..d25ee490c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -73,6 +73,7 @@ public class TaxDeclareRecordPO implements Serializable { /** * 申报的requestId,用于下载申报过程 */ + @Deprecated private String declareRequestId; /** * 备注 diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 8d3c1fcba..ad6319472 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -134,8 +134,6 @@ public interface TaxDeclareRecordService { */ void declare(Long id, Integer reportType); - TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType); - List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId); /** @@ -191,19 +189,6 @@ public interface TaxDeclareRecordService { */ String queryDeclareStatus(Long id); - void updateById(TaxDeclareRecordPO taxDeclareRecord); - /** - * 获取申报记录状态列表 - * @param id - * @return - */ - List getOrInitTaxReports(Long id); - - /** - * 更新申报状态,同时更新主记录 - * @param declareStatus - */ - void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus); } diff --git a/src/com/engine/salary/service/TaxDeclareStatusService.java b/src/com/engine/salary/service/TaxDeclareStatusService.java new file mode 100644 index 000000000..b2c970ef9 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareStatusService.java @@ -0,0 +1,37 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; + +import java.util.List; + +/** + * 个税申报表状态 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclareStatusService { + + /** + * 获取申报记录状态 + * @param taxDeclareRecordId + * @param reportType + * @return + */ + TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType); + + /** + * 获取申报记录状态列表 + * @param id + * @return + */ + List getOrInitTaxReports(Long id); + + /** + * 更新申报状态,同时更新主记录 + * @param declareStatus + */ + void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus); +} diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index cad15ebc3..a0b762c91 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -52,6 +52,9 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); } + protected TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } protected TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 69d9ecb89..8c17eb205 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -20,10 +20,7 @@ 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.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.entity.taxdeclaration.po.*; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; @@ -78,6 +75,11 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); } + private TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } @@ -355,10 +357,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar 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(taxDeclareRecordPO.getDeclareRequestId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareStatus.getDeclareRequestId()); Map>> onlineDataMap = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 822d12102..468e53afa 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -92,6 +92,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return MapperProxyFactory.getProxy(TaxDeclareStatusMapper.class); } + private TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } + private TaxDeclarationService getTaxDeclarationService(User user) { return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } @@ -641,7 +645,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType); - TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); @@ -720,7 +724,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); declareStatus.setTaxDeclareErrorMsg(""); - updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -736,11 +740,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } - @Override - public TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType) { - return getTaxDeclareStatusMapper().getDeclareStatus(taxDeclareRecordId, reportType); - } - @Override public List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) { return getTaxDeclareStatusMapper().listSome(TaxDeclareStatusPO.builder().taxDeclareRecordId(taxDeclareRecordId).build()); @@ -751,7 +750,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); if (StringUtils.isEmpty(declareStatus.getRequestId()) || !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156496, "请先点击「在线申报」后再点击「申报反馈」获取申报结果")); @@ -851,7 +850,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); } //更新申报状态 - updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); // 如果申报失败 if (CollectionUtils.isNotEmpty(taxDeclareFails)) { @@ -884,7 +883,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); // 更正申报成功后不能作废 if (Objects.equals(declareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182701, "更正申报后不允许作废")); @@ -922,7 +921,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 更新个税申报状态 declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); - updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -943,7 +942,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(declareStatus.getRequestId())) { @@ -979,7 +978,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe //更新个税申报状态 declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); declareStatus.setRequestId(""); - updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -1013,12 +1012,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe @Override public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { Long id = param.getId(); + TaxDeclareRecordPO taxDeclareRecord = getById(id); String requestId = param.getRequestId(); - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, param.getReportType()); DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); - GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? taxDeclareRecord.getDeclareRequestId() : requestId); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? declareStatus.getDeclareRequestId() : requestId); Map>> map = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); @@ -1031,7 +1030,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe public void updateDeclare(Long id, Integer reportType) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); - TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); List taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); @@ -1066,7 +1065,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue()); declareStatus.setRequestId(""); - updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -1082,16 +1081,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } - @Override - public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus) { - //更新申报表状态 - getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); - - //更新主记录 - getOrInitTaxReports(declareStatus.getTaxDeclareRecordId()); - } - - @Override public void cancelCorrect(Long id) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); @@ -1193,72 +1182,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); } - @Override - public List getOrInitTaxReports(Long id) { - - // 查询个税申报记录 - TaxDeclareRecordPO taxDeclareRecord = getById(id); - if (Objects.isNull(taxDeclareRecord)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); - } - - // 查询个税申报表 - List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); - if (CollectionUtils.isEmpty(taxDeclarations)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据")); - } - - Set reportTypes = new HashSet<>(); - taxDeclarations.forEach(taxDeclarationPO -> { - reportTypes.add(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getReportType().getValue()); - }); - - List statuses = new ArrayList<>(); - - int personNum = 0; - BigDecimal taxPayAmount = new BigDecimal(0); - BigDecimal taxPaidAmount = new BigDecimal(0); - BigDecimal taxPurePaidAmount = new BigDecimal(0); - - for (Integer reportType : reportTypes) { - TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); - if (declareStatus == null) { - declareStatus = TaxDeclareStatusPO.builder() - .id(IdGenerator.generate()) - .taxDeclareRecordId(id) - .reportType(reportType) - .taxDeclareType(taxDeclareRecord.getTaxDeclareType()) - .taxDeclareStatus(taxDeclareRecord.getTaxDeclareStatus()) - .taxDeclareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) - .personNum(taxDeclareRecord.getPersonNum()) - .taxPayAmount(taxDeclareRecord.getTaxPayAmount()) - .taxPaidAmount(taxDeclareRecord.getTaxPaidAmount()) - .taxPurePaidAmount(taxDeclareRecord.getTaxPaidAmount()) - .deleteType(0) - .build(); - getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); - } - statuses.add(declareStatus); - - personNum += declareStatus.getPersonNum() == null ? 0 : declareStatus.getPersonNum(); - taxPayAmount = taxPayAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount())); - taxPaidAmount = taxPaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount())); - taxPurePaidAmount = taxPurePaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount())); - } - - //更新记录的状态,各个报表状态一致则采纳,否则取最小的进度状态 - Integer declareStatusEnum = statuses.stream().map(TaxDeclareStatusPO::getTaxDeclareStatus).min(Comparator.comparing(Integer::valueOf)).orElse(NOT_DECLARE.getValue()); - - taxDeclareRecord.setPersonNum(personNum); - taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString()); - taxDeclareRecord.setTaxPaidAmount(taxPaidAmount.toString()); - taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.toString()); - taxDeclareRecord.setTaxDeclareStatus(declareStatusEnum); - updateById(taxDeclareRecord); - - return statuses; - } - private TaxDeclareRequest buildTaxDeclareRequest(Long id) { // 查询供应商信息 diff --git a/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java new file mode 100644 index 000000000..f5d10ee62 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java @@ -0,0 +1,135 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper; +import com.engine.salary.service.TaxDeclarationService; +import com.engine.salary.service.TaxDeclareStatusService; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.math.BigDecimal; +import java.util.*; + +import static com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum.NOT_DECLARE; + +/** + * 个税申报 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclareStatusServiceImpl extends Service implements TaxDeclareStatusService { + + + private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); + } + + private TaxDeclareStatusMapper getTaxDeclareStatusMapper() { + return MapperProxyFactory.getProxy(TaxDeclareStatusMapper.class); + } + + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + + @Override + public TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType) { + return getTaxDeclareStatusMapper().getDeclareStatus(taxDeclareRecordId, reportType); + } + + + @Override + public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus) { + //更新申报表状态 + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + + //更新主记录 + getOrInitTaxReports(declareStatus.getTaxDeclareRecordId()); + } + + + @Override + public List getOrInitTaxReports(Long id) { + + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordMapper().getById(id); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); + } + + // 查询个税申报表 + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); + if (CollectionUtils.isEmpty(taxDeclarations)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据")); + } + + Set reportTypes = new HashSet<>(); + taxDeclarations.forEach(taxDeclarationPO -> { + reportTypes.add(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getReportType().getValue()); + }); + + List statuses = new ArrayList<>(); + + int personNum = 0; + BigDecimal taxPayAmount = new BigDecimal(0); + BigDecimal taxPaidAmount = new BigDecimal(0); + BigDecimal taxPurePaidAmount = new BigDecimal(0); + + for (Integer reportType : reportTypes) { + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + if (declareStatus == null) { + declareStatus = TaxDeclareStatusPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(id) + .reportType(reportType) + .taxDeclareType(taxDeclareRecord.getTaxDeclareType()) + .taxDeclareStatus(taxDeclareRecord.getTaxDeclareStatus()) + .taxDeclareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) + .personNum(taxDeclareRecord.getPersonNum()) + .taxPayAmount(taxDeclareRecord.getTaxPayAmount()) + .taxPaidAmount(taxDeclareRecord.getTaxPaidAmount()) + .taxPurePaidAmount(taxDeclareRecord.getTaxPaidAmount()) + .deleteType(0) + .build(); + getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); + } + statuses.add(declareStatus); + + personNum += declareStatus.getPersonNum() == null ? 0 : declareStatus.getPersonNum(); + taxPayAmount = taxPayAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount())); + taxPaidAmount = taxPaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount())); + taxPurePaidAmount = taxPurePaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount())); + } + + //更新记录的状态,各个报表状态一致则采纳,否则取最小的进度状态 + Integer declareStatusEnum = statuses.stream().map(TaxDeclareStatusPO::getTaxDeclareStatus).min(Comparator.comparing(Integer::valueOf)).orElse(NOT_DECLARE.getValue()); + + taxDeclareRecord.setPersonNum(personNum); + taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString()); + taxDeclareRecord.setTaxPaidAmount(taxPaidAmount.toString()); + taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.toString()); + taxDeclareRecord.setTaxDeclareStatus(declareStatusEnum); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + + return statuses; + } + + +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index a0c6d5139..7c1facf76 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -98,7 +98,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService status.setTaxPaidAmount(totalPaid.toString()); status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); status.setTaxPayAmount(BigDecimal.ZERO.toString()); - getTaxDeclareRecordService(user).updateTaxDeclareStatus(status); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(status); }); TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param); diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 2ad459aa5..10ef95a47 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -64,6 +64,10 @@ public class TaxDeclareRecordWrapper extends Service { return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); } + private TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } + private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -361,7 +365,7 @@ public class TaxDeclareRecordWrapper extends Service { // 查询个税扣缴义务人 TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); - TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareRecordService(user).getTaxDeclareStatus(taxDeclareRecordId, param.getReportType()); + TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(taxDeclareRecordId, param.getReportType()); TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.class); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); @@ -888,6 +892,6 @@ public class TaxDeclareRecordWrapper extends Service { } public List getTaxReports(Long id) { - return getTaxDeclareRecordService(user).getOrInitTaxReports(id); + return getTaxDeclareStatusService(user).getOrInitTaxReports(id); } } From d1b6a782382090785395ccc39057925e7b3bd0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 10 Apr 2024 09:08:24 +0800 Subject: [PATCH 150/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/mapper/employeedeclare/EmployeeDeclareMapper.xml | 2 +- .../salary/service/impl/EmployeeDeclareServiceImpl.java | 4 +++- src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 53f28f353..c5d985ffc 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -452,7 +452,7 @@ #{birthplace}, - #{tax_reasons}, + #{taxReasons}, diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index a418082d6..3fb74033c 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -198,6 +198,8 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setCardNum(saveParam.getCardNum().toUpperCase()); employeeDeclare.setGender(saveParam.getGender().getValue()); employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(saveParam.getBirthday())); + employeeDeclare.setBirthplace(saveParam.getBirthplace()); + employeeDeclare.setTaxReasons(saveParam.getTaxReasons()); employeeDeclare.setEmploymentStatus(saveParam.getEmploymentStatus().getValue()); employeeDeclare.setMobile(saveParam.getMobile()); employeeDeclare.setEmploymentType(saveParam.getEmploymentType().getValue()); @@ -388,7 +390,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } boolean declareSuccess = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getSuccessfullyDeclared(), 1)); if (declareSuccess) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156467, "报送成功过的人员不允许删除")); +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156467, "报送成功过的人员不允许删除")); } getEmployeeDeclareMapper().deleteByIds(ids, new Date()); // 记录日志 diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 65ad5b8ef..953f01a78 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -298,7 +298,9 @@ public class EmployeeDeclareWrapper extends Service { .setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class)) .setMartyrDependents(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class)) .setMartyrDependentsCardNo(employeeDeclare.getMartyrDependentsCardNo()) - .setDeductExpenses(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class)); + .setDeductExpenses(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class)) + .setBirthplace(employeeDeclare.getBirthplace()) + .setTaxReasons(employeeDeclare.getTaxReasons()); } else { employeeDeclare = null; } From 917c9f87c12f95a78d85209646fef5f8ec423dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 10 Apr 2024 09:18:05 +0800 Subject: [PATCH 151/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TaxPaymentWithholdingServiceImpl.java | 5 +++-- .../impl/TaxPaymentWithholdingVoucherServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 7c1facf76..67b2a0c2a 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -56,7 +56,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService } List statuses = getTaxDeclareRecordService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId()); - statuses.forEach(status -> { + for (TaxDeclareStatusPO status:statuses) { WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) .map(WithholdingFeedbackResponse::getBody) .map(body -> { @@ -80,6 +80,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { + // fixme throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt())); } // 累计实缴金额 @@ -99,7 +100,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); status.setTaxPayAmount(BigDecimal.ZERO.toString()); getTaxDeclareStatusService(user).updateTaxDeclareStatus(status); - }); + } TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 44e895087..9fec5d913 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -100,7 +100,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS String url = apiConfig.getHost() + api; Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); if (syncStatus) { - requestParam.put("bblx", "1"); + requestParam.put("bblx", param.getReportType()); } return postRequest(apiConfig, url, requestParam, clazz); } From 691f4c42cee5bd1461a87be6fc2b774f2a163222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 10 Apr 2024 14:48:58 +0800 Subject: [PATCH 152/298] =?UTF-8?q?=E5=86=85=E7=BD=AE=E7=AE=97=E7=A8=8E?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/salarysob/IncomeCategoryEnum.java | 24 +- .../GetDeclareTaxResultFeedbackResponse.java | 257 +++++++++++++++++- 2 files changed, 260 insertions(+), 21 deletions(-) diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index f0564f27c..fbce1c59b 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -139,36 +139,36 @@ public enum IncomeCategoryEnum implements BaseEnum { NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { -// List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); -// List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); -// result.put(this.getDefaultLabel(), zhsdSheetData); + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); return result; } }, NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); return result; } }, NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); return result; } }, NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); return result; } }; diff --git a/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java index 3abdd210b..6691cdb96 100644 --- a/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java @@ -51,19 +51,16 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { // * 分类所得 必填:是 见分类所得计算结果 // */ // private 对象 flsd; -// /** -// * 非居民所得 必填:是 见非居民所得计算结果 -// */ -// private fjmsd fjmsd; -// /** + /** + * 非居民所得 必填:是 见非居民所得计算结果 + */ + private fjmsd fjmsd; + + // /** // * 限售股所得 必填:是 见限售股所得计算结果 // */ // private 对象 xsgsd; - /** - * 人员申报失败列表 必填:是 参考人员代报结果对象 - */ - private List rysbsblb; @Data public static class zhsd { @@ -660,6 +657,248 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { } + + @Data + public static class fjmsd { + /** + * 正常工资薪金(无住所个人正常工资薪金)所得列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx wjgzxjlb; + /** + * 无住所个人数月奖金列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx wjrysyjjlb; + /** + * 劳务报酬列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx lwbclb; + /** + * 稿酬所得列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx gcsdlb; + /** + * 利息姑息红利所得列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx lxgxhllb; + /** + * 股权转让列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx gqzrlb; + /** + * 其他财产转让列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx qtcczrlb; + /** + * 偶然所得列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx orsdlb; + /** + * 解除劳动合同一次性补偿金列表 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx jcldhtycxbcjlb; + /** + * 保险营销员薪金算税结果对象 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx bxyxy; + /** + * 证券经纪人薪金算税结果对象 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx zqjjr; + /** + * 个人股权激励结果对象 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx grgqjl; + /** + * 特许权使用费所得 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx txqsyfsd; + /** + * 个人房屋出租所得 参考非居民所得算税结果对象 + */ + private fjmsdssjgdx grfwczsd; + + /** + * 非居民所得算税结果对象 + */ + @Data + public static class fjmsdssjgdx { + /** + * 非居民算税成功列表 参考输入报文非居民所得输出结果报文 + */ + private List sscglb; + /** + * 非居民算税失败列表 参考输入报文非居民所得输出结果报文 + */ + private List sssblb; + /** + * 非居民算税失败原因列表 参考算税失败原因对象 + */ + private List sssbyylb; + /** + * 参与非居民算税总人数 + */ + private int sszrs; + /** + * 非居民算税失败总人数 + */ + private int sssbrs; + + /** + * 4.4.1.3.4.2非居民所得输出结果报文 + */ + @Data + public static class fjmsdscbw { + /** + * 姓名 必填:是 + */ + @SalaryTableColumn(text = "姓名", width = "10%", column = "xm") + @ExcelHead(title = "姓名", dataIndex = "xm") + private String xm; + + /** + * 证件类型名称 必填:是 + */ + @SalaryTableColumn(text = "证件类型", width = "10%", column = "zzlx") + @ExcelHead(title = "证件类型", dataIndex = "zzlx") + private String zzlx; + + /** + * 证件号码 必填:是 + */ + @SalaryTableColumn(text = "证件号码", width = "10%", column = "zzhm") + @ExcelHead(title = "证件号码", dataIndex = "zzhm") + private String zzhm; + + /** + * 收入额 必填:是 + */ + @SalaryTableColumn(text = "收入额", width = "10%", column = "sre") + @ExcelHead(title = "收入额", dataIndex = "sre") + private String sre; + + /** + * 累计收入(不含本次) 必填:是 + */ + @SalaryTableColumn(text = "累计收入(不含本次)", width = "10%", column = "ljsre") + @ExcelHead(title = "累计收入(不含本次)", dataIndex = "ljsre") + private String ljsre; + + /** + * 免税收入 必填:是 + */ + @SalaryTableColumn(text = "免税收入", width = "10%", column = "mssd") + @ExcelHead(title = "免税收入", dataIndex = "mssd") + private String mssd; + /** + * 财产原值 必填:是 + */ + private String ccyz; + /** + * 允许扣除的税费 必填:是 + */ + private String yxkcsf; + /** + * 投资抵扣 必填:是 + */ + private String tzdk; + /** + * 其他 必填:是 + */ + private String qt; + /** + * 备注 必填:是 + */ + private String bz; + /** + * 实际工作年限 必填:是 + */ + private String sjgznxs; + /** + * 减除费用 必填:是 + */ + private String jcfy; + /** + * 准予扣除的捐赠额 必填:是 + */ + @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "zykcjze") + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "zykcjze") + private String zykcjze; + /** + * 税前扣除项目合计 必填:是 + */ + private String sqkcxmhj; + /** + * 应纳税额所得额 必填:是 + */ + @SalaryTableColumn(text = "应纳税额所得额", width = "10%", column = "ynssde") + @ExcelHead(title = "应纳税额所得额", dataIndex = "ynssde") + private String ynssde; + /** + * 应纳税额 必填:是 + */ + @SalaryTableColumn(text = "应纳税额", width = "10%", column = "ynse") + @ExcelHead(title = "应纳税额", dataIndex = "ynse") + private String ynse; + /** + * 减免税额 必填:是 + */ + private String jmse; + /** + * 应扣缴税额 必填:是 + */ + @SalaryTableColumn(text = "应扣缴税额", width = "10%", column = "yingkjse") + @ExcelHead(title = "应扣缴税额", dataIndex = "yingkjse") + private String yingkjse; + /** + * 已扣缴税额 必填:是 无需填写该值,按0处理 + */ + @SalaryTableColumn(text = "已扣缴税额", width = "10%", column = "ykjse") + @ExcelHead(title = "已扣缴税额", dataIndex = "ykjse") + private String ykjse; + /** + * 税率 必填:是 + */ + @SalaryTableColumn(text = "税率", width = "10%", column = "sl") + @ExcelHead(title = "税率", dataIndex = "sl") + private String sl; + /** + * 速算扣除数 必填:是 + */ + @SalaryTableColumn(text = "速算扣除数", width = "10%", column = "sskcs") + @ExcelHead(title = "速算扣除数", dataIndex = "sskcs") + private String sskcs; + /** + * 代报方式 必填:是 + */ + private String sbfs; + /** + * 应补退税额 必填:是 + */ + @SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse") + @ExcelHead(title = "应补退税额", dataIndex = "ybtse") + private String ybtse; + /** + * 非居民所得项目名字 必填:是非居民所得薪金类别-无住所个人正常工资薪金、全年一次性奖金收入 + */ + private String sdxm; + /** + * 所得期间起 必填:是 YYYY-MM + */ + private String sdqjq; + /** + * 所得期间止 必填:是 YYYY-MM + */ + private String sdqjz; + } + } + } + + + /** + * 人员申报失败列表 必填:是 参考人员代报结果对象 + */ + private List rysbsblb; + /** * 4.4.1.3.1.1人员代报结果对象 */ From a2a18245bd730c192218478faf2b04a02aa74e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 11 Apr 2024 10:59:36 +0800 Subject: [PATCH 153/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=BC=B4=E6=AC=BE?= =?UTF-8?q?=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/TaxDeclareStatusService.java | 6 +++--- .../impl/AbstractTaxPaymentService.java | 4 +--- .../service/impl/SIArchivesServiceImpl.java | 2 -- .../impl/SalaryAcctCalcServiceImpl.java | 1 - .../impl/SalaryArchiveExcelServiceImpl.java | 1 - .../service/impl/SalaryArchiveServiceImpl.java | 1 - .../TaxDeclarationApiFlowWarnServiceImpl.java | 4 +--- .../impl/TaxDeclareRecordServiceImpl.java | 18 ++++++++++++------ .../impl/TaxDeclareStatusServiceImpl.java | 8 +++++--- .../TaxPaymentWithheldVoucherServiceImpl.java | 2 -- .../impl/TaxPaymentWithholdingServiceImpl.java | 9 ++++----- ...axPaymentWithholdingVoucherServiceImpl.java | 4 ---- .../wrapper/TaxDeclareRecordWrapper.java | 2 +- 13 files changed, 27 insertions(+), 35 deletions(-) diff --git a/src/com/engine/salary/service/TaxDeclareStatusService.java b/src/com/engine/salary/service/TaxDeclareStatusService.java index b2c970ef9..b40b2c738 100644 --- a/src/com/engine/salary/service/TaxDeclareStatusService.java +++ b/src/com/engine/salary/service/TaxDeclareStatusService.java @@ -23,15 +23,15 @@ public interface TaxDeclareStatusService { TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType); /** - * 获取申报记录状态列表 + * 更新主记录,返回申报记录状态列表 * @param id * @return */ - List getOrInitTaxReports(Long id); + List updateRecord(Long id); /** * 更新申报状态,同时更新主记录 * @param declareStatus */ - void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus); + void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus,boolean updateRecord); } diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index a0b762c91..25078bcf0 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -26,13 +26,12 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxpayment.TaxPaymentRequestMapper; import com.engine.salary.service.*; import com.engine.salary.util.*; -import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; import lombok.AllArgsConstructor; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.transaction.annotation.Transactional; import weaver.hrm.User; import java.math.BigDecimal; @@ -145,7 +144,6 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa return new TempWrapper(apiConfigPO, taxReturnPO, taxAgentPO, taxDeclareRecord); } - @Transactional(rollbackFor = Exception.class) public String getRequestId(TaxPaymentQueryParam param) { TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); QuerySpecialAmountResponse queryResponse = getRequestIdResponse(tempWrapper.taxReturnPO, tempWrapper.taxAgentPO.getName(), diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 811127514..fbdf3f0b6 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -314,7 +314,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService * @param currentEmployeeId */ @Override - @Transactional(rollbackFor = Exception.class) public void handleStayDelData(long currentEmployeeId) { log.info("福利档案中待减员数据自动处理逻辑开始:"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); @@ -351,7 +350,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService * 福利档案中增量数据处理 * @param currentEmployeeId */ - @Transactional(rollbackFor = Exception.class) @Override public void handleChangeData(long currentEmployeeId) { try { diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java index c48450772..1df986fef 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java @@ -135,7 +135,6 @@ // } // // @Override -// @Transactional(rollbackFor = Exception.class) // public void calcByEmployeeIds(Long salaryAcctRecordId, Collection salaryAcctEmployeeIds, DataCollectionEmployee simpleEmployee) throws Exception { // SalaryAcctRateDTO salaryAcctRate = new SalaryAcctRateDTO("" + salaryAcctRecordId); // try { diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 8e0986007..c34c1fcc3 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -403,7 +403,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch // * 导入薪资档案 // */ // @BatchImportHandler("importSalaryArchive") -// @Transactional(rollbackFor = Exception.class) // public void importSalaryArchive() { // BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage(); // log.info("【薪资档案】接收到上传的数据:{}", String.format("batchTaskId=%s, fileName=%s", message.getBatchTaskId(), message.getBatchFile().getName())); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index c6b3032c6..22b6eb738 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -253,7 +253,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe * * @param currentEmployeeId */ - @Transactional(rollbackFor = Exception.class) public void handleSuspendData(Long currentEmployeeId) { List personnelStatuss = new ArrayList() {{ add("4"); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 97833c197..276f3ab71 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -28,13 +28,12 @@ import com.engine.salary.service.TaxDeclarationApiFlowWarnService; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; -import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.transaction.annotation.Transactional; import weaver.common.MessageUtil; import weaver.email.EmailWorkRunnable; import weaver.general.BaseBean; @@ -103,7 +102,6 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax } @Override - @Transactional(rollbackFor = Exception.class) public void deleteReceiver(Long id) { TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id); SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试"); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 468e53afa..7ab44eb0c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -724,7 +724,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); declareStatus.setTaxDeclareErrorMsg(""); - getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -831,7 +831,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); declareStatus.setDeclareRequestId(declareStatus.getRequestId()); declareStatus.setRequestId(""); + //实缴(不含滞纳金) BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount()); + //应缴 BigDecimal payAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount()); if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) { // 如果是已缴纳状态,则更新已缴纳金额,判断是否需要线下退税 @@ -850,7 +852,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); } //更新申报状态 - getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true); // 如果申报失败 if (CollectionUtils.isNotEmpty(taxDeclareFails)) { @@ -921,7 +923,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 更新个税申报状态 declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); - getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -978,7 +980,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe //更新个税申报状态 declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); declareStatus.setRequestId(""); - getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); @@ -1021,7 +1023,11 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map>> map = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); + 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); } @@ -1065,7 +1071,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue()); declareStatus.setRequestId(""); - getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true); // 记录日志 TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); diff --git a/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java index f5d10ee62..d2db18c73 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java @@ -56,17 +56,19 @@ public class TaxDeclareStatusServiceImpl extends Service implements TaxDeclareSt @Override - public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus) { + public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus, boolean updateRecord) { //更新申报表状态 getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); //更新主记录 - getOrInitTaxReports(declareStatus.getTaxDeclareRecordId()); + if (updateRecord) { + updateRecord(declareStatus.getTaxDeclareRecordId()); + } } @Override - public List getOrInitTaxReports(Long id) { + public List updateRecord(Long id) { // 查询个税申报记录 TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordMapper().getById(id); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java index 22a5c0015..235bdeefd 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -17,7 +17,6 @@ import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import lombok.extern.slf4j.Slf4j; -import org.springframework.transaction.annotation.Transactional; import java.util.*; @@ -42,7 +41,6 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ return postRequest(apiConfig, url, requestParam, clazz); } - @Transactional(rollbackFor = Exception.class) @Override public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 67b2a0c2a..930a0f201 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -56,7 +56,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService } List statuses = getTaxDeclareRecordService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId()); - for (TaxDeclareStatusPO status:statuses) { + for (TaxDeclareStatusPO status : statuses) { WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) .map(WithholdingFeedbackResponse::getBody) .map(body -> { @@ -99,14 +99,13 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService status.setTaxPaidAmount(totalPaid.toString()); status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); status.setTaxPayAmount(BigDecimal.ZERO.toString()); - getTaxDeclareStatusService(user).updateTaxDeclareStatus(status); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false); } TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param); -// // 更新个税申报记录状态为已缴款 -// TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO(); -// updateTaxDeclareRecord(param, totalPaid); + //更新主记录 + getTaxDeclareStatusService(user).updateRecord(param.getTaxDeclareRecordId()); // 更新缴款请求为已反馈 updateTaxPaymentRequest(param); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 9fec5d913..de73ad3bb 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -23,7 +23,6 @@ import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.util.*; import lombok.extern.slf4j.Slf4j; -import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.List; @@ -44,7 +43,6 @@ import java.util.stream.Collectors; public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentService { @Override - @Transactional(rollbackFor = Exception.class) public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { WithholdingVoucherFeedbackResponse feedbackResponse = (WithholdingVoucherFeedbackResponse) checkBeforeGetFeedbackResponse(param); // 校验请求结果 @@ -130,7 +128,6 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS } @Override - @Transactional(rollbackFor = Exception.class) public void syncWithholdingFeedback(TaxPaymentQueryParam param) { TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); SyncWithholdingFeedbackResponse response = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), @@ -166,7 +163,6 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS } @Override - @Transactional(rollbackFor = Exception.class) public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 10ef95a47..b6eaa2e0b 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -892,6 +892,6 @@ public class TaxDeclareRecordWrapper extends Service { } public List getTaxReports(Long id) { - return getTaxDeclareStatusService(user).getOrInitTaxReports(id); + return getTaxDeclareStatusService(user).updateRecord(id); } } From 4aa66ea587d4acd7303fd7ef36540c285a60767b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 11 Apr 2024 18:57:56 +0800 Subject: [PATCH 154/298] =?UTF-8?q?=E5=A4=96=E7=B1=8D=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../employeedeclare/bo/EmployeeDeclareBO.java | 22 +-- .../bo/EmployeeDeclareRequest.java | 2 +- .../dto/EmployeeDeclareExcelDTO.java | 53 +++++- .../employeedeclare/po/EmployeeDeclarePO.java | 4 + .../bo/TaxDeclarationRequest.java | 2 +- .../bo/TaxDeclarationValueList.java | 2 +- .../bo/TaxDeclareEmployeeBO.java | 2 +- .../enums/employeedeclare/CardTypeEnum.java | 16 +- .../enums/employeedeclare/GenderEnum.java | 10 ++ .../impl/EmployeeDeclareExcelServiceImpl.java | 160 +++++++++++++----- .../TaxPaymentWithholdingServiceImpl.java | 2 +- .../wrapper/EmployeeDeclareWrapper.java | 2 +- 12 files changed, 207 insertions(+), 70 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java index 48898d83d..1e3b7243c 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java @@ -2,11 +2,8 @@ package com.engine.salary.entity.employeedeclare.bo; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; -import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; -import org.apache.commons.lang3.StringUtils; /** * @author Harryxzy @@ -23,22 +20,27 @@ public class EmployeeDeclareBO { EmployeeDeclarePO po = EmployeeDeclarePO.builder() .jobNum(dto.getJobNum()) .employeeName(dto.getEmployeeName()) - .cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) + .cardType(dto.getCardType()) .cardNum(dto.getCardNum()) - .employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus())) - .employmentType(StringUtils.isBlank(dto.getEmploymentType()) ? null : new Integer(dto.getEmploymentType())) + .nationality(dto.getNationality()) + .employmentStatus(dto.getEmploymentStatus()) + .employmentType(dto.getEmploymentType()) .employmentFirstYear(dto.getEmploymentFirstYear()) .mobile(dto.getMobile()) - .employmentDate(StringUtils.isBlank(dto.getEmploymentDate()) ? null : SalaryDateUtil.stringToDate(dto.getEmploymentDate()) ) - .dismissDate(StringUtils.isBlank(dto.getDismissDate()) ? null : SalaryDateUtil.stringToDate(dto.getDismissDate())) + .employmentDate(dto.getEmploymentDate()) + .dismissDate(dto.getDismissDate()) .disability(dto.getDisability()) .disabilityCardNo(dto.getDisabilityCardNo()) .martyrDependents(dto.getMartyrDependents()) .martyrDependentsCardNo(dto.getMartyrDependentsCardNo()) .lonelyOld(dto.getLonelyOld()) .deductExpenses(dto.getDeductExpenses()) - .gender(StringUtils.isBlank(dto.getGender()) ? null : new Integer(dto.getGender())) - .birthday(StringUtils.isBlank(dto.getBirthday()) ? null : SalaryDateUtil.stringToDate(dto.getBirthday())) + .entryDate(dto.getEntryDate()) + .departureDate(dto.getDepartureDate()) + .gender(dto.getGender()) + .birthplace(dto.getBirthplace()) + .birthday(dto.getBirthday()) + .taxReasons(dto.getTaxReasons()) .build(); return po; } diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java index b7a08373e..5527df49e 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -42,7 +42,7 @@ public class EmployeeDeclareRequest { // *姓名 employeeInfoMap.put("xm", employeeDeclare.getEmployeeName()); // *证件类型 - CardTypeEnum cardTypeEnum = CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()); + CardTypeEnum cardTypeEnum = CardTypeEnum.getByValue(employeeDeclare.getCardType()); employeeInfoMap.put("zzlx", cardTypeEnum.getDefaultLabel()); // *证件号码 employeeInfoMap.put("zzhm", employeeDeclare.getCardNum()); diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java index 8880ce557..0da6dea75 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java @@ -11,6 +11,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; +import java.util.Date; import java.util.Set; /** @@ -67,27 +68,39 @@ public class EmployeeDeclareExcelDTO { // 证件类型 @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") - private String cardType; + private Integer cardType; // 证件号码 @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") private String cardNum; + // 性别 + @SalaryTableColumn(text = "国籍", width = "10%", column = "nationality") + @TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality") + private String nationality; + // 性别 @SalaryTableColumn(text = "性别", width = "10%", column = "gender") @TableTitle(title = "性别", dataIndex = "gender", key = "gender") - private String gender; + private Integer gender; + + /** + * 出生地 + */ + @SalaryTableColumn(text = "出生地", width = "10%", column = "birthplace") + @TableTitle(title = "出生地", dataIndex = "birthplace", key = "birthplace") + private String birthplace; // 出生日期 @SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday") @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") - private String birthday; + private Date birthday; // 人员状态 @SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus") @TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus") - private String employmentStatus; + private Integer employmentStatus; // 手机号码 @SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile") @@ -97,12 +110,12 @@ public class EmployeeDeclareExcelDTO { // 任职受雇从业类型 @SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType") @TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType") - private String employmentType; + private Integer employmentType; // 任职受雇从业日期 @SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate") @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") - private String employmentDate; + private Date employmentDate; // 入职年度就业情形 private String employmentFirstYear; @@ -111,7 +124,33 @@ public class EmployeeDeclareExcelDTO { // 离职日期 @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") - private String dismissDate; + private Date dismissDate; + + /** + * 首次入境时间 + */ + @SalaryTableColumn(text = "首次入境时间", width = "10%", column = "entryDate") + @TableTitle(title = "首次入境时间", dataIndex = "entryDate", key = "entryDate") + private Date entryDate; + + /** + * 预计离境时间 + */ + @SalaryTableColumn(text = "预计离境时间", width = "10%", column = "departureDate") + @TableTitle(title = "预计离境时间", dataIndex = "departureDate", key = "departureDate") + private Date departureDate; + + /** + * 涉税事由, + * 任职受雇 + * 提供临时劳务 + * 转让财产 + * 从事投资和经营活动 + * 其他 + */ + @SalaryTableColumn(text = "涉税事由", width = "10%", column = "taxReasons") + @TableTitle(title = "涉税事由", dataIndex = "taxReasons", key = "taxReasons") + private String taxReasons; // 是否残疾 private Integer disability; diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index 6e954de8f..b282f68a8 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -2,6 +2,8 @@ package com.engine.salary.entity.employeedeclare.po; import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.GenderEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -78,6 +80,7 @@ public class EmployeeDeclarePO { /** * 证件类型 + * @see CardTypeEnum */ @ElogTransform(name = "证件类型") private Integer cardType; @@ -102,6 +105,7 @@ public class EmployeeDeclarePO { /** * 性别 + * @see GenderEnum */ @ElogTransform(name = "性别") private Integer gender; diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 8e1cf9c1a..b64ac8b12 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -146,7 +146,7 @@ public class TaxDeclarationRequest { // 姓名 requestParam.put("xm", employeeDeclare.getEmployeeName()); // 证件类型 - requestParam.put("zzlx", CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel()); + requestParam.put("zzlx", CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()); // 证件号码 requestParam.put("zzhm", employeeDeclare.getCardNum()); // 所得项目 diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index 8208035b4..f5e8acf8c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -92,7 +92,7 @@ public class TaxDeclarationValueList { if (employeeDeclare != null) { dataMap.put(cnKey ? "工号" : "jobNum", employeeDeclare.getJobNum()); dataMap.put(cnKey ? "姓名" : "username", employeeDeclare.getEmployeeName()); - dataMap.put(cnKey ? "证件类型" : "cardType",CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel() ); + dataMap.put(cnKey ? "证件类型" : "cardType",CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel() ); dataMap.put(cnKey ? "证件号码" : "cardNum", employeeDeclare.getCardNum()); } else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java index 46bd2cf8b..1765ddc65 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -56,7 +56,7 @@ public class TaxDeclareEmployeeBO { abnormalEmployeeListDTO .setEmployeeName(employeeDeclare.getEmployeeName()) .setJobNum(employeeDeclare.getJobNum()) - .setCardType(CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel()) + .setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()) .setCardNum(employeeDeclare.getCardNum()) .setDeclareStatus(declareStatusEnum) .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); diff --git a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java index 0378a49ba..4b0af0325 100644 --- a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -2,6 +2,7 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Arrays; import java.util.Objects; /** @@ -44,7 +45,7 @@ public enum CardTypeEnum implements BaseEnum { return labelId; } - public static CardTypeEnum getDefaultLabelByValue(Integer value) { + public static CardTypeEnum getByValue(Integer value) { for (CardTypeEnum e : CardTypeEnum.values()) { if (Objects.equals(e.getValue(), value)) { return e; @@ -52,4 +53,17 @@ public enum CardTypeEnum implements BaseEnum { } return RESIDENT_IDENTITY_CARDS; } + + public static CardTypeEnum getByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + CardTypeEnum[] enumAry = CardTypeEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i]; + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java index a4849d129..f6590e131 100644 --- a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java @@ -3,6 +3,7 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; import java.util.Arrays; +import java.util.Objects; /** * 性别 @@ -56,4 +57,13 @@ public enum GenderEnum implements BaseEnum { } return null; } + + public static GenderEnum getDefaultLabelByValue(Integer value) { + for (GenderEnum e : GenderEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return MALE; + } } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index de5a7a82a..98589a15f 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -16,10 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; -import com.engine.salary.enums.employeedeclare.CardTypeEnum; -import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; -import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; -import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -101,14 +98,20 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee List row = Lists.newArrayList(); row.add(employeeDeclare.getJobNum()); row.add(employeeDeclare.getEmployeeName()); - row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + row.add(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()); row.add(employeeDeclare.getCardNum()); + row.add(employeeDeclare.getNationality()); + row.add(GenderEnum.getDefaultLabelByValue(employeeDeclare.getGender()).getDefaultLabel()); + row.add(employeeDeclare.getBirthplace()); + row.add(employeeDeclare.getBirthday()); row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); - row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel()); - row.add(employeeDeclare.getEmploymentFirstYear()); row.add(employeeDeclare.getMobile()); + row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel()); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEntryDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDepartureDate())); + row.add(employeeDeclare.getTaxReasons()); row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); row.add(employeeDeclare.getDisabilityCardNo()); row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); @@ -211,7 +214,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); // 表头 List headers = ExcelSupport.getSheetHeader(sheet, 0); - + // 检查表头 String isCorrectHeader = checkHeader(headers, headerList); if (isCorrectHeader != null) { @@ -235,7 +238,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); for (String dataKey : headerList) { String dataValue = Util.null2String(map.get(dataKey)); - if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel( 0, "工号"))) { + if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "工号"))) { if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); @@ -253,30 +256,66 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee employeeDeclareExcel.setEmployeeName(dataValue); } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件类型"))) { - employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue().toString()); + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件类型不能为空")); + errorData.add(errorMessageMap); + } else { + CardTypeEnum cardTypeEnum = CardTypeEnum.getByDefaultLabel(dataValue); + if (cardTypeEnum == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件类型填写错误,只能填写居民身份证、外国护照")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setCardType(cardTypeEnum.getValue()); + } + } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件号码"))) { if (StringUtils.isEmpty(dataValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码不能为空")); errorData.add(errorMessageMap); - } else if (!SalaryCardUtil.checkIdNum(dataValue)) { - isError = true; - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码格式不正确")); - errorData.add(errorMessageMap); } else { // 身份证号全部转为大写 employeeDeclareExcel.setCardNum(dataValue.toUpperCase()); - employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString()); - employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString()); +// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString()); +// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString()); } - } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "人员状态"))) { + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "国籍"))) { + employeeDeclareExcel.setNationality(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "性别"))) { + Integer gender = GenderEnum.getValueByDefaultLabel(dataValue); + if (gender == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "性别填写有误!")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setGender(gender); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "出生地"))) { + employeeDeclareExcel.setBirthplace(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "出生日期"))) { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setBirthday(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "状态"))) { boolean legalDataValue = false; for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { legalDataValue = true; - employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue().toString()); + employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); break; } } @@ -286,23 +325,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "人员状态只能填写正常或非正常")); errorData.add(errorMessageMap); } - } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型"))) { - boolean legalDataValue = false; - for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { - if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { - legalDataValue = true; - employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue().toString()); - break; - } - } - if (!legalDataValue) { - isError = true; - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型填写错误")); - errorData.add(errorMessageMap); - } - } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "入职年度就业情形"))) { - employeeDeclareExcel.setEmploymentFirstYear(dataValue); } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "手机号码"))) { if (StringUtils.isEmpty(dataValue)) { isError = true; @@ -317,6 +339,21 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } else { employeeDeclareExcel.setMobile(dataValue); } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型"))) { + boolean legalDataValue = false; + for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { + if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { + legalDataValue = true; + employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); + break; + } + } + if (!legalDataValue) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型填写错误")); + errorData.add(errorMessageMap); + } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业日期"))) { if (StringUtils.isEmpty(dataValue)) { if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue().toString())) { @@ -327,7 +364,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } } else { if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { - dataValue = dataValue.substring(0,10); + dataValue = dataValue.substring(0, 10); } if (!SalaryDateUtil.checkDay(dataValue)) { isError = true; @@ -335,7 +372,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); errorData.add(errorMessageMap); } else { - employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); + employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); } } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "离职日期"))) { @@ -348,7 +385,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } } else { if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { - dataValue = dataValue.substring(0,10); + dataValue = dataValue.substring(0, 10); } if (!SalaryDateUtil.checkDay(dataValue)) { isError = true; @@ -356,9 +393,35 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); errorData.add(errorMessageMap); } else { - employeeDeclareExcel.setDismissDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); + employeeDeclareExcel.setDismissDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); } } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "首次入境时间"))) { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEntryDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "预计离境时间"))) { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setDepartureDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "涉税事由"))) { + employeeDeclareExcel.setTaxReasons(dataValue); } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否残疾"))) { if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); @@ -528,12 +591,12 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } - public static String[] getNullPropertyNames (Object source) { + public static String[] getNullPropertyNames(Object source) { final BeanWrapper src = new BeanWrapperImpl(source); PropertyDescriptor[] pds = src.getPropertyDescriptors(); Set emptyNames = new HashSet<>(); - for(PropertyDescriptor pd : pds) { + for (PropertyDescriptor pd : pds) { Object srcValue = src.getPropertyValue(pd.getName()); // 此处判断可根据需求修改 if (srcValue == null) { @@ -545,7 +608,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } - private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee, EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, Date taxCycle, Date now) { @@ -1086,12 +1148,18 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee headers.add(SalaryI18nUtil.getI18nLabel(111111, "姓名")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件类型")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件号码")); - headers.add(SalaryI18nUtil.getI18nLabel(111111, "人员状态")); - headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业类型")); - headers.add(SalaryI18nUtil.getI18nLabel(111111, "入职年度就业情形")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "国籍")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "性别")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "出生地")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "出生日期")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "状态")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "手机号码")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业类型")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业日期")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "离职日期")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "首次入境时间")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "预计离境时间")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "涉税事由")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否残疾")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "残疾证号")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否烈属")); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 930a0f201..0f8e4622f 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -141,7 +141,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); - requestParam.put("sblx", 1); + requestParam.put("sblx", param.getReportType()); cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); return tempWrapper; } diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 953f01a78..f4ab000ff 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -284,7 +284,7 @@ public class EmployeeDeclareWrapper extends Service { .setNationality(employeeDeclare.getNationality()) .setEntryDate(employeeDeclare.getEntryDate()) .setDepartureDate(employeeDeclare.getDepartureDate()) - .setCardType(CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType())) + .setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType())) .setCardNum(employeeDeclare.getCardNum()) .setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class)) .setBirthday(employeeDeclare.getBirthday()) From 0e6449e1e2933e2a63ddeafcf50d2b5b92a420e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 12 Apr 2024 17:46:53 +0800 Subject: [PATCH 155/298] =?UTF-8?q?=E5=A4=96=E7=B1=8D=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202404120303.sql | 18 +++++++++ resource/sqlupgrade/GS/sql202404120303.sql | 18 +++++++++ resource/sqlupgrade/JC/sql202404120303.sql | 18 +++++++++ resource/sqlupgrade/Mysql/sql202404120303.sql | 17 +++++++++ .../sqlupgrade/Oracle/sql202404120303.sql | 17 +++++++++ resource/sqlupgrade/PG/sql202404120303.sql | 17 +++++++++ .../sqlupgrade/SQLServer/sql202404120303.sql | 18 +++++++++ resource/sqlupgrade/ST/sql202404120303.sql | 18 +++++++++ .../service/TaxDeclareRecordService.java | 3 -- .../service/TaxDeclareStatusService.java | 3 ++ .../impl/TaxDeclareRecordServiceImpl.java | 5 +-- .../impl/TaxDeclareStatusServiceImpl.java | 5 +++ .../TaxPaymentWithholdingServiceImpl.java | 37 ++++++++++--------- ...xPaymentWithholdingVoucherServiceImpl.java | 8 +++- 14 files changed, 177 insertions(+), 25 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202404120303.sql create mode 100644 resource/sqlupgrade/GS/sql202404120303.sql create mode 100644 resource/sqlupgrade/JC/sql202404120303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202404120303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202404120303.sql create mode 100644 resource/sqlupgrade/PG/sql202404120303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202404120303.sql create mode 100644 resource/sqlupgrade/ST/sql202404120303.sql diff --git a/resource/sqlupgrade/DM/sql202404120303.sql b/resource/sqlupgrade/DM/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/resource/sqlupgrade/GS/sql202404120303.sql b/resource/sqlupgrade/GS/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/resource/sqlupgrade/JC/sql202404120303.sql b/resource/sqlupgrade/JC/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202404120303.sql b/resource/sqlupgrade/Mysql/sql202404120303.sql new file mode 100644 index 000000000..67da1a7d2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202404120303.sql @@ -0,0 +1,17 @@ +CREATE TABLE hrsa_tax_declare_status ( +id bigint(0) NOT NULL , +tax_declare_record_id bigint(0) NULL , +report_type int(0) NULL , +request_id varchar(100) , +tax_declare_type tinyint(0) NULL , +tax_declare_status tinyint(0) NULL , +display_update_icon tinyint(0) NULL , +tax_declare_error_msg varchar(1000) , +person_num int(0) NULL , +tax_pay_amount varchar(255) , +tax_paid_amount varchar(255) , +tax_pure_paid_amount varchar(255) , +declare_request_id varchar(100) , +delete_type int(0) NULL, +PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202404120303.sql b/resource/sqlupgrade/Oracle/sql202404120303.sql new file mode 100644 index 000000000..c024ae2a7 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202404120303.sql @@ -0,0 +1,17 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202404120303.sql b/resource/sqlupgrade/PG/sql202404120303.sql new file mode 100644 index 000000000..6bad5c7fb --- /dev/null +++ b/resource/sqlupgrade/PG/sql202404120303.sql @@ -0,0 +1,17 @@ +CREATE TABLE hrsa_tax_declare_status ( +id bigserial NOT NULL , +tax_declare_record_id bigint NULL , +report_type int NULL , +request_id varchar(100) , +tax_declare_type int NULL , +tax_declare_status int NULL , +display_update_icon int NULL , +tax_declare_error_msg varchar(1000) , +person_num int NULL , +tax_pay_amount varchar(255) , +tax_paid_amount varchar(255) , +tax_pure_paid_amount varchar(255) , +declare_request_id varchar(100) , +delete_type int NULL, +PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202404120303.sql b/resource/sqlupgrade/SQLServer/sql202404120303.sql new file mode 100644 index 000000000..2a9169a28 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202404120303.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_status +( +id bigint primary key , +tax_declare_record_id bigint NULL , +report_type int NULL , +request_id varchar(100) , +tax_declare_type tinyint NULL , +tax_declare_status tinyint NULL , +display_update_icon tinyint NULL , +tax_declare_error_msg varchar(1000) , +person_num int NULL , +tax_pay_amount varchar(255) , +tax_paid_amount varchar(255) , +tax_pure_paid_amount varchar(255) , +declare_request_id varchar(100) , +delete_type int NULL +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202404120303.sql b/resource/sqlupgrade/ST/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index ad6319472..424e296d4 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -8,7 +8,6 @@ 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.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -134,8 +133,6 @@ public interface TaxDeclareRecordService { */ void declare(Long id, Integer reportType); - List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId); - /** * 个税申报获取反馈 * diff --git a/src/com/engine/salary/service/TaxDeclareStatusService.java b/src/com/engine/salary/service/TaxDeclareStatusService.java index b40b2c738..f6f6674b0 100644 --- a/src/com/engine/salary/service/TaxDeclareStatusService.java +++ b/src/com/engine/salary/service/TaxDeclareStatusService.java @@ -14,6 +14,9 @@ import java.util.List; **/ public interface TaxDeclareStatusService { + List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId); + + /** * 获取申报记录状态 * @param taxDeclareRecordId diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 7ab44eb0c..847f694ff 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -740,10 +740,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } - @Override - public List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) { - return getTaxDeclareStatusMapper().listSome(TaxDeclareStatusPO.builder().taxDeclareRecordId(taxDeclareRecordId).build()); - } + @Override public void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) { diff --git a/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java index d2db18c73..88e92f045 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java @@ -49,6 +49,11 @@ public class TaxDeclareStatusServiceImpl extends Service implements TaxDeclareSt return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } + @Override + public List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) { + return getTaxDeclareStatusMapper().listSome(TaxDeclareStatusPO.builder().taxDeclareRecordId(taxDeclareRecordId).build()); + } + @Override public TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType) { return getTaxDeclareStatusMapper().getDeclareStatus(taxDeclareRecordId, reportType); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 0f8e4622f..743f1631c 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -55,7 +55,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService throw new SalaryRunTimeException(msg); } - List statuses = getTaxDeclareRecordService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId()); + List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId()); for (TaxDeclareStatusPO status : statuses) { WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) .map(WithholdingFeedbackResponse::getBody) @@ -141,7 +141,6 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); - requestParam.put("sblx", param.getReportType()); cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); return tempWrapper; } @@ -155,22 +154,26 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); -// if (paymentRequestPO != null) { - String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; - QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); - SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) - .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); - SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) - || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); +// if (paymentRequestPO != null) { + List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); + statuses.forEach(status -> { + requestParam.put("sblx", status.getReportType()); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) + .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); - getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO - .builder() - .feedback(SalaryOnOffEnum.ON.getValue()) - .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) - .taxAgentId(taxDeclareRecord.getTaxAgentId()) - .taxYearMonth(taxDeclareRecord.getTaxCycle()) - .build()); -// } + getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO + .builder() + .feedback(SalaryOnOffEnum.ON.getValue()) + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .build()); + }); + +// } } protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index de73ad3bb..028a86c7c 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.entity.taxpayment.bo.TaxPaymentBO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; import com.engine.salary.entity.taxpayment.dto.TaxWithholdingVoucherFeedbackDTO; @@ -112,6 +113,11 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); // if (paymentRequestPO != null) { + + List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); + statuses.forEach(status -> { + requestParam.put("sblx", status.getReportType()); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) @@ -124,6 +130,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); + }); // } } @@ -166,7 +173,6 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); - requestParam.put("sblx", 1); cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); } From 149674548834980a8a8a8aa0b171e741d142328b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Apr 2024 20:12:48 +0800 Subject: [PATCH 156/298] =?UTF-8?q?=E4=BD=9C=E5=BA=9F=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/EmployeeInformationChangeParam.java | 43 +++++++++++ .../param/EmployeeInvalidParam.java | 31 ++++++++ .../taxagent/TaxAgentTaxReturnMapper.xml | 3 +- .../remote/tax/client/EmployeeClient.java | 73 +++++++++++++++++-- .../BatchInvalidSubmissionRequest.java | 71 ++++++++++++++++++ .../employee/InformationChangeRequest.java | 60 +++++++++++++++ .../service/EmployeeDeclareService.java | 14 ++++ .../impl/EmployeeDeclareServiceImpl.java | 41 +++++++++++ .../salary/web/EmployeeDeclareController.java | 16 ++++ .../wrapper/EmployeeDeclareWrapper.java | 11 +++ 10 files changed, 357 insertions(+), 6 deletions(-) create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeInformationChangeParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeInvalidParam.java create mode 100644 src/com/engine/salary/remote/tax/request/employee/BatchInvalidSubmissionRequest.java create mode 100644 src/com/engine/salary/remote/tax/request/employee/InformationChangeRequest.java diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeInformationChangeParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInformationChangeParam.java new file mode 100644 index 000000000..7809661f7 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInformationChangeParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 人员报送 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeInformationChangeParam extends BaseQueryParam { + + /** + * 人员记录id + */ + @DataCheck(require = true,message = "参数错误,id不能为空") + private Long id; + + /** + * + */ + private String name; + + //证件类型 + private CardTypeEnum cardType; + + //证件号码 + private String cardNum; + + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeInvalidParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInvalidParam.java new file mode 100644 index 000000000..fa67731ce --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInvalidParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 人员报送 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeInvalidParam extends BaseQueryParam { + + /** + * 人员记录id + */ + @DataCheck(require = true,message = "参数错误,id不能为空") + private Long id; + + +} diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml index 59ce83251..da28243a6 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -70,7 +70,8 @@ - SELECT FROM hrsa_tax_agent_tax_return t diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java index 90da29385..f1f452c13 100644 --- a/src/com/engine/salary/remote/tax/client/EmployeeClient.java +++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java @@ -2,7 +2,9 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareParam; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.remote.tax.request.employee.BatchInvalidSubmissionRequest; import com.engine.salary.remote.tax.request.employee.GetCompanyEmployeeRequest; +import com.engine.salary.remote.tax.request.employee.InformationChangeRequest; import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse; import com.engine.salary.util.HttpUtil; import com.engine.salary.util.JsonUtil; @@ -13,6 +15,7 @@ import org.apache.commons.lang3.StringUtils; import java.util.HashMap; import java.util.Map; +import java.util.UUID; /** * 人员信息登记报送客户端 @@ -34,8 +37,8 @@ public class EmployeeClient extends TaxBaseClient { String url = super.apiConfig.getHost() + "gateway/iit/data/getCompanyEmployee"; GetCompanyEmployeeRequest getCompanyEmployeeRequest = new GetCompanyEmployeeRequest(); - getCompanyEmployeeRequest.setNsrsbh( returnPO.getTaxCode()); - getCompanyEmployeeRequest.setQymc(""); + getCompanyEmployeeRequest.setNsrsbh(returnPO.getTaxCode()); + getCompanyEmployeeRequest.setQymc(returnPO.getTaxAgentName()); getCompanyEmployeeRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); getCompanyEmployeeRequest.setAreaid(returnPO.getAreaCode()); getCompanyEmployeeRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); @@ -45,10 +48,10 @@ public class EmployeeClient extends TaxBaseClient { getCompanyEmployeeRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); getCompanyEmployeeRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); getCompanyEmployeeRequest.setJmsmmm("0"); - getCompanyEmployeeRequest.setMmlx(""+returnPO.getPasswordType()); + getCompanyEmployeeRequest.setMmlx("" + returnPO.getPasswordType()); getCompanyEmployeeRequest.setSsyf(SalaryDateUtil.getFormatYYYYMM(param.getTaxCycle())); - getCompanyEmployeeRequest.setPageNo(""+param.getCurrent()); - getCompanyEmployeeRequest.setPageSize(""+param.getPageSize()); + getCompanyEmployeeRequest.setPageNo("" + param.getCurrent()); + getCompanyEmployeeRequest.setPageSize("" + param.getPageSize()); String reqJson = JsonUtil.toJsonString(getCompanyEmployeeRequest); log.info("getCompanyEmployee params --- \n{}\n", reqJson); @@ -62,4 +65,64 @@ public class EmployeeClient extends TaxBaseClient { } + public String batchInvalidSubmission(BatchInvalidSubmissionRequest batchInvalidSubmissionRequest) { + + String url = super.apiConfig.getHost() + "gateway/iit/declare/batchInvalidSubmission"; + batchInvalidSubmissionRequest.setNsrsbh(returnPO.getTaxCode()); + batchInvalidSubmissionRequest.setBizNo(UUID.randomUUID().toString().replace("-", "")); + batchInvalidSubmissionRequest.setQymc(returnPO.getTaxAgentName()); + batchInvalidSubmissionRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + batchInvalidSubmissionRequest.setAreaid(returnPO.getAreaCode()); + batchInvalidSubmissionRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + batchInvalidSubmissionRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + batchInvalidSubmissionRequest.setJmsbmm("0"); + batchInvalidSubmissionRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + batchInvalidSubmissionRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + batchInvalidSubmissionRequest.setJmsmmm("0"); + batchInvalidSubmissionRequest.setMmlx("" + returnPO.getPasswordType()); + + + String reqJson = JsonUtil.toJsonString(batchInvalidSubmissionRequest); + log.info("batchInvalidSubmission params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("batchInvalidSubmission res --- {}", res); +// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class); + return res; + } + + public String informationChange(InformationChangeRequest informationChangeRequest) { + + String url = super.apiConfig.getHost() + "gateway/iit/employee/informationChange"; + informationChangeRequest.setNsrsbh(returnPO.getTaxCode()); + informationChangeRequest.setBizNo(UUID.randomUUID().toString().replace("-", "")); + informationChangeRequest.setQymc(returnPO.getTaxAgentName()); + informationChangeRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + informationChangeRequest.setAreaid(returnPO.getAreaCode()); + informationChangeRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + informationChangeRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + informationChangeRequest.setJmsbmm("0"); + informationChangeRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + informationChangeRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + informationChangeRequest.setJmsmmm("0"); + informationChangeRequest.setMmlx("" + returnPO.getPasswordType()); + + + String reqJson = JsonUtil.toJsonString(informationChangeRequest); + log.info("informationChangeRequest params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("informationChangeRequest res --- {}", res); +// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class); + return res; + } + } diff --git a/src/com/engine/salary/remote/tax/request/employee/BatchInvalidSubmissionRequest.java b/src/com/engine/salary/remote/tax/request/employee/BatchInvalidSubmissionRequest.java new file mode 100644 index 000000000..a56c5103f --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/BatchInvalidSubmissionRequest.java @@ -0,0 +1,71 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchInvalidSubmissionRequest { + + + private String bizNo; + + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 企业名称 必填:是 扣缴义务人名称:例如:测试网络科技有限公司 + */ + private String qymc; + /** + * 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:条件必填 分部门代报时必传 + */ + private String bmbh; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 实名账号 必填:是 + */ + private String smzh; + /** + * 实名密码 必填:是 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明 + */ + private String jmsmmm; + + /** + * 密码类型 必填:是 0表示申报密码; 2表示实名账号实名密码 + */ + private String mmlx; + + /** + * 人员列表 必填:是 + */ + protected List rylb; + + + @Data + public static class RY { + private String xm; + private String zzhm; + private String zzlx; + } +} diff --git a/src/com/engine/salary/remote/tax/request/employee/InformationChangeRequest.java b/src/com/engine/salary/remote/tax/request/employee/InformationChangeRequest.java new file mode 100644 index 000000000..32d364545 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/InformationChangeRequest.java @@ -0,0 +1,60 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +@Data +public class InformationChangeRequest { + + + private String bizNo; + + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 企业名称 必填:是 扣缴义务人名称:例如:测试网络科技有限公司 + */ + private String qymc; + /** + * 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:条件必填 分部门代报时必传 + */ + private String bmbh; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 实名账号 必填:是 + */ + private String smzh; + /** + * 实名密码 必填:是 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明 + */ + private String jmsmmm; + + /** + * 密码类型 必填:是 0表示申报密码; 2表示实名账号实名密码 + */ + private String mmlx; + + private String xm; + private String zzlx; + private String zzhm; +} diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index ed184159a..3243a0234 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -176,6 +176,19 @@ public interface EmployeeDeclareService{ */ void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate); + /** + * 作废人员 + * @param param + */ + String invalid(EmployeeInvalidParam param); + + /** + * 关键信息变更 + * @param param + * @return + */ + String informationChange(EmployeeInformationChangeParam param); + /** * 同步任职受雇日期为入职日期 * @@ -184,4 +197,5 @@ public interface EmployeeDeclareService{ String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param); void batchInsert(List insertList); + } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 3fb74033c..f21a640c0 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -42,6 +42,9 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; +import com.engine.salary.remote.tax.client.EmployeeClient; +import com.engine.salary.remote.tax.request.employee.BatchInvalidSubmissionRequest; +import com.engine.salary.remote.tax.request.employee.InformationChangeRequest; import com.engine.salary.service.*; import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; @@ -718,6 +721,44 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } } + @Override + public String invalid(EmployeeInvalidParam param) { + List employeeDeclarePOS = listByIds(Collections.singletonList(param.getId())); + if (CollectionUtils.isEmpty(employeeDeclarePOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "未找到该人员")); + } + + BatchInvalidSubmissionRequest request = new BatchInvalidSubmissionRequest(); + List rys = employeeDeclarePOS.stream().map(po -> { + BatchInvalidSubmissionRequest.RY ry = new BatchInvalidSubmissionRequest.RY(); + ry.setXm(po.getEmployeeName()); + ry.setZzhm(po.getCardNum()); + ry.setZzlx(CardTypeEnum.getByValue(po.getCardType()).getDefaultLabel()); + return ry; + }).collect(Collectors.toList()); + request.setRylb(rys); + + EmployeeClient employeeClient = new EmployeeClient(employeeDeclarePOS.get(0).getTaxAgentId()); + String s = employeeClient.batchInvalidSubmission(request); + return s; + } + + @Override + public String informationChange(EmployeeInformationChangeParam param) { + EmployeeDeclarePO employeeDeclarePO = getById(param.getId()); + if (employeeDeclarePO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "未找到该人员")); + } + + InformationChangeRequest request =new InformationChangeRequest(); + request.setXm(param.getName()); + request.setZzlx(param.getCardType().getDefaultLabel()); + request.setZzhm(param.getCardNum()); + EmployeeClient employeeClient = new EmployeeClient(employeeDeclarePO.getTaxAgentId()); + String s = employeeClient.informationChange(request); + return s; + } + @Override public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) { List employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index fa54d79f3..c94c9da12 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -242,6 +242,22 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); } + @POST + @Path("/invalid") + @Produces(MediaType.APPLICATION_JSON) + public String invalid(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeInvalidParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::invalid, param); + } + + @POST + @Path("/informationChange") + @Produces(MediaType.APPLICATION_JSON) + public String informationChange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeInformationChangeParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::informationChange, param); + } + /** * 人员报送-后端业务逻辑是否已经完成 * diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index f4ab000ff..fe681eb07 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -543,6 +543,17 @@ public class EmployeeDeclareWrapper extends Service { return employeeDeclareRate.getIndex(); } + public String invalid(EmployeeInvalidParam param) { + return getEmployeeDeclareService(user).invalid(param); + } + + public String informationChange(EmployeeInformationChangeParam param) { + return getEmployeeDeclareService(user).informationChange(param); + } + + + + /** * 获取人员报送相关后端接口是否已经完成 * From a27ad1f0701c16d536f7fc5ca0cd1459a8dcfd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Apr 2024 20:26:56 +0800 Subject: [PATCH 157/298] =?UTF-8?q?=E5=B9=B6=E6=A1=A3=E6=A1=88=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../remote/tax/client/EmployeeClient.java | 45 ++++++++++++ .../MergedEmployeeArchivesRequest.java | 71 +++++++++++++++++++ .../impl/EmployeeDeclareServiceImpl.java | 1 + 3 files changed, 117 insertions(+) create mode 100644 src/com/engine/salary/remote/tax/request/employee/MergedEmployeeArchivesRequest.java diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java index f1f452c13..0bbee002f 100644 --- a/src/com/engine/salary/remote/tax/client/EmployeeClient.java +++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java @@ -5,6 +5,7 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; import com.engine.salary.remote.tax.request.employee.BatchInvalidSubmissionRequest; import com.engine.salary.remote.tax.request.employee.GetCompanyEmployeeRequest; import com.engine.salary.remote.tax.request.employee.InformationChangeRequest; +import com.engine.salary.remote.tax.request.employee.MergedEmployeeArchivesRequest; import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse; import com.engine.salary.util.HttpUtil; import com.engine.salary.util.JsonUtil; @@ -13,6 +14,7 @@ import com.engine.salary.util.SingnatureData; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -125,4 +127,47 @@ public class EmployeeClient extends TaxBaseClient { return res; } + + public String mergedEmployeeArchives(MergedEmployeeArchivesRequest mergedEmployeeArchivesRequest) { + + String url = super.apiConfig.getHost() + "gateway/iit/mergedEmployeeArchives/query"; + mergedEmployeeArchivesRequest.setNsrsbh(returnPO.getTaxCode()); + mergedEmployeeArchivesRequest.setBizNo(UUID.randomUUID().toString().replace("-", "")); + mergedEmployeeArchivesRequest.setQymc(returnPO.getTaxAgentName()); + mergedEmployeeArchivesRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + mergedEmployeeArchivesRequest.setAreaid(returnPO.getAreaCode()); + mergedEmployeeArchivesRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + mergedEmployeeArchivesRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + mergedEmployeeArchivesRequest.setJmsbmm("0"); + mergedEmployeeArchivesRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + mergedEmployeeArchivesRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + mergedEmployeeArchivesRequest.setJmsmmm("0"); + mergedEmployeeArchivesRequest.setMmlx("" + returnPO.getPasswordType()); + + + String reqJson = JsonUtil.toJsonString(mergedEmployeeArchivesRequest); + log.info("mergedEmployeeArchivesRequest params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("mergedEmployeeArchivesRequest res --- {}", res); +// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class); + return res; + } + + public String mergedEmployeeArchivesFeedback(String requestId) { + + String url = super.apiConfig.getHost() + "gateway/iit/mergedEmployeeArchives/getFeedback"; + Map params = new HashMap<>(1); + params.put("requestId", requestId); + log.info("mergedEmployeeArchivesFeedback requestId --- \n{}\n", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("mergedEmployeeArchivesFeedback res --- {}", res); +// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class); + return res; + } } diff --git a/src/com/engine/salary/remote/tax/request/employee/MergedEmployeeArchivesRequest.java b/src/com/engine/salary/remote/tax/request/employee/MergedEmployeeArchivesRequest.java new file mode 100644 index 000000000..fa6c67adf --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/MergedEmployeeArchivesRequest.java @@ -0,0 +1,71 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +import java.util.List; + +@Data +public class MergedEmployeeArchivesRequest { + + + private String bizNo; + + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 企业名称 必填:是 扣缴义务人名称:例如:测试网络科技有限公司 + */ + private String qymc; + /** + * 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:条件必填 分部门代报时必传 + */ + private String bmbh; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 实名账号 必填:是 + */ + private String smzh; + /** + * 实名密码 必填:是 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明 + */ + private String jmsmmm; + + /** + * 密码类型 必填:是 0表示申报密码; 2表示实名账号实名密码 + */ + private String mmlx; + + /** + * 人员列表 必填:是 + */ + protected List bdrys; + + + @Data + public static class RY { + private String xm; + private String zzlx; + private String zzhm; + } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index f21a640c0..a88612e7e 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -759,6 +759,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla return s; } + @Override public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) { List employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); From 1c2f0f516a0144b4d5c80ff93e1b39e9bcdd874f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 23 Apr 2024 11:39:41 +0800 Subject: [PATCH 158/298] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8Dsql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202309050103.sql | 3 --- resource/sqlupgrade/GS/sql202309050103.sql | 3 --- resource/sqlupgrade/JC/sql202309050103.sql | 3 --- resource/sqlupgrade/Mysql/sql202309050103.sql | 1 - resource/sqlupgrade/Oracle/sql202309050103.sql | 2 -- resource/sqlupgrade/PG/sql202309050103.sql | 2 -- resource/sqlupgrade/SQLServer/sql202309050103.sql | 2 -- resource/sqlupgrade/ST/sql202309050103.sql | 3 --- 8 files changed, 19 deletions(-) delete mode 100644 resource/sqlupgrade/DM/sql202309050103.sql delete mode 100644 resource/sqlupgrade/GS/sql202309050103.sql delete mode 100644 resource/sqlupgrade/JC/sql202309050103.sql delete mode 100644 resource/sqlupgrade/Mysql/sql202309050103.sql delete mode 100644 resource/sqlupgrade/Oracle/sql202309050103.sql delete mode 100644 resource/sqlupgrade/PG/sql202309050103.sql delete mode 100644 resource/sqlupgrade/SQLServer/sql202309050103.sql delete mode 100644 resource/sqlupgrade/ST/sql202309050103.sql diff --git a/resource/sqlupgrade/DM/sql202309050103.sql b/resource/sqlupgrade/DM/sql202309050103.sql deleted file mode 100644 index e9e5dfeee..000000000 --- a/resource/sqlupgrade/DM/sql202309050103.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); -/ - diff --git a/resource/sqlupgrade/GS/sql202309050103.sql b/resource/sqlupgrade/GS/sql202309050103.sql deleted file mode 100644 index e9e5dfeee..000000000 --- a/resource/sqlupgrade/GS/sql202309050103.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); -/ - diff --git a/resource/sqlupgrade/JC/sql202309050103.sql b/resource/sqlupgrade/JC/sql202309050103.sql deleted file mode 100644 index e9e5dfeee..000000000 --- a/resource/sqlupgrade/JC/sql202309050103.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); -/ - diff --git a/resource/sqlupgrade/Mysql/sql202309050103.sql b/resource/sqlupgrade/Mysql/sql202309050103.sql deleted file mode 100644 index 67dd54d95..000000000 --- a/resource/sqlupgrade/Mysql/sql202309050103.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050103.sql b/resource/sqlupgrade/Oracle/sql202309050103.sql deleted file mode 100644 index c010cb4ef..000000000 --- a/resource/sqlupgrade/Oracle/sql202309050103.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5) -/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309050103.sql b/resource/sqlupgrade/PG/sql202309050103.sql deleted file mode 100644 index 442635f18..000000000 --- a/resource/sqlupgrade/PG/sql202309050103.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5); -/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309050103.sql b/resource/sqlupgrade/SQLServer/sql202309050103.sql deleted file mode 100644 index 362f2654c..000000000 --- a/resource/sqlupgrade/SQLServer/sql202309050103.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5) -GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202309050103.sql b/resource/sqlupgrade/ST/sql202309050103.sql deleted file mode 100644 index e9e5dfeee..000000000 --- a/resource/sqlupgrade/ST/sql202309050103.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); -/ - From 591555fa8a4c8a123f2fb52bd71a1e65d428462b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 23 Apr 2024 17:47:02 +0800 Subject: [PATCH 159/298] =?UTF-8?q?=E6=9B=B4=E6=96=B0sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sqlupgrade/SQLServer/sql202403193303.sql | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/resource/sqlupgrade/SQLServer/sql202403193303.sql b/resource/sqlupgrade/SQLServer/sql202403193303.sql index a1f345591..771e3b45f 100644 --- a/resource/sqlupgrade/SQLServer/sql202403193303.sql +++ b/resource/sqlupgrade/SQLServer/sql202403193303.sql @@ -1,9 +1,16 @@ -ALTER TABLE hrsa_employee_declare -ADD nationality varchar(255) NULL , -ADD birthplace varchar(255) NULL , -ADD tax_reasons varchar(255) NULL , -entry_date datetime NULL , -departure_date datetime NULL +ALTER TABLE hrsa_employee_declare ADD nationality varchar(255) NULL +GO + +ALTER TABLE hrsa_employee_declare ADD birthplace varchar(255) NULL +GO + +ALTER TABLE hrsa_employee_declare ADD tax_reasons varchar(255) NULL +GO + +ALTER TABLE hrsa_employee_declare ADD entry_date datetime NULL +GO + +ALTER TABLE hrsa_employee_declare ADD departure_date datetime NULL GO update hrsa_employee_declare set nationality = 'й' where nationality is null From 79cfa0cbc07f223a875e8b5f8b3f9c223a68e1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 21 May 2024 10:50:17 +0800 Subject: [PATCH 160/298] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BE=80=E6=9C=9F?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=A4=9A=E4=BD=99=E9=A1=B9=E7=9B=AE=20?= =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1=E5=88=AB=E5=90=8D=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308150603.sql | 2 +- resource/sqlupgrade/GS/sql202308150603.sql | 2 +- resource/sqlupgrade/JC/sql202308150603.sql | 2 +- resource/sqlupgrade/Mysql/sql202308150603.sql | 2 +- .../sqlupgrade/Oracle/sql202308150603.sql | 2 +- resource/sqlupgrade/PG/sql202308150603.sql | 2 +- .../sqlupgrade/SQLServer/sql202308150603.sql | 2 +- resource/sqlupgrade/ST/sql202308150603.sql | 2 +- .../salary/annotation/SalaryFormulaVar.java | 6 ++++ .../entity/datacollection/AddUpSituation.java | 35 ++++++++++--------- .../impl/SalarySobAddUpRuleServiceImpl.java | 4 +++ 11 files changed, 36 insertions(+), 25 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202308150603.sql b/resource/sqlupgrade/DM/sql202308150603.sql index afa21f4ad..42973a3fa 100644 --- a/resource/sqlupgrade/DM/sql202308150603.sql +++ b/resource/sqlupgrade/DM/sql202308150603.sql @@ -57,6 +57,6 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome'); + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); / diff --git a/resource/sqlupgrade/GS/sql202308150603.sql b/resource/sqlupgrade/GS/sql202308150603.sql index afa21f4ad..42973a3fa 100644 --- a/resource/sqlupgrade/GS/sql202308150603.sql +++ b/resource/sqlupgrade/GS/sql202308150603.sql @@ -57,6 +57,6 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome'); + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); / diff --git a/resource/sqlupgrade/JC/sql202308150603.sql b/resource/sqlupgrade/JC/sql202308150603.sql index afa21f4ad..42973a3fa 100644 --- a/resource/sqlupgrade/JC/sql202308150603.sql +++ b/resource/sqlupgrade/JC/sql202308150603.sql @@ -57,6 +57,6 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome'); + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); / diff --git a/resource/sqlupgrade/Mysql/sql202308150603.sql b/resource/sqlupgrade/Mysql/sql202308150603.sql index e7e16eeb1..d79395752 100644 --- a/resource/sqlupgrade/Mysql/sql202308150603.sql +++ b/resource/sqlupgrade/Mysql/sql202308150603.sql @@ -54,5 +54,5 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome') + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction') ; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150603.sql b/resource/sqlupgrade/Oracle/sql202308150603.sql index 824a4ce82..4f9868ff8 100644 --- a/resource/sqlupgrade/Oracle/sql202308150603.sql +++ b/resource/sqlupgrade/Oracle/sql202308150603.sql @@ -53,5 +53,5 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome') + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction') / \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150603.sql b/resource/sqlupgrade/PG/sql202308150603.sql index 001f75870..357a806d0 100644 --- a/resource/sqlupgrade/PG/sql202308150603.sql +++ b/resource/sqlupgrade/PG/sql202308150603.sql @@ -57,5 +57,5 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome'); + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); / \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150603.sql b/resource/sqlupgrade/SQLServer/sql202308150603.sql index 4cf555b00..f6c058c12 100644 --- a/resource/sqlupgrade/SQLServer/sql202308150603.sql +++ b/resource/sqlupgrade/SQLServer/sql202308150603.sql @@ -54,5 +54,5 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome') + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction') GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308150603.sql b/resource/sqlupgrade/ST/sql202308150603.sql index afa21f4ad..42973a3fa 100644 --- a/resource/sqlupgrade/ST/sql202308150603.sql +++ b/resource/sqlupgrade/ST/sql202308150603.sql @@ -57,6 +57,6 @@ select id, create_time, update_time, creator, delete_type, tenant_key, salary_so from hrsa_salary_sob_item where delete_type = 0 and income_category = 1 - and salary_item_code in ('addUpTaxableIncome'); + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); / diff --git a/src/com/engine/salary/annotation/SalaryFormulaVar.java b/src/com/engine/salary/annotation/SalaryFormulaVar.java index 2e3077158..c5d10b7d7 100644 --- a/src/com/engine/salary/annotation/SalaryFormulaVar.java +++ b/src/com/engine/salary/annotation/SalaryFormulaVar.java @@ -24,4 +24,10 @@ public @interface SalaryFormulaVar { String dataType(); String fieldId() default ""; + + /** + * 别名,用于属性名和项目名不匹配时场景 + * @return + */ + String alias() default ""; } diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index 96c6b8945..c12b48717 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -22,7 +22,7 @@ import java.util.List; @Builder @NoArgsConstructor @AllArgsConstructor -@SalaryTable(pageId = "a4f83287-e3f9-4275-9527-7d06e54y6238", fields = "id,addUpSubtraction", operates = {@SalaryTableOperate(text = "删除",index = "0")}) +@SalaryTable(pageId = "a4f83287-e3f9-4275-9527-7d06e54y6238", fields = "id,addUpSubtraction", operates = {@SalaryTableOperate(text = "删除", index = "0")}) //hrsa_add_up_situation @ElogTransform(name = "往期累计情况") public class AddUpSituation { @@ -59,6 +59,7 @@ public class AddUpSituation { /** * 人员类型 + * * @see DataCollectionEmployeeTypeEnum */ private Integer employeeType; @@ -90,15 +91,15 @@ public class AddUpSituation { /** * 累计公积金个人合计 */ - @ElogTransform(name = "累计公积金个人合计") @SalaryFormulaVar(defaultLabel = "累计公积金个人合计", labelId = 86709, dataType = "number") + @ElogTransform(name = "累计公积金个人合计") @Encrypt private String addUpAccumulationFundTotal; /** * 累计子女教育 */ - @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number") @Encrypt @Deprecated private String addUpChildEducation; @@ -106,7 +107,7 @@ public class AddUpSituation { /** * 累计继续教育 */ - @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number") @Encrypt @Deprecated private String addUpContinuingEducation; @@ -114,7 +115,7 @@ public class AddUpSituation { /** * 累计住房贷款利息 */ - @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number") @Encrypt @Deprecated private String addUpHousingLoanInterest; @@ -122,7 +123,7 @@ public class AddUpSituation { /** * 累计住房租金 */ - @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number") @Encrypt @Deprecated private String addUpHousingRent; @@ -130,7 +131,7 @@ public class AddUpSituation { /** * 累计赡养老人 */ - @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number") @Encrypt @Deprecated private String addUpSupportElderly; @@ -138,7 +139,7 @@ public class AddUpSituation { /** * 累计大病医疗 */ - @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number") @Encrypt @Deprecated private String addUpIllnessMedical; @@ -146,7 +147,7 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ - @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number") @Encrypt @Deprecated private String addUpInfantCare; @@ -154,7 +155,7 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ - @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number") @Encrypt @Deprecated private String addUpPrivatePension; @@ -162,56 +163,56 @@ public class AddUpSituation { /** * 累计企业(职业)年金及其他福利 */ - @ElogTransform(name = "累计企业(职业)年金及其他福利") @SalaryFormulaVar(defaultLabel = "累计企业(职业)年金及其他福利", labelId = 90567, dataType = "number") + @ElogTransform(name = "累计企业(职业)年金及其他福利") @Encrypt private String addUpEnterpriseAndOther; /** * 累计其他免税扣除 */ - @ElogTransform(name = "累计其他免税扣除") @SalaryFormulaVar(defaultLabel = "累计其他免税扣除", labelId = 93902, dataType = "number") + @ElogTransform(name = "累计其他免税扣除") @Encrypt private String addUpOtherDeduction; /** * 累计免税收入 */ + @SalaryFormulaVar(defaultLabel = "累计免税收入", labelId = 86704, dataType = "number",alias = "addUpTaxFreeIncome") @ElogTransform(name = "累计免税收入") - @SalaryFormulaVar(defaultLabel = "累计免税收入", labelId = 86704, dataType = "number") @Encrypt private String addUpTaxExemptIncome; /** * 累计准予扣除的捐赠额 */ - @ElogTransform(name = "累计准予扣除的捐赠额") @SalaryFormulaVar(defaultLabel = "累计准予扣除的捐赠额", labelId = 86703, dataType = "number") + @ElogTransform(name = "累计准予扣除的捐赠额") @Encrypt private String addUpAllowedDonation; /** * 累计减免税额 */ + @SalaryFormulaVar(defaultLabel = "累计减免税额", labelId = 105478, dataType = "number", alias = "addUpTaxDeduction") @ElogTransform(name = "累计减免税额") - @SalaryFormulaVar(defaultLabel = "累计减免税额", labelId = 105478, dataType = "number") @Encrypt private String addUpTaxSavings; /** * 累计已预扣预缴税额 */ - @ElogTransform(name = "累计已预扣预缴税额") @SalaryFormulaVar(defaultLabel = "累计已预扣预缴税额", labelId = 86702, dataType = "number") + @ElogTransform(name = "累计已预扣预缴税额") @Encrypt private String addUpAdvanceTax; /** * 实际累计已预扣预缴税额 */ - @ElogTransform(name = "实际累计已预扣预缴税额") @SalaryFormulaVar(defaultLabel = "实际累计已预扣预缴税额", labelId = 233557, dataType = "number") + @ElogTransform(name = "实际累计已预扣预缴税额") @Encrypt private String actualAddUpAdvanceTax; diff --git a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java index ead78218b..29d6af22d 100644 --- a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java @@ -111,6 +111,10 @@ public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobA addUpRuleDTO.setCanEdit(true); Long salaryItemId = salarySobAddUpMap.get(incomeCategoryId + "-" + declaredField.getName()); + if(salaryItemId == null){ + //往期累计属性名和项目名不匹配,采用别名 + salaryItemId = salarySobAddUpMap.get(incomeCategoryId + "-" + annotation.alias()); + } SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); if (Objects.nonNull(salaryItem)) { Map dataMap = Maps.newHashMap(); From 8bf2cda7c345baa295de7dfa68642d564ea72dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 21 May 2024 12:29:42 +0800 Subject: [PATCH 161/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EmployeeDeclareExcelServiceImpl.java | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 98589a15f..067b4acfd 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -397,28 +397,32 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee } } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "首次入境时间"))) { - if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { - dataValue = dataValue.substring(0, 10); - } - if (!SalaryDateUtil.checkDay(dataValue)) { - isError = true; - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); - errorData.add(errorMessageMap); - } else { - employeeDeclareExcel.setEntryDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + if (StringUtils.isNotBlank(dataValue)) { + if (dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEntryDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "预计离境时间"))) { - if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { - dataValue = dataValue.substring(0, 10); - } - if (!SalaryDateUtil.checkDay(dataValue)) { - isError = true; - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); - errorData.add(errorMessageMap); - } else { - employeeDeclareExcel.setDepartureDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + if (StringUtils.isNotBlank(dataValue)) { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setDepartureDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "涉税事由"))) { employeeDeclareExcel.setTaxReasons(dataValue); From 0e1242daa7771510c2c254a6046f17b15d03f255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 28 May 2024 14:10:45 +0800 Subject: [PATCH 162/298] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/TaxDeclarationExcelServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 9be20c0ad..63581da27 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -7,7 +7,6 @@ import com.engine.core.impl.Service; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; @@ -221,6 +220,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar heads.add(SalaryI18nUtil.getI18nLabel(86185, "部门")); heads.add(SalaryI18nUtil.getI18nLabel(86186, "手机号")); heads.add(SalaryI18nUtil.getI18nLabel(86317, "工号")); + heads.add(SalaryI18nUtil.getI18nLabel(86317, "证件号码")); heads.addAll(SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList())); List> rowList = new ArrayList<>(); @@ -336,6 +336,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar String deparmentName = (String) map.getOrDefault("部门", ""); String mobile = (String) map.getOrDefault("手机号", ""); String workcode = (String) map.getOrDefault("工号", ""); + String idNo = (String) map.getOrDefault("证件号码", ""); if (StringUtils.isEmpty(username) && "0".equals(confValue)) { isError = true; @@ -344,7 +345,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar excelComments.add(errorMessageMap); } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, username, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, username, deparmentName, mobile, workcode, idNo,null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; From ec7b251981acf5a422d84f0a43af4f0c6c07e9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 30 May 2024 14:21:27 +0800 Subject: [PATCH 163/298] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=98=BE=E7=A4=BA=E7=94=B3=E6=8A=A5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml index fe69e78d3..7bf054ad4 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -17,6 +17,7 @@ + @@ -41,6 +42,7 @@ , t.pattern , t.value_type , t.item_hide + , t.income_category From c28bbf4d1d7ea8fb56ed35fc7eaf2aa6efe3c4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 30 May 2024 14:49:02 +0800 Subject: [PATCH 164/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/SalarySobServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 9467158e2..83fe0d68d 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -36,6 +36,7 @@ import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; From cdcdfabe9baf1fccf3f39527672be0d0cbcd9e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 30 May 2024 15:19:15 +0800 Subject: [PATCH 165/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/salarysob/SalarySobItemMapper.xml | 19 +++++++++++++------ .../impl/SalarySobItemServiceImpl.java | 19 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml index e71a593c6..04c91d121 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -173,6 +173,7 @@ pattern=#{pattern}, value_type=#{valueType}, item_hide=#{itemHide}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -230,6 +231,9 @@ item_hide=#{itemHide}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 @@ -276,7 +280,7 @@ INSERT INTO hrsa_salary_sob_item(salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category) VALUES ( @@ -296,13 +300,14 @@ #{item.pattern}, #{item.valueType}, #{item.salaryItemCode}, - #{item.itemHide} + #{item.itemHide}, + #{item.incomeCategory} ) INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category) select @@ -322,14 +327,15 @@ #{item.pattern,jdbcType=INTEGER}, #{item.valueType,jdbcType=INTEGER}, #{item.salaryItemCode,jdbcType=INTEGER}, - #{item.itemHide,jdbcType=DOUBLE} + #{item.itemHide,jdbcType=DOUBLE}, + #{item.incomeCategory,jdbcType=VARCHAR} from dual INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category) VALUES ( #{item.salarySobId}, @@ -348,7 +354,8 @@ #{item.pattern}, #{item.valueType}, #{item.salaryItemCode}, - #{item.itemHide} + #{item.itemHide}, + #{item.incomeCategory} ) diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index a8cfe0900..84e48c3d2 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -2,6 +2,7 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.biz.SalarySobBiz; import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; @@ -9,9 +10,8 @@ import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; -import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -380,6 +380,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe Date now = new Date(); Long salarySobId = saveParam.getSalarySobId(); + SalarySobPO sob = salarySobBiz.getById(salarySobId); + String incomeCategory = sob.getIncomeCategory() == null ? "1" : sob.getIncomeCategory().toString(); List itemGroups = saveParam.getItemGroups(); List newGroupIds = SalaryEntityUtil.properties(itemGroups, SalarySobItemSaveParam.SalarySobItemGroupParam::getId, Collectors.toList()); List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salarySobId); @@ -405,6 +407,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) + .incomeCategory(incomeCategory) .salaryItemId(itemParam.getSalaryItemId()) .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(salarySobItemGroupId) @@ -447,6 +450,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) + .incomeCategory(incomeCategory) .salaryItemId(itemParam.getSalaryItemId()) .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(groupId) @@ -471,6 +475,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .id(itemParam.getId()) + .incomeCategory(incomeCategory) .salaryItemId(itemParam.getSalaryItemId()) .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(groupId) @@ -510,13 +515,13 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needAddItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).salaryItemId(itemParam.getSalaryItemId()).salaryItemCode(salaryItemPO.getCode()).salarySobItemGroupId(NumberUtils.LONG_ZERO).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).incomeCategory(incomeCategory).salaryItemId(itemParam.getSalaryItemId()).salaryItemCode(salaryItemPO.getCode()).salarySobItemGroupId(NumberUtils.LONG_ZERO).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); salarySobItems.add(salarySobItemPO); } for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needUpdateItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().id(itemParam.getId()).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).updateTime(now).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().id(itemParam.getId()).incomeCategory(incomeCategory).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).updateTime(now).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).build(); getSalarySobItemMapper().updateIgnoreNull(salarySobItemPO); } @@ -679,12 +684,12 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe // 查询薪资项目副本 List salarySobItemPOS = listBySalarySobId(salarySobId); // 查询薪资项目 - List salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId,Collectors.toList()); + List salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId, Collectors.toList()); List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); // 查询公式详情 - List formulaIds = SalaryEntityUtil.properties(salaryItems, SalaryItemPO::getFormulaId,Collectors.toList()); + List formulaIds = SalaryEntityUtil.properties(salaryItems, SalaryItemPO::getFormulaId, Collectors.toList()); List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); - SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS,salaryItems,expressFormulas,new ArrayList<>(),new HashSet<>()); + SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItems, expressFormulas, new ArrayList<>(), new HashSet<>()); } /** From 440a64aece54cdfe5443c4733b48282cfd26a5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 3 Jun 2024 13:52:39 +0800 Subject: [PATCH 166/298] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AbstractTaxAgentTaxReturnCheckService.java | 2 ++ .../engine/salary/service/impl/AddUpDeductionServiceImpl.java | 1 + src/com/engine/salary/service/impl/SalarySobServiceImpl.java | 1 + 3 files changed, 4 insertions(+) diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java index e4a5fba05..301782ed1 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -124,6 +124,7 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl String reqJson = JsonUtil.toJsonString(requestParam); Map params = new HashMap<>(1); Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + log.info("getCompanyRegisterInfo params = {}", reqJson); String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); log.info("getCompanyRegisterInfo === res : {}", res); return JsonUtil.parseBean(res, CompanyRegisterInfoResponse.class); @@ -190,6 +191,7 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl String reqJson = JsonUtil.toJsonString(requestParam); Map params = new HashMap<>(1); Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + log.info("checkPassword === res : {}", reqJson); String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); log.info("checkPassword === res : {}", res); return JsonUtil.parseObject(res, CheckPasswordResponse.class); diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index a89542508..0a3db3b50 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1751,6 +1751,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction Map params = new HashMap<>(1); params.put("requestId", requestPO.getOuterRequestId()); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + log.info("GET_QUERY_SPECIAL_AMOUNT_FEEDBACK params = {}", params); String res = HttpUtil.getRequest(url, header, params); log.info("GET_QUERY_SPECIAL_AMOUNT_FEEDBACK res = {}", res); return JsonUtil.parseObject(res, QuerySpecialAmountFeedbackResponse.class); diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 9467158e2..83fe0d68d 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -36,6 +36,7 @@ import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; From e1e00f4db0a4a915f1e6ca760fd1632c483611ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 6 Jun 2024 13:51:33 +0800 Subject: [PATCH 167/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=97=E7=A8=8Ev1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/config/SalaryPermissionConfig.java | 6 +- .../salary/constant/SzyhApiConstant.java | 19 + .../entity/salaryacct/bo/SalaryCalcTax.java | 199 +++ .../salaryacct/bo/SalaryCalcTaxFeedback.java | 62 + .../salaryacct/bo/SalaryCalcTaxRequest.java | 258 +++ .../salaryacct/dto/SalaryCalcTaxInfoDTO.java | 27 + .../salaryacct/param/SalaryCalcTaxParam.java | 19 + .../salaryacct/po/SalaryAcctCalcTaxReqPO.java | 52 + .../enums/salarysob/IncomeCategoryEnum.java | 247 ++- .../SalaryAcctCalcTaxReqMapper.java | 74 + .../salaryacct/SalaryAcctCalcTaxReqMapper.xml | 232 +++ .../remote/tax/client/CalculateClient.java | 31 + ...lculateASynIndividualIncomeTaxRequest.java | 1442 +++++++++++++++++ ...ynIndividualIncomeTaxFeedbackResponse.java | 746 +++++++++ .../service/EmployeeDeclareService.java | 9 + .../service/SalaryAcctCalcTaxReqService.java | 30 + .../service/SalaryAcctResultService.java | 1 + .../salary/service/SalaryCalcTaxService.java | 29 + .../impl/EmployeeDeclareServiceImpl.java | 19 + .../impl/SalaryAcctCalcTaxReqServiceImpl.java | 37 + .../impl/SalaryAcctResultServiceImpl.java | 9 + .../impl/SalaryCalcTaxServiceImpl.java | 315 ++++ .../engine/salary/util/SalaryEntityUtil.java | 36 +- .../salary/web/SalaryAcctController.java | 44 +- .../salary/web/SalarySobController.java | 7 + .../wrapper/SalaryAcctResultWrapper.java | 33 + .../salary/wrapper/SalarySobWrapper.java | 14 + test/ParseTaxApi.java | 4 +- 28 files changed, 3950 insertions(+), 51 deletions(-) create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxFeedback.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryCalcTaxParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryAcctCalcTaxReqPO.java create mode 100644 src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.java create mode 100644 src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.xml create mode 100644 src/com/engine/salary/remote/tax/client/CalculateClient.java create mode 100644 src/com/engine/salary/remote/tax/request/calculate/CalculateASynIndividualIncomeTaxRequest.java create mode 100644 src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java create mode 100644 src/com/engine/salary/service/SalaryAcctCalcTaxReqService.java create mode 100644 src/com/engine/salary/service/SalaryCalcTaxService.java create mode 100644 src/com/engine/salary/service/impl/SalaryAcctCalcTaxReqServiceImpl.java create mode 100644 src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java diff --git a/src/com/engine/salary/config/SalaryPermissionConfig.java b/src/com/engine/salary/config/SalaryPermissionConfig.java index 7703e9267..61abe6086 100644 --- a/src/com/engine/salary/config/SalaryPermissionConfig.java +++ b/src/com/engine/salary/config/SalaryPermissionConfig.java @@ -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"; diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 608bf61a4..ae932a07d 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -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"; + + + /** * 请求成功状态码 diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java new file mode 100644 index 000000000..3dab288f0 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java @@ -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 salaryAcctTaxAgents; + + /** + * 薪资核算关联的薪资核算人员 + */ + private List salaryAcctEmployees; + + /** + * 薪资核算关联的薪资核算结果 + */ + private List salaryAcctResultValues; + + /** + * 个税扣缴义务人 + */ + private List taxAgents; + + /** + * 个税扣缴义务人的个税信息 + */ + private List taxAgentTaxReturns; + + /** + * 个税申报表字段 + */ + private List taxReportColumns; + + /** + * 薪资账套的个税申报表字段对应 + */ + private List salarySobTaxReportRules; + + /** + * 报送人员 + */ + private List employeeDeclares; + + public Map> buildCalcTaxRequestParam() { + // 薪资核算关联的个税扣缴义务人 + Map> salaryAcctAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + // 薪资核算关联的薪资核算人员 + Map> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getTaxAgentId); + // 薪资核算关联的薪资核算结果 + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); + // 个税扣款义务人 + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId); + // 个税扣款义务人的个税信息 + Map taxAgentTaxReturnMap = SalaryEntityUtil.convert2Map(taxAgentTaxReturns, TaxAgentTaxReturnPO::getTaxAgentId); + // 个税申报表字段 + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + // 薪资账套的个税申报表字段对应 + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex); + // 报送人员 + Map> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); + + Map> resultMap = new HashMap<>(); + + for (Map.Entry> 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 salaryAcctEmployees = salaryAcctEmployeeMap.get(taxAgent.getId()); + if (CollectionUtils.isEmpty(salaryAcctEmployees)) { + continue; + } + List employeeDeclares = employeeDeclareMap.get(taxAgent.getId()); + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该个税扣缴义务人无申报人员")); + } + + // 注册的企业信息-->请求参数 + Map 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 buildZHSDRequestParam(List salaryAcctTaxAgents, + List salaryAcctEmployees, + Map> salaryAcctResultValueMap, + Map> taxReportColumnMap, + Map salarySobTaxReportRuleMap, + List employeeDeclares) { + Map> incomeCategoryKeySalaryAcctEmployeeMap = SalaryEntityUtil + .group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); + + Map requestParam = new HashMap<>(); + + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum + .parseByValue(salaryAcctTaxAgent.getIncomeCategory()); + List taxReportColumns = taxReportColumnMap.get(incomeCategoryEnum.getValue().toString()); + List subSalaryAcctEmployees = incomeCategoryKeySalaryAcctEmployeeMap.get(incomeCategoryEnum.getValue().toString()); + Map 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; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxFeedback.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxFeedback.java new file mode 100644 index 000000000..70963b916 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxFeedback.java @@ -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 dataMap; + + private List employeeDeclares; + + public SalaryCalcTaxFeedback(Map dataMap, List employeeDeclares) { + this.dataMap = dataMap; + this.employeeDeclares = employeeDeclares; + } + + public Map buildZCGZXJFeedback() { + Map successDataMap = new HashMap<>(); + List 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 resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum())); + } + return resultMap; + } + + public Map buildOtherFeedback() { + Map successDataMap = new HashMap<>(); + List 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 resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum())); + } + return resultMap; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java new file mode 100644 index 000000000..cca1f16ff --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java @@ -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 salaryAcctEmployeeMap; + private Map> salaryAcctResultValueMap; + private List taxReportColumns; + private Map salarySobTaxReportRuleMap; + private List employeeDeclares; + + /** + * 正常工资薪金 + * + * @return + */ + public Map buildZCGZXJRequestParam() { + // 人员列表 + List> RYLBRequestParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); + // 正常工资薪金列表 + List> ZCGZXJLBRequestParams = buildRequestParams(IncomeCategoryEnum.WAGES_AND_SALARIES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map 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> buildQNYCXJJSSLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.ONETIME_ANNUAL_BONUS, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 稿酬所得 + * + * @return + */ + public List> buildGCSDLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 一般劳务报酬所得 + * + * @return + */ + public List> buildLWBCLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_LABOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 解除劳动合同一次性补偿金 + * + * @return + */ + public List> buildJCLDHTYCXBCJLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_DISMISS, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 保险营销员佣金收入 + * + * @return + */ + public Map buildBXYXYRequestParam() { + List> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map param = new HashMap<>(); + // 保险营销员薪金列表 + param.put("bxyxylwbclb", requestParams); + // 是否传入累计个人养老金,2使用传入数据 + param.put("gryljcl", 2); + return param; + } + + /** + * 证券经纪人佣金收入 + * + * @return + */ + public Map buildZQJJRRequestParam() { + List> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map param = new HashMap<>(); + // 证券经纪人薪金列表 + param.put("zqjjrsdlb", requestParams); + // 是否传入累计个人养老金,2使用传入数据 + param.put("gryljcl", 2); + return param; + } + + /** + * 其他连续劳务报酬所得 + * + * @return + */ + public Map buildQTLXLWBCRequestParam() { + List> requestParams = buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map param = new HashMap<>(); + param.put("qtlxlwbclb", Lists.newArrayList()); + // 是否传入累计个人养老金,2使用传入数据 + param.put("gryljcl", 2); + return param; + } + + /** + * 特许权使用费所得 + * + * @return + */ + public List> buildTXQRequestParam() { + return buildRequestParams(IncomeCategoryEnum.ROYALTIES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 个人股权激励收入 + * + * @return + */ + public List> buildGRGQJLRequestParam() { + return buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 年金领取 + * + * @return + */ + public List> buildQYNJRequestParam() { + return buildRequestParams(IncomeCategoryEnum.ANNUITY_RECEIPT, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 内退一次性补偿金 + * + * @return + */ + public List> buildNTYCXBCJLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_RETIRE, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 其他非连续劳务报酬所得 + * + * @return + */ + public List> buildQTFLXLWBCRequestParam() { + return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + private List> buildRequestParams(IncomeCategoryEnum incomeCategoryEnum, + List employeeDeclares, + Map salaryAcctEmployeeMap, + Map> salaryAcctResultValueMap) { + List> requestParams = Lists.newArrayListWithExpectedSize(salaryAcctResultValueMap.size()); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + SalaryAcctEmployeePO salaryAcctEmployee = salaryAcctEmployeeMap.get(employeeDeclare.getEmployeeId()); + if (salaryAcctEmployee == null) { + continue; + } + List salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployee.getId()); + if (salaryAcctResultValue == null) { + continue; + } + Map map = SalaryEntityUtil.convert2Map(salaryAcctResultValue, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); + Map requestParam = buildRequestParam(incomeCategoryEnum, employeeDeclare, map); + if (MapUtils.isNotEmpty(requestParam)) { + requestParams.add(requestParam); + } + } + return requestParams; + } + + private Map buildRequestParam(IncomeCategoryEnum incomeCategoryEnum, + EmployeeDeclarePO employeeDeclare, + Map salaryAcctResultValue) { + if (CollectionUtils.isEmpty(taxReportColumns)) { + return Collections.emptyMap(); + } + Map 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; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java new file mode 100644 index 000000000..554f98f9d --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java @@ -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; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryCalcTaxParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryCalcTaxParam.java new file mode 100644 index 000000000..d4745f149 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryCalcTaxParam.java @@ -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; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctCalcTaxReqPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctCalcTaxReqPO.java new file mode 100644 index 000000000..a325a71a1 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctCalcTaxReqPO.java @@ -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 ids; +} diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index fbce1c59b..9d7c9c427 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -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 { // todo 多语言 WAGES_AND_SALARIES(1, "0101", "正常工资薪金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) { @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); result.put(this.getDefaultLabel(), zhsdSheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); result.put(this.getDefaultLabel(), sheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); result.put(this.getDefaultLabel(), sheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); result.put(this.getDefaultLabel(), sheetData); - return result; } + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); result.put(this.getDefaultLabel(), sheetData); - return result; + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); + Map 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 { this.labelId = labelId; } - public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + public abstract void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + + + public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares); + @Override public Integer getValue() { diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.java new file mode 100644 index 000000000..badcde3d7 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.java @@ -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 listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List 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 ids); + + void deleteByRecordId(Long salaryAcctRecordId); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.xml new file mode 100644 index 000000000..ced6e5276 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.xml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + INSERT INTO hrsa_acct_calc_tax_req + + + + id, + + + salary_acct_record_id, + + + tax_agent_id, + + + request_id, + + + tenant_key, + + + creator, + + + delete_type, + + + create_time, + + + update_time, + + + + + #{id}, + + + #{salaryAcctRecordId}, + + + #{taxAgentId}, + + + #{requestId}, + + + #{tenantKey}, + + + #{creator}, + + + #{deleteType}, + + + #{createTime}, + + + #{updateTime}, + + + + + + + + UPDATE hrsa_acct_calc_tax_req + + 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}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_acct_calc_tax_req + + + 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}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_acct_calc_tax_req + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_acct_calc_tax_req + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_acct_calc_tax_req + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_acct_record_id = #{salaryAcctRecordId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/remote/tax/client/CalculateClient.java b/src/com/engine/salary/remote/tax/client/CalculateClient.java new file mode 100644 index 000000000..6c27ef8fc --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/CalculateClient.java @@ -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 params = new HashMap<>(1); + params.put("requestId", requestId); + Map 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); + + } +} diff --git a/src/com/engine/salary/remote/tax/request/calculate/CalculateASynIndividualIncomeTaxRequest.java b/src/com/engine/salary/remote/tax/request/calculate/CalculateASynIndividualIncomeTaxRequest.java new file mode 100644 index 000000000..408dec81f --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/calculate/CalculateASynIndividualIncomeTaxRequest.java @@ -0,0 +1,1442 @@ +package com.engine.salary.remote.tax.request.calculate; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class CalculateASynIndividualIncomeTaxRequest { + /** + * 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID,建议使用UUID + */ + private String bizNo; + /** + * 企业名称 必填:是 扣缴义务人名称:例如:测试ß科技有限公司 + */ + private String qymc; + /** + * 密码类型 必填:否 0表示申报密码;2表示实名账号实名密码 + */ + private String mmlx; + /** + * 实名账号 必填:条件必填 当mmlx=2时,必填 + */ + private String smzh; + /** + * 实名密码 必填:条件必填 当mmlx=2时,必填 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密,1表示加密 + */ + private String jmsmmm; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:条件必填 分部门代报时必传 + */ + private String bmbh; + /** + * 部门名称 必填:否 分部门代报时必传 + */ + private String bmmc; + /** + * 所属期 必填:是 格式YYYYMM年月 + */ + private String skssq; + /** + * 多批次算税,是否校验人员之前批次算税状态 必填:否 应用场景: 如果填写“是”,在多批次算税中会校验当前批次中的人员在之前批次算税中是否存在未拿反馈的请求,如果存在就阻断当前批次算税。 + * 如果不填写或者填写“否”,不校验该逻辑。 + */ + private String sfjyrysszt; + /** + * 综合所得 必填:是 见综合所得 + */ + private zhsd zhsd; +// /** +// * 分类所得 必填:是 见分类所得 +// */ +// private 对象 flsd; +// /** +// * 非居民所得 必填:是 见非居民所得 +// */ +// private 对象 fjmsd; +// /** +// * 限售股所得 必填:是 见限售股所得 +// */ +// private 对象 xsgsd; + + @Data + public static class zhsd { + /** + * 是否离线算薪 必填:否 可选【是】或【否】,非必传,不传的情况下默认为【否】,当为离线算薪时,专项下载、人员报送都失效, + * sfrysb=1 时也不会报送人员, + * zcgzxjsfcrlj=0时会统一使用本地数据进行计算 + */ + private String sflxsx; + /** + * 减免方式 必填:否 1:"比例减免方式" 2:"限额减免方式" 其他方式不传值,按照当地政策选择减免方式 + */ + private String jmfs; + /** + * 减免比例 必填:条件必填 jmfs为1时必填,示例:10% 传0.1 + */ + private BigDecimal jmbl; + /** + * 减免限额 必填:条件必填 jmfs为2时必填,减免限额大于0 + */ + private BigDecimal jmxe; + /** + * 正常工资薪金对象 必填:是 参考综合所得-正常工资薪金对象 + */ + private zcgzxj zcgzxj; + /** + * 全年一次性奖金收入列表 必填:是 参考综合所得-全年一次性奖金收入 + */ + private List qnycxjjsslb; + /** + * 稿酬所得列表 必填:是 参考综合所得-稿酬所得 + */ + private List gcsdlb; + /** + * 一般劳务报酬所得列表 必填:是 参考综合所得-一般劳务报酬所得 + */ + private List lwbclb; + /** + * 解除劳动合同一次性补偿金列表 必填:是 参考综合所得-解除劳动合同一次性补偿金 + */ + private List jcldhtycxbcjlb; + /** + * 保险营销员 必填:是 参考综合所得-保险营销员薪金对象 + */ + private bxyxy bxyxy; + /** + * 证券经纪人 必填:是 参考综合所得-证券经纪人薪金对象 + */ + private zqjjr zqjjr; + /** + * 其他连续劳务报酬所得 必填:是 参考综合所得-其他连续劳务报酬所得 + */ + private qtlxlwbc qtlxlwbc; + /** + * 特许权所得 必填:是 参考综合所得-特许权所得 + */ + private List txq; + /** + * 个人股权激励所得 必填:是 参考综合所得-个人股权激励所得 + */ + private List grgqjl; + /** + * 企业年金 必填:是 参考综合所得-企业年金 + */ + private List qynj; + /** + * 内退一次性补偿金 必填:是 参考综合所得-内退一次性补偿金 + */ + private List ntycxbcjlb; + /** + * 其他非连续劳务报酬 必填:是 参考综合所得-其他非连续劳务报酬 + */ + private List qtflxlwbc; +// /** +// * 提前退休一次性补贴 必填:是 参考综合所得-提前退休一次性补贴 +// */ +// private List tqtxycxbt; +// /** +// * 央企负责人绩效薪金延期兑现收入和任期奖励 必填:是 参考综合所得-央企负责人绩效薪金延期兑现收入和任期奖励 +// */ +// private 数组 yqfzrsrhjl; +// /** +// * 法律援助劳务报酬所得列表 必填:是 参考综合所得-法律援助劳务报酬所得列表 +// */ +// private 数组 flyzlwbclb; +// /** +// * 非居民所得 必填:是 见非居民所得 +// */ +// private 对象 fjmsd; +// /** +// * 限售股所得 必填:是 见限售股所得 +// */ +// private 对象 xsgsd; + + @Data + public static class ry { + /** + * 姓名 必填:是 纳税人姓名 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 证件号码需要大写 + */ + private String zzhm; + /** + * 其他证件类型 必填:条件必填 见证件类型字典 + */ + private String qtzzlx; + /** + * 其他证件号码 必填:条件必填 见证件类型字典 + */ + private String qtzzhm; + /** + * 部门编号 必填:否 部门编号 + */ + private String bmbh; + /** + * 人员报送策略 必填:否 1. 默认逻辑“是”,仅当信息变化时才会报送信息到税局 2. 若企业想要支持人员信息不变化的情况下,也能重新发起报送,覆盖局端信息,可修改传参为“否” + */ + private String rybscl; + /** + * 工号 必填:否 + */ + private String gh; + /** + * 所属期 必填:否 格式YYYYMM年月 + */ + private String skssq; + /** + * 电话号码 必填:是 11位中国大陆手机号码 + */ + private String lxdh; + /** + * 人员状态 必填:是 默认为正常,可选择正常/非正常 + */ + private String nsrzt; + /** + * 任职受雇类型 必填:是 可选择雇员、保险营销员、证券经纪人、其他、实习学生(全日制学历教育) + */ + private String sfgy; + /** + * 入职年度就业情形 必填:否 当雇员、保险营销员、证券经纪人时可选择:当年首次入职学生、当年首次入职其他人员。其他情况下填写默认为空 + */ + private String rzndjyqk; + /** + * 受雇日期 必填:条件必填 格式:YYYY-MM-DD,不能大于当前时间 任职受雇类型选择:雇员、保险营销员、证券经纪人、实习学生(全日制学历教育)时必录 + */ + private String rzsgrq; + /** + * 性别 必填:是 男/女 + */ + private String xb; + /** + * 出生日期 必填:是 YYYY-MM-DD 需要和身份证上保持一致 + */ + private String csny; + /** + * 国籍 必填:是 见国籍字典 + */ + private String gj; + /** + * 人员地区 必填:是 境内/境外 + */ + private String rydq; + /** + * 离职日期 必填:否 格式:YYYY-MM-DD,不能大于当前时间,离职日期不能大于入职日期 人员状态非正常时必填 注:清空离职时间传入空字符串,不能是null + */ + private String lzrq; + /** + * 个人投资总额 必填:条件必填 当为股东投资者时必填,投资额大于0 + */ + private BigDecimal grgbze; + /** + * 个人投资比例 必填:否 投资额填写时必填,范围为0~100,不包含0 + */ + private BigDecimal grgbbl; + /** + * 是否残疾 必填:否 默认为否,可选择是/否 + */ + private String sfcj; + /** + * 是否烈属 必填:否 默认为否,可选择是/否 + */ + private String sfls; + /** + * 是否孤老 必填:否 默认为否,可选择是/否 + */ + private String sfgl; + /** + * 是否扣除减除费用 必填:否 默认为是,可选择是/否,传null或者空值都会默认为是,当填了否后, 如果后续还需要保持否的状态还需传否,不填则会默认为是 + */ + private String sfzdw; + /** + * 残疾证号 必填:条件必填 当为残疾时必填 + */ + private String cjzh; + /** + * 烈属证号 必填:条件必填 当为烈属时必填 + */ + private String lszh; + /** + * 邮箱 必填:否 + */ + private String dzyx; + /** + * 学历 必填:否 + * 默认为空,大学本科以下 大学本科 研究生 + */ + private String xl; + /** + * 职务 必填:否 高层 普通 + */ + private String zw; + /** + * 开户银行 必填:否 见银行字典 + */ + private String khyh; + /** + * 开户银行省份 必填:否 见开户银行省份字典 + */ + private String khyhsfmz; + /** + * 银行账号 必填:否 如果khyh,khyhsfmz,yhzh 有一项选择填写了那么其他两项也需要填写 + */ + private String yhzh; + /** + * 居住省份 必填:否 中文,例如浙江省 + */ + private String lxdz_sheng; + /** + * 居住城市 必填:否 中文,例如杭州市 + */ + private String lxdz_shi; + /** + * 居住区县 必填:否 中文,例如滨江区 + */ + private String lxdz_qx; + /** + * 居住街道 必填:否 中文,浦沿街道 + */ + private String lxdz_jd; + /** + * 居住详细地址 必填:否 + */ + private String lxdz; + /** + * 户籍省份 必填:否 中文,例如浙江省 + */ + private String hjszd_sheng; + /** + * 户籍城市 必填:否 中文,例如杭州市 + */ + private String hjszd_shi; + /** + * 户籍区县 必填:否 中文,例如滨江区 + */ + private String hjszd_qx; + /** + * 户籍街道 必填:否 中文,浦沿街道 + */ + private String hjszd_jd; + /** + * 户籍详细地址 必填:否 + */ + private String hjszd_xxdz; + /** + * 备注 必填:否 + */ + private String bz; + /** + * 出生地 必填:条件必填 外籍人员必填,填写出生地国家(地区),见国籍字典 + */ + private String csd; + /** + * 涉税事由 必填:条件必填 外籍人员必填,多个时用逗号分割; + * 任职受雇 提供临时劳务 转让财产 从事投资和经营活动 其他 + */ + private String sssx; + /** + * 首次入境时间 必填:条件必填 证件类型为港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时,且任职受雇类型选择雇员时必填,格式YYYY-MM-DD + */ + private String scrjsj; + /** + * 预计离境时间 必填:条件必填 证件类型为港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时,且任职受雇类型选择雇员时必填,格式YYYY-MM-DD + */ + private String yjljsj; + /** + * 联系地省份 必填:否 + */ + private String wjrlxdz_sheng; + /** + * 联系地城市 必填:否 + */ + private String wjrlxdz_shi; + /** + * 联系地区县 必填:否 + */ + private String wjrlxdz_qx; + /** + * 联系地街道 必填:否 + */ + private String wjrlxdz_jd; + /** + * 联系地详细地址 必填:否 + */ + private String wjrlxdz_xxdz; + /** + * 中文名 必填:否 证件类型为外国护照、外国人永久居留身份证、外国人工作许可证(A类)、外国人工作许可证(B类)、外国人工作许可证(C类)时不可填写,其他证件类型可填写。如果有填写必须为中文。 + */ + private String xmzw; + + } + + @Data + public static class zcgzxj { + /** + * 正常工资薪金列表 必填:是 参考综合所得-正常工资薪金 + */ + private List zcgzxjlb; + /** + * 上月正常工资薪金列表 必填:否 参考综合所得-正常工资薪金 + * 1、若当月已经代报完毕(当月代报上月所得),那么能从客户端下发累计到上月的所得数据,此时传给客户端的所得月份为当前月份 + * 2、若当月未代报完毕(当月代报上月所得),那么能从客户端下发累计到上月-1的所属数据,此时传给客户端的所得月份为当月月份-1 + * 3、上月正常工资薪金列表与本月正常工资薪金列表需要一一对应 + */ + private List syzcgzxjlb; + /** + * 人员列表 必填:是 见人员列表 + */ + private List rylb; + /** + * 正常工资薪金是否需要下载专项 必填:是 + * 1:需要专项明细进行专项计算 + * 0:不需要专项明细进行专项计算 + * 见附录专项传值策略 + */ + private String zcgzxjsfxyzx; + /** + * 是否已代报上月正常工资薪金 必填:否 + * 仅对需要计算正常工资所得生效,(默认为1) + * 1: 已代报上月正常工资薪金 + * 0: 未代报上月正常工资薪金(两个月算税传入0) + */ + private String syysfsyzcgzxj; + /** + * 支持传入专项 必填:否 + * 仅在syysfsyzcgzxj=0时候生效,默认值=0 + * 0: 不支持用户传专项,使用实时下载的专项,默认值 + * 1: 支持传上月当月的专项 + * 2:支持传截止至上月为止的累计专项 + */ + private String zcgzxjsfcrzx; + /** + * 当前算税月正常工资薪金是否传入专项累计 必填:否 + * 仅对当前算税月数据生效,默认为0 + * (如果是离线算薪,zcgzxjsfcrlj=1时会强制使用本地数据进行计算) + * 0:使用下载计算专项累计 + * 1:使用传入的专项累计值 + * 2: 不实时下载专项,使用本地数据进行计算 + * 见附录专项传值策略 + */ + private String zcgzxjsfcrlj; + + /** + * 批次号 必填:否 + * 默认不填为Null,表示一月一次算薪; + * 其他整数值(如1、2、3等)为一月多次发薪算薪的批次 + */ + private Integer pch; + /** + * 是否导入上月正常工资薪金(一月多次发薪) 必填:否 + * 仅在一月多次算税场景中使用 0:不导入上月薪金 1:导入上月薪资(默认为1,导入上月薪资) + */ + private String sfdrsyzcgzxj; + /** + * 是否同时人员报送 必填:否 0: 人员不报送; + */ + private String sfrysb; + /** + * 年金/住房公积金上限选项 必填:否 + * 1:不处理(默认) + * 2:使用年金/公积金上限(超过上限使用上限值,不超过 则使用原来的值) + * 3:年金使用上限,公积金截取超上限部分纳入收入额 + * 4.年金使用上限,截取公积金超过上限的部分减少收入额 + */ + private String njzfgjjsxxx; + /** + * 企业下载往期标志 必填:否 + * 1:按照企业维度下载(默认) 0:按照部门维度下载(企业在局端备案分部门,需要传入0) + */ + private String qyxzwqbz; + + /** + * 多月算税,是否使用上月传入的应补退税额 必填:否 + * 1. 不传或传空(默认为否)或者传“否”,与当前多月算税逻辑一致。2. 传“是”,多月算税时取上月薪资数据传入的应补退税额参与算税。 + */ + private String sfsysyybtse; + + /** + * 个人养老金策略 必填:否 + * 0: 不传或传空或者传“0”则会实时下载个人养老金 1: 传“1”则使用本地的个人养老金 2: 传“2”则使用传入的累计个人养老金 + */ + private String gryljcl; + + /** + * 上月个人养老金策略 必填:否 + * 不传或传空赋值默认值,默认值为1 + * 0:传“0”则会实时下载个人养老金 1: 传“1”则使用本地的个人养老金 2: 传“2”则使用传入的累计个人养老金 + */ + private String sygryljcl; + + @Data + public static class zcgz { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:条件必填 当sygs为空或者等于公式5时必填 + */ + private BigDecimal sre; + /** + * 适用公式 必填:否 见《工资收入公式字典》 + * 重点说明:一般正常工资薪金所得不用传适用公式,只需要传入收入额,就可以进行计算;也可以传适用公式,系统就会按照适用公式进行计算 当证件类型为居民身份证时,适用公式默认为空 + */ + private String sygs; + /** + * 境内工作天数 必填:条件必填 正常工资薪金传了适用公式才需要条件必录。当sygs字段填值并且不等于公式5时,该字段必填,可以为小数 小数位0.5天 不能两位小数,只能是1或者1.0不能1.00 + */ + private BigDecimal jngzts; + /** + * 境外工作天数 必填:条件必填 正常工资薪金传了适用公式才需要条件必录。当sygs字段填值并且不等于公式5时,该字段必填,可以为小数 小数位0.5天 不能两位小数,只能是1或者1.0不能1.00 + */ + private BigDecimal jwgzts; + /** + * 境内支付 必填:条件必填 正常工资薪金传了适用公式才需要条件必录。当sygs字段填值并且不等于公式5时,该字段必填 + */ + private BigDecimal jnzf; + /** + * 境外支付 必填:条件必填 正常工资薪金传了适用公式才需要条件必录。当sygs字段填值并且不等于公式5时,该字段必填 + */ + private BigDecimal jwzf; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 基本养老保险 必填:否 无则填0 + */ + private BigDecimal jbylaobxf; + /** + * 基本医疗保险 必填:否 无则填0 + */ + private BigDecimal jbylbxf; + /** + * 失业保险 必填:否 无则填0 + */ + private BigDecimal sybxf; + /** + * 住房公积金 必填:否 无则填0 + */ + private BigDecimal zfgjj; + /** + * 年金 必填:否 无则填0 + */ + private BigDecimal nj; + /** + * 商业健康保险 必填:否 无则填0 + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:否 无则填0 + */ + private BigDecimal syylbx; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目,填写其他,一定 + */ + private BigDecimal qt; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称 + */ + private String bz; + /** + * 准予扣除的捐赠额 必填:否 无则填0,按照税法以及相关法规、政策规定,可以在税前扣除的捐赠额 + */ + private BigDecimal zykcjze; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 所得项目名称 必填:是 正常工资薪金; + */ + private String sdxm; + /** + * 子女教育支出 必填:条件必填 在zcgzxjsfcrzx=1时必传,默认不传 + */ + private BigDecimal znjyzc; + /** + * 继续教育支出 必填:条件必填 在zcgzxjsfcrzx=1时必传,默认不传 + */ + private BigDecimal jxjyzc; + /** + * 住房租金支出 必填:条件必填 在zcgzxjsfcrzx=1时必传,默认不传 + */ + private BigDecimal zfzjzc; + /** + * 房屋贷款支出 必填:条件必填 在zcgzxjsfcrzx=1时必传,默认不传 + */ + private BigDecimal zfdklxzc; + /** + * 赡养老人支出 必填:条件必填 在zcgzxjsfcrzx=1时必传,默认不传 + */ + private BigDecimal sylrzc; + /** + * 3岁以下婴幼儿照护支出 必填:条件必填 在zcgzxjsfcrzx=1时必传,默认不传 + */ + private BigDecimal yyezhzc; + /** + * 累计子女教育支出 必填:条件必填 在zcgzxjsfcrzx=2时必传,默认不传 + */ + private BigDecimal ljznjyzc; + /** + * 累计继续教育支出 必填:条件必填 在zcgzxjsfcrzx=2时必传,默认不传 + */ + private BigDecimal ljjxjyzc; + /** + * 累计住房租金支出 必填:条件必填 在zcgzxjsfcrzx=2时必传,默认不传 + */ + private BigDecimal ljzfzjzc; + /** + * 累计房屋贷款支出 必填:条件必填 在zcgzxjsfcrzx=2时必传,默认不传 + */ + private BigDecimal ljzfdklxzc; + /** + * 累计赡养老人支出 必填:条件必填 在zcgzxjsfcrzx=2时必传,默认不传 + */ + private BigDecimal ljsylrzc; + /** + * 累计3岁以下婴幼儿照护支出 必填:条件必填 在zcgzxjsfcrzx=2时必传,默认不传 + */ + private BigDecimal ljyyezhzc; + /** + * 累计个人养老金 必填:否 在gryljcl=2时传值,默认不传 + */ + private BigDecimal ljgrylj; + /** + * 累计个人养老金校验码 必填:否 + * 在gryljcl=2时传值,默认不传 在ljgrylj传值时校验是否合法 ljgrylj传0时不校验 + */ + private String ljgryljjym; + /** + * 应补退税额 必填:否 配合sfsysyybtse字段使用 + */ + private BigDecimal ybtse; + } + } + + @Data + public static class qnycxjjss { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 批次号 必填:否 默认不填为Null,表示一月一次算薪; 其他整数值(如1、2、3等)为一月多次发薪算薪的批次 + */ + private Integer pch; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 准予扣除的捐赠额 必填:否 无则填0 + */ + private BigDecimal zykcjze; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 备注 必填: 条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 所得项目名称 必填:是 填写:全年一次性奖金收入; + */ + private String sdxm; + } + + @Data + public static class gcsd { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 备注 必填: 条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 所得项目名称 必填:是 填写:稿酬所得; + */ + private String sdxm; + } + + @Data + public static class lwbc { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 当期免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 商业健康保险 必填:否 无则填0 + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:否 无则填0 + */ + private BigDecimal syylbx; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 备注 必填:条件必填  根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 允许扣除税费 必填:否 + */ + private BigDecimal yxkcsf; + /** + * 所得项目名称 必填:是 填写:一般劳务报酬所得; + */ + private String sdxm; + } + + @Data + public static class jcldhtycxbcj { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 备注 必填: 条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 准予扣除的捐赠额 必填:否 无则填0 + */ + private BigDecimal zykcjze; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 所得项目名称 必填:是 填写:解除劳动合同一次性补偿金; + */ + private String sdxm; + + } + + @Data + public static class bxyxy { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:条件必填 当sygs为空或者等于公式5时必填 + */ + private BigDecimal sre; + /** + * 免税收入 必填:是 无则填0 + */ + private BigDecimal mssd; + /** + * 商业健康保险 必填:是 无则填0 + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:是 无则填0 + */ + private BigDecimal syylbx; + /** + * 准予扣除的捐赠额 必填:否 无则填0,按照税法以及相关法规、政策规定,可以在税前扣除的捐赠额 + */ + private BigDecimal zykcjze; + /** + * 其他 必填:是 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 减免税额 必填:是 无则填0 + */ + private BigDecimal jmse; + /** + * 累计个人养老金 必填:否 在gryljcl=2时传值,默认不传 + */ + private BigDecimal ljgrylj; + /** + * 累计个人养老金校验码 必填:否 + * 在gryljcl=2时传值,默认不传 在ljgrylj传值时校验是否合法 ljgrylj传0时不校验 + */ + private String ljgryljjym; + + /** + * 所得项目名称 必填:是 保险营销员佣金收入; + */ + private String sdxm; + /** + * 允许扣除税费 必填:否 + */ + private BigDecimal yxkcsf; + /** + * 应补退税额 必填:否 配合sfsysyybtse字段使用 + */ + private BigDecimal ybtse; + } + + @Data + public static class zqjjr { + /** + * 证券经纪人所得薪金列表 必填:null 参考综合所得-证券经纪人列表 + */ + private List zqjjrsdlb; + /** + * 上月证券经纪人列表 必填:null 参考综合所得-证券经纪人列表 + */ + private List syzqjjrlb; + /** + * 人员列表 必填:null 见企业人员列表 + */ + private List rylb; + /** + * 批次号 必填:否 + * 默认不填为Null,表示一月一次算薪; + * 其他整数值(如1、2、3等)为一月多次发薪算薪的批次 + */ + private Integer pch; + /** + * 是否导入上月正常工资薪金(一月多次发薪) 必填:否 + * 仅在一月多次算税场景中使用 + * 0:不导入上月薪金 1:导入上月薪资 (默认为1,导入上月薪资) + */ + private String sfdrsyzcgzxj; + /** + * 是否同时人员报送 必填:否 0: 人员不报送; 1: 人员报送 (默认为1,算税前同时处理人员报送,离线算薪模式时,不会进行人员报送) + */ + private String sfrysb; + /** + * 是否已代报上月薪金 必填:否 (默认为1) 1: 已代报上月正常工资薪金 0: 未代报上月正常工资薪金(两个月算税传入0) + */ + private String syysfsyzcgzxj; + /** + * 企业下载往期标志 必填:否 1:按照企业维度下载(默认) 0:按照部门维度下载(企业在局端备案分部门,需要传入0) + */ + private String qyxzwqbz; + /** + * 多月算税,是否使用上月传入的应补退税额 必填:否 + * 1. 不传或传空(默认为否)或者传“否”,与当前多月算税逻辑一致。 2. 传“是”,多月算税时取上月薪资数据传入的应补退税额参与算税。 + */ + private String sfsysyybtse; + /** + * 个人养老金策略 必填:否 + * 0: 不传或传空或者传“0”则会实时下载个人养老金 1: 传“1”则使用本地的个人养老金 2: 传“2”则使用传入的累计个人养老金 + */ + private String gryljcl; + /** + * 上月个人养老金策略 必填:否 + * 不传或传空赋值默认值,默认值为1 0:传“0”则会实时下载个人养老金 1: 传“1”则使用本地的个人养老金 2: 传“2”则使用传入的累计个人养老金 + */ + private String sygryljcl; + + + @Data + public static class zqjjrsd { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:条件必填 当sygs为空或者等于公式5时必填 + */ + private BigDecimal sre; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 商业健康保险 必填:否 无则填0 + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:否 无则填0 + */ + private BigDecimal syylbx; + /** + * 准予扣除的捐赠额 必填:否 无则填0,按照税法以及相关法规、政策规定,可以在税前扣除的捐赠额 + */ + private BigDecimal zykcjze; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 累计个人养老金 必填:否 在gryljcl=2时传值,默认不传 + */ + private BigDecimal ljgrylj; + /** + * 累计个人养老金校验码 必填:否 + * 在gryljcl=2时传值,默认不传 在ljgrylj传值时校验是否合法 ljgrylj传0时不校验 + */ + private String ljgryljjym; + /** + * 所得项目名称 必填:是 证券经纪人佣金收入; + */ + private String sdxm; + /** + * 允许扣除税费 必填:否 + */ + private BigDecimal yxkcsf; + /** + * 应补退税额 必填:否 配合sfsysyybtse字段使用 + */ + private BigDecimal ybtse; + } + } + + @Data + public static class qtlxlwbc { + /** + * 其他连续劳务报酬所得列表 必填:null 参考综合所得-其他连续劳务报酬所得列表 + */ + private List qtlxlwbclb; + /** + * 上月其他连续劳务报酬所得列表 必填:null 参考综合所得-其他连续劳务报酬所得列表 + */ + private List syqtlxlwbclb; + /** + * 人员列表 必填:null 见企业人员列表 + */ + private List rylb; + /** + * 是否同时人员报送 必填:否 0: 人员不报送;1: 人员报送 默认为1,算税前同时处理人员报送,离线算薪模式时,不会进行人员报送) + */ + private String sfrysb; + /** + * 是否已代报上薪金 必填:否 (默认为1) 1: 已代报上月正常工资薪金 0: 未代报上月正常工资薪金(两个月算税) + */ + private String syysfsyzcgzxj; + /** + * 企业下载往期标志 必填:否 1:按照企业维度下载(默认) 0:按照部门维度下载(企业在局端备案分部门,需要传入0) + */ + private String qyxzwqbz; + /** + * 批次号 必填:否 默认不填为Null,表示一月一次算薪; 其他整数值(如1、2、3等)为一月多次发薪算薪的批次 + */ + private Integer pch; + /** + * 多月算税,是否使用上月传入的应补退税额 必填:否 1. 不传或传空(默认为否)或者传“否”,与当前多月算税逻辑一致。 2. 传“是”,多月算税时取上月薪资数据传入的应补退税额参与算税。 + */ + private String sfsysyybtse; + /** + * 个人养老金策略 必填:否 0: 不传或传空或者传“0”则会实时下载个人养老金 1: 传“1”则使用本地的个人养老金 2: 传“2”则使用传入的累计个人养老金 + */ + private String gryljcl; + /** + * 上月个人养老金策略 必填:否 不传或传空赋值默认值,默认值为1 0:传“0”则会实时下载个人养老金 1: 传“1”则使用本地的个人养老金 2: 传“2”则使用传入的累计个人养老金 + */ + private String sygryljcl; + + @Data + public static class qtlxlw { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:条件必填 当sygs为空或者等于公式5时必填 + */ + private BigDecimal sre; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 商业健康保险 必填:否 无则填0 + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:否 无则填0 + */ + private BigDecimal syylbx; + /** + * 准予扣除的捐赠额 必填:否 无则填0,按照税法以及相关法规、政策规定,可以在税前扣除的捐赠额 + */ + private BigDecimal zykcjze; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 累计个人养老金 必填:否 在gryljcl=2时传值,默认不传 + */ + private BigDecimal ljgrylj; + /** + * 累计个人养老金校验码 必填:否 在gryljcl=2时传值,默认不传 在ljgrylj传值时校验是否合法 ljgrylj传0时不校验 + */ + private String ljgryljjym; + /** + * 所得项目名称 必填:是 证券经纪人佣金收入; + */ + private String sdxm; + /** + * 允许扣除税费 必填:否 + */ + private BigDecimal yxkcsf; + /** + * 应补退税额 必填:否 配合sfsysyybtse字段使用 + */ + private BigDecimal ybtse; + } + } + + @Data + public static class txq { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 备注 必填: 条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 所得项目名称 必填:是 填写:特许权使用费所得 + */ + private String sdxm; + } + + @Data + public static class grgqjl { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:是 + */ + private BigDecimal sre; + /** + * 累计收入额(不含本期) 必填:否 如果为null,则使用本地申报数据累计自动填充 + */ + private BigDecimal ljsre; + /** + * 累计免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 准予扣除的捐赠额 必填:否 无则填0 + */ + private BigDecimal zykcjze; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 适用公式 必填:否 见《工资收入公式字典》 + */ + private String sygs; + /** + * 累计已扣缴税额 必填:否 如果为null,则使用本地申报数据累计自动填充 + */ + private BigDecimal ykjse; + /** + * 境内工作天数 必填:条件必填 + * 当sygs字段填值并且不等于公式5时,该字段必填 不能两位小数,只能是1或者1.0不能1.00 + */ + private BigDecimal jngzts; + /** + * 境外工作天数 必填:条件必填 + * 当sygs字段填值并且不等于公式5时,该字段必填 + * 不能两位小数,只能是1或者1.0不能1.00 + */ + private BigDecimal jwgzts; + /** + * 境内支付 必填:条件必填 当sygs字段填值并且不等于公式5时,该字段必填 + */ + private BigDecimal jnzf; + /** + * 境外支付 必填:条件必填 当sygs字段填值并且不等于公式5时,该字段必填 + */ + private BigDecimal jwzf; + /** + * 所得项目名称 必填:是 填写:个人股权激励收入 + */ + private String sdxm; + } + + @Data + public static class qynj { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 已完税缴费额 必填:否 不填写默认为0 + */ + private BigDecimal ywsjfe; + /** + * 全部缴费额 必填:是 不小于等于0,取值小数点后两位例0.00 + */ + private BigDecimal qbjfe; + /** + * 是否一次性领取 必填: 是 1:是 0:否 + */ + private String sfycxlq; + /** + * 年金领取方式 必填:条件必填 当“是否一次性领取”为是时,不可填写,当“是否一次性领取”为否时,可填写; 领取方式按“按年”,“按季”,“按月” + */ + private String njlqfs; + /** + * 年金领取原因 必填:条件必填 当“是否一次性领取”为是时,可填写; 当“是否一次性领取”为否时,不可填写; 领取原因:“出国定居或个人死亡“、”其他“; + */ + private String njlqyy; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 商业健康保险 必填:否 + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:否 + */ + private BigDecimal syylbx; + /** + * 其他 必填:否 + */ + private BigDecimal qt; + /** + * 准予扣除捐赠额 必填:否 + */ + private BigDecimal zykcjze; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 所得项目名称 必填:是 填写:年金领取 + */ + private String sdxm; + } + + @Data + public static class ntycxbcj { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 一次性补偿收入 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 本期工资收入 必填: 否 + */ + private BigDecimal bqgzs; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 其他 必填:否 + */ + private BigDecimal qt; + /** + * 准予扣除捐赠额 必填:否 + */ + private BigDecimal zykcjze; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 所得项目名称 必填:是 填写:内退一次性补偿金 + */ + private String sdxm; + /** + * 分摊月份数 必填:是 + */ + private Integer ftyfs; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + } + + @Data + public static class qtflxlwbc { + /** + * 姓名 必填:是 + */ + private String xm; + /** + * 证件类型 必填:是 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 必填:是 + */ + private String zzhm; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + private BigDecimal sre; + /** + * 免税收入 必填:否 无则填0 + */ + private BigDecimal mssd; + /** + * 商业健康保险 必填:否 无则填0 + */ + private BigDecimal syjkbx; + /** + * 税延养老保险 必填:否 无则填0 + */ + private BigDecimal syylbx; + /** + * 允许扣除税费 必填:否 + */ + private BigDecimal yxkcsf; + /** + * 其他 必填:否 按法律规定可以在税前扣除的项目 + */ + private BigDecimal qt; + /** + * 备注 必填:条件必填 根据政策要求,填写【其他】项,一定在备注中写明具体扣除项目名称,备注不超过20个字符 + */ + private String bz; + /** + * 减免税额 必填:否 无则填0 + */ + private BigDecimal jmse; + /** + * 所得项目名称 必填:是 填写:其他非连续劳务报酬 + */ + private String sdxm; + } + } + + +} diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java new file mode 100644 index 000000000..7c1e13b6d --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -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 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 sscglb; + /** + * 综合算税失败列表 参考综合所得输出结果报文 + */ + private List sssblb; + /** + * 综合算税失败原因列表 参考算税失败原因对象 + */ + private List 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 sscglb; + /** + * 非居民算税失败列表 参考输入报文非居民所得输出结果报文 + */ + private List sssblb; + /** + * 非居民算税失败原因列表 参考算税失败原因对象 + */ + private List 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; + } + + } + + +} diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 3243a0234..94c52cafa 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -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 listPage4FailByParam(EmployeeDeclareFailListQueryParam param); + /** + * 根据薪资核算记录关系的个税扣缴义务人查询报送人员 + * + * @param salaryAcctTaxAgents + * @return + */ + List listBySalaryAcctTaxAgent(List salaryAcctTaxAgents); + /** * 保存 * diff --git a/src/com/engine/salary/service/SalaryAcctCalcTaxReqService.java b/src/com/engine/salary/service/SalaryAcctCalcTaxReqService.java new file mode 100644 index 000000000..8fe41c879 --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctCalcTaxReqService.java @@ -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 listByRecordId(Long salaryAcctRecordId); + + /** + * 批量保存 + * + * @param salaryAcctCalcTaxReqs + */ + void batchSave(List salaryAcctCalcTaxReqs); + + /** + * 根据薪资核算记录删除 + * + * @param salaryAcctRecordId + */ + void deleteByRecordId(Long salaryAcctRecordId); +} diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index 0090f8330..e2e83b054 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -116,6 +116,7 @@ public interface SalaryAcctResultService { * @param salaryAcctResultPOS 薪资核算结果 */ void batchSave(List salaryAcctResultPOS); + void batchUpdate(List salaryAcctResultPOS); /** * 根据薪资核算人员id删除薪资核算结果 diff --git a/src/com/engine/salary/service/SalaryCalcTaxService.java b/src/com/engine/salary/service/SalaryCalcTaxService.java new file mode 100644 index 000000000..7e6efec5c --- /dev/null +++ b/src/com/engine/salary/service/SalaryCalcTaxService.java @@ -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); +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index a88612e7e..264a83e56 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -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 listBySalaryAcctTaxAgent(List salaryAcctTaxAgents) { + if (CollectionUtils.isEmpty(salaryAcctTaxAgents)) { + return Collections.emptyList(); + } + Map employeeDeclareParamMap = new HashMap<>(); + for (SalaryAcctTaxAgentPO po : salaryAcctTaxAgents) { + employeeDeclareParamMap.putIfAbsent(po.getTaxAgentId() + "-" + po.getTaxCycle(), po); + } + List employeeDeclares = new ArrayList<>(); + for (Map.Entry entry : employeeDeclareParamMap.entrySet()) { + SalaryAcctTaxAgentPO salaryAcctTaxAgent = entry.getValue(); + List temp = listByTaxCycleAndTaxAgentId(salaryAcctTaxAgent.getTaxCycle(), salaryAcctTaxAgent.getTaxAgentId()); + employeeDeclares.addAll(temp); + } + return employeeDeclares; + } + @Override public void save(EmployeeDeclareSaveParam saveParam) { Date now = new Date(); diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalcTaxReqServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalcTaxReqServiceImpl.java new file mode 100644 index 000000000..c23a9b87c --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryAcctCalcTaxReqServiceImpl.java @@ -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 listByRecordId(Long salaryAcctRecordId) { + return getSalaryAcctCalcTaxReqMapper().listSome(SalaryAcctCalcTaxReqPO.builder().salaryAcctRecordId(salaryAcctRecordId).build()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void batchSave(List salaryAcctCalcTaxReqs) { + if (CollectionUtils.isNotEmpty(salaryAcctCalcTaxReqs)) { + salaryAcctCalcTaxReqs.forEach(getSalaryAcctCalcTaxReqMapper()::insertIgnoreNull); + } + } + + @Override + public void deleteByRecordId(Long salaryAcctRecordId) { + getSalaryAcctCalcTaxReqMapper().deleteByRecordId(salaryAcctRecordId); + } +} diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 32a23ed79..0bb2244ae 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -704,6 +704,15 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } } + public void batchUpdate(List salaryAcctResultPOS) { + if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) { + // 数据加密 + encryptUtil.encryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); + List> partition = Lists.partition(salaryAcctResultPOS, 100); + partition.forEach(getSalaryAcctResultMapper()::batchUpdate); + } + } + @Override public void deleteBySalaryAcctEmployeeIds(Collection salaryAcctEmployeeIds) { diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java new file mode 100644 index 000000000..4edb5b06a --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -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 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 salaryAcctTaxAgents = getSalaryAcctTaxAgentService(user) + .listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + // 查询薪资核算记录关联的薪资核算人员 + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecord.getId()); + // 查询薪资核算记录关联的薪资核算结果 + List salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + // 查询个税扣缴义务人 + Set taxAgentIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); + // 查询个税扣缴义务人关联的报税信息 + List taxAgentTaxReturns = getTaxAgentTaxReturnService(user).getByTaxAgentIds(taxAgentIds); + // 查询个税申报表字段 + List taxReportColumns = getTaxReportColumnService(user).listAll(); + // 查询薪资核算记录关联薪资账套的个税申报配置 + List salarySobTaxReportRules = getSalarySobTaxReportRuleService(user) + .listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId())); + // 查询报送人员 + List employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents); + + List salaryAcctCalcTaxReqs = new ArrayList<>(); + + Date now = new Date(); + Map params = new HashMap<>(1); + Map 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> taxAgentIdKeyRequestParam = salaryCalcTax.buildCalcTaxRequestParam(); + for (Map.Entry> 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 salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecord.getId()); + Map> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, e -> e.getTaxAgentId() + "-" + e.getIncomeCategory()); + // 查询薪资核算记录关联的薪资核算结果 + List salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + Map> salaryAcctResultValueMap = SalaryEntityUtil.list2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId, SalaryAcctResultPO::getSalaryItemId); + // 查询薪资核算记录关联的个税扣缴义务人 + List salaryAcctTaxAgents = getSalaryAcctTaxAgentService(user) + .listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + Map> salaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + // 查询薪资核算记录关联的异步算税请求记录 + List salaryAcctCalcTaxReqs = getSalaryAcctCalcTaxReqService(user).listByRecordId(salaryAcctRecord.getId()); + if (CollectionUtils.isEmpty(salaryAcctCalcTaxReqs)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(268184, "请先计算个税再获取反馈")); + } + // 查询薪资核算记录关联的薪资账套个税申报表字段对应 + List salarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId())); + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex); + // 查询报送人员 + List employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents); + Map> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); + + String url = apiConfig.getHost() + SzyhApiConstant.ASYN_INDIVIDUAL_INCOME_TAX_FEEDBACK; + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + + List 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 subSalaryAcctTaxAgents = salaryAcctTaxAgentMap.get(salaryAcctCalcTaxReq.getTaxAgentId()); + if (CollectionUtils.isEmpty(subSalaryAcctTaxAgents)) { + continue; + } + List subEmployeeDeclares = employeeDeclareMap.get(salaryAcctCalcTaxReq.getTaxAgentId()); + + // 获取不同所得项目的个税 + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : subSalaryAcctTaxAgents) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(salaryAcctTaxAgent.getIncomeCategory()); + if (incomeCategoryEnum == null) { + continue; + } + + Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares); + + + Map 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 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 subSalaryAcctEmployees = salaryAcctEmployeeMap.get(salaryAcctTaxAgent.getTaxAgentId() + "-" + salaryAcctTaxAgent.getIncomeCategory()); + if (CollectionUtils.isEmpty(subSalaryAcctEmployees)) { + continue; + } + for (SalaryAcctEmployeePO salaryAcctEmployee : subSalaryAcctEmployees) { + Map 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); + } +} diff --git a/src/com/engine/salary/util/SalaryEntityUtil.java b/src/com/engine/salary/util/SalaryEntityUtil.java index 81e5b12d9..f14a1a2d8 100644 --- a/src/com/engine/salary/util/SalaryEntityUtil.java +++ b/src/com/engine/salary/util/SalaryEntityUtil.java @@ -163,6 +163,36 @@ public class SalaryEntityUtil { Collectors.collectingAndThen(Collectors.toList(), e -> e.stream().map(valueMapper).collect(Collectors.toList())))); } + public static Map> list2Map(Collection objs, Function function1, Function function2, Function function3) { + if (CollectionUtils.isEmpty(objs)) { + return Maps.newHashMap(); + } + Map> collect = objs.stream().collect(Collectors.groupingBy(function1)); + Map> map = new HashMap<>(); + for (Map.Entry> entry: collect.entrySet()) { + Map 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 Map> list2Map(Collection objs, Function function1, Function function2) { + if (CollectionUtils.isEmpty(objs)) { + return Maps.newHashMap(); + } + Map> collect = objs.stream().collect(Collectors.groupingBy(function1)); + Map> map = new HashMap<>(); + for (Map.Entry> entry: collect.entrySet()) { + Map 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 ""; diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 52d95a469..b70d97416 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -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(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(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(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(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 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> listCheckResult(@RequestBody @Validated SalaryCheckResultQueryParam queryParam) { // WeaTable 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> listCheckResultRecord(@RequestBody @Validated SalaryCheckResultRecordQueryParam queryParam) { // WeaTable 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 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 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 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> 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> exportCheckResultDetail(@RequestParam(value = "checkResultId") Long checkResultId) { // DataCollectionEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 3782721f4..1fe36dbdb 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -103,6 +103,13 @@ public class SalarySobController { return new ResponseResult>(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>>(user).run(getSalarySobWrapper(user)::incomeCategoryList); + } /** * 薪资账套基本信息表单 diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index cae703b1c..d8ebc1009 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -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); + } } diff --git a/src/com/engine/salary/wrapper/SalarySobWrapper.java b/src/com/engine/salary/wrapper/SalarySobWrapper.java index e0f456a5f..72f9f1518 100644 --- a/src/com/engine/salary/wrapper/SalarySobWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobWrapper.java @@ -269,4 +269,18 @@ public class SalarySobWrapper extends Service { return taxAgentIds.contains(salarySobPO.getTaxAgentId()) || Objects.isNull(salarySobPO.getTaxAgentId()); } + public List> incomeCategoryList() { + IncomeCategoryEnum[] values = IncomeCategoryEnum.values(); + List> list = new ArrayList<>(values.length); + for (IncomeCategoryEnum value : values) { + Map map = new HashMap(); + 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; + } } diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java index 56bb4a986..716d56807 100644 --- a/test/ParseTaxApi.java +++ b/test/ParseTaxApi.java @@ -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"); } From 6a8c2dd8ac3c0d950c8a459576092161552aa6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 7 Jun 2024 11:01:57 +0800 Subject: [PATCH 168/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/annotation/TaxField.java | 12 + .../salarysob/dto/SalarySobTaxRuleDTO.java | 55 ++ .../param/SalarySobTaxRuleSaveParam.java | 43 + .../salarysob/po/SalarySobTaxRulePO.java | 60 ++ .../salarysob/DeclareReportTypeEnum.java | 56 +- .../enums/salarysob/IncomeCategoryEnum.java | 211 ++--- .../salarysob/SalarySobTaxRuleMapper.java | 73 ++ .../salarysob/SalarySobTaxRuleMapper.xml | 249 ++++++ ...ynIndividualIncomeTaxFeedbackResponse.java | 800 +++++++++--------- .../service/SalarySobTaxRuleService.java | 51 ++ .../impl/SalaryCalcTaxServiceImpl.java | 2 +- .../impl/SalarySobTaxRuleServiceImpl.java | 160 ++++ .../salary/web/SalarySobController.java | 39 + .../wrapper/SalarySobTaxRuleWrapper.java | 45 + 14 files changed, 1314 insertions(+), 542 deletions(-) create mode 100644 src/com/engine/salary/annotation/TaxField.java create mode 100644 src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java create mode 100644 src/com/engine/salary/entity/salarysob/param/SalarySobTaxRuleSaveParam.java create mode 100644 src/com/engine/salary/entity/salarysob/po/SalarySobTaxRulePO.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.xml create mode 100644 src/com/engine/salary/service/SalarySobTaxRuleService.java create mode 100644 src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java create mode 100644 src/com/engine/salary/wrapper/SalarySobTaxRuleWrapper.java diff --git a/src/com/engine/salary/annotation/TaxField.java b/src/com/engine/salary/annotation/TaxField.java new file mode 100644 index 000000000..57495febf --- /dev/null +++ b/src/com/engine/salary/annotation/TaxField.java @@ -0,0 +1,12 @@ +package com.engine.salary.annotation; + +import java.lang.annotation.*; + +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface TaxField { + String name(); + + String taxIndex(); +} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java new file mode 100644 index 000000000..a39c1abbf --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java @@ -0,0 +1,55 @@ +package com.engine.salary.entity.salarysob.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * 薪资账套的个税规则 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class SalarySobTaxRuleDTO { + + //所得项目的id + private String incomeCategoryId; + + //所得项目的名称 + private String incomeCategoryName; + + //个税的对应关系 + private List taxRules; + + @Data + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class TaxRuleDTO { + + //个税字段 + private String name; + + //个税索引 + private String taxIndex; + + //个税字段和薪资项目的对应关系 + private Map salaryItem; + + //个税字段的值 + private String value; + + //对应关系是否可以编辑 + private boolean canEdit; + } +} diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobTaxRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxRuleSaveParam.java new file mode 100644 index 000000000..bf3be6fc6 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxRuleSaveParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.salarysob.param; + +import lombok.Data; + +import java.util.List; + +/** + * 薪资账套的个税规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobTaxRuleSaveParam { + + //薪资账套的id + private Long salarySobId; + + //不同所得项目的个税的对应关系 + private List incomeCategoryParams; + + @Data + public static class TaxReportRuleIncomeCategoryParam { + + //所得项目 + private String incomeCategory; + + //个税的对应关系 + private List taxRuleParams; + } + + @Data + public static class TaxRuleParam { + + //个税的列索引 + private String taxIndex; + + //薪资项目的id + private Long salaryItemId; + } +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxRulePO.java new file mode 100644 index 000000000..4bd4c0613 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxRulePO.java @@ -0,0 +1,60 @@ +package com.engine.salary.entity.salarysob.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalarySobTaxRulePO { + /** + * ID + */ + private Long id; + /** + * 创建时间 + */ + private Date createTime; + /** + * 修改时间 + */ + private Date updateTime; + /** + * 创建人id + */ + private Long creator; + /** + * 是否删除 + */ + private Integer deleteType; + /** + * 租户KEY + */ + private String tenantKey; + /** + * 薪资账套的id + */ + private Long salarySobId; + /** + * 所得项目 + */ + private String incomeCategory; + /** + * 个税列索引 + */ + private String taxIndex; + /** + * 薪资项目id + */ + private Long salaryItemId; + + //主键id集合 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java b/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java index 2d99b4ebc..f54e7bc86 100644 --- a/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java +++ b/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java @@ -1,8 +1,14 @@ package com.engine.salary.enums.salarysob; +import com.engine.salary.annotation.TaxField; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; import com.engine.salary.enums.BaseEnum; +import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; /** @@ -14,10 +20,30 @@ import java.util.Objects; * @version 1.0 **/ public enum DeclareReportTypeEnum implements BaseEnum { - COMPREHENSIVE_INCOME(1, "综合所得", 100133), - CLASSIFIED_INCOME(2, "分类所得", 86185), - NONRESIDENT_INCOME(3, "非居民所得", 107369), - RESTRICTED_SHARES_INCOME(4, "限售股所得", 90633); + COMPREHENSIVE_INCOME(1, "综合所得", 100133) { + @Override + public List getTaxRules() { + return buildRules(GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result.class); + } + }, + CLASSIFIED_INCOME(2, "分类所得", 86185) { + @Override + public List getTaxRules() { + return buildRules(null); + } + }, + NONRESIDENT_INCOME(3, "非居民所得", 107369) { + @Override + public List getTaxRules() { + return buildRules(GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result.class); + } + }, + RESTRICTED_SHARES_INCOME(4, "限售股所得", 90633) { + @Override + public List getTaxRules() { + return buildRules(null); + } + }; private int value; @@ -47,6 +73,28 @@ public enum DeclareReportTypeEnum implements BaseEnum { return defaultLabel; } + public abstract List getTaxRules(); + + public static List buildRules(Class clazz) { + if (clazz == null) { + return new ArrayList<>(); + } + List rules = new ArrayList<>(); + Field[] fields = clazz.getDeclaredFields(); + for (Field f : fields) { + boolean isanno = f.isAnnotationPresent(TaxField.class); + if (isanno) { + TaxField annotation = f.getAnnotation(TaxField.class); + String name = annotation.name(); + String taxIndex = annotation.taxIndex(); + SalarySobTaxRuleDTO.TaxRuleDTO taxRuleDTO = SalarySobTaxRuleDTO.TaxRuleDTO.builder().name(name).taxIndex(taxIndex).build(); + rules.add(taxRuleDTO); + } + } + return rules; + } + + public static DeclareReportTypeEnum parseByValue(Integer value) { for (DeclareReportTypeEnum targetTypeEnum : DeclareReportTypeEnum.values()) { if (Objects.equals(targetTypeEnum.getValue(), value)) { diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 9d7c9c427..4eed6daa9 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,14 +1,19 @@ package com.engine.salary.enums.salarysob; 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 lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import weaver.general.Util; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.*; /** @@ -19,6 +24,7 @@ import java.util.*; * @author qiantao * @version 1.0 **/ +@Slf4j public enum IncomeCategoryEnum implements BaseEnum { // todo 多语言 @@ -31,12 +37,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + SalarySobTaxRuleDTO salarySobTaxRuleDTO = SalarySobTaxRuleDTO.builder().incomeCategoryId(this.getValue().toString()).incomeCategoryName(this.getDefaultLabel()).build(); + List taxRules = this.getReportType().getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule->{ + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = rule.getClass().getMethod(getter); + Object invoke = method.invoke(rule); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("no such method", ex); + } + }); + salarySobTaxRuleDTO.setTaxRules(taxRules); + resultMap.put(employeeDeclare.getEmployeeId(),salarySobTaxRuleDTO ); } return resultMap; } @@ -50,15 +71,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) { @Override @@ -69,15 +85,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) { @Override @@ -88,15 +99,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) { @Override @@ -107,15 +113,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) { @Override @@ -126,15 +127,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) { @Override @@ -145,15 +141,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) { @Override @@ -164,15 +155,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) { @Override @@ -183,15 +169,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) { @Override @@ -202,15 +183,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) { @Override @@ -221,15 +197,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) { @Override @@ -240,15 +211,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) { @Override @@ -259,15 +225,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -278,15 +239,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -297,15 +253,10 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } + }, NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -314,17 +265,11 @@ public enum IncomeCategoryEnum implements BaseEnum { List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); result.put(this.getDefaultLabel(), sheetData); } - @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; - } + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; + } }, NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -335,14 +280,8 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); - Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm); - Map resultMap = new HashMap<>(); - for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { - resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum())); - } - return resultMap; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { + return null; } }; @@ -368,7 +307,7 @@ public enum IncomeCategoryEnum implements BaseEnum { public abstract void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); - public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares); + public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares); @Override diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.java new file mode 100644 index 000000000..cd2db6677 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.salarysob.po.SalarySobTaxRulePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalarySobTaxRuleMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(SalarySobTaxRulePO sobTaxRule); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + SalarySobTaxRulePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param sobTaxRule 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(SalarySobTaxRulePO sobTaxRule); + + /** + * 修改,修改所有字段 + * + * @param sobTaxRule 修改的记录 + * @return 返回影响行数 + */ + int update(SalarySobTaxRulePO sobTaxRule); + + /** + * 修改,忽略null字段 + * + * @param sobTaxRule 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(SalarySobTaxRulePO sobTaxRule); + + /** + * 删除记录 + * + * @param sobTaxRule 待删除的记录 + * @return 返回影响行数 + */ + int delete(SalarySobTaxRulePO sobTaxRule); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBySalarySobIds(@Param("salarySobIds") Collection salarySobIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.xml new file mode 100644 index 000000000..53277c457 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.salary_sob_id + , t.income_category + , t.tax_index + , t.salary_item_id + + + + + + + + + + + + + + + INSERT INTO hrsa_sob_tax_rule + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + salary_sob_id, + + + income_category, + + + tax_index, + + + salary_item_id, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{salarySobId}, + + + #{incomeCategory}, + + + #{taxIndex}, + + + #{salaryItemId}, + + + + + + + UPDATE hrsa_sob_tax_rule + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + salary_sob_id=#{salarySobId}, + income_category=#{incomeCategory}, + tax_index=#{taxIndex}, + salary_item_id=#{salaryItemId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_rule + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + salary_sob_id=#{salarySobId}, + + + income_category=#{incomeCategory}, + + + tax_index=#{taxIndex}, + + + salary_item_id=#{salaryItemId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_rule + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_sob_tax_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + UPDATE hrsa_sob_tax_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_sob_id IN + + #{salarySobId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java index 7c1e13b6d..6801b8767 100644 --- a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -1,6 +1,7 @@ package com.engine.salary.remote.tax.response.calculate; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.annotation.TaxField; import com.engine.salary.entity.taxpayment.response.BaseResponse; import lombok.Data; import lombok.EqualsAndHashCode; @@ -210,6 +211,291 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { * 企业上月是否已申报 0:上月未申报 1:上月已申报 2:上上月未申报 */ private String qysysfysb; + + + @Data + public static class result { + /** + * 是否明细申报 必填:否 是或者否 + */ + private String sfmxsb; + /** + * 姓名 必填:否 如果是汇总申报返回空 + */ + private String xm; + /** + * 证件类型 必填:否 见证件类型字典 如果是汇总申报返回空 + */ + private String zzlx; + /** + * 证件号码 必填:否 如果是汇总申报返回空 + */ + private String zzhm; + /** + * 任职受雇日期 必填:是 格式YYYY-MM-DD + */ + private String rzsgrq; + /** + * 离职日期 必填:否 格式YYYY-MM-DD + */ + private String lzrq; + /** + * 当期收入额 必填:是 不填写默认为0 + */ + 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; + /** + * 应纳税所得额 必填:否 正常工资薪金返回否 + */ + private BigDecimal ynssde; + /** + * 应纳税额 必填:否 正常工资薪金返回否 + */ + private BigDecimal ynse; + /** + * 已缴税额 必填:否 正常工资薪金返回否 + */ + private BigDecimal ykjse; + /** + * 应扣缴税额 必填:否 正常工资薪金返回否 + */ + private BigDecimal yingkjse; + /** + * 税率 必填:否 + */ + private BigDecimal sl; + /** + * 速算扣除数 必填:否 + */ + private BigDecimal sskcs; + /** + * 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬 + */ + private String sdxm; + /** + * 应补退税额 必填:否 应补退税额=累计应扣缴税额-累计已缴税额 + */ + @TaxField(name = "应补退税额", taxIndex = "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; + + } } } @@ -296,410 +582,122 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { * 非居民算税失败总人数 */ private int sssbrs; + + @Data + public static class result { + + /** + * 姓名 必填:是 + */ + 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 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; - - } /** * 算税失败原因对象 diff --git a/src/com/engine/salary/service/SalarySobTaxRuleService.java b/src/com/engine/salary/service/SalarySobTaxRuleService.java new file mode 100644 index 000000000..b4d15c58b --- /dev/null +++ b/src/com/engine/salary/service/SalarySobTaxRuleService.java @@ -0,0 +1,51 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobTaxRulePO; + +import java.util.Collection; +import java.util.List; + +/** + * 薪资账套的个税规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobTaxRuleService { + + /** + * 根据薪资账套id查询薪资账套的个税规则 + * + * @param salarySobIds + * @return + */ + List listBySalarySobId(Long salarySobIds); + + /** + * 根据薪资账套id查询薪资账套的个税规则 + * + * @param salarySobId + * @return + */ + List getSalarySobTaxRuleDTO(Long salarySobId); + + /** + * 保存 + * + * @param saveParam + */ + void saveByParam(SalarySobTaxRuleSaveParam saveParam); + + /** + * 按薪资账套id删除 + * + * @param salarySobIds + */ + void deleteBySalarySobIds(Collection salarySobIds); + + void saveBatch(List salarySobTaxReportRules); +} diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index 4edb5b06a..9134fd988 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -230,7 +230,7 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe continue; } - Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares); +// Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares); Map dataMap = null; diff --git a/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java new file mode 100644 index 000000000..59a390f1a --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java @@ -0,0 +1,160 @@ +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.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxRulePO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.salarysob.SalarySobTaxRuleMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + * 薪资账套的个税申报表规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobTaxRuleServiceImpl extends Service implements SalarySobTaxRuleService { + + + private SalarySobTaxRuleMapper salarySobTaxRuleMapper() { + return MapperProxyFactory.getProxy(SalarySobTaxRuleMapper.class); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + + @Override + public List listBySalarySobId(Long salarySobId) { + if (salarySobId == null) { + return Collections.emptyList(); + } + return salarySobTaxRuleMapper().listSome(SalarySobTaxRulePO.builder().salarySobId(salarySobId).build()); + } + + @Override + public List getSalarySobTaxRuleDTO(Long salarySobId) { + List resultList = Lists.newArrayList(); + // 查询薪资账套 + SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId); + Integer incomeCategory = salarySob.getIncomeCategory(); + List incomeCategoryIds = Collections.singletonList(incomeCategory); + // 薪资账套的薪资项目 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId); + // 薪资账套的回算薪资项目 + List salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId); + // 薪资项目 + Set salaryItemIds = Sets.newHashSet(); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId)); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId)); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + // 薪资账套中已经存在的对应关系 + List salarySobTaxReportRules = listBySalarySobId(salarySobId); + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, + e -> e.getIncomeCategory() + "-" + e.getTaxIndex(), SalarySobTaxRulePO::getSalaryItemId); + + for (Integer incomeCategoryId : incomeCategoryIds) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId); + List taxRules = incomeCategoryEnum.getReportType().getTaxRules(); + for (SalarySobTaxRuleDTO.TaxRuleDTO taxRule : taxRules) { + Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxRule.getTaxIndex()); + SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); + if (Objects.nonNull(salaryItem)) { + Map dataMap = Maps.newHashMap(); + dataMap.put("id", salaryItem.getId().toString()); + dataMap.put("name", salaryItem.getName()); + taxRule.setSalaryItem(dataMap); + } + } + + SalarySobTaxRuleDTO salarySobTaxReportRuleDTO = new SalarySobTaxRuleDTO(); + salarySobTaxReportRuleDTO.setIncomeCategoryId(incomeCategoryId.toString()); + salarySobTaxReportRuleDTO.setIncomeCategoryName(SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + salarySobTaxReportRuleDTO.setTaxRules(taxRules); + resultList.add(salarySobTaxReportRuleDTO); + } + return resultList; + } + + @Override + public void saveByParam(SalarySobTaxRuleSaveParam saveParam) { + // 校验参数是否合法 + // 构建po + Date now = new Date(); + List salarySobTaxReportRules = Lists.newArrayList(); + for (SalarySobTaxRuleSaveParam.TaxReportRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { + for (SalarySobTaxRuleSaveParam.TaxRuleParam taxReportRuleParam : incomeCategoryParam.getTaxRuleParams()) { + SalarySobTaxRulePO salarySobTaxRule = new SalarySobTaxRulePO(); + salarySobTaxRule.setId(IdGenerator.generate()); + salarySobTaxRule.setSalarySobId(saveParam.getSalarySobId()); + salarySobTaxRule.setIncomeCategory(incomeCategoryParam.getIncomeCategory()); + salarySobTaxRule.setTaxIndex(taxReportRuleParam.getTaxIndex()); + salarySobTaxRule.setSalaryItemId(taxReportRuleParam.getSalaryItemId()); + salarySobTaxRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobTaxRule.setCreator((long) user.getUID()); + salarySobTaxRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobTaxRule.setCreateTime(now); + salarySobTaxRule.setUpdateTime(now); + salarySobTaxReportRules.add(salarySobTaxRule); + } + } + deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId())); + if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) { + salarySobTaxReportRules.forEach(salarySobTaxRuleMapper()::insertIgnoreNull); + } + } + + @Override + public void deleteBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return; + } + salarySobTaxRuleMapper().deleteBySalarySobIds(salarySobIds); + } + + @Override + public void saveBatch(List salarySobTaxReportRules) { + if (CollectionUtils.isEmpty(salarySobTaxReportRules)) { + return; + } +// salarySobTaxReportRules.forEach(salarySobTaxReportRuleMapper()::insertIgnoreNull); + } +} diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 904d1a472..7bdd6a0ea 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -81,6 +81,11 @@ public class SalarySobController { private SalarySobAddUpRuleWrapper getSalarySobAddUpRuleWrapper(User user) { return ServiceUtil.getService(SalarySobAddUpRuleWrapper.class, user); } + + private SalarySobTaxRuleWrapper getSalarySobTaxRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobTaxRuleWrapper.class, user); + } + /**********************************薪资账套 start*********************************/ /** @@ -548,6 +553,40 @@ public class SalarySobController { /**********************************薪资账套的个税申报表规则 end*********************************/ + /**********************************薪资账套的个税申报表规则 start*********************************/ + + /** + * 薪资账套下的个税规则的详情 + * + * @param id 薪资账套id + * @return + */ + @GET + @Path("/taxrule/getForm") + @ApiOperation("薪资账套下的个税规则的详情") + @Produces(MediaType.APPLICATION_JSON) + public String getSalarySobTaxRuleForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobTaxRuleWrapper(user)::getForm, id); + } + + /** + * 保存薪资账套下的个税规则 + * + * @param saveParam 保存参数 + * @return + */ + @POST + @Path("/taxrule/save") + @ApiOperation("保存薪资账套下的个税规则的") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobTaxRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobTaxRuleSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobTaxRuleWrapper(user)::save, saveParam); + } + + /**********************************薪资账套的个税申报表规则 end*********************************/ + /**********************************调薪计薪规则 start*********************************/ diff --git a/src/com/engine/salary/wrapper/SalarySobTaxRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobTaxRuleWrapper.java new file mode 100644 index 000000000..493b2ed36 --- /dev/null +++ b/src/com/engine/salary/wrapper/SalarySobTaxRuleWrapper.java @@ -0,0 +1,45 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxRuleSaveParam; +import com.engine.salary.service.SalarySobTaxRuleService; +import com.engine.salary.service.impl.SalarySobTaxRuleServiceImpl; +import weaver.hrm.User; + +import java.util.List; + +/** + * 薪资账套的个税规则 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobTaxRuleWrapper extends Service { + + private SalarySobTaxRuleService getSalarySobTaxRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxRuleServiceImpl.class, user); + } + + /** + * 薪资账套的个税规则 + * + * @param salarySobId + * @return + */ + public List getForm(Long salarySobId) { + return getSalarySobTaxRuleService(user).getSalarySobTaxRuleDTO(salarySobId); + } + + /** + * 保存薪资账套的个税规则 + * + * @param saveParam + */ + public void save(SalarySobTaxRuleSaveParam saveParam) { + getSalarySobTaxRuleService(user).saveByParam(saveParam); + } +} From dc85ba6043bb9daf291ce7c40a73404f0e5adc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 11 Jun 2024 10:09:18 +0800 Subject: [PATCH 169/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salarysob/dto/SalarySobTaxRuleDTO.java | 6 +- .../enums/salarysob/IncomeCategoryEnum.java | 388 ++++++++++++++++-- .../impl/SalaryCalcTaxServiceImpl.java | 87 +--- .../impl/SalarySobTaxRuleServiceImpl.java | 7 +- test/ParseTaxApi.java | 4 +- 5 files changed, 369 insertions(+), 123 deletions(-) diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java index a39c1abbf..787d71271 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java @@ -6,7 +6,6 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; -import java.util.Map; /** * 薪资账套的个税规则 @@ -44,12 +43,15 @@ public class SalarySobTaxRuleDTO { private String taxIndex; //个税字段和薪资项目的对应关系 - private Map salaryItem; + private Long salaryItemId; + private String salaryItemName; //个税字段的值 private String value; //对应关系是否可以编辑 private boolean canEdit; + + } } diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 4eed6daa9..fcdacf5cd 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -37,27 +37,25 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - SalarySobTaxRuleDTO salarySobTaxRuleDTO = SalarySobTaxRuleDTO.builder().incomeCategoryId(this.getValue().toString()).incomeCategoryName(this.getDefaultLabel()).build(); - List taxRules = this.getReportType().getTaxRules(); + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); - Map resultMap = new HashMap<>(); + Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); - taxRules.forEach(rule->{ + taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { - Method method = rule.getClass().getMethod(getter); - Object invoke = method.invoke(rule); + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); rule.setValue(Util.null2String(invoke)); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { - log.error("no such method", ex); + log.error("getTaxErr no such method {}", getter, ex); } }); - salarySobTaxRuleDTO.setTaxRules(taxRules); - resultMap.put(employeeDeclare.getEmployeeId(),salarySobTaxRuleDTO ); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); } return resultMap; } @@ -71,8 +69,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -85,8 +102,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -99,8 +135,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -113,8 +168,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -127,8 +201,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -141,8 +234,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -155,8 +267,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -169,8 +300,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -183,8 +333,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -197,8 +366,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -211,8 +399,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -225,8 +432,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -239,8 +465,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -253,8 +498,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, @@ -267,8 +531,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }, NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @@ -280,8 +563,27 @@ public enum IncomeCategoryEnum implements BaseEnum { } @Override - public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares) { - return null; + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + } + return resultMap; } }; @@ -307,7 +609,7 @@ public enum IncomeCategoryEnum implements BaseEnum { public abstract void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); - public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares); + public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO); @Override diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index 9134fd988..ef221cba5 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -6,10 +6,10 @@ 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.dto.SalarySobTaxRuleDTO; import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; @@ -27,7 +27,6 @@ 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 { @@ -61,6 +60,10 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); } + private SalarySobTaxRuleService getSalarySobTaxRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxRuleServiceImpl.class, user); + } + private EmployeeDeclareService getEmployeeDeclareService(User user) { return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); } @@ -196,15 +199,13 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe if (CollectionUtils.isEmpty(salaryAcctCalcTaxReqs)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(268184, "请先计算个税再获取反馈")); } - // 查询薪资核算记录关联的薪资账套个税申报表字段对应 - List salarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId())); - Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex); + // 查询薪资核算记录关联的薪资账套个税字段对应 + List salarySobTaxRules = getSalarySobTaxRuleService(user).getSalarySobTaxRuleDTO(salaryAcctRecord.getSalarySobId()); + Map salarySobTaxRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxRules, SalarySobTaxRuleDTO::getIncomeCategoryId); // 查询报送人员 List employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents); Map> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); - String url = apiConfig.getHost() + SzyhApiConstant.ASYN_INDIVIDUAL_INCOME_TAX_FEEDBACK; - Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); List resultPOS = new ArrayList<>(); for (SalaryAcctCalcTaxReqPO salaryAcctCalcTaxReq : salaryAcctCalcTaxReqs) { @@ -229,65 +230,8 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe if (incomeCategoryEnum == null) { continue; } - -// Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares); - - - Map 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 employeeIdKeyTaxMap; - SalaryCalcTaxFeedback salaryCalcTaxFeedback = new SalaryCalcTaxFeedback(dataMap, subEmployeeDeclares); - if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) { - employeeIdKeyTaxMap = salaryCalcTaxFeedback.buildZCGZXJFeedback(); - } else { - employeeIdKeyTaxMap = salaryCalcTaxFeedback.buildOtherFeedback(); - } - - LocalDateTime now = LocalDateTime.now(); + SalarySobTaxRuleDTO taxRuleDTO = salarySobTaxRuleMap.get(incomeCategoryEnum.getValue().toString()); + Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares,taxRuleDTO); List subSalaryAcctEmployees = salaryAcctEmployeeMap.get(salaryAcctTaxAgent.getTaxAgentId() + "-" + salaryAcctTaxAgent.getIncomeCategory()); if (CollectionUtils.isEmpty(subSalaryAcctEmployees)) { continue; @@ -297,12 +241,13 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe 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())); + SalarySobTaxRuleDTO salarySobTaxRuleDTO = empIdResult.get(salaryAcctEmployee.getEmployeeId()); + List taxRules = salarySobTaxRuleDTO.getTaxRules(); + taxRules.forEach(rule->{ + SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(rule.getSalaryItemId()); + salaryAcctResultPO.setResultValue(rule.getValue()); resultPOS.add(salaryAcctResultPO); - } + }); } } } diff --git a/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java index 59a390f1a..65e81008f 100644 --- a/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java @@ -19,7 +19,6 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; -import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; @@ -98,10 +97,8 @@ public class SalarySobTaxRuleServiceImpl extends Service implements SalarySobTax Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxRule.getTaxIndex()); SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); if (Objects.nonNull(salaryItem)) { - Map dataMap = Maps.newHashMap(); - dataMap.put("id", salaryItem.getId().toString()); - dataMap.put("name", salaryItem.getName()); - taxRule.setSalaryItem(dataMap); + taxRule.setSalaryItemId(salaryItem.getId()); + taxRule.setSalaryItemName(salaryItem.getName()); } } diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java index 716d56807..56bb4a986 100644 --- a/test/ParseTaxApi.java +++ b/test/ParseTaxApi.java @@ -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"); } From e94273468e23b42b52a3b7220094ee18e9677b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 11 Jun 2024 15:27:00 +0800 Subject: [PATCH 170/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=9D=9E=E6=AD=A3=E5=B8=B8=E4=BA=BA=E5=91=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/EmployeeDeclareServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index a88612e7e..3756e353e 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -458,8 +458,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()) //只需要正常的 .stream() - .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) - && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) + .filter(e ->Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) .collect(Collectors.toList()); // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId()); From 063322564855b1c77bc4170894449d49a466e34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 14 Jun 2024 13:34:21 +0800 Subject: [PATCH 171/298] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=81=87=E6=9C=9F?= =?UTF-8?q?=E4=BD=99=E9=A2=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attend/service/impl/RemoteAttend4SalaryServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java b/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java index 6aeab513e..99553f193 100644 --- a/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java +++ b/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java @@ -18,6 +18,7 @@ import org.apache.commons.lang3.math.NumberUtils; import weaver.general.BaseBean; import weaver.general.Util; +import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -172,7 +173,7 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt public List> getBalanceOfLeaveColumns() { Map paramsMap = new HashMap(); paramsMap.put("dateScope", "6"); - paramsMap.put("selectedYear", 2023); + paramsMap.put("selectedYear", LocalDate.now().getYear()); paramsMap.put("dataScope", "3"); paramsMap.put("resourceId", 92); paramsMap.put("status", "9"); From 6648e4140ed3cd224221782fae25f9ce0ca66886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Jun 2024 10:26:17 +0800 Subject: [PATCH 172/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=97=E7=A8=8Esql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202406170103.sql | 14 ++++++++++++++ resource/sqlupgrade/GS/sql202406170103.sql | 14 ++++++++++++++ resource/sqlupgrade/JC/sql202406170103.sql | 14 ++++++++++++++ resource/sqlupgrade/Mysql/sql202406170103.sql | 13 +++++++++++++ resource/sqlupgrade/Oracle/sql202406170103.sql | 13 +++++++++++++ resource/sqlupgrade/PG/sql202406170103.sql | 13 +++++++++++++ resource/sqlupgrade/SQLServer/sql202406170103.sql | 14 ++++++++++++++ resource/sqlupgrade/ST/sql202406170103.sql | 14 ++++++++++++++ 8 files changed, 109 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202406170103.sql create mode 100644 resource/sqlupgrade/GS/sql202406170103.sql create mode 100644 resource/sqlupgrade/JC/sql202406170103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202406170103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202406170103.sql create mode 100644 resource/sqlupgrade/PG/sql202406170103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202406170103.sql create mode 100644 resource/sqlupgrade/ST/sql202406170103.sql diff --git a/resource/sqlupgrade/DM/sql202406170103.sql b/resource/sqlupgrade/DM/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/GS/sql202406170103.sql b/resource/sqlupgrade/GS/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/JC/sql202406170103.sql b/resource/sqlupgrade/JC/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202406170103.sql b/resource/sqlupgrade/Mysql/sql202406170103.sql new file mode 100644 index 000000000..be09a90f9 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202406170103.sql @@ -0,0 +1,13 @@ +CREATE TABLE hrsa_sob_tax_rule ( + id bigint(0) NOT NULL, + create_time datetime(0) , + update_time datetime(0) , + creator bigint(0) , + delete_type int(0) , + tenant_key varchar(10), + salary_sob_id bigint(0), + income_category varchar(100) , + tax_index varchar(100) , + salary_item_id bigint(0) , + PRIMARY KEY (id) +) ; diff --git a/resource/sqlupgrade/Oracle/sql202406170103.sql b/resource/sqlupgrade/Oracle/sql202406170103.sql new file mode 100644 index 000000000..1abe248d6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202406170103.sql @@ -0,0 +1,13 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202406170103.sql b/resource/sqlupgrade/PG/sql202406170103.sql new file mode 100644 index 000000000..848173fc6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202406170103.sql @@ -0,0 +1,13 @@ +CREATE TABLE hrsa_sob_tax_rule ( + id bigserial NOT NULL, + salary_sob_id bigint , + income_category varchar(100) , + tax_index varchar(100) , + salary_item_id bigint , + creator bigint NOT NULL DEFAULT 0 , + create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP , + update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP , + delete_type int NOT NULL DEFAULT 0 , + tenant_key varchar(10) NOT NULL DEFAULT '' , + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202406170103.sql b/resource/sqlupgrade/SQLServer/sql202406170103.sql new file mode 100644 index 000000000..c84a374f4 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202406170103.sql @@ -0,0 +1,14 @@ +create table hrsa_sob_tax_rule +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int, + tenant_key nvarchar(10), + salary_sob_id bigint, + income_category varchar(100), + tax_index varchar(100), + salary_item_id bigint +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202406170103.sql b/resource/sqlupgrade/ST/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + From af8cce85257bb672a55a5435601b2f196f7963bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Jun 2024 17:03:48 +0800 Subject: [PATCH 173/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=97=E7=A8=8E?= =?UTF-8?q?=EF=BC=8C=E4=B8=AA=E7=A8=8E=E5=AF=B9=E5=BA=94=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ynIndividualIncomeTaxFeedbackResponse.java | 85 ++++++++++++------- 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java index 6801b8767..d4d1c0b53 100644 --- a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -1,6 +1,5 @@ package com.engine.salary.remote.tax.response.calculate; -import com.engine.salary.annotation.TableTitle; import com.engine.salary.annotation.TaxField; import com.engine.salary.entity.taxpayment.response.BaseResponse; import lombok.Data; @@ -343,46 +342,40 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { * 应扣缴税额 必填:否 正常工资薪金返回否 */ private BigDecimal yingkjse; - /** - * 税率 必填:否 - */ - private BigDecimal sl; - /** - * 速算扣除数 必填:否 - */ - private BigDecimal sskcs; /** * 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬 */ private String sdxm; - /** - * 应补退税额 必填:否 应补退税额=累计应扣缴税额-累计已缴税额 - */ - @TaxField(name = "应补退税额", taxIndex = "ybtse") - private BigDecimal ybtse; + /** * 累计收入额 必填:否 */ + @TaxField(name = "累计收入额", taxIndex = "ljsre") private BigDecimal ljsre; /** * 累计免税收入额 必填:否 */ + @TaxField(name = "累计免税收入额", taxIndex = "ljmssd") private BigDecimal ljmssd; /** * 累计专项扣除额 必填:否 三险一金合计 */ + @TaxField(name = "累计专项扣除额", taxIndex = "ljzxkce") private BigDecimal ljzxkce; /** * 累计专项附加扣除额 必填:否 专项附加合计 */ + @TaxField(name = "累计专项附加扣除额", taxIndex = "ljzxfjkce") private BigDecimal ljzxfjkce; /** * 累计其他扣除额 必填:否 */ + @TaxField(name = "累计其他扣除额", taxIndex = "ljqtkce") private BigDecimal ljqtkce; /** * 累计减免税额 必填:否 */ + @TaxField(name = "累计减免税额", taxIndex = "ljjmse") private BigDecimal ljjmse; /** * 累计减除费用额 必填:否 正常工资薪金累计减除费用 必填:否 对应保险营销员、证券经纪人累计费用 @@ -404,31 +397,17 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { * 月减除费用 必填:否 保险营销员、证券经纪人,其他连续劳务报酬的减除费用 */ private BigDecimal yjcfy; - /** - * 累计应纳税所得额 必填:否 - */ - @TableTitle(title = "累计应纳税所得额", dataIndex = "ljynssde", key = "ljynssde") - private BigDecimal ljynssde; - /** - * 累计应纳税额 必填:否 - */ - private BigDecimal ljynse; - /** - * 累计应扣缴税额 必填:否 累计应扣缴税额 = 累计应纳税额 - 累计减免税额 - */ - private BigDecimal ljyingkjse; - /** - * 累计已缴税额 必填:否 - */ - private BigDecimal ljykjse; /** * 累计子女教育支出 必填:否 */ + @TaxField(name = "累计子女教育", taxIndex = "ljznjyzc") private BigDecimal ljznjyzc; /** * 累计继续教育支出 必填:否 */ + @TaxField(name = "累计继续教育", taxIndex = "ljjxjyzc") private BigDecimal ljjxjyzc; + /** * 累计非学历继续教育支持 必填:否 */ @@ -440,26 +419,32 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { /** * 累计住房租金支出 必填:否 */ + @TaxField(name = "累计住房租金", taxIndex = "ljzfzjzc") private BigDecimal ljzfzjzc; /** * 累计房屋贷款支出 必填:否 */ + @TaxField(name = "累计房屋贷款", taxIndex = "ljzfdklxzc") private BigDecimal ljzfdklxzc; /** * 累计赡养老人支出 必填:否 */ + @TaxField(name = "累计赡养老人", taxIndex = "ljsylrzc") private BigDecimal ljsylrzc; /** * 累计3岁以下婴幼儿照护支出 必填:否 */ + @TaxField(name = "累计3岁以下婴幼儿照护", taxIndex = "ljyyezhzc") private BigDecimal ljyyezhzc; /** * 累计准予扣除的捐赠额 必填:否 */ + @TaxField(name = "累计准予扣除的捐赠额", taxIndex = "ljzykcjze") private BigDecimal ljzykcjze; /** * 累计个人养老金 必填:否 */ + @TaxField(name = "累计个人养老金", taxIndex = "ljgrylj") private BigDecimal ljgrylj; /** * 累计个人养老金校验码 必填:否 @@ -495,6 +480,44 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { */ private BigDecimal njcfy; + /** + * 累计应纳税所得额 必填:否 + */ + @TaxField(name = "累计应纳税所得额", taxIndex = "ljynssde") + private BigDecimal ljynssde; + + /** + * 税率 必填:否 + */ + @TaxField(name = "税率", taxIndex = "sl") + private BigDecimal sl; + /** + * 速算扣除数 必填:否 + */ + @TaxField(name = "速算扣除数", taxIndex = "sskcs ") + private BigDecimal sskcs; + + /** + * 累计应纳税额 必填:否 + */ + @TaxField(name = "累计应纳税额", taxIndex = "ljynse") + private BigDecimal ljynse; + /** + * 累计应扣缴税额 必填:否 累计应扣缴税额 = 累计应纳税额 - 累计减免税额 + */ + @TaxField(name = "累计应扣缴税额", taxIndex = "ljyingkjse") + private BigDecimal ljyingkjse; + /** + * 累计已缴税额 必填:否 + */ + @TaxField(name = "累计已缴税额", taxIndex = "ljykjse") + private BigDecimal ljykjse; + + /** + * 应补退税额 必填:否 应补退税额=累计应扣缴税额-累计已缴税额 + */ + @TaxField(name = "应补退税额", taxIndex = "ybtse") + private BigDecimal ybtse; } } From d52e1460018d00b86942d1e314259293edb47bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Jun 2024 09:53:46 +0800 Subject: [PATCH 174/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=97=E7=A8=8E?= =?UTF-8?q?=E6=97=B6=E6=A0=A1=E9=AA=8C=E4=BA=BA=E5=91=98=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=B7=B2=E6=8A=A5=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/AbnormalEmployeeListDTO.java | 37 +++++++ .../param/AbnormalEmployeeListQueryParam.java | 39 +++++++ .../salarysob/dto/SalarySobCycleDTO.java | 4 + .../enums/salarysob/IncomeCategoryEnum.java | 104 +++++++++++++++--- .../salaryacct/SalaryAcctEmployeeMapper.java | 6 + .../salaryacct/SalaryAcctEmployeeMapper.xml | 42 ++++++- ...ynIndividualIncomeTaxFeedbackResponse.java | 2 +- .../service/SalaryAcctEmployeeService.java | 11 ++ .../impl/SalaryAcctEmployeeServiceImpl.java | 29 ++++- .../impl/SalaryAcctRecordServiceImpl.java | 14 +-- .../impl/SalaryCalcTaxServiceImpl.java | 16 ++- .../salary/web/SalaryAcctController.java | 11 ++ .../wrapper/SalaryAcctEmployeeWrapper.java | 11 ++ 13 files changed, 295 insertions(+), 31 deletions(-) create mode 100644 src/com/engine/salary/entity/salaryacct/dto/AbnormalEmployeeListDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/AbnormalEmployeeListQueryParam.java diff --git a/src/com/engine/salary/entity/salaryacct/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/AbnormalEmployeeListDTO.java new file mode 100644 index 000000000..f6292f980 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/AbnormalEmployeeListDTO.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.salaryacct.dto; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 未报送人员列表 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AbnormalEmployeeListDTO { + + //主键id + private Long id; + + //人员id + private Long employeeId; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + //工号") + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + +} diff --git a/src/com/engine/salary/entity/salaryacct/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/AbnormalEmployeeListQueryParam.java new file mode 100644 index 000000000..0e129b8c9 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/AbnormalEmployeeListQueryParam.java @@ -0,0 +1,39 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.common.BaseQueryParam; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 未报送人员列表 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AbnormalEmployeeListQueryParam extends BaseQueryParam { + + //工号、姓名、身份证号码") + private String keyword; + + //个税申报记录id") + private Long recordId; + + @JsonIgnore + //个税扣缴义务人id") + private Long taxAgentId; + + @JsonIgnore + //税款所属期") + private Date taxCycle; +} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java index 70a688b10..5a1f4ed2b 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java @@ -65,4 +65,8 @@ public class SalarySobCycleDTO { private Date attendCycleFromDate; @SalaryFormulaVar(defaultLabel = "考勤周期结束日期", labelId = 86321, dataType = "string") private Date attendCycleEndDate; + + + //存在异常人员数量 + private Integer abnormalEmployeeNum; } diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index fcdacf5cd..2ce01f8c3 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -8,12 +8,14 @@ import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedback 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; import org.apache.commons.collections4.CollectionUtils; import weaver.general.Util; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.lang.reflect.Type; import java.util.*; /** @@ -38,6 +40,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); @@ -45,6 +48,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -55,7 +61,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -70,6 +76,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); @@ -77,6 +84,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -87,7 +97,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -103,6 +113,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); @@ -110,6 +121,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -120,7 +134,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -136,6 +150,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); @@ -143,6 +158,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -153,7 +171,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -169,6 +187,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); @@ -176,6 +195,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -186,7 +208,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -202,6 +224,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); @@ -209,6 +232,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -219,7 +245,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -235,6 +261,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); @@ -242,6 +269,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -252,7 +282,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -268,6 +298,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); @@ -275,6 +306,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -285,7 +319,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -301,6 +335,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); @@ -308,6 +343,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -318,7 +356,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -334,6 +372,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); @@ -341,6 +380,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -351,7 +393,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -367,6 +409,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); @@ -374,6 +417,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -384,7 +430,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -400,6 +446,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); @@ -407,6 +454,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -417,7 +467,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -433,6 +483,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); @@ -440,6 +491,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -450,7 +504,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -466,6 +520,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); @@ -473,6 +528,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -483,7 +541,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -499,6 +557,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); @@ -506,6 +565,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -516,7 +578,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -532,6 +594,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); @@ -539,6 +602,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -549,7 +615,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } @@ -564,6 +630,7 @@ public enum IncomeCategoryEnum implements BaseEnum { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); @@ -571,6 +638,9 @@ public enum IncomeCategoryEnum implements BaseEnum { Map resultMap = new HashMap<>(); for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } taxRules.forEach(rule -> { String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); try { @@ -581,7 +651,7 @@ public enum IncomeCategoryEnum implements BaseEnum { log.error("getTaxErr no such method {}", getter, ex); } }); - resultMap.put(employeeDeclare.getEmployeeId(), taxRuleDTO); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); } return resultMap; } diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java index 3b97e3084..b8244909f 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java @@ -1,6 +1,8 @@ package com.engine.salary.mapper.salaryacct; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; +import com.engine.salary.entity.salaryacct.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import org.apache.ibatis.annotations.Param; @@ -122,4 +124,8 @@ public interface SalaryAcctEmployeeMapper { void lockByAcctEmpIds(@Param("lockStatus") Integer lockStatus, @Param("acctEmpIds") Set acctEmpIds); void lockByRecordId(@Param("lockStatus") Integer lockStatus, @Param("recordId") Long recordId); + + List listPage4NotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + int countNotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); } diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index f39b5bc53..8ea42d36e 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -1281,7 +1281,47 @@ UPDATE hrsa_salary_acct_emp SET lock_status = #{lockStatus} WHERE delete_type = 0 - AND salary_acct_record_id =#{recordId} + AND salary_acct_record_id = #{recordId} + + + + + diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java index d4d1c0b53..0657a790f 100644 --- a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -494,7 +494,7 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { /** * 速算扣除数 必填:否 */ - @TaxField(name = "速算扣除数", taxIndex = "sskcs ") + @TaxField(name = "速算扣除数", taxIndex = "sskcs") private BigDecimal sskcs; /** diff --git a/src/com/engine/salary/service/SalaryAcctEmployeeService.java b/src/com/engine/salary/service/SalaryAcctEmployeeService.java index 10bdf5bd5..505befd94 100644 --- a/src/com/engine/salary/service/SalaryAcctEmployeeService.java +++ b/src/com/engine/salary/service/SalaryAcctEmployeeService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -264,4 +265,14 @@ public interface SalaryAcctEmployeeService { */ void lockEmp(SalaryAcctResultUpdateLockStatusParam updateParam); + /** + * 未报送人员 + * @param queryParam + * @return + */ + PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + + int countNotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + } diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 412858d08..3144966ab 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -5,11 +5,12 @@ import cn.hutool.core.date.DateUtil; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -788,4 +789,30 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct } } + + @Override + public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + + Long recordId = queryParam.getRecordId(); + SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(recordId); + SalarySobPO sobPO = getSalarySobService(user).getById(recordPO.getSalarySobId()); + queryParam.setTaxCycle(recordPO.getTaxCycle()); + queryParam.setTaxAgentId(sobPO.getTaxAgentId()); + + List list = getSalaryAcctEmployeeMapper().listPage4NotDeclareByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AbnormalEmployeeListDTO.class); + } + + @Override + public int countNotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + + Long recordId = queryParam.getRecordId(); + SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(recordId); + SalarySobPO sobPO = getSalarySobService(user).getById(recordPO.getSalarySobId()); + queryParam.setTaxCycle(recordPO.getTaxCycle()); + queryParam.setTaxAgentId(sobPO.getTaxAgentId()); + + return getSalaryAcctEmployeeMapper().countNotDeclareByParam(queryParam); + } + } diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 546cbf3c9..deb771892 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -3,15 +3,13 @@ package com.engine.salary.service.impl; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.common.LocalDateRange; import com.engine.salary.common.YearMonthRange; -import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.report.po.SalaryAcctResultReportPO; import com.engine.salary.config.SalaryElogConfig; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryBill.po.SalarySendPO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; +import com.engine.salary.entity.salaryacct.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -20,9 +18,9 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobPO; -import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -41,7 +39,6 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; -import com.engine.salary.util.db.IdGenerator; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; @@ -286,8 +283,11 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); } // 查询薪资核算所用薪资账套的薪资周期、考勤周期…… - return getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth())); + SalarySobCycleDTO salarySobCycle = getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth())); + int i = getSalaryAcctEmployeeService(user).countNotDeclareByParam(AbnormalEmployeeListQueryParam.builder().recordId(id).build()); + salarySobCycle.setAbnormalEmployeeNum(i); + return salarySobCycle; } @Override diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index ef221cba5..1eedb6ae5 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -7,6 +7,7 @@ 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.dto.SalaryCalcTaxInfoDTO; +import com.engine.salary.entity.salaryacct.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryCalcTaxParam; import com.engine.salary.entity.salaryacct.po.*; import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; @@ -110,6 +111,11 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量")); } + int i = getSalaryAcctEmployeeService(user).countNotDeclareByParam(AbnormalEmployeeListQueryParam.builder().recordId(salaryCalcTaxParam.getSalaryAcctRecordId()).build()); + if (i > 0) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(11111, "存在未报送的人员,请先进行人员报送")); + } + // 查询薪资核算记录 SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryCalcTaxParam.getSalaryAcctRecordId()); // 查询薪资核算记录关联的个税扣缴义务人 @@ -231,7 +237,7 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe continue; } SalarySobTaxRuleDTO taxRuleDTO = salarySobTaxRuleMap.get(incomeCategoryEnum.getValue().toString()); - Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares,taxRuleDTO); + Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares, taxRuleDTO); List subSalaryAcctEmployees = salaryAcctEmployeeMap.get(salaryAcctTaxAgent.getTaxAgentId() + "-" + salaryAcctTaxAgent.getIncomeCategory()); if (CollectionUtils.isEmpty(subSalaryAcctEmployees)) { continue; @@ -243,10 +249,12 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe } SalarySobTaxRuleDTO salarySobTaxRuleDTO = empIdResult.get(salaryAcctEmployee.getEmployeeId()); List taxRules = salarySobTaxRuleDTO.getTaxRules(); - taxRules.forEach(rule->{ + taxRules.forEach(rule -> { SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(rule.getSalaryItemId()); - salaryAcctResultPO.setResultValue(rule.getValue()); - resultPOS.add(salaryAcctResultPO); + if (salaryAcctResultPO != null) { + salaryAcctResultPO.setResultValue(rule.getValue()); + resultPOS.add(salaryAcctResultPO); + } }); } } diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 5897976db..39a9a2245 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -400,6 +400,17 @@ public class SalaryAcctController { } } + /** + * 未报送人员列表 + */ + @POST + @Path("/acctemployee/listPage4NotDeclare") + @Produces(MediaType.APPLICATION_JSON) + public String listPage4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryAcctEmployeeWrapper(user)::listPage4NotDeclareByParam, param); + } + // **********************************薪资核算人员相关 end*********************************/ diff --git a/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java index 095935fd5..b010175a9 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java @@ -4,6 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAccEmployeeListDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -195,4 +196,14 @@ public class SalaryAcctEmployeeWrapper extends Service { public void lockEmp(SalaryAcctResultUpdateLockStatusParam salaryAcctResultUpdateLockStatusParam) { getSalaryAcctEmployeeService(user).lockEmp(salaryAcctResultUpdateLockStatusParam); } + + + /** + * 未报送人员列表 + * @param param + * @return + */ + public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam param) { + return getSalaryAcctEmployeeService(user).listPage4NotDeclareByParam(param); + } } From 24a979507a29aa2b4419dfb5b175fbad96751724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Jun 2024 11:37:31 +0800 Subject: [PATCH 175/298] =?UTF-8?q?=E6=9C=AA=E6=8A=A5=E9=80=81=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index 8ea42d36e..63102bbe9 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -1287,9 +1287,10 @@ + SELECT + + FROM hrsa_api_task_record t + WHERE delete_type = 0 + + + + + + + + + + + + INSERT INTO hrsa_api_task_record + + + + api, + + + create_time, + + + delete_type, + + + id, + + + param, + + + response, + + + source, + + + tenant_key, + + + update_time, + + + + + #{api}, + + + #{createTime}, + + + #{deleteType}, + + + #{id}, + + + #{param}, + + + #{response}, + + + #{source}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_api_task_record + + api=#{api}, + create_time=#{createTime}, + delete_type=#{deleteType}, + param=#{param}, + response=#{response}, + source=#{source}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_api_task_record + + + api=#{api}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + param=#{param}, + + + response=#{response}, + + + source=#{source}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_api_task_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_api_task_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/remote/tax/client/CompanyClient.java b/src/com/engine/salary/remote/tax/client/CompanyClient.java new file mode 100644 index 000000000..502f5db81 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/CompanyClient.java @@ -0,0 +1,40 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.Map; + +@Slf4j +public class CompanyClient extends TaxBaseClient { + + + public CompanyClient(Long taxAgentId, User user) { + super(taxAgentId, user); + } + + public CompanyRegisterInfoResponse getCompanyRegisterInfo(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_URL; + String requestId = request(url, requestParam); + + String getRegisterInfoFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_FEEDBACK_URL; + Map map = new HashMap<>(1); + map.put("requestId", requestId); + return response(getRegisterInfoFeedbackUrl, map, CompanyRegisterInfoResponse.class); + } + + public CheckPasswordResponse checkPassword(Map requestParam) { + + String url = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_URL; + String requestId = request(url, requestParam); + + String checkPasswordFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_FEEDBACK_URL; + Map map = new HashMap<>(1); + map.put("requestId", requestId); + return response(checkPasswordFeedbackUrl, map, CheckPasswordResponse.class); + } +} diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java index 1eae80e88..41a5f3cbf 100644 --- a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -1,12 +1,21 @@ package com.engine.salary.remote.tax.client; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.remote.tax.response.RequestIdResponse; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; -import com.engine.salary.util.Sm4Utils; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; +import weaver.general.Util; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.Map; @Slf4j public class TaxBaseClient { @@ -20,8 +29,9 @@ public class TaxBaseClient { } public Long taxAgentId; - public TaxDeclarationApiConfigPO apiConfig ; - public TaxAgentTaxReturnPO returnPO ; + public User user; + public TaxDeclarationApiConfigPO apiConfig; + public TaxAgentTaxReturnPO returnPO; public TaxBaseClient(Long taxAgentId) { this.taxAgentId = taxAgentId; @@ -35,4 +45,61 @@ public class TaxBaseClient { } this.returnPO = taxReturnPO; } + + public TaxBaseClient(Long taxAgentId, User user) { + this.taxAgentId = taxAgentId; + this.apiConfig = getTaxDeclareApiConfigMapper().getOne(); + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); + try { + // 密码解密 + taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); + } catch (Exception e) { + log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); + } + this.returnPO = taxReturnPO; + this.user = user; + } + + public String request(String url, Map requestParam) { + String reqJson = JsonUtil.toJsonString(requestParam); + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + //记录接口 + TaskUtil taskUtil = new TaskUtil(); + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, reqJson, res); + + RequestIdResponse response = JsonUtil.parseObject(res, RequestIdResponse.class); + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || response.getBody() == null) { + // 如果返回错误 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, response.getHead().getMsg())); + } + return response.getBody().getRequestId(); + } + + public T response(String url, Map param, Class clazz) { + TaskUtil taskUtil = new TaskUtil(); + T response = null; + for (int i = 0; i < 5; i++) { + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, param); + response = JsonUtil.parseBean(res, clazz); + //记录接口 + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + // 如果税友返回错误信息 + String code = response.getHead().getCode(); + if (SzyhApiConstant.HANDLING_CODE.equals(code)) { + try { + Thread.sleep(5 * 1000); + } catch (InterruptedException e) { + log.error("", e); + } + } else { + break; + } + } + return response; + } } diff --git a/src/com/engine/salary/entity/taxagent/response/GetRequestIdResponse.java b/src/com/engine/salary/remote/tax/response/RequestIdResponse.java similarity index 75% rename from src/com/engine/salary/entity/taxagent/response/GetRequestIdResponse.java rename to src/com/engine/salary/remote/tax/response/RequestIdResponse.java index f69bf8844..ef5505021 100644 --- a/src/com/engine/salary/entity/taxagent/response/GetRequestIdResponse.java +++ b/src/com/engine/salary/remote/tax/response/RequestIdResponse.java @@ -1,5 +1,6 @@ -package com.engine.salary.entity.taxagent.response; +package com.engine.salary.remote.tax.response; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import lombok.Data; /** @@ -11,7 +12,7 @@ import lombok.Data; * @version 1.0 **/ @Data -public class GetRequestIdResponse { +public class RequestIdResponse { /** * 接口状态 */ diff --git a/src/com/engine/salary/service/ApiTaskService.java b/src/com/engine/salary/service/ApiTaskService.java new file mode 100644 index 000000000..bdf3ac137 --- /dev/null +++ b/src/com/engine/salary/service/ApiTaskService.java @@ -0,0 +1,7 @@ +package com.engine.salary.service; + +public interface ApiTaskService { + + void writeApiTaskRecord (String source,String api,String param,String response); + +} diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java index 8698d8e26..9bfef4bbb 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -10,18 +10,16 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; -import com.engine.salary.entity.taxagent.response.GetRequestIdResponse; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.TaxAgentTaxReturnCheckService; -import com.engine.salary.service.TaxAgentTaxReturnService; -import com.engine.salary.service.TaxDeclarationApiConfigService; -import com.engine.salary.util.*; +import com.engine.salary.remote.tax.client.CompanyClient; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; @@ -57,6 +55,10 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); } + protected ApiTaskService getApiTaskService(User user) { + return ServiceUtil.getService(ApiTaskServiceImpl.class, user); + } + /** * 获取验证类型 * @@ -83,9 +85,7 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl po.setUpdateTime(new Date()); // 如果税友返回错误信息 if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || CollectionUtils.isEmpty(response.getBody())) { - po.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); - po.setFailReason(response.getHead().getMsg()); - return new ArrayList<>(); + throw new SalaryRunTimeException(response.getHead().getMsg()); } // 如果税友返回验证信息 List checkFormDTOList = buildCheckDTO(saveParam, response.getBody()); @@ -109,11 +109,11 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl * @return */ protected CompanyRegisterInfoResponse getCompanyRegisterInfo(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { - TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentTaxReturnPO.getTaxAgentId()); + Long taxAgentId = taxAgentTaxReturnPO.getTaxAgentId(); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentId); if (taxAgentPO == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); } - String url = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_URL; Map requestParam = new HashMap<>(4); requestParam.put("bizNo", IdGenerator.generate()); requestParam.put("qymc", taxAgentPO.getName()); @@ -122,40 +122,11 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl if (StringUtils.isNotEmpty(saveParam.getTaxRegistrationNumber())) { requestParam.put("djxhid", saveParam.getTaxRegistrationNumber()); } - String reqJson = JsonUtil.toJsonString(requestParam); - Map params = new HashMap<>(1); - Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - log.info("getCompanyRegisterInfo1 === params:{} === res : {}", reqJson, res); - GetRequestIdResponse getRequestIdResponse = JsonUtil.parseBean(res, GetRequestIdResponse.class); - if (getRequestIdResponse == null || getRequestIdResponse.getHead() == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); - } - taxAgentTaxReturnPO.setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()); - taxAgentTaxReturnPO.setUpdateTime(new Date()); - // 如果税友返回错误信息 - if (!SzyhApiConstant.SUCCESS_CODE.equals(getRequestIdResponse.getHead().getCode()) || getRequestIdResponse.getBody() == null) { - taxAgentTaxReturnPO.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); - taxAgentTaxReturnPO.setFailReason(getRequestIdResponse.getHead().getMsg()); - return null; - } - try { - Thread.sleep(5 * 1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - String requestId = getRequestIdResponse.getBody().getRequestId(); - String getRegisterInfoFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_FEEDBACK_URL; - Map feedbackHeader = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - Map map = new HashMap<>(1); - map.put("requestId", requestId); - String companyRegisterInfoResponseRes = HttpUtil.getRequest(getRegisterInfoFeedbackUrl, feedbackHeader, map); - log.info("getCompanyRegisterInfo2 === requestId:{} === res : {}", requestId, companyRegisterInfoResponseRes); - return JsonUtil.parseBean(companyRegisterInfoResponseRes, CompanyRegisterInfoResponse.class); + return new CompanyClient(taxAgentId, user).getCompanyRegisterInfo(requestParam); } + private List buildCheckDTO(TaxAgentTaxReturnSaveParam saveParam, List registerInfos) { List checkFormDTOList = new ArrayList<>(); for (int i = 1; i <= registerInfos.size(); i++) { @@ -194,7 +165,7 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl if (taxAgentPO == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); } - String url = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_URL; + Long taxAgentId = taxAgentPO.getId(); Map requestParam = new HashMap<>(16); requestParam.put("bizNo", IdGenerator.generate()); requestParam.put("qymc", taxAgentPO.getName()); @@ -214,38 +185,8 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl requestParam.put("bmbh", saveParam.getDepartmentCode()); requestParam.put("bmmc", saveParam.getDepartmentName()); } - String reqJson = JsonUtil.toJsonString(requestParam); - Map params = new HashMap<>(1); - Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - log.info("checkPassword1 === reqJson :{} === res : {}", reqJson, res); - GetRequestIdResponse response = JsonUtil.parseObject(res, GetRequestIdResponse.class); - if (response == null || response.getHead() == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); - } - taxAgentTaxReturnPO.setUpdateTime(new Date()); - if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || response.getBody() == null) { - // 如果返回错误 - taxAgentTaxReturnPO.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); - taxAgentTaxReturnPO.setFailReason(response.getHead().getMsg()); - return null; - } - - try { - Thread.sleep(5 * 1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - String checkPasswordFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_FEEDBACK_URL; - Map feedbackHeader = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - Map map = new HashMap<>(1); - String requestId = response.getBody().getRequestId(); - map.put("requestId", requestId); - res = HttpUtil.getRequest(checkPasswordFeedbackUrl, feedbackHeader, map); - log.info("checkPassword2 === requestId :{} === res : {}", requestId, res); - return JsonUtil.parseBean(res, CheckPasswordResponse.class); + return new CompanyClient(taxAgentId, user).checkPassword(requestParam); } /** diff --git a/src/com/engine/salary/service/impl/ApiTaskServiceImpl.java b/src/com/engine/salary/service/impl/ApiTaskServiceImpl.java new file mode 100644 index 000000000..107edf704 --- /dev/null +++ b/src/com/engine/salary/service/impl/ApiTaskServiceImpl.java @@ -0,0 +1,53 @@ +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.entity.api.ApiTaskRecordPO; +import com.engine.salary.mapper.api.ApiTaskRecordMapper; +import com.engine.salary.service.ApiTaskService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +import java.util.Date; + +/** + * api任务调度服务 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class ApiTaskServiceImpl extends Service implements ApiTaskService { + + private ApiTaskRecordMapper getApiTaskRecordMapper() { + return MapperProxyFactory.getProxy(ApiTaskRecordMapper.class); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + @Override + public void writeApiTaskRecord(String source, String api, String param, String response) { + log.info("source:{} , api:{} , param:{} , response : {}", source, api, param, response); + Date now = new Date(); + ApiTaskRecordPO build = ApiTaskRecordPO.builder() + .id(IdGenerator.generate()) + .source(source) + .api(api) + .param(param) + .response(response) + .createTime(now) + .updateTime(now) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getApiTaskRecordMapper().insertIgnoreNull(build); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 10785a692..9da19ccfb 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -23,7 +23,7 @@ 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.taxagent.response.GetRequestIdResponse; +import com.engine.salary.remote.tax.response.RequestIdResponse; import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.bo.*; @@ -1008,6 +1008,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); // 申报类型 requestParam.put("sblx", reportType + ""); + + + // 请求 String reqJson = JsonUtil.toJsonString(requestParam); @@ -1015,7 +1018,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map params = new HashMap<>(1); Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - GetRequestIdResponse getRequestIdResponse = JsonUtil.parseObject(res, GetRequestIdResponse.class); + RequestIdResponse getRequestIdResponse = JsonUtil.parseObject(res, RequestIdResponse.class); log.info("更正申报请求数据1:=== params:{} ,getRequestIdResponse:{}", res, getRequestIdResponse); diff --git a/src/com/engine/salary/util/TaskUtil.java b/src/com/engine/salary/util/TaskUtil.java new file mode 100644 index 000000000..9b498d316 --- /dev/null +++ b/src/com/engine/salary/util/TaskUtil.java @@ -0,0 +1,37 @@ +package com.engine.salary.util; + +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.api.ApiTaskRecordPO; +import com.engine.salary.mapper.api.ApiTaskRecordMapper; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; + +import java.util.Date; + +@Slf4j +public class TaskUtil { + + private ApiTaskRecordMapper getApiTaskRecordMapper() { + return MapperProxyFactory.getProxy(ApiTaskRecordMapper.class); + } + + public void writeApiTaskRecord(String source, String api, String param, String response) { + log.info("source:{} , api:{} , param:{} , response : {}", source, api, param, response); + Date now = new Date(); + ApiTaskRecordPO build = ApiTaskRecordPO.builder() + .id(IdGenerator.generate()) + .source(source) + .api(api) + .param(param) + .response(response) + .createTime(now) + .updateTime(now) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getApiTaskRecordMapper().insertIgnoreNull(build); + } + + +} From 65fcfb8face298cec7ca302ffeda3f37caeea591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Jun 2024 09:30:25 +0800 Subject: [PATCH 187/298] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/wiki/待添加sql | 56 +++++++++++++++++++ .../salary/constant/SzyhApiConstant.java | 8 ++- .../response/UpdateDeclareResponse.java | 9 +-- .../remote/tax/client/CompanyClient.java | 5 +- .../remote/tax/client/DeclareClient.java | 19 +++++++ .../remote/tax/client/TaxBaseClient.java | 38 ++++++------- ...AbstractTaxAgentTaxReturnCheckService.java | 4 +- .../impl/TaxDeclareRecordServiceImpl.java | 39 +------------ .../salary/wrapper/TaxPaymentWrapper.java | 20 ++++--- 9 files changed, 120 insertions(+), 78 deletions(-) diff --git a/resource/wiki/待添加sql b/resource/wiki/待添加sql index 44d2fbec2..8452d9a87 100644 --- a/resource/wiki/待添加sql +++ b/resource/wiki/待添加sql @@ -3,3 +3,59 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000003, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '其他', 'royaltiesOther', 'number', 'qt', NULL, 0); INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000004, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '备注', 'royaltiesRemark', 'string', 'bz', NULL, 0); INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000005, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '减免税额', 'royaltiesTaxDeduction', 'number', 'jmse', NULL, 0); + + +CREATE TABLE hrsa_api_task_record ( + id bigint(0) NOT NULL , + source varchar(500) , + api varchar(500), + param text , + response text, + tenant_key varchar(255) , + delete_type int(0) , + create_time datetime(0), + update_time datetime(0), + PRIMARY KEY (id) USING BTREE +); + +create table hrsa_api_task_record +( + id number primary key , + source varchar2(500) , + api varchar2(500), + param clob , + response clob, + create_time date, + update_time date, + delete_type int default 0, + tenant_key varchar2(10) +) +/ + +create table hrsa_api_task_record +( + id bigint primary key , + source varchar(500) , + api varchar(500), + param ntext , + response ntext, + create_time datetime, + update_time datetime, + delete_type int default 0, + tenant_key nvarchar(10) +) +GO + +create table hrsa_api_task_record +( + id bigint primary key , + source varchar(500) , + api varchar(500), + param text , + response text, + create_time timestamp, + update_time timestamp, + delete_type int default 0, + tenant_key varchar(10) +); +/ \ No newline at end of file diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 1e2ff14b0..5b22a491c 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -139,7 +139,13 @@ public class SzyhApiConstant { /** * 缴款凭证作废 */ - public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/payment/cancelWithholdingVoucher"; +// public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/payment/cancelWithholdingVoucher"; + public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/service/cancelWithholdingVoucher"; + + /** + * 缴款凭证作废反馈 + */ + public static final String CANCEL_WITHHOLDING_VOUCHER_FEEDBACK = "gateway/iit/service/getCancelWithholdingVoucher"; /** * 完税证明 */ diff --git a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java index e2b77f90c..7c586658c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -1,7 +1,6 @@ package com.engine.salary.entity.taxdeclaration.response; -import com.engine.salary.entity.taxagent.response.SzyhResponseHead; -import io.swagger.annotations.ApiModel; +import com.engine.salary.entity.taxpayment.response.BaseResponse; import lombok.Data; /** @@ -13,9 +12,5 @@ import lombok.Data; * @version 1.0 **/ @Data -@ApiModel("更正申报的返回数据") -public class UpdateDeclareResponse { - - //接口状态") - private SzyhResponseHead head; +public class UpdateDeclareResponse extends BaseResponse { } diff --git a/src/com/engine/salary/remote/tax/client/CompanyClient.java b/src/com/engine/salary/remote/tax/client/CompanyClient.java index 502f5db81..b57a2d726 100644 --- a/src/com/engine/salary/remote/tax/client/CompanyClient.java +++ b/src/com/engine/salary/remote/tax/client/CompanyClient.java @@ -4,7 +4,6 @@ import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; import lombok.extern.slf4j.Slf4j; -import weaver.hrm.User; import java.util.HashMap; import java.util.Map; @@ -13,8 +12,8 @@ import java.util.Map; public class CompanyClient extends TaxBaseClient { - public CompanyClient(Long taxAgentId, User user) { - super(taxAgentId, user); + public CompanyClient(Long taxAgentId) { + super(taxAgentId); } public CompanyRegisterInfoResponse getCompanyRegisterInfo(Map requestParam) { diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index 45ee201ae..33a5e6be0 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -1,7 +1,12 @@ package com.engine.salary.remote.tax.client; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; import lombok.extern.slf4j.Slf4j; +import java.util.HashMap; +import java.util.Map; + /** * 个税申报客户端 *

Copyright: Copyright (c) 2023

@@ -17,4 +22,18 @@ public class DeclareClient extends TaxBaseClient{ } + /** + * 更正申报 + * @param requestParam + */ + public UpdateDeclareResponse correct(Map requestParam){ + String url = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE; + String requestId = request(url, requestParam); + String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE_FEEDBACK; + + Map map = new HashMap<>(1); + map.put("requestId", requestId); + return response(feedbackUrl, map, UpdateDeclareResponse.class); + } + } diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java index 41a5f3cbf..3057b55fb 100644 --- a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -1,18 +1,17 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.constant.SzyhApiConstant; -import com.engine.salary.remote.tax.response.RequestIdResponse; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxpayment.response.BaseResponse; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; +import com.engine.salary.remote.tax.response.RequestIdResponse; import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; import weaver.general.Util; -import weaver.hrm.User; import java.util.HashMap; import java.util.Map; @@ -23,16 +22,16 @@ public class TaxBaseClient { return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class); } - private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); } public Long taxAgentId; - public User user; public TaxDeclarationApiConfigPO apiConfig; public TaxAgentTaxReturnPO returnPO; + public static final int threshold = 600; + public TaxBaseClient(Long taxAgentId) { this.taxAgentId = taxAgentId; this.apiConfig = getTaxDeclareApiConfigMapper().getOne(); @@ -46,20 +45,6 @@ public class TaxBaseClient { this.returnPO = taxReturnPO; } - public TaxBaseClient(Long taxAgentId, User user) { - this.taxAgentId = taxAgentId; - this.apiConfig = getTaxDeclareApiConfigMapper().getOne(); - TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); - try { - // 密码解密 - taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); - } catch (Exception e) { - log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); - } - this.returnPO = taxReturnPO; - this.user = user; - } - public String request(String url, Map requestParam) { String reqJson = JsonUtil.toJsonString(requestParam); Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); @@ -82,22 +67,33 @@ public class TaxBaseClient { public T response(String url, Map param, Class clazz) { TaskUtil taskUtil = new TaskUtil(); T response = null; - for (int i = 0; i < 5; i++) { + for (int i = 0; i <= threshold; ++i) { Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, param); response = JsonUtil.parseBean(res, clazz); //记录接口 taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } // 如果税友返回错误信息 String code = response.getHead().getCode(); if (SzyhApiConstant.HANDLING_CODE.equals(code)) { + //进行中的任务,重试 try { - Thread.sleep(5 * 1000); + Thread.sleep(6 * 1000); } catch (InterruptedException e) { log.error("", e); } - } else { + if (threshold == i) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "未在预期时间内完成任务,请稍后重试!阀值:" + threshold)); + } + } else if (SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode())) { + //成功的任务,返回结果 break; + } else { + //错误任务,提示 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, response.getHead().getMsg())); } } return response; diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java index 9bfef4bbb..ea1684fac 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -123,7 +123,7 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl requestParam.put("djxhid", saveParam.getTaxRegistrationNumber()); } - return new CompanyClient(taxAgentId, user).getCompanyRegisterInfo(requestParam); + return new CompanyClient(taxAgentId).getCompanyRegisterInfo(requestParam); } @@ -186,7 +186,7 @@ public abstract class AbstractTaxAgentTaxReturnCheckService extends Service impl requestParam.put("bmmc", saveParam.getDepartmentName()); } - return new CompanyClient(taxAgentId, user).checkPassword(requestParam); + return new CompanyClient(taxAgentId).checkPassword(requestParam); } /** diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 9da19ccfb..8047f6783 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -23,7 +23,6 @@ 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.remote.tax.response.RequestIdResponse; import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; import com.engine.salary.entity.taxdeclaration.bo.*; @@ -46,6 +45,7 @@ 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.service.*; import com.engine.salary.service.factory.TaxPaymentServiceFactory; import com.engine.salary.util.*; @@ -1009,41 +1009,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 申报类型 requestParam.put("sblx", reportType + ""); - - - // 请求 - String reqJson = JsonUtil.toJsonString(requestParam); - - String url = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE; - Map params = new HashMap<>(1); - Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - RequestIdResponse getRequestIdResponse = JsonUtil.parseObject(res, RequestIdResponse.class); - log.info("更正申报请求数据1:=== params:{} ,getRequestIdResponse:{}", res, getRequestIdResponse); - - - if (Objects.isNull(getRequestIdResponse) || Objects.isNull(getRequestIdResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); - } - if (!Objects.equals(getRequestIdResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE) || getRequestIdResponse.getBody() == null) { - throw new SalaryRunTimeException(getRequestIdResponse.getHead().getMsg()); - } - - String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE_FEEDBACK; - Map feedbackHeader = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - Map map = new HashMap<>(1); - String requestId = getRequestIdResponse.getBody().getRequestId(); - map.put("requestId", requestId); - res = HttpUtil.getRequest(feedbackUrl, feedbackHeader, map); - log.info("更正申报请求数据2: === requestId :{} === res : {}", requestId, res); - - UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class); - if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); - } - if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { - throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg()); - } + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + declareClient.correct(requestParam); //更新申报状态 declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java index f90f62713..41e153802 100644 --- a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -1,12 +1,16 @@ package com.engine.salary.wrapper; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; -import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.engine.salary.service.factory.TaxPaymentServiceFactory; +import com.engine.salary.service.impl.TaxPaymentAgreementServiceImpl; +import com.engine.salary.service.impl.TaxPaymentWithheldVoucherServiceImpl; +import com.engine.salary.service.impl.TaxPaymentWithholdingServiceImpl; +import com.engine.salary.service.impl.TaxPaymentWithholdingVoucherServiceImpl; import lombok.extern.slf4j.Slf4j; /** @@ -22,15 +26,15 @@ public class TaxPaymentWrapper extends Service { private final TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); public TaxFeedbackResultDTO getAgreementFeedback(TaxPaymentQueryParam param) { - return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).getFeedback(param); + return ServiceUtil.getService(TaxPaymentAgreementServiceImpl.class, user).getFeedback(param); } public TaxFeedbackResultDTO payAgreementFeedback(TaxPaymentQueryParam param) { - return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue()).getFeedback(param); + return ServiceUtil.getService(TaxPaymentWithholdingServiceImpl.class, user).getFeedback(param); } public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { - return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).getFeedback(param); + return ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).getFeedback(param); } public String getRequestId(TaxPaymentQueryParam param) { @@ -38,18 +42,18 @@ public class TaxPaymentWrapper extends Service { } public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { - return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param); + return ServiceUtil.getService(TaxPaymentAgreementServiceImpl.class, user).queryTaxAmount(param); } public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { - return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue()).getWithheldVoucher(param); + return ServiceUtil.getService(TaxPaymentWithheldVoucherServiceImpl.class, user).getWithheldVoucher(param); } public void getSyncWithholdingFeedback(TaxPaymentQueryParam param) { - taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).syncWithholdingFeedback(param); + ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).syncWithholdingFeedback(param); } public void cancelVoucher(TaxPaymentQueryParam param) { - taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(param); + ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).cancelWithholdingVoucher(param); } } From 68467fbe4650d2f325f05394f6d44fcd99bfa4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Jun 2024 11:19:34 +0800 Subject: [PATCH 188/298] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E4=BD=9C=E5=BA=9F?= =?UTF-8?q?=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CancelDeclareFeedbackResponse.java | 7 +--- .../remote/tax/client/DeclareClient.java | 23 ++++++++--- .../service/TaxDeclareRecordService.java | 2 +- .../impl/TaxDeclareRecordServiceImpl.java | 40 ++++++++++--------- .../wrapper/TaxDeclareRecordWrapper.java | 2 +- 5 files changed, 42 insertions(+), 32 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java index 564edd0b7..d22edac56 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java @@ -1,6 +1,6 @@ package com.engine.salary.entity.taxdeclaration.response; -import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxpayment.response.BaseResponse; import lombok.Data; import java.util.Map; @@ -14,10 +14,7 @@ import java.util.Map; * @version 1.0 **/ @Data -public class CancelDeclareFeedbackResponse { - - //接口状态") - private SzyhResponseHead head; +public class CancelDeclareFeedbackResponse extends BaseResponse { //接口状态") private Map body; diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index 33a5e6be0..4049eb679 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -1,6 +1,7 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; import lombok.extern.slf4j.Slf4j; @@ -16,24 +17,34 @@ import java.util.Map; * @version 1.0 **/ @Slf4j -public class DeclareClient extends TaxBaseClient{ +public class DeclareClient extends TaxBaseClient { public DeclareClient(Long taxAgentId) { super(taxAgentId); } + public CancelDeclareFeedbackResponse cancel(Map requestParam, Map responseParam) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE; + String requestId = request(url, requestParam); + + String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK; + responseParam.put("requestId", requestId); + return response(feedbackUrl, responseParam, CancelDeclareFeedbackResponse.class); + } + /** * 更正申报 + * * @param requestParam */ - public UpdateDeclareResponse correct(Map requestParam){ + public UpdateDeclareResponse correct(Map requestParam) { String url = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE; String requestId = request(url, requestParam); - String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE_FEEDBACK; - Map map = new HashMap<>(1); - map.put("requestId", requestId); - return response(feedbackUrl, map, UpdateDeclareResponse.class); + String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(feedbackUrl, responseParam, UpdateDeclareResponse.class); } } diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 0af1b0767..35b387f7b 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -136,7 +136,7 @@ public interface TaxDeclareRecordService { * * @param id */ - void cancelDeclare(Long id, Integer reportType); + void cancelDeclare(Long id, Integer reportType,TaxDeclarationRateDTO taxDeclarationRate); /** * 获取作废反馈 diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 8047f6783..25bcdfcaf 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -873,9 +873,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - public void cancelDeclare(Long id, Integer reportType) { + public void cancelDeclare(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + Long taxAgentId = taxDeclareRecord.getTaxAgentId(); TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); // 更正申报成功后不能作废 @@ -886,8 +887,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废")); } - // 供应商信息 - TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); // 注册的企业信息-->请求参数 Map requestParam = taxDeclareRequest.getRequestParam(); // 税款所属期 @@ -895,26 +894,29 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 申报类型 requestParam.put("sblx", reportType + ""); // 作废银联缴款凭证 -// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); +// ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); // 是否清空所得 requestParam.put("sfqksd", "0"); - // 请求 - String reqJson = JsonUtil.toJsonString(requestParam); - String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE; - Map params = new HashMap<>(1); - Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - log.info("作废申报返回数据:" + res); - DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); - if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); + + Map responseParam = new HashMap<>(); + responseParam.put("reportType",reportType + ""); + DeclareClient declareClient = new DeclareClient(taxAgentId); + CancelDeclareFeedbackResponse cancelDeclareFeedbackResponse = declareClient.cancel(requestParam,responseParam); + + // 作废是否成功 + CancelDeclareStatusEnum cancelDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("fkztbj"), 10), CancelDeclareStatusEnum.class); + if (cancelDeclareStatusEnum == CancelDeclareStatusEnum.CANCEL_FAIL) { + String feedbackBody = Util.null2String(cancelDeclareFeedbackResponse.getBody().get("fknr")).replace("\\", ""); + List errorMsgList = JsonUtil.parseList(feedbackBody, Map.class).stream().map(e -> Util.null2String(e.get("msg"))).collect(Collectors.toList()); + taxDeclarationRate.setStatus(false).setMsg(SalaryI18nUtil.getI18nLabel(156508, "作废失败:") + StringUtils.join(errorMsgList, ",")); } - if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { - throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("sbztbj"), 1), TaxDeclareStatusEnum.class); + if (taxDeclareStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); } - // 更新个税申报状态 - declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); - declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); + + //更新个税申报状态 + declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true); // 记录日志 diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 31a03fa2f..a288693c7 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -523,7 +523,7 @@ public class TaxDeclareRecordWrapper extends Service { @Override public void execute() { try { - getTaxDeclareRecordService(user).cancelDeclare(id, param.getReportType()); + getTaxDeclareRecordService(user).cancelDeclare(id, param.getReportType(),taxDeclarationRate); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); From d267810e5c3e9ae8dd439f2f7ef089eb91c88126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Jun 2024 11:30:35 +0800 Subject: [PATCH 189/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8A=A5=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index 63102bbe9..37c39a0d5 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -1244,7 +1244,7 @@ - AND salary_sob_id IN + AND t.salary_sob_id IN #{salarySobId} From 77708b96ab7fef106f336be006a0d76772f7f51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 28 Jun 2024 14:02:05 +0800 Subject: [PATCH 190/298] =?UTF-8?q?=E5=8D=87=E7=BA=A71?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/constant/SzyhApiConstant.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 5b22a491c..c4e0711ed 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -146,6 +146,8 @@ public class SzyhApiConstant { * 缴款凭证作废反馈 */ public static final String CANCEL_WITHHOLDING_VOUCHER_FEEDBACK = "gateway/iit/service/getCancelWithholdingVoucher"; + + /** * 完税证明 */ From bdcdef34c222c2d1297a67a0f4968f5f261f03d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 1 Jul 2024 15:09:40 +0800 Subject: [PATCH 191/298] =?UTF-8?q?=E9=9D=9E=E6=AD=A3=E5=B8=B8=E5=B7=A5?= =?UTF-8?q?=E8=B5=84=E8=96=AA=E9=87=91=E7=9A=84=E4=B8=AA=E7=A8=8E=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetASynIndividualIncomeTaxFeedbackResponse.java | 4 ++-- .../service/impl/SalarySobTaxRuleServiceImpl.java | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java index f1bd7e0c7..741d0a9d5 100644 --- a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -495,12 +495,12 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { /** * 税率 必填:否 */ - @TaxField(name = "本月(次)工资薪金税税率", taxIndex = "sl") + @TaxField(name = "税率", taxIndex = "sl") private BigDecimal sl; /** * 速算扣除数 必填:否 */ - @TaxField(name = "本月(次)工资薪金税速算扣除数", taxIndex = "sskcs") + @TaxField(name = "速算扣除数", taxIndex = "sskcs") private BigDecimal sskcs; /** diff --git a/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java index 65e81008f..2b95251dc 100644 --- a/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java @@ -92,7 +92,15 @@ public class SalarySobTaxRuleServiceImpl extends Service implements SalarySobTax for (Integer incomeCategoryId : incomeCategoryIds) { IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId); - List taxRules = incomeCategoryEnum.getReportType().getTaxRules(); + List taxRules = new ArrayList<>(); + if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES || incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_WAGES_AND_SALARIES) { + //只有正常工资薪金,才显示算税明细规则 + taxRules = incomeCategoryEnum.getReportType().getTaxRules(); + } else { + taxRules.add(SalarySobTaxRuleDTO.TaxRuleDTO.builder().name("税率").taxIndex("sl").build()); + taxRules.add(SalarySobTaxRuleDTO.TaxRuleDTO.builder().name("速算扣除数").taxIndex("sskcs").build()); + taxRules.add(SalarySobTaxRuleDTO.TaxRuleDTO.builder().name("本月(次)应补税额").taxIndex("ybtse").build()); + } for (SalarySobTaxRuleDTO.TaxRuleDTO taxRule : taxRules) { Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxRule.getTaxIndex()); SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); From 39a2684196c878372d5ee501807944ff091974a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 2 Jul 2024 15:39:31 +0800 Subject: [PATCH 192/298] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=BC=B4=E6=AC=BE?= =?UTF-8?q?=E5=87=AD=E8=AF=81=E4=BD=9C=E5=BA=9F=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=AE=8C=E7=A8=8E=E8=AF=81=E6=98=8E=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SzyhApiConstant.java | 20 ++++++-- .../bo/EmployeeDeclareRefresh.java | 5 -- .../salaryacct/bo/SalaryAcctCalculateBO.java | 5 ++ .../remote/tax/client/CompanyClient.java | 12 ++--- .../remote/tax/client/TaxBaseClient.java | 36 +++++++++++++ .../remote/tax/client/TaxPaymentClient.java | 50 +++++++++++++++++++ .../impl/SalaryAcctCalculateServiceImpl.java | 7 +++ .../impl/SalaryAcctResultServiceImpl.java | 11 +++- .../impl/SalaryCalcTaxServiceImpl.java | 34 ++++++++++--- .../TaxPaymentWithheldVoucherServiceImpl.java | 17 +++---- .../TaxPaymentWithholdingServiceImpl.java | 12 +++-- ...xPaymentWithholdingVoucherServiceImpl.java | 6 +-- 12 files changed, 174 insertions(+), 41 deletions(-) create mode 100644 src/com/engine/salary/remote/tax/client/TaxPaymentClient.java diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index c4e0711ed..0d0ed10a7 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -151,11 +151,25 @@ public class SzyhApiConstant { /** * 完税证明 */ - public static final String GET_WITHHELD_VOUCHER = "gateway/iit/payment/getWithheldVoucher"; +// public static final String GET_WITHHELD_VOUCHER = "gateway/iit/payment/getWithheldVoucher"; + public static final String GET_WITHHELD_VOUCHER = "gateway/iit/service/getWithheldVoucher"; + /** - * 刷新缴款状态 + * 完税证明反馈 */ - public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; + public static final String GET_WITHHELD_VOUCHER_FEEDBACK = "gateway/iit/service/getWithheldVoucher"; + + /** + * 查询缴款状态 + */ +// public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; + public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/service/getSyncWithholdingFeedback"; + + /** + * 查询缴款状态反馈 + */ + public static final String GET_SYNC_WITHHOLDING_FEEDBACK_FEEDBACK = "gateway/iit/service/getSyncWithholding"; + /** * 个人养老金下载 diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index 78d1f5874..484103c3a 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -125,11 +125,6 @@ public class EmployeeDeclareRefresh { employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue()); employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum))); employeeDeclare.setNationality("中国"); - } else { - // fixme 阿富汗 -// employeeDeclare.setNationality("阿富汗"); -// employeeDeclare.setEntryDate(); -// employeeDeclare.setDepartureDate(); } // 对人员处理「人员状态」、「离职日期」 SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java index f29ccd1ce..57c113390 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java @@ -120,6 +120,11 @@ public class SalaryAcctCalculateBO { */ private BlockingDeque results; + /** + * 个税项目 + */ + private List taxIds; + /** * 系统算税启用状态 */ diff --git a/src/com/engine/salary/remote/tax/client/CompanyClient.java b/src/com/engine/salary/remote/tax/client/CompanyClient.java index b57a2d726..3ebf962e9 100644 --- a/src/com/engine/salary/remote/tax/client/CompanyClient.java +++ b/src/com/engine/salary/remote/tax/client/CompanyClient.java @@ -21,9 +21,9 @@ public class CompanyClient extends TaxBaseClient { String requestId = request(url, requestParam); String getRegisterInfoFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_FEEDBACK_URL; - Map map = new HashMap<>(1); - map.put("requestId", requestId); - return response(getRegisterInfoFeedbackUrl, map, CompanyRegisterInfoResponse.class); + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(getRegisterInfoFeedbackUrl, responseParam, CompanyRegisterInfoResponse.class); } public CheckPasswordResponse checkPassword(Map requestParam) { @@ -32,8 +32,8 @@ public class CompanyClient extends TaxBaseClient { String requestId = request(url, requestParam); String checkPasswordFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_FEEDBACK_URL; - Map map = new HashMap<>(1); - map.put("requestId", requestId); - return response(checkPasswordFeedbackUrl, map, CheckPasswordResponse.class); + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(checkPasswordFeedbackUrl, responseParam, CheckPasswordResponse.class); } } diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java index 3057b55fb..b880cc01f 100644 --- a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -98,4 +98,40 @@ public class TaxBaseClient { } return response; } + + public T postResponse(String url, Map param, Class clazz) { + String reqJson = JsonUtil.toJsonString(param); + TaskUtil taskUtil = new TaskUtil(); + T response = null; + for (int i = 0; i <= threshold; ++i) { + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + response = JsonUtil.parseBean(res, clazz); + //记录接口 + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + // 如果税友返回错误信息 + String code = response.getHead().getCode(); + if (SzyhApiConstant.HANDLING_CODE.equals(code)) { + //进行中的任务,重试 + try { + Thread.sleep(6 * 1000); + } catch (InterruptedException e) { + log.error("", e); + } + if (threshold == i) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "未在预期时间内完成任务,请稍后重试!阀值:" + threshold)); + } + } else if (SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode())) { + //成功的任务,返回结果 + break; + } else { + //错误任务,提示 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, response.getHead().getMsg())); + } + } + return response; + } } diff --git a/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java new file mode 100644 index 000000000..403b0e051 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java @@ -0,0 +1,50 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; + +@Slf4j +public class TaxPaymentClient extends TaxBaseClient { + public TaxPaymentClient(Long taxAgentId) { + super(taxAgentId); + } + + + /** + * 作废缴款凭证 + * + * @param requestParam + * @return + */ + public QuerySpecialAmountResponse cancelWithholdingVoucher(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + String requestId = request(url, requestParam); + + url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER_FEEDBACK + "?requestId=" + requestId; + Map responseParam = new HashMap<>(1); + return postResponse(url, responseParam, QuerySpecialAmountResponse.class); + + } + + + /** + * 开具完税证明 + * @param requestParam + * @return + */ + public WithheldVoucherResponse getWithheldVoucher(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER; + String requestId = request(url, requestParam); + + url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER_FEEDBACK + "?requestId=" + requestId; + Map responseParam = new HashMap<>(1); + return postResponse(url, responseParam, WithheldVoucherResponse.class); + + } + +} diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index 69c40951c..65821146b 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -196,6 +196,9 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc Set salarySobBackItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId); Map salarySobBackItemMap = SalaryEntityUtil.convert2Map(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId); List salaryAcctResultTempPOS = Lists.newArrayList(); + + //个税项目id + List taxIds = salaryAcctCalculateBO.getTaxIds(); sw.stop(); // 开始核算 sw.start("核算耗时"); @@ -225,6 +228,10 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc SalarySobItemPO salarySobItemPO = salaryItemIdKeySalarySobItemPOMap.get(salaryItemId); expressFormula = expressFormulaMap.get(salarySobItemPO.getFormulaId()); defaultValue = salarySobItemPO.getDefaultValue(); + } else if (taxIds.contains(salaryItemId)) { + //个税项目,默认只能从税局取。 + expressFormula = null; + defaultValue = ""; } else { expressFormula = expressFormulaMap.get(salaryItemPO.getFormulaId()); defaultValue = salaryItemPO.getDefaultValue(); diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index bd38b76f3..f68e8b815 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -202,6 +202,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user); } + private SalarySobTaxRuleService getSalarySobTaxRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxRuleServiceImpl.class, user); + } + @Override public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { @@ -786,8 +790,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 本次运算的回算薪资项目所涉及的变量 Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); // 9、计算薪资项目的运算优先级 -// List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); + //账套中配置的个税字段,不需要系统算 + List salarySobTaxRulePOS = getSalarySobTaxRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List taxIds = SalaryEntityUtil.properties(salarySobTaxRulePOS, SalarySobTaxRulePO::getSalaryItemId, Collectors.toList()); // 10、根据id查询其他合并计税的薪资核算记录 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); @@ -853,7 +859,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe .setChildMonitor(childMonitor) .setResults(calculateResults) .setCalculateKey(calculateKey) - .setTaxDeclarationFunction(taxDeclarationFunction); + .setTaxDeclarationFunction(taxDeclarationFunction) + .setTaxIds(taxIds); List finalSalarySobBackItems = salarySobBackItems; LocalRunnable localRunnable = new LocalRunnable() { @Override diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index 9e41240a4..1777067af 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -194,7 +194,8 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量")); } // 查询薪资核算记录 - SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryCalcTaxParam.getSalaryAcctRecordId()); + Long salaryAcctRecordId = salaryCalcTaxParam.getSalaryAcctRecordId(); + SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); // 查询薪资核算记录关联的薪资核算人员 List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecord.getId()); Map> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, e -> e.getTaxAgentId() + "-" + e.getIncomeCategory()); @@ -218,7 +219,9 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe Map> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); - List resultPOS = new ArrayList<>(); + List addResultPOS = new ArrayList<>(); + List updateResultPOS = new ArrayList<>(); + for (SalaryAcctCalcTaxReqPO salaryAcctCalcTaxReq : salaryAcctCalcTaxReqs) { CalculateClient calculateClient = new CalculateClient(salaryAcctCalcTaxReq.getTaxAgentId()); GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse = calculateClient.getASynIndividualIncomeTaxFeedback(salaryAcctCalcTaxReq.getRequestId()); @@ -234,7 +237,7 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe continue; } List subEmployeeDeclares = employeeDeclareMap.get(salaryAcctCalcTaxReq.getTaxAgentId()); - + Date now = new Date(); // 获取不同所得项目的个税 for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : subSalaryAcctTaxAgents) { IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(salaryAcctTaxAgent.getIncomeCategory()); @@ -255,17 +258,36 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe SalarySobTaxRuleDTO salarySobTaxRuleDTO = empIdResult.get(salaryAcctEmployee.getEmployeeId()); List taxRules = salarySobTaxRuleDTO.getTaxRules(); taxRules.forEach(rule -> { - SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(rule.getSalaryItemId()); + Long salaryItemId = rule.getSalaryItemId(); + SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(salaryItemId); if (salaryAcctResultPO != null) { salaryAcctResultPO.setResultValue(rule.getValue()); - resultPOS.add(salaryAcctResultPO); + updateResultPOS.add(salaryAcctResultPO); + } else { + salaryAcctResultPO = SalaryAcctResultPO.builder() + .salaryAcctRecordId(salaryAcctRecordId) + .salaryAcctEmpId(salaryAcctEmployee.getId()) + .employeeId(salaryAcctEmployee.getEmployeeId()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(salaryItemId) + .resultValue(rule.getValue()) + .originResultValue("") + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build(); + addResultPOS.add(salaryAcctResultPO); } }); } } } - getSalaryAcctResultService(user).batchUpdate(resultPOS); + getSalaryAcctResultService(user).batchSave(addResultPOS); + getSalaryAcctResultService(user).batchUpdate(updateResultPOS); getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId()); // 记录日志 getSalaryAcctResultService(user).writeBatchLog(salaryAcctRecord, Collections.emptyMap(), SalaryLogOperateTypeEnum.GET_CALC_TAX_FEEDBACK); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java index 235bdeefd..16578143b 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -3,16 +3,14 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.datacollection.bo.DataCollectionBO; -import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; -import com.engine.salary.entity.taxpayment.response.BaseResponse; import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.client.TaxPaymentClient; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -35,17 +33,14 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ return TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue(); } - protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, String taxAgentName, TaxPaymentQueryParam param, TaxDeclarationApiConfigPO apiConfig, Class clazz) { - String url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER; - Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); - return postRequest(apiConfig, url, requestParam, clazz); - } - @Override public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); - WithheldVoucherResponse queryResponse = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), - param, tempWrapper.getApiConfigPO(), WithheldVoucherResponse.class); + + TaxPaymentClient taxPaymentClient = new TaxPaymentClient(param.getTaxAgentId()); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + WithheldVoucherResponse queryResponse = taxPaymentClient.getWithheldVoucher(requestParam); + // 校验请求结果 String responseCode = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(body -> { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 743f1631c..4b37d0c0f 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -22,11 +22,15 @@ import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.client.TaxPaymentClient; import com.engine.salary.util.*; import lombok.extern.slf4j.Slf4j; import java.math.BigDecimal; -import java.util.*; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; /** * 三方缴款 @@ -80,7 +84,6 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { - // fixme throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt())); } // 累计实缴金额 @@ -153,13 +156,12 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - // if (paymentRequestPO != null) { + TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId()); List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); statuses.forEach(status -> { requestParam.put("sblx", status.getReportType()); - String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; - QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + QuerySpecialAmountResponse cancelResponse = taxPaymentClient.cancelWithholdingVoucher(requestParam); SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 028a86c7c..517548901 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -22,6 +22,7 @@ import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.client.TaxPaymentClient; import com.engine.salary.util.*; import lombok.extern.slf4j.Slf4j; @@ -115,11 +116,10 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS // if (paymentRequestPO != null) { List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); + TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId()); statuses.forEach(status -> { requestParam.put("sblx", status.getReportType()); - - String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; - QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + QuerySpecialAmountResponse cancelResponse = taxPaymentClient.cancelWithholdingVoucher(requestParam); SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()), head.getMsg()); From 3f723d77508a83d616dffaf217a1bd7c605c0309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 2 Jul 2024 19:13:14 +0800 Subject: [PATCH 193/298] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/remote/tax/client/CalculateClient.java | 4 +++- .../service/impl/SalaryAcctCalculateServiceImpl.java | 11 +++++++---- .../salary/service/impl/SalaryCalcTaxServiceImpl.java | 5 +++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/remote/tax/client/CalculateClient.java b/src/com/engine/salary/remote/tax/client/CalculateClient.java index 6c27ef8fc..4a120a015 100644 --- a/src/com/engine/salary/remote/tax/client/CalculateClient.java +++ b/src/com/engine/salary/remote/tax/client/CalculateClient.java @@ -4,6 +4,7 @@ import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTa import com.engine.salary.util.HttpUtil; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SingnatureData; +import com.engine.salary.util.TaskUtil; import lombok.extern.slf4j.Slf4j; import java.util.Collections; @@ -23,7 +24,8 @@ public class CalculateClient extends TaxBaseClient{ params.put("requestId", requestId); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, params); - + TaskUtil taskUtil = new TaskUtil(); + taskUtil.writeApiTaskRecord(requestId, url, requestId, res); log.info("getDeclareTaxResultFeedback res --- {}", res); return JsonUtil.parseObject(res, GetASynIndividualIncomeTaxFeedbackResponse.class); diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index 65821146b..5dd7be258 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -228,14 +228,17 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc SalarySobItemPO salarySobItemPO = salaryItemIdKeySalarySobItemPOMap.get(salaryItemId); expressFormula = expressFormulaMap.get(salarySobItemPO.getFormulaId()); defaultValue = salarySobItemPO.getDefaultValue(); - } else if (taxIds.contains(salaryItemId)) { - //个税项目,默认只能从税局取。 - expressFormula = null; - defaultValue = ""; } else { expressFormula = expressFormulaMap.get(salaryItemPO.getFormulaId()); defaultValue = salaryItemPO.getDefaultValue(); } + + if (taxIds.contains(salaryItemId)) { + //个税项目,默认只能从税局取。 + expressFormula = null; + defaultValue = ""; + } + if (Objects.nonNull(expressFormula)) { // 运行公式 ExcelResult result = runExpressFormula(expressFormula, formulaVarValueMap, simpleEmployee); diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index 1777067af..f6182ce83 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -158,6 +158,8 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe String reqJson = JsonUtil.toJsonString(entry.getValue()); // 请求第三方供应商 String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + TaskUtil taskUtil = new TaskUtil(); + taskUtil.writeApiTaskRecord(salaryAcctRecordId+"", url, reqJson, res); DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { @@ -256,6 +258,9 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe continue; } SalarySobTaxRuleDTO salarySobTaxRuleDTO = empIdResult.get(salaryAcctEmployee.getEmployeeId()); + if (salarySobTaxRuleDTO == null) { + continue; + } List taxRules = salarySobTaxRuleDTO.getTaxRules(); taxRules.forEach(rule -> { Long salaryItemId = rule.getSalaryItemId(); From 420d0a1fffe0fe48bdf4780382cd5ef6ddb2a85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 3 Jul 2024 15:34:23 +0800 Subject: [PATCH 194/298] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=AE=8C=E7=A8=8E?= =?UTF-8?q?=E8=AF=81=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/constant/SzyhApiConstant.java | 2 +- .../engine/salary/remote/tax/client/TaxPaymentClient.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 0d0ed10a7..8a7fe765a 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -157,7 +157,7 @@ public class SzyhApiConstant { /** * 完税证明反馈 */ - public static final String GET_WITHHELD_VOUCHER_FEEDBACK = "gateway/iit/service/getWithheldVoucher"; + public static final String GET_WITHHELD_VOUCHER_FEEDBACK = "gateway/iit/service/getWithheldVoucherFeedback"; /** * 查询缴款状态 diff --git a/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java index 403b0e051..5d06903cc 100644 --- a/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java @@ -34,16 +34,18 @@ public class TaxPaymentClient extends TaxBaseClient { /** * 开具完税证明 + * * @param requestParam * @return */ - public WithheldVoucherResponse getWithheldVoucher(Map requestParam) { + public WithheldVoucherResponse getWithheldVoucher(Map requestParam) { String url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER; String requestId = request(url, requestParam); - url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER_FEEDBACK + "?requestId=" + requestId; + url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER_FEEDBACK; Map responseParam = new HashMap<>(1); - return postResponse(url, responseParam, WithheldVoucherResponse.class); + responseParam.put("requestId", requestId); + return response(url, responseParam, WithheldVoucherResponse.class); } From 0c22a57f1961ca85d44c05e5b1dc5e2df86ad25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 4 Jul 2024 10:32:09 +0800 Subject: [PATCH 195/298] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E7=BC=B4=E6=AC=BE=E7=8A=B6=E6=80=81=20=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E7=BC=B4=E6=AC=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../remote/tax/client/TaxPaymentClient.java | 22 ++++- .../TaxPaymentWithholdingServiceImpl.java | 64 +++++++-------- ...xPaymentWithholdingVoucherServiceImpl.java | 80 ++++++++++--------- src/com/engine/salary/util/TaskUtil.java | 33 ++++---- .../salary/web/TaxPaymentController.java | 4 + .../salary/wrapper/TaxPaymentWrapper.java | 11 ++- 6 files changed, 120 insertions(+), 94 deletions(-) diff --git a/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java index 5d06903cc..2f80692b1 100644 --- a/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java @@ -2,6 +2,7 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +import com.engine.salary.entity.taxpayment.response.SyncWithholdingFeedbackResponse; import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; import lombok.extern.slf4j.Slf4j; @@ -25,9 +26,26 @@ public class TaxPaymentClient extends TaxBaseClient { String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; String requestId = request(url, requestParam); - url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER_FEEDBACK + "?requestId=" + requestId; + url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER_FEEDBACK; Map responseParam = new HashMap<>(1); - return postResponse(url, responseParam, QuerySpecialAmountResponse.class); + responseParam.put("requestId", requestId); + return response(url, responseParam, QuerySpecialAmountResponse.class); + + } + + /** + * 刷新缴款状态 + * @param requestParam + * @return + */ + public SyncWithholdingFeedbackResponse getSyncWithholding(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_SYNC_WITHHOLDING_FEEDBACK; + String requestId = request(url, requestParam); + + url = apiConfig.getHost() + SzyhApiConstant.GET_SYNC_WITHHOLDING_FEEDBACK_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(url, responseParam, SyncWithholdingFeedbackResponse.class); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 4b37d0c0f..678f125da 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -3,7 +3,6 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.datacollection.bo.DataCollectionBO; -import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; @@ -13,16 +12,13 @@ import com.engine.salary.entity.taxpayment.dto.TaxAgreementFeedbackResultDTO; import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; -import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; import com.engine.salary.entity.taxpayment.response.BaseResponse; import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse; -import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.remote.tax.client.TaxPaymentClient; import com.engine.salary.util.*; import lombok.extern.slf4j.Slf4j; @@ -143,40 +139,38 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService @Override protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); - Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); - cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); return tempWrapper; } - @Override - public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { - TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO - .builder() - .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) - .taxAgentId(taxDeclareRecord.getTaxAgentId()) - .taxYearMonth(taxDeclareRecord.getTaxCycle()) - .build()); -// if (paymentRequestPO != null) { - TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId()); - List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); - statuses.forEach(status -> { - requestParam.put("sblx", status.getReportType()); - QuerySpecialAmountResponse cancelResponse = taxPaymentClient.cancelWithholdingVoucher(requestParam); - SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) - .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); - SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); - - getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO - .builder() - .feedback(SalaryOnOffEnum.ON.getValue()) - .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) - .taxAgentId(taxDeclareRecord.getTaxAgentId()) - .taxYearMonth(taxDeclareRecord.getTaxCycle()) - .build()); - }); - -// } - } +// @Override +// public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { +// TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO +// .builder() +// .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) +// .taxAgentId(taxDeclareRecord.getTaxAgentId()) +// .taxYearMonth(taxDeclareRecord.getTaxCycle()) +// .build()); +//// if (paymentRequestPO != null) { +// TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId()); +// List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); +// statuses.forEach(status -> { +// requestParam.put("sblx", status.getReportType()); +// QuerySpecialAmountResponse cancelResponse = taxPaymentClient.cancelWithholdingVoucher(requestParam); +// SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) +// .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试"))); +// SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); +// +// getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO +// .builder() +// .feedback(SalaryOnOffEnum.ON.getValue()) +// .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) +// .taxAgentId(taxDeclareRecord.getTaxAgentId()) +// .taxYearMonth(taxDeclareRecord.getTaxCycle()) +// .build()); +// }); +// +//// } +// } protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING_FEEDBACK; diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 517548901..6eaabba46 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -16,20 +16,19 @@ import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; import com.engine.salary.entity.taxpayment.response.BaseResponse; import com.engine.salary.entity.taxpayment.response.SyncWithholdingFeedbackResponse; -import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse; import com.engine.salary.entity.taxpayment.response.WithholdingVoucherFeedbackResponse; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; -import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.remote.tax.client.TaxPaymentClient; -import com.engine.salary.util.*; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; import lombok.extern.slf4j.Slf4j; -import java.math.BigDecimal; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; @@ -134,40 +133,43 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS // } } - @Override - public void syncWithholdingFeedback(TaxPaymentQueryParam param) { - TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); - SyncWithholdingFeedbackResponse response = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), - param, tempWrapper.getApiConfigPO(), SyncWithholdingFeedbackResponse.class); - // 校验请求结果 - String responseCode = Optional.ofNullable(response) - .map(SyncWithholdingFeedbackResponse::getHead) - .map(SzyhResponseHead::getCode) - .orElse(null); - WithholdingFeedbackResponse.Feedback body = Optional.ofNullable(response) - .map(SyncWithholdingFeedbackResponse::getBody) - .orElse(null); - if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(body)) { - log.info("syncWithholdingFeedback code error:{}", JSON.toJSONString(response)); - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "税局接口异常,请稍后重试")); - } - Integer paymentStatus = SalaryEntityUtil.getIntValue(body.getJkzt(), -1); - TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); - if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { - throw new SalaryRunTimeException(String.format("查询失败,失败原因:%s,申报状态:%s", body.getJksbyy(), body.getSbzt())); - } - // 累计实缴金额 - BigDecimal totalPaid = body.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); - // 更新个税申报记录状态为已缴款 - updateTaxDeclareRecord(param, totalPaid); - // 更新三方缴款反馈状态 - getTaxPaymentRequestMapper().updateFeedbackByTaxDeclareRecordId(TaxPaymentRequestPO - .builder() - .feedback(SalaryOnOffEnum.ON.getValue()) - .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) - .taxDeclareRecordId(param.getTaxDeclareRecordId()) - .build()); - } +// @Override +// public void syncWithholdingFeedback(TaxPaymentQueryParam param) { +// TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); +// TaxPaymentClient taxPaymentClient = new TaxPaymentClient(param.getTaxAgentId()); +// Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); +// requestParam.put("bblx", param.getReportType()); +// SyncWithholdingFeedbackResponse response = taxPaymentClient.getSyncWithholding(requestParam); +// +// // 校验请求结果 +// String responseCode = Optional.ofNullable(response) +// .map(SyncWithholdingFeedbackResponse::getHead) +// .map(SzyhResponseHead::getCode) +// .orElse(null); +// WithholdingFeedbackResponse.Feedback body = Optional.ofNullable(response) +// .map(SyncWithholdingFeedbackResponse::getBody) +// .orElse(null); +// if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(body)) { +// log.info("syncWithholdingFeedback code error:{}", JSON.toJSONString(response)); +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "税局接口异常,请稍后重试")); +// } +// Integer paymentStatus = SalaryEntityUtil.getIntValue(body.getJkzt(), -1); +// TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); +// if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { +// throw new SalaryRunTimeException(String.format("查询失败,失败原因:%s,申报状态:%s", body.getJksbyy(), body.getSbzt())); +// } +// // 累计实缴金额 +// BigDecimal totalPaid = body.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); +// // 更新个税申报记录状态为已缴款 +// updateTaxDeclareRecord(param, totalPaid); +// // 更新三方缴款反馈状态 +// getTaxPaymentRequestMapper().updateFeedbackByTaxDeclareRecordId(TaxPaymentRequestPO +// .builder() +// .feedback(SalaryOnOffEnum.ON.getValue()) +// .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) +// .taxDeclareRecordId(param.getTaxDeclareRecordId()) +// .build()); +// } @Override public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { diff --git a/src/com/engine/salary/util/TaskUtil.java b/src/com/engine/salary/util/TaskUtil.java index 9b498d316..63df65134 100644 --- a/src/com/engine/salary/util/TaskUtil.java +++ b/src/com/engine/salary/util/TaskUtil.java @@ -17,20 +17,25 @@ public class TaskUtil { } public void writeApiTaskRecord(String source, String api, String param, String response) { - log.info("source:{} , api:{} , param:{} , response : {}", source, api, param, response); - Date now = new Date(); - ApiTaskRecordPO build = ApiTaskRecordPO.builder() - .id(IdGenerator.generate()) - .source(source) - .api(api) - .param(param) - .response(response) - .createTime(now) - .updateTime(now) - .deleteType(0) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); - getApiTaskRecordMapper().insertIgnoreNull(build); + try { + log.info("source:{} , api:{} , param:{} , response : {}", source, api, param, response); + Date now = new Date(); + ApiTaskRecordPO build = ApiTaskRecordPO.builder() + .id(IdGenerator.generate()) + .source(source) + .api(api) + .param(param) + .response(response) + .createTime(now) + .updateTime(now) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getApiTaskRecordMapper().insertIgnoreNull(build); + }catch (Exception e){ + log.error("writeApiTaskRecord error", e); + } + } diff --git a/src/com/engine/salary/web/TaxPaymentController.java b/src/com/engine/salary/web/TaxPaymentController.java index 07e5203ca..800e9e91d 100644 --- a/src/com/engine/salary/web/TaxPaymentController.java +++ b/src/com/engine/salary/web/TaxPaymentController.java @@ -103,6 +103,7 @@ public class TaxPaymentController { @Path("/voucher/print") @POST @Produces(MediaType.APPLICATION_JSON) + @Deprecated public String printVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()); User user = HrmUserVarify.getUser(request, response); @@ -118,6 +119,7 @@ public class TaxPaymentController { @Path("/voucher/print/feedback") @POST @Produces(MediaType.APPLICATION_JSON) + @Deprecated public String printVoucherFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()); User user = HrmUserVarify.getUser(request, response); @@ -133,6 +135,7 @@ public class TaxPaymentController { @Path("/voucher/cancel") @POST @Produces(MediaType.APPLICATION_JSON) + @Deprecated public String cancelVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxPaymentWrapper(user)::cancelVoucher, param); @@ -161,6 +164,7 @@ public class TaxPaymentController { @Path("/voucher/status/sync") @POST @Produces(MediaType.APPLICATION_JSON) + @Deprecated public String getSyncWithholdingFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getSyncWithholdingFeedback, param); diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java index 41e153802..258af95af 100644 --- a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -33,9 +33,6 @@ public class TaxPaymentWrapper extends Service { return ServiceUtil.getService(TaxPaymentWithholdingServiceImpl.class, user).getFeedback(param); } - public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { - return ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).getFeedback(param); - } public String getRequestId(TaxPaymentQueryParam param) { return taxPaymentServiceFactory.get(param.getType()).getRequestId(param); @@ -49,11 +46,17 @@ public class TaxPaymentWrapper extends Service { return ServiceUtil.getService(TaxPaymentWithheldVoucherServiceImpl.class, user).getWithheldVoucher(param); } + @Deprecated public void getSyncWithholdingFeedback(TaxPaymentQueryParam param) { ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).syncWithholdingFeedback(param); } - + @Deprecated public void cancelVoucher(TaxPaymentQueryParam param) { ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).cancelWithholdingVoucher(param); } + @Deprecated + public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { + return ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).getFeedback(param); + } + } From 0fb8ed179255d7054da87107aa1ecdccad9757f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 15 Jul 2024 16:59:10 +0800 Subject: [PATCH 196/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryCalcTaxServiceImpl.java | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index f6182ce83..2ee4b657e 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -159,7 +159,7 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe // 请求第三方供应商 String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); TaskUtil taskUtil = new TaskUtil(); - taskUtil.writeApiTaskRecord(salaryAcctRecordId+"", url, reqJson, res); + taskUtil.writeApiTaskRecord(salaryAcctRecordId + "", url, reqJson, res); DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { @@ -262,31 +262,33 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe continue; } List taxRules = salarySobTaxRuleDTO.getTaxRules(); - taxRules.forEach(rule -> { - Long salaryItemId = rule.getSalaryItemId(); - SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(salaryItemId); - if (salaryAcctResultPO != null) { - salaryAcctResultPO.setResultValue(rule.getValue()); - updateResultPOS.add(salaryAcctResultPO); - } else { - salaryAcctResultPO = SalaryAcctResultPO.builder() - .salaryAcctRecordId(salaryAcctRecordId) - .salaryAcctEmpId(salaryAcctEmployee.getId()) - .employeeId(salaryAcctEmployee.getEmployeeId()) - .taxAgentId(salaryAcctEmployee.getTaxAgentId()) - .salarySobId(salaryAcctEmployee.getSalarySobId()) - .salaryItemId(salaryItemId) - .resultValue(rule.getValue()) - .originResultValue("") - .creator((long) user.getUID()) - .createTime(now) - .updateTime(now) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .deleteType(0) - .build(); - addResultPOS.add(salaryAcctResultPO); - } - }); + taxRules.stream() + .filter(rule -> rule.getSalaryItemId() != null) + .forEach(rule -> { + Long salaryItemId = rule.getSalaryItemId(); + SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(salaryItemId); + if (salaryAcctResultPO != null) { + salaryAcctResultPO.setResultValue(rule.getValue()); + updateResultPOS.add(salaryAcctResultPO); + } else { + salaryAcctResultPO = SalaryAcctResultPO.builder() + .salaryAcctRecordId(salaryAcctRecordId) + .salaryAcctEmpId(salaryAcctEmployee.getId()) + .employeeId(salaryAcctEmployee.getEmployeeId()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(salaryItemId) + .resultValue(rule.getValue()) + .originResultValue("") + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build(); + addResultPOS.add(salaryAcctResultPO); + } + }); } } } From 46b3dde438f6c70851f2ff1c81a2eaf4c0eaa08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 17 Jul 2024 09:03:31 +0800 Subject: [PATCH 197/298] =?UTF-8?q?=E7=A8=8E=E5=90=8E=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/cache/SalaryCacheKey.java | 5 + .../SalaryAfterTaxAcctCalculateParam.java | 24 +++ .../salaryacct/SalaryAcctResultMapper.java | 1 + .../service/SalaryAcctResultService.java | 8 + .../impl/SalaryAcctResultServiceImpl.java | 192 +++++++++++++++++- .../TaxDeclarationApiConfigServiceImpl.java | 18 +- .../salary/web/SalaryAcctController.java | 9 + .../wrapper/SalaryAcctResultWrapper.java | 43 +++- .../proxy/SalaryAcctResultWrapperProxy.java | 2 + 9 files changed, 278 insertions(+), 24 deletions(-) create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAfterTaxAcctCalculateParam.java diff --git a/src/com/engine/salary/cache/SalaryCacheKey.java b/src/com/engine/salary/cache/SalaryCacheKey.java index 642a499c7..2f345fc76 100644 --- a/src/com/engine/salary/cache/SalaryCacheKey.java +++ b/src/com/engine/salary/cache/SalaryCacheKey.java @@ -15,6 +15,11 @@ public class SalaryCacheKey { */ public final static String ACCT_PROGRESS = "ACCT_PROGRESS_"; + /** + * 核算税后工资进度 + */ + public final static String AFTER_TAXA_CCT_PROGRESS = "AFTER_TAX_ACCT_PROGRESS_"; + /** * 薪资核算的账套配置 */ diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAfterTaxAcctCalculateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAfterTaxAcctCalculateParam.java new file mode 100644 index 000000000..55fd34a0c --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAfterTaxAcctCalculateParam.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 税后薪资核算的参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAfterTaxAcctCalculateParam { + @DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空") + private Long salaryAcctRecordId; +} diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java index 545b5a81b..bbc727459 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java @@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param; import java.util.Collection; import java.util.List; +import java.util.Set; public interface SalaryAcctResultMapper { diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index d537c56c6..b4af31089 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -151,6 +151,13 @@ public interface SalaryAcctResultService { */ void calculate(SalaryAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee); + /** + * 核算税后 + * @param calculateParam + * @param simpleEmployee + */ + void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee); + /** * 根据薪资核算记录的id、个税扣缴义务人查询薪资核算结果 * @@ -224,4 +231,5 @@ public interface SalaryAcctResultService { void writeBatchLog(SalaryAcctRecordPO salaryAcctRecord, Map newResultValueMap, SalaryLogOperateTypeEnum operateType); + } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index b049989bc..ea7a59966 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -919,6 +919,181 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } } + + @Override + public void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee) { + Long salaryAcctRecordId = calculateParam.getSalaryAcctRecordId(); + try { + // 1、查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + //查询对应账套 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资账套不存在或已被删除")); + } + + // 不是查询薪资账套下实时的薪资项目,而是查询发起薪资核算时存储的薪资项目快照 + SalaryAcctConfig salaryAcctSobConfig = getSalaryAcctSobConfigService(user).getSalaryAcctConfig(salaryAcctRecordId); + + // 1.1、如果薪资核算记录已经归档了,就不能继续核算 + if (!Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99148, "当前薪资核算记录已归档,请重新打开后再进行核算")); + } + // 2、查询薪资核算记录的薪资周期、考勤周期等 + SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctRecordId); + // 3、查询薪资核算记录所用薪资账套的薪资项目副本 + List salarySobItemPOS = salaryAcctSobConfig.getSalarySobItems(); + if (CollectionUtils.isEmpty(salarySobItemPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99151, "当前所用的薪资账套未选择任何薪资项目,无法核算")); + } + // 回算薪资项目 + List salarySobBackItems = Collections.emptyList(); + if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), 1)) { + salarySobBackItems = salaryAcctSobConfig.getSalarySobBackItems(); + } + // 4、查询当前租户的所有薪资项目 + List salaryItemPOS = getSalaryItemService(user).listAll(); + // 5、查询薪资核算记录所用薪资账套的调薪计薪规则 + List salarySobAdjustRulePOS = getSalarySobAdjustRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + // 6、查询社保福利的所有字段 + Map welfareColumns = getSIAccountService(user).welfareColumns(); + // 7、查询考勤引用的所有字段 + List attendQuoteFieldListDTOS = getAttendQuoteFieldService(user).listAll(); + + // 8、查询公式详情 + Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); + formulaIds.addAll(SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId)); + formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); + List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + // 本次运算的回算薪资项目所涉及的变量 + Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); + // 9、计算薪资项目的运算优先级 + List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); + + //核算税后逻辑,去除非税后项目 + List afterTaxItems = new ArrayList<>(); + afterTaxItems.add(1695204436147L); + salarySobItemsWithPriority = salarySobItemsWithPriority.stream().filter(afterTaxItems::contains).collect(Collectors.toList()); + + //账套中配置的个税字段,不需要系统算 + List salarySobTaxRulePOS = getSalarySobTaxRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List taxIds = SalaryEntityUtil.properties(salarySobTaxRulePOS, SalarySobTaxRulePO::getSalaryItemId, Collectors.toList()); + + // 10、根据id查询其他合并计税的薪资核算记录 + List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); + // 11、查询本次核算人员 + List salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId()); + if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(103378, "薪资核算人员不能为空")); + } + + //核算锁定值 + List lockSalaryItemIds = salaryAcctRecordPO.getLockSalaryItemIds(); + Map acctResults = new HashMap<>(); + if (CollUtil.isNotEmpty(lockSalaryItemIds)) { + List acctResultPOS = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singleton(salaryAcctRecordId), lockSalaryItemIds); + acctResults = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().filter(po -> lockSalaryItemIds.contains(po.getSalaryItemId())).collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a)); + } + List lockEmpIds = salaryAcctEmployeePOS.stream().filter(po -> LockStatusEnum.LOCK.getValue().equals(po.getLockStatus())).map(SalaryAcctEmployeePO::getId).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(lockEmpIds)) { + List acctResultPOS = listBySalaryAcctEmployeeIds(lockEmpIds); + Map acctResultMaps = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a)); + acctResults.putAll(acctResultMaps); + } + + + // 11.1、初始化进度 + ProgressDTO initProgress = new ProgressDTO().setTitle(SalaryI18nUtil.getI18nLabel(97515, "核算中")).setTitleLabelId(97515L).setTotalQuantity(salaryAcctEmployeePOS.size() * 2 + 1).setCalculatedQuantity(0).setProgress(BigDecimal.ZERO).setStatus(true).setMessage(StringUtils.EMPTY); + getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, initProgress); + // 12、对薪资核算人员进行拆分 + List> partition = Lists.partition(salaryAcctEmployeePOS, 100); + // 12.1、监控子线程的任务执行 + CountDownLatch childMonitor = new CountDownLatch(partition.size()); + // 12.2、记录子线程的执行结果 + BlockingDeque calculateResults = new LinkedBlockingDeque<>(partition.size()); + // 12.3、生成本次运算的key + String calculateKey = UUID.randomUUID().toString(); + // 12.4、是否采用系统算税 + TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration(); + // 12.5、多线程运算,运算结果存放在临时表中 + for (List acctEmployeePOS : partition) { + SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO() + .setSalaryAcctRecordPO(salaryAcctRecordPO) + .setSalarySobPO(salarySobPO) + .setSalarySobCycleDTO(salarySobCycleDTO) + .setOtherSalaryAcctRecordPOS(otherSalaryAcctRecordPOS) + .setSalaryAcctLockResultPOS(MapUtils.emptyIfNull(acctResults)) + .setLockSalaryItemIds(lockSalaryItemIds) + .setSalarySobItemPOS(salarySobItemPOS) + .setSalaryItemIdWithPriorityList(salarySobItemsWithPriority) + .setExpressFormulas(expressFormulas) + .setSalaryItemPOS(salaryItemPOS) + .setSalarySobAdjustRulePOS(salarySobAdjustRulePOS) + .setWelfareColumns(MapUtils.emptyIfNull(welfareColumns)) + .setAttendQuoteFieldListDTOS(attendQuoteFieldListDTOS) + .setSalaryAcctEmployeePOS(acctEmployeePOS) + .setIssuedFieldIds(issuedFieldIds) + .setChildMonitor(childMonitor) + .setResults(calculateResults) + .setCalculateKey(calculateKey) + .setTaxDeclarationFunction(taxDeclarationFunction) + .setTaxIds(taxIds); + List finalSalarySobBackItems = salarySobBackItems; + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems); + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable); + } + // 13、等待所有子线程执行完毕 + childMonitor.await(); + + + // 14、判断子线程执行结果 + boolean allSuccess = calculateResults.stream().allMatch(SalaryAcctCalculateBO.Result::isStatus); + if (!allSuccess) { + // 薪资核算实现的线程的错误信息 + String errorMsg = calculateResults.stream().filter(result -> !result.isStatus()).map(SalaryAcctCalculateBO.Result::getErrMsg).collect(Collectors.joining("|")); + getSalaryAcctProgressService(user).fail(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, errorMsg); + // 删除薪资核算临时存储表中的数据 + getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey); + return; + } + // 15、处理核算结果临时表数据 + handleSalaryAfterTaxAcctResultTemp(salaryAcctRecordId, calculateKey, afterTaxItems); + // 16、开始运行校验规则 +// SalaryAcctCheckParam salaryAcctCheckParam = new SalaryAcctCheckParam() +// .setSalaryAcctRecordId(calculateParam.getSalaryAcctRecordId()) +// .setIds(calculateParam.getIds()); +// salaryCheckResultService.check(salaryAcctCheckParam, true, simpleEmployee); +// Thread.sleep(10); + getSalaryAcctProgressService(user).finish(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, true); + + + // 记录日志 + // 查询操作日志的targetName + String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(salaryAcctRecordId); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryAcctRecordId)); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "核算税后薪资")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "核算税后薪资")); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); + } catch (Exception e) { + log.info("核算税后薪资出错:{}", e.getMessage(), e); + getSalaryAcctProgressService(user).fail(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, SalaryI18nUtil.getI18nLabel(99642, "薪资核算出错") + ": " + e.getMessage()); + } finally { + // 数据库字段加密用 + } + } + @NotNull private List sortItems(List salarySobItemPOS, List salarySobBackItems, List salaryItemPOS, List expressFormulas) { @@ -999,6 +1174,19 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe log.info(sw.prettyPrint()); } + + private void handleSalaryAfterTaxAcctResultTemp(Long salaryAcctRecordId, String calculateKey, List afterTaxItemIds) { + // 查询薪资核算结果的临时存储 + List salaryAcctResultTempPOS = getSalaryAcctResultTempService(user).listByCalculateKey(calculateKey); + // 删除原来的薪资核算结果 + getSalaryAcctResultMapper().deleteBySalaryAcctRecordIdAndSalaryItemIds(salaryAcctRecordId, afterTaxItemIds); + // 保存薪资的薪资核算结果 + List salaryAcctResultPOS = SalaryAcctResultBO.convert2ResultPO(salaryAcctResultTempPOS); + batchSave(salaryAcctResultPOS); + // 删除薪资核算临时存储表中的数据 + getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey); + } + @Override public List listBySalaryAcctRecordIdsAndTaxAgentIds(Collection salaryAcctRecordIds, Collection taxAgentIds) { if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { @@ -1254,8 +1442,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe LoggerContext> context = new LoggerContext<>(); context.setUser(user); context.setTargetId(salaryAcctRecord.getId().toString()); - context.setTargetName(SalaryI18nUtil.getI18nLabel( 268573, "全部人员")); - context.setOperator(user.getUID()+""); + context.setTargetName(SalaryI18nUtil.getI18nLabel(268573, "全部人员")); + context.setOperator(user.getUID() + ""); context.setOperateType(operateType.getValue()); context.setOperateTypeName(operateType.getDefaultLabel()); context.setGroupId(SalaryLogGroupTypeEnum.SALARY_ACCT_RESULT_VALUE.getValue()); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java index f307a95c8..9d44300cc 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -3,14 +3,12 @@ package com.engine.salary.service.impl; import com.engine.core.impl.Service; import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse; -import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiProfilePO; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareApiProfileEnum; -import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiProfileMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; import com.engine.salary.service.TaxDeclarationApiConfigService; @@ -19,7 +17,10 @@ import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import java.util.*; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * chengliming @@ -97,17 +98,6 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe config.setHost(getApiHost()); insert(config); } - if (StringUtils.isNotEmpty(config.getAppKey()) && StringUtils.isNotEmpty(config.getAppSecret())) { - QuerySpecialAmountFeedbackResponse response = getQuerySpecialAmountFeedbackResponse(config); - // 校验请求结果 - String responseCode = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); - - if (SzyhApiConstant.ERROR_CODE.equals(responseCode) - || SzyhApiConstant.APP_DISABLED_CODE.equals(responseCode) - || SzyhApiConstant.APP_PAUSED_CODE.equals(responseCode)) { - throw new SalaryRunTimeException("账号密码错误或账号已停用"); - } - } } private String getApiHost() { diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 39a9a2245..151d0e9e3 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -541,6 +541,15 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::calcTaxFeedback, salaryCalcTaxParam); } + //计算税后工资 + @POST + @Path("/acctresult/afterTaxAccounting") + @Produces(MediaType.APPLICATION_JSON) + public String afterTaxAccounting(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAfterTaxAcctCalculateParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::afterTaxAccounting, param); + } + //导出核算结果 @GET @Path("/acctresult/export") diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index d8ebc1009..0442df794 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -236,14 +236,6 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult .setStatus(true) .setMessage(StringUtils.EMPTY); getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), initProgress); - // 异步执行薪资核算 -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// getSalaryAcctResultService(user).calculate(calculateParam, simpleEmployee); -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculateV1", localRunnable); new Thread() { public void run() { getSalaryAcctResultService(user).calculate(calculateParam, simpleEmployee); @@ -252,6 +244,41 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult } + /** + * 核算税后 + * + * @param calculateParam 薪资核算的参数 + */ + public void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam) { + //当前登陆人员 + DataCollectionEmployee simpleEmployee = new DataCollectionEmployee(); + simpleEmployee.setEmployeeId((long) user.getUID()); + // 检查薪资核算人员的个税扣缴义务人 + getSalaryAcctEmployeeWrapper(user).checkTaxAgent(calculateParam.getSalaryAcctRecordId()); + // 检查是否正在核算中 + ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + calculateParam.getSalaryAcctRecordId()); + if (Objects.nonNull(salaryAcctProgressDTO) && salaryAcctProgressDTO.isStatus() && Optional.ofNullable(salaryAcctProgressDTO.getProgress()).orElse(BigDecimal.ZERO).compareTo(BigDecimal.ONE) < 0) { + return; + } + // 初始化进度 + ProgressDTO initProgress = new ProgressDTO() + .setTitle(SalaryI18nUtil.getI18nLabel(97515, "核算中")) + .setTitleLabelId(97515L) + .setTotalQuantity(NumberUtils.INTEGER_ONE) + .setCalculatedQuantity(NumberUtils.INTEGER_ZERO) + .setProgress(BigDecimal.ZERO) + .setStatus(true) + .setMessage(StringUtils.EMPTY); + getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), initProgress); + new Thread() { + public void run() { + getSalaryAcctResultService(user).afterTaxAccounting(calculateParam, simpleEmployee); + } + }.start(); + + } + + /** * 检查是否有薪资核算结果的查看权限 * @param salaryAcctRecordId diff --git a/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java b/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java index 7a984d1c4..4334ed9ba 100644 --- a/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java +++ b/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java @@ -19,5 +19,7 @@ public interface SalaryAcctResultWrapperProxy { void calculate(SalaryAcctCalculateParam calculateParam); + void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam); + void batchUpdate(SalaryAcctResultBatchUpdateParam param); } From d518b86c82f1bc6e4016a5de5eae8696f53d73ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 17 Jul 2024 10:04:49 +0800 Subject: [PATCH 198/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=97=E7=A8=8Esql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202407170103.sql | 14 ++++++++++++++ resource/sqlupgrade/GS/sql202407170103.sql | 14 ++++++++++++++ resource/sqlupgrade/JC/sql202407170103.sql | 14 ++++++++++++++ resource/sqlupgrade/Mysql/sql202407170103.sql | 13 +++++++++++++ resource/sqlupgrade/Oracle/sql202407170103.sql | 13 +++++++++++++ resource/sqlupgrade/PG/sql202407170103.sql | 13 +++++++++++++ resource/sqlupgrade/SQLServer/sql202407170103.sql | 13 +++++++++++++ resource/sqlupgrade/ST/sql202407170103.sql | 14 ++++++++++++++ 8 files changed, 108 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202407170103.sql create mode 100644 resource/sqlupgrade/GS/sql202407170103.sql create mode 100644 resource/sqlupgrade/JC/sql202407170103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202407170103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202407170103.sql create mode 100644 resource/sqlupgrade/PG/sql202407170103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202407170103.sql create mode 100644 resource/sqlupgrade/ST/sql202407170103.sql diff --git a/resource/sqlupgrade/DM/sql202407170103.sql b/resource/sqlupgrade/DM/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202407170103.sql b/resource/sqlupgrade/GS/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202407170103.sql b/resource/sqlupgrade/JC/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202407170103.sql b/resource/sqlupgrade/Mysql/sql202407170103.sql new file mode 100644 index 000000000..10ccaaadd --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id bigint primary key comment 'ID' , + create_time datetime default now() comment 'ʱ' , + update_time datetime default now() comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + salary_acct_record_id bigint comment 'нʺ¼id' , + tax_agent_id bigint comment '˰۽id' , + request_id varchar(100) comment 'requestId' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202407170103.sql b/resource/sqlupgrade/Oracle/sql202407170103.sql new file mode 100644 index 000000000..906e14906 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202407170103.sql b/resource/sqlupgrade/PG/sql202407170103.sql new file mode 100644 index 000000000..47f27e07f --- /dev/null +++ b/resource/sqlupgrade/PG/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id bigint primary key , + create_time timestamp default now(), + update_time timestamp default now(), + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + salary_acct_record_id bigint, + tax_agent_id bigint, + request_id varchar(100) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202407170103.sql b/resource/sqlupgrade/SQLServer/sql202407170103.sql new file mode 100644 index 000000000..a8734ab0c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id bigint primary key , + create_time datetime default getdate(), + update_time datetime default getdate(), + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + salary_acct_record_id bigint, + tax_agent_id bigint, + request_id nvarchar(100) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202407170103.sql b/resource/sqlupgrade/ST/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + From 08c30c292b613692e9b704d1c5565afb5e6db3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 17 Jul 2024 11:05:30 +0800 Subject: [PATCH 199/298] =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java | 10 +++++----- .../salary/service/impl/SalaryCalcTaxServiceImpl.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java index 554f98f9d..ff19dd7ec 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java @@ -10,11 +10,6 @@ import lombok.Data; @Data public class SalaryCalcTaxInfoDTO { - /** - * 是否开启智能算薪 - */ - private boolean enableTaxDeclarationApiConfig; - /** * 是否显示计算个税按钮 */ @@ -24,4 +19,9 @@ public class SalaryCalcTaxInfoDTO { * 是否显示获取个税计算反馈按钮 */ private boolean showCalcTaxFeedbackButton; + + /** + * 是否显示核算税后薪资按钮 + */ + private boolean showCalcAfterTaxButton; } diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index 2ee4b657e..ce13407f1 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -98,9 +98,9 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe boolean showCalcTaxFeedbackButton = enableTaxDeclarationApiConfig && CollectionUtils.isNotEmpty(salaryAcctCalcTaxReqs); SalaryCalcTaxInfoDTO salaryCalcTaxInfo = new SalaryCalcTaxInfoDTO(); - salaryCalcTaxInfo.setEnableTaxDeclarationApiConfig(enableTaxDeclarationApiConfig); salaryCalcTaxInfo.setShowCalcTaxButton(showCalcTaxButton); salaryCalcTaxInfo.setShowCalcTaxFeedbackButton(showCalcTaxFeedbackButton); + salaryCalcTaxInfo.setShowCalcAfterTaxButton(showCalcTaxFeedbackButton); return salaryCalcTaxInfo; } From f40d2bec9168bf4043c625f83ce1909bd14fe175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 17 Jul 2024 13:37:39 +0800 Subject: [PATCH 200/298] =?UTF-8?q?=E7=A8=8E=E5=90=8E=E5=B7=A5=E8=B5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryAcctResultServiceImpl.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index ea7a59966..b42c9ce8c 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -973,15 +973,22 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 9、计算薪资项目的运算优先级 List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); - //核算税后逻辑,去除非税后项目 - List afterTaxItems = new ArrayList<>(); - afterTaxItems.add(1695204436147L); - salarySobItemsWithPriority = salarySobItemsWithPriority.stream().filter(afterTaxItems::contains).collect(Collectors.toList()); - //账套中配置的个税字段,不需要系统算 List salarySobTaxRulePOS = getSalarySobTaxRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); List taxIds = SalaryEntityUtil.properties(salarySobTaxRulePOS, SalarySobTaxRulePO::getSalaryItemId, Collectors.toList()); + /** + * 计算税后薪资 + */ + int index = salarySobItemsWithPriority.size() - 1; + for (Long id : taxIds) { + int i = salarySobItemsWithPriority.indexOf(id); + if (i != -1 && i < index) { + index = i; + } + } + salarySobItemsWithPriority = salarySobItemsWithPriority.subList(index, salarySobItemsWithPriority.size()); + // 10、根据id查询其他合并计税的薪资核算记录 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); // 11、查询本次核算人员 @@ -1065,7 +1072,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe return; } // 15、处理核算结果临时表数据 - handleSalaryAfterTaxAcctResultTemp(salaryAcctRecordId, calculateKey, afterTaxItems); + handleSalaryAfterTaxAcctResultTemp(salaryAcctRecordId, calculateKey,salarySobItemsWithPriority); // 16、开始运行校验规则 // SalaryAcctCheckParam salaryAcctCheckParam = new SalaryAcctCheckParam() // .setSalaryAcctRecordId(calculateParam.getSalaryAcctRecordId()) From 89812f45f84df5ca4a8f4b88e75d1cc8195c6592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 22 Jul 2024 14:18:05 +0800 Subject: [PATCH 201/298] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/salarysob/IncomeCategoryEnum.java | 140 ++++++++++++- .../remote/tax/client/DeclareClient.java | 22 +++ .../service/TaxDeclarationValueService.java | 14 ++ .../service/TaxDeclareRecordService.java | 12 ++ .../service/TaxReportColumnService.java | 8 + .../impl/SalaryCalcTaxServiceImpl.java | 2 +- .../impl/TaxDeclarationValueServiceImpl.java | 186 ++++++++++++++++++ .../impl/TaxDeclareRecordServiceImpl.java | 64 ++++++ .../impl/TaxReportColumnServiceImpl.java | 7 + .../salary/web/TaxDeclarationController.java | 94 +++++++++ .../wrapper/TaxDeclareRecordWrapper.java | 27 +++ 11 files changed, 568 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index a0290d408..3dd5eccac 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -4,7 +4,9 @@ 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; @@ -56,6 +58,14 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } + + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) { @Override @@ -86,6 +96,15 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + + }, ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) { @Override @@ -116,6 +135,13 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) { @Override @@ -146,6 +172,13 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) { @Override @@ -175,7 +208,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) { @Override @@ -205,7 +244,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) { @Override @@ -235,7 +280,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) { @Override @@ -266,6 +317,14 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) { @Override @@ -296,6 +355,14 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) { @Override @@ -325,7 +392,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) { @Override @@ -356,6 +429,14 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) { @Override @@ -385,7 +466,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } }, ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) { @@ -417,6 +504,14 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @@ -447,7 +542,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + return result; + } }, NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -477,7 +578,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + return result; + } }, NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -507,6 +614,14 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } + + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + return result; + } }, NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -536,6 +651,14 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } + + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + return result; + } }; @@ -560,6 +683,9 @@ public enum IncomeCategoryEnum implements BaseEnum { public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO); + public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + + @Override public Integer getValue() { return value; diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index 4049eb679..e72fc9007 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -3,8 +3,13 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; +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; @@ -22,6 +27,23 @@ 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 params = new HashMap<>(1); + params.put("requestId", requestId); + Map 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); + } + public CancelDeclareFeedbackResponse cancel(Map requestParam, Map responseParam) { String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE; diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 61feaee0e..f961dbc6f 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -1,15 +1,18 @@ 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; /** * 个税申报表明细 @@ -86,6 +89,17 @@ public interface TaxDeclarationValueService { */ void autoAddWagesDeclare(TaxDeclareRecordPO po); + /** + * 对比 + * @param param + */ + Map contrast(ContrastQueryParam param); + + + /** + * 导出在线对比 + */ + XSSFWorkbook exportContrast(ContrastQueryParam param); /** * 根据主键删除 diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 35b387f7b..75522ca3f 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -2,11 +2,13 @@ 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.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; @@ -131,6 +133,16 @@ public interface TaxDeclareRecordService { void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate); + /** + * 申报内置算税结果查询 + * + * @param id + * @return + */ + Object getDeclareTaxResultFeedback(Long id); + + XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param); + /** * 作废 * diff --git a/src/com/engine/salary/service/TaxReportColumnService.java b/src/com/engine/salary/service/TaxReportColumnService.java index 329cd697e..bed870ffb 100644 --- a/src/com/engine/salary/service/TaxReportColumnService.java +++ b/src/com/engine/salary/service/TaxReportColumnService.java @@ -22,6 +22,14 @@ public interface TaxReportColumnService { */ List listAll(); + + /** + * 根据是否是对比字段查询 + * @param contrastType 1是 0否 + * @return + */ + List listByContrastType(Integer contrastType); + /** * 根据所得项目查询个税申报表表头 * diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index ce13407f1..6d56f2121 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -138,7 +138,7 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe // 查询个税扣缴义务人关联的报税信息 List taxAgentTaxReturns = getTaxAgentTaxReturnService(user).getByTaxAgentIds(taxAgentIds); // 查询个税申报表字段 - List taxReportColumns = getTaxReportColumnService(user).listAll(); + List taxReportColumns = getTaxReportColumnService(user).listByContrastType(0); // 查询薪资核算记录关联薪资账套的个税申报配置 List salarySobTaxReportRules = getSalarySobTaxReportRuleService(user) .listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId())); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index f2e481fd0..950bf1beb 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -343,6 +343,192 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar batchSave(autoAddValuePOs); } + @Override + public Map 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>> onlineDataMap = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); + + Map resultList = new HashMap<>(); + List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); + + // 查询个税申报表表头 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList()); + // 人员id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 查询报送的人员 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 查询人员信息 + List simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询人员薪资(身份证号码等) + List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询外部人员 + List extEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())).map(TaxDeclarationValuePO::getEmployeeId).collect(Collectors.toList()); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); + + // 艾志分权 240529注释 + // List taxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + // Map authMap = getEmployeeDeclareService(user).empIdsByAzGssbAuth(user.getUID()); + // List canManageEmpIds = (List)authMap.get("canManageEmpIds"); + // if (!taxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId())) { + // taxDeclarationValues = taxDeclarationValues.stream().filter(po -> canManageEmpIds.contains(po.getEmployeeId())).collect(Collectors.toList()); + // } + + // 列表数据 + List> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); + + + Map> localMap = new HashMap<>(); + for (Map map : localList) { + String no = map.getOrDefault("证件号码", "").toString(); + localMap.put(no, map); + } + + List> onlineData = onlineDataMap.get(incomeCategoryEnum.getDefaultLabel()); + List heads = onlineData.get(0); + List> data = onlineData.subList(1, onlineData.size()); + List> onlineMap = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + List row = data.get(i); + Map 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> onlineNoMap = new HashMap<>(); + for (Map map : onlineMap) { + String no = map.getOrDefault("证件号码", "").toString(); + onlineNoMap.put(no, map); + } + + List onlyShowColumns = new ArrayList<>(); + List> oneResultList = new ArrayList<>(); + for (Map local : localList) { + AtomicBoolean hasDiff = new AtomicBoolean(false); + Map 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 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 finalOnlyShowColumns = onlyShowColumns.stream().distinct().collect(Collectors.toList()); + List 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 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 table = new SalaryWeaTable(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 contrastMap = contrast(param); + List header = ((List) contrastMap.get("columns")); + PageInfo> pageInfo = (PageInfo>)contrastMap.get("pageInfo"); + List> list = pageInfo.getList(); + + List 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 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 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)); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 25bcdfcaf..c132b8fe5 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -28,6 +28,7 @@ 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.AbnormalEmployeeListQueryParam; +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.po.*; @@ -39,6 +40,7 @@ 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.*; @@ -46,11 +48,13 @@ 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.google.common.collect.ImmutableMap; @@ -59,6 +63,7 @@ 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; @@ -991,6 +996,65 @@ 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>> map = new HashMap<>(); + List 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>> map = new HashMap<>(); + List 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)); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); + // 艾志分权 - 240529注释 + // List taxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + // if (!taxAgentIds.contains(taxDeclareRecord.getTaxAgentId())) { + // Map authMap = getEmployeeDeclareService(user).empIdsByAzGssbAuth(user.getUID()); + // List canManageEmpIds = (List)authMap.get("canManageEmpIds"); + // // 获取这些人在人员信息报送中的证件号码 + // List employeeDeclareList = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); + // List canManageCardNum = employeeDeclareList.stream().filter(declare -> canManageEmpIds.contains(declare.getEmployeeId())).map(EmployeeDeclarePO::getCardNum).collect(Collectors.toList()); + // for (Map.Entry>> entry : map.entrySet()) { + // List> valueList = entry.getValue(); + // List> newvalueList = new ArrayList<>(); + // newvalueList.add(valueList.get(0)); + // for (int i =1; i value = valueList.get(i); + // String cardNum = Util.null2String(value.get(2)); + // if (canManageCardNum.contains(cardNum)) { + // newvalueList.add(value); + // } + // } + // map.put(entry.getKey(), newvalueList); + // } + // } + + return ExcelUtil.genWorkbookV2(map); + } + + @Override public void updateDeclare(Long id, Integer reportType) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); diff --git a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java index 30ebbe9d5..c09510bd8 100644 --- a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -30,6 +30,13 @@ public class TaxReportColumnServiceImpl extends Service implements TaxReportColu return getTaxReportColumnMapper().listAll(); } + @Override + public List listByContrastType(Integer contrastType) { + + return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().contrastType(contrastType).build()); + + } + @Override public List listByIncomeCategory(IncomeCategoryEnum incomeCategory, Integer... contrastTypes) { return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().contrastTypes(Arrays.asList(contrastTypes)).incomeCategory(incomeCategory.getValue().toString()).build()); diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 0dfe7c291..c35e8e70f 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -248,6 +248,100 @@ public class TaxDeclarationController { return new ResponseResult(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(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>(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; + } + } + /** * 作废 diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index a288693c7..563fa0ec4 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -509,6 +509,15 @@ 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); + } + /** * 作废 */ @@ -633,6 +642,24 @@ public class TaxDeclareRecordWrapper extends Service { } + /** + * 对比算税结果 + * + * @param param + */ + public Map contrast(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).contrast(param); + } + + /** + * 导出在线对比 + * + * @param param + * @return + */ + public XSSFWorkbook exportContrast(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).exportContrast(param); + } /** * 刷新数据 From 2a7431c463fc92c3468fdc7c7c1d769632e6f7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 23 Jul 2024 10:14:58 +0800 Subject: [PATCH 202/298] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SzyhApiConstant.java | 16 +- .../enums/salarysob/IncomeCategoryEnum.java | 8 + .../remote/tax/client/DeclareClient.java | 29 +- .../remote/tax/client/TaxBaseClient.java | 41 +- .../declare/GetCompanyIncomesRequest.java | 81 ++++ .../declare/GetCompanyIncomesResponse.java | 456 ++++++++++++++++++ .../impl/TaxDeclarationValueServiceImpl.java | 39 +- .../impl/TaxDeclareRecordServiceImpl.java | 22 - test/ParseTaxApi.java | 4 +- 9 files changed, 639 insertions(+), 57 deletions(-) create mode 100644 src/com/engine/salary/remote/tax/request/declare/GetCompanyIncomesRequest.java create mode 100644 src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 8a7fe765a..15ba4af9b 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -23,7 +23,6 @@ public class SzyhApiConstant { /** * 企业注册接口 */ -// public static final String GET_REGISTER_INFO_URL = "gateway/iit/declare/getCompanyRegisterInfo"; public static final String GET_REGISTER_INFO_URL = "gateway/iit/service/getCompanyRegisterInfo"; /** * 企业注册反馈接口 @@ -33,7 +32,6 @@ public class SzyhApiConstant { /** * 校验密码接口 */ -// public static final String CHECK_PASSWORD_URL = "gateway/iit/check/checkPassword"; public static final String CHECK_PASSWORD_URL = "gateway/iit/service/check/checkPassword"; /** * 校验密码反馈接口 @@ -83,7 +81,6 @@ public class SzyhApiConstant { /** * 更正申报 */ -// public static final String UPDATE_DECLARE = "/gateway/iit/report/correct"; public static final String UPDATE_DECLARE = "/gateway/iit/service/correct"; /** @@ -96,6 +93,16 @@ public class SzyhApiConstant { */ public static final String CANCEL_CORRECT = "gateway/iit/report/cancelCorrect"; + /** + * 企业申报数据明细查询 + */ + public static final String GET_COMPANY_INCOMES = "gateway/iit/service/getCompanyIncomes"; + + /** + * 企业申报数据明细查询反馈 + */ + public static final String GET_COMPANY_INCOMES_FEEDBACK = "gateway/iit/service/getCompanyIncomesFeedback"; + /** * 获取流量统计情况 */ @@ -139,7 +146,6 @@ public class SzyhApiConstant { /** * 缴款凭证作废 */ -// public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/payment/cancelWithholdingVoucher"; public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/service/cancelWithholdingVoucher"; /** @@ -151,7 +157,6 @@ public class SzyhApiConstant { /** * 完税证明 */ -// public static final String GET_WITHHELD_VOUCHER = "gateway/iit/payment/getWithheldVoucher"; public static final String GET_WITHHELD_VOUCHER = "gateway/iit/service/getWithheldVoucher"; /** @@ -162,7 +167,6 @@ public class SzyhApiConstant { /** * 查询缴款状态 */ -// public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/service/getSyncWithholdingFeedback"; /** diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 3dd5eccac..65bfa1de2 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -4,6 +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.GetCompanyIncomesResponse; import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.excel.ExcelUtil; @@ -685,6 +686,13 @@ public enum IncomeCategoryEnum implements BaseEnum { public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetCompanyIncomesResponse response){ + List sfmx = response.getBody().getSfmx(); + List> sheetData = ExcelUtil.getExcelSheetData(GetCompanyIncomesResponse.sfmx.class, sfmx); + result.put(this.getDefaultLabel(), sheetData); + return result; + } + @Override public Integer getValue() { diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index e72fc9007..e8f0d36ee 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -3,6 +3,7 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; +import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.util.HttpUtil; import com.engine.salary.util.JsonUtil; @@ -29,9 +30,13 @@ public class DeclareClient extends TaxBaseClient { /** * 申报内置算税结果查询 - * @param requestId· + * + * 已下架 + * + * @param requestId * @return */ + @Deprecated public GetDeclareTaxResultFeedbackResponse getDeclareTaxResultFeedback(String requestId){ // 供应商信息 String url = super.apiConfig.getHost() + "/gateway/iit/report/getDeclareTaxResultFeedback"; @@ -45,6 +50,12 @@ public class DeclareClient extends TaxBaseClient { } + /** + * 作废申报 + * @param requestParam + * @param responseParam + * @return + */ public CancelDeclareFeedbackResponse cancel(Map requestParam, Map responseParam) { String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE; String requestId = request(url, requestParam); @@ -69,4 +80,20 @@ public class DeclareClient extends TaxBaseClient { return response(feedbackUrl, responseParam, UpdateDeclareResponse.class); } + + /** + * 企业申报数据明细 + * @param requestParam + * @return + */ + public GetCompanyIncomesResponse getCompanyIncomes(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_COMPANY_INCOMES; + String requestId = request(url, requestParam); + + String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.GET_COMPANY_INCOMES_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(feedbackUrl, responseParam, GetCompanyIncomesResponse.class); + } + } diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java index b880cc01f..da59e71b1 100644 --- a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -1,10 +1,12 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.constant.SzyhApiConstant; +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.taxpayment.response.BaseResponse; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; import com.engine.salary.remote.tax.response.RequestIdResponse; @@ -15,6 +17,7 @@ import weaver.general.Util; import java.util.HashMap; import java.util.Map; +import java.util.UUID; @Slf4j public class TaxBaseClient { @@ -26,9 +29,14 @@ public class TaxBaseClient { return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); } + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + public Long taxAgentId; public TaxDeclarationApiConfigPO apiConfig; public TaxAgentTaxReturnPO returnPO; + public TaxAgentPO taxAgent; public static final int threshold = 600; @@ -36,13 +44,32 @@ public class TaxBaseClient { this.taxAgentId = taxAgentId; this.apiConfig = getTaxDeclareApiConfigMapper().getOne(); TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); - try { - // 密码解密 - taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); - } catch (Exception e) { - log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); - } +// try { +// // 密码解密 +// taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); +// } catch (Exception e) { +// log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); +// } this.returnPO = taxReturnPO; + this.taxAgent = getTaxAgentMapper().getById(taxAgentId); + } + + public Map initRequestMap() { + Map requestMap = new HashMap<>(); + requestMap.put("bizNo", UUID.randomUUID().toString().replace("-", "")); + requestMap.put("qymc", taxAgent.getName()); + requestMap.put("mmlx", returnPO.getPasswordType()); + requestMap.put("smzh", returnPO.getRealAccount()); + requestMap.put("smmm", returnPO.getPwd()); + requestMap.put("jmsmmm", "1"); + requestMap.put("sbmm", returnPO.getPwd()); + requestMap.put("jmsbmm", "1"); + requestMap.put("djxhid", returnPO.getTaxRegistrationNumber()); + requestMap.put("nsrsbh", returnPO.getTaxCode()); + requestMap.put("areaid", returnPO.getAreaCode()); + requestMap.put("bmbh", returnPO.getDepartmentCode()); + requestMap.put("bmmc", returnPO.getDepartmentName()); + return requestMap; } public String request(String url, Map requestParam) { @@ -70,9 +97,9 @@ public class TaxBaseClient { for (int i = 0; i <= threshold; ++i) { Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, param); - response = JsonUtil.parseBean(res, clazz); //记录接口 taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + response = JsonUtil.parseBean(res, clazz); if (response == null || response.getHead() == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); } diff --git a/src/com/engine/salary/remote/tax/request/declare/GetCompanyIncomesRequest.java b/src/com/engine/salary/remote/tax/request/declare/GetCompanyIncomesRequest.java new file mode 100644 index 000000000..f8912a261 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/declare/GetCompanyIncomesRequest.java @@ -0,0 +1,81 @@ +package com.engine.salary.remote.tax.request.declare; + +import lombok.Data; + +@Data +public class GetCompanyIncomesRequest { + /** + * 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID,建议使用UUID + */ + private String bizNo; + /** + * 企业名称 必填:是 扣缴义务人名称:例如:测试ß科技有限公司 + */ + private String qymc; + /** + * 密码类型 必填:否 0表示申报密码;2表示实名账号实名密码 + */ + private String mmlx; + /** + * 实名账号 必填:条件必填 当mmlx=2时,必填 + */ + private String smzh; + /** + * 实名密码 必填:条件必填 当mmlx=2时,必填 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密,1表示加密 + */ + private String jmsmmm; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 登记序号 必填:条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:条件必填 分部门代报时必传 + */ + private String bmbh; + /** + * 部门名称 必填:否 分部门代报时必传 + */ + private String bmmc; + /** + * 所属期 必填:是 格式YYYYMM年月 + */ + private String skssq; + /** + * 每页的数量 + */ + private Integer pageSize; + /** + * 页码 + */ + private Integer pageNo; + /** + * 报表类型 + *

+ * 1:综合所得; + * 2: 分类所得; + * 3:非居民所得 + * 4: 限售股所得 + */ + private String reportType; + +} diff --git a/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java new file mode 100644 index 000000000..078ac90a5 --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java @@ -0,0 +1,456 @@ +package com.engine.salary.remote.tax.response.declare; + +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.util.excel.ExcelHead; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class GetCompanyIncomesResponse extends BaseResponse { + /** + * 返回数据 + */ + private Body body; + + + /** + * 人员专项附加扣除信息查询结果body + **/ + @Data + public static class Body { + /** + * 明细 + */ + private List sfmx; + + /** + * 合计 + */ + private sfhj sfhj; + + + } + + @Data + public static class sfmx { + /** + * 是否明细申报 是或者否 + */ + private String sfmxsb; + /** + * 纳税人姓名 汇总申报为空 + */ + @SalaryTableColumn(text = "姓名", width = "10%", column = "xm") + @ExcelHead(title = "姓名", dataIndex = "xm") + private String xm; + /** + * 纳税识别号 + */ + private String nsrsbh; + /** + * 证件类型 汇总申报为空 + */ + @SalaryTableColumn(text = "证件类型", width = "10%", column = "zzlx") + @ExcelHead(title = "证件类型", dataIndex = "zzlx") + private String zjlx; + /** + * 证件号码 汇总申报为空 + */ + @SalaryTableColumn(text = "证件号码", width = "10%", column = "zjhm") + @ExcelHead(title = "证件号码", dataIndex = "zjhm") + private String zjhm; + /** + * 非居民个人 1:否 2:是 + */ + private String sffjm; + /** + * 所得项目名称 见所得项目字典 + */ + private String sdxmmc; + /** + * 收入额 + */ + @SalaryTableColumn(text = "本期收入", width = "10%", column = "sre") + @ExcelHead(title = "本期收入", dataIndex = "sre") + private String sre; + /** + * 费用 + */ + private String fy; + /** + * 免税收入 + */ + @SalaryTableColumn(text = "本期免税收入", width = "10%", column = "mssr") + @ExcelHead(title = "本期免税收入", dataIndex = "mssr") + private String mssr; + /** + * 财产原值 + */ + private String ccyz; + /** + * 投资抵扣 + */ + private String tzdk; + /** + * 允许扣除的费用 + */ + private String yxkcsf; + /** + * 减计比例 + */ + private String jjbl; + /** + * 减除费用 + */ + private String jcfy; + /** + * 基本养老保险 + */ + @SalaryTableColumn(text = "基本养老保险费", width = "10%", column = "jbylaobxf") + @ExcelHead(title = "基本养老保险费", dataIndex = "jbylaobxf") + private String jbylaobxf; + /** + * 基本医疗保险费 + */ + @SalaryTableColumn(text = "基本医疗保险费", width = "10%", column = "jbylbxf") + @ExcelHead(title = "基本医疗保险费", dataIndex = "jbylbxf") + private String jbylbxf; + /** + * 失业保险费 + */ + @SalaryTableColumn(text = "失业保险费", width = "10%", column = "sybxf") + @ExcelHead(title = "失业保险费", dataIndex = "sybxf") + private String sybxf; + /** + * 住房公积金 + */ + @SalaryTableColumn(text = "住房公积金", width = "10%", column = "zfgjj") + @ExcelHead(title = "住房公积金", dataIndex = "zfgjj") + private String zfgjj; + /** + * 年金 + */ + @SalaryTableColumn(text = "企业(职业)年金", width = "10%", column = "nj") + @ExcelHead(title = "企业(职业)年金", dataIndex = "nj") + private String nj; + /** + * 商业健康保险 + */ + @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "syjkbx") + @ExcelHead(title = "商业健康保险", dataIndex = "syjkbx") + private String syjkbx; + /** + * 税延养老保险 + */ + @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "syylbx") + @ExcelHead(title = "税延养老保险", dataIndex = "syylbx") + private String syylbx; + /** + * 其它扣除 + */ + @SalaryTableColumn(text = "其他", width = "10%", column = "qt") + @ExcelHead(title = "其他", dataIndex = "qt") + private String qt; + /** + * 准予扣除的捐赠额 + */ + @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "zykcjze") + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "zykcjze") + private String zykcjze; + /** + * 累计收入额 + */ + @SalaryTableColumn(text = "累计收入额", width = "10%", column = "ljsre") + @ExcelHead(title = "累计收入额", dataIndex = "ljsre") + private String ljsre; + /** + * 累计减除费用 + */ + @SalaryTableColumn(text = "累计减除费用", width = "10%", column = "ljjcfy") + @ExcelHead(title = "累计减除费用", dataIndex = "ljjcfy") + private String ljjcfy; + /** + * 累计专项扣除 + */ + @SalaryTableColumn(text = "累计专项扣除", width = "10%", column = "ljzxkc") + @ExcelHead(title = "累计专项扣除", dataIndex = "ljzxkc") + private String ljzxkc; + /** + * 累计子女教育 + */ + @SalaryTableColumn(text = "累计子女教育", width = "10%", column = "ljznjy") + @ExcelHead(title = "累计子女教育", dataIndex = "ljznjy") + private String ljznjy; + /** + * 累计赡养老人 + */ + @SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "ljsylr") + @ExcelHead(title = "累计赡养老人", dataIndex = "ljsylr") + private String ljsylr; + /** + * 累计住房贷款利息 + */ + @SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "ljzfdklx") + @ExcelHead(title = "累计住房贷款利息", dataIndex = "ljzfdklx") + private String ljzfdklx; + /** + * 累计住房租金 + */ + @SalaryTableColumn(text = "累计住房租金", width = "10%", column = "ljzfzj") + @ExcelHead(title = "累计住房租金", dataIndex = "ljzfzj") + private String ljzfzj; + /** + * 累计继续教育 + */ + @SalaryTableColumn(text = "累计继续教育", width = "10%", column = "ljjxjy") + @ExcelHead(title = "累计继续教育", dataIndex = "ljjxjy") + private String ljjxjy; + /** + * 累计3岁以下婴幼儿照护支出 + */ + @SalaryTableColumn(text = "累计3岁以下婴幼儿照护", width = "10%", column = "ljyyezhzc") + @ExcelHead(title = "累计3岁以下婴幼儿照护", dataIndex = "ljyyezhzc") + private String ljyyezhzc; + /** + * 累计其它扣除 + */ + @SalaryTableColumn(text = "累计其他扣除", width = "10%", column = "ljqtkc") + @ExcelHead(title = "累计其他扣除", dataIndex = "ljqtkc") + private String ljqtkc; + /** + * 累计准予扣除的捐赠额 + */ + @SalaryTableColumn(text = "累计准予扣除的捐赠", width = "10%", column = "ljzykcjze") + @ExcelHead(title = "累计准予扣除的捐赠", dataIndex = "ljzykcjze") + private String ljzykcjze; + /** + * 累计个人养老金 + */ + private BigDecimal ljgrylj; + /** + * 应纳税所得额 + */ + @SalaryTableColumn(text = "累计应纳税所得额", width = "10%", column = "ynssde") + @ExcelHead(title = "累计应纳税所得额", dataIndex = "ynssde") + private String ynssde; + /** + * 税率 + */ + @SalaryTableColumn(text = "税率", width = "10%", column = "sl") + @ExcelHead(title = "税率", dataIndex = "sl") + private String sl; + /** + * 协定税率 + */ + private String xdsl; + /** + * 速算扣除数 + */ + @SalaryTableColumn(text = "速算扣除数", width = "10%", column = "sskcs") + @ExcelHead(title = "速算扣除数", dataIndex = "sskcs") + private String sskcs; + /** + * 应纳税额 + */ + @SalaryTableColumn(text = "累计应纳税额", width = "10%", column = "ynse") + @ExcelHead(title = "累计应纳税额", dataIndex = "ynse") + private String ynse; + /** + * 减免税额 + */ + @SalaryTableColumn(text = "累计减免税额", width = "10%", column = "jmse") + @ExcelHead(title = "累计减免税额", dataIndex = "jmse") + private String jmse; + /** + * 已扣缴税额 + */ + @SalaryTableColumn(text = "累计已缴税额", width = "10%", column = "ykjse") + @ExcelHead(title = "累计已缴税额", dataIndex = "ykjse") + private String ykjse; + /** + * 应补退税额 + */ + @SalaryTableColumn(text = "应补(退)税额", width = "10%", column = "ybtse") + @ExcelHead(title = "应补(退)税额", dataIndex = "ybtse") + private String ybtse; + /** + * 备注 + */ + private String bz; + /** + * 分摊年度数 + */ + private Integer ftnds; + /** + * 年减除费用 默认为60000 + */ + private BigDecimal njcfy; + /** + * 应扣缴税额 + */ + private BigDecimal kjse; + /** + * 证券账户号 限售股所得才会返回 + */ + private String zqzhh; + /** + * 股票代码 限售股所得才会返回 + */ + private String gpdm; + /** + * 股票名称 限售股所得才会返回 + */ + private String gpmc; + /** + * 每股计税价格 限售股所得才会返回 + */ + private BigDecimal mgjsjg; + /** + * 转让股数 限售股所得才会返回 + */ + private Integer zrgs; + /** + * 限售股原值 限售股所得才会返回 + */ + private BigDecimal xsgyz; + /** + * 合理税费 限售股所得才会返回 + */ + private BigDecimal hlsf; + /** + * 扣除及减除项目合计 限售股所得才会返回 + */ + private BigDecimal kcjjcxmhj; + + } + + @Data + public static class sfhj { + /** + * 收入额合计 + */ + private String srehj; + /** + * 免税收入合计 + */ + private String mssrhj; + /** + * 财产原值合计 + */ + private String ccyzhj; + /** + * 投资抵扣合计 + */ + private String tzdkhj; + /** + * 允许扣除的税费合计 + */ + private String yxkcsfhj; + /** + * 基本养老保险费合计 + */ + private String jbylaobxfhj; + /** + * 基本医疗保险费合计 + */ + private String jbylbxfhj; + /** + * 失业保险费合计 + */ + private String sybxfhj; + /** + * 住房公积金合计 + */ + private String zfgjjhj; + /** + * 年金合计 + */ + private String njhj; + /** + * 商业健康保险合计 + */ + private String syjkbxhj; + /** + * 税延养老保险合计 + */ + private String syylbxhj; + /** + * 其他扣除合计 + */ + private String qthj; + /** + * 准予扣除的捐赠额合计 + */ + private String zykcjzehj; + /** + * 累计收入额合计 + */ + private String ljsrehj; + /** + * 累计专项扣除合计 + */ + private String ljzxkchj; + /** + * 累计子女教育合计 + */ + private String ljznjyhj; + /** + * 累计赡养老人合计 + */ + private String ljsylrhj; + /** + * 累计住房贷款利息合计 + */ + private String ljzfdklxhj; + /** + * 累计住房租金合计 + */ + private String ljzfzjhj; + /** + * 累计继续教育合计 + */ + private String ljjxjyhj; + /** + * 累计3岁以下婴幼儿照护支出合计 + */ + private String ljyyezhzchj; + /** + * 累计其他扣除合计 + */ + private String ljqtkchj; + /** + * 累计准予扣除的捐赠额合计 + */ + private String ljzykcjzehj; + /** + * 累计个人养老金合计 + */ + private BigDecimal ljgryljhj; + /** + * 应纳税所得额合计 + */ + private String ynssdehj; + /** + * 应纳税额合计 + */ + private String ynsehj; + /** + * 减免税额合计 + */ + private String jmsehj; + /** + * 已扣缴税额合计 + */ + private String ykjsehj; + /** + * 应补退税额合计 + */ + private String ybtsehj; + } + +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 950bf1beb..277e208ab 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -1,13 +1,14 @@ package com.engine.salary.service.impl; import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -31,7 +32,7 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.remote.tax.client.DeclareClient; -import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; import com.engine.salary.service.*; import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; @@ -203,7 +204,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar TaxDeclarationValuePO po = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclarationId(param.getTaxDeclarationId()).taxDeclareRecordId(taxDeclareRecordId).employeeId(param.getEmployeeId()).employeeType(param.getEmployeeType()).resultValue(param.getTaxReportColumnValues()).resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())).createTime(new Date()).updateTime(new Date()).source(SourceEnum.ADD.getValue()).creator((long) user.getUID()).deleteType(0).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); TaxDeclarationValuePO po4log = new TaxDeclarationValuePO(); - BeanUtils.copyProperties(po,po4log); + BeanUtils.copyProperties(po, po4log); encryptUtil.encrypt(po, TaxDeclarationValuePO.class); getTaxDeclarationValueMapper().insertIgnoreNull(po); @@ -217,8 +218,8 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar .replace("{1}", SalaryDateUtil.getFormatYearMonth(declareRecordPO.getTaxCycle())) .replace("{2}", po.getEmployeeId().toString())); loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增人员")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增人员")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增人员")); loggerContext.setNewValues(po4log); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); @@ -252,8 +253,8 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecordPO.getTaxCycle())) .replace("{2}", po.getEmployeeId().toString())); loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "修改个税申报数据")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "修改个税申报数据")); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "修改个税申报数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "修改个税申报数据")); loggerContext.setOldValues(oldPo); loggerContext.setNewValues(po4log); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); @@ -358,15 +359,21 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } 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 requestParam = declareClient.initRequestMap(); + // 税款所属期 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclaration.getTaxCycle())); + requestParam.put("pageSize", 10000); + requestParam.put("pageNo", 1); + requestParam.put("reportType", reportType); + GetCompanyIncomesResponse companyIncomes = declareClient.getCompanyIncomes(requestParam); Map>> onlineDataMap = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, companyIncomes)); Map resultList = new HashMap<>(); List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); @@ -388,14 +395,6 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar List extEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())).map(TaxDeclarationValuePO::getEmployeeId).collect(Collectors.toList()); List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); - // 艾志分权 240529注释 - // List taxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - // Map authMap = getEmployeeDeclareService(user).empIdsByAzGssbAuth(user.getUID()); - // List canManageEmpIds = (List)authMap.get("canManageEmpIds"); - // if (!taxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId())) { - // taxDeclarationValues = taxDeclarationValues.stream().filter(po -> canManageEmpIds.contains(po.getEmployeeId())).collect(Collectors.toList()); - // } - // 列表数据 List> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); @@ -453,6 +452,8 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar onlyShowColumns.add(col); hasDiff.set(true); } + } else if ((StrUtil.isBlank(localValue) && "0.00".equals(onlineValue)) || (StrUtil.isBlank(onlineValue) && "0.00".equals(localValue))) { + //短路 } else { if (!Objects.equals(localValue, onlineValue)) { dto.setDiff(localValue); @@ -509,7 +510,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 获取线下对比结果 Map contrastMap = contrast(param); List header = ((List) contrastMap.get("columns")); - PageInfo> pageInfo = (PageInfo>)contrastMap.get("pageInfo"); + PageInfo> pageInfo = (PageInfo>) contrastMap.get("pageInfo"); List> list = pageInfo.getList(); List empInfoColumns = new ArrayList<>(); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index c132b8fe5..55d8ccb63 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1028,28 +1028,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .filter(incomeCategoryEnum -> incomeCategoryEnum.getReportType().getValue().equals(param.getReportType())) .collect(Collectors.toList()).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); - // 艾志分权 - 240529注释 - // List taxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - // if (!taxAgentIds.contains(taxDeclareRecord.getTaxAgentId())) { - // Map authMap = getEmployeeDeclareService(user).empIdsByAzGssbAuth(user.getUID()); - // List canManageEmpIds = (List)authMap.get("canManageEmpIds"); - // // 获取这些人在人员信息报送中的证件号码 - // List employeeDeclareList = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); - // List canManageCardNum = employeeDeclareList.stream().filter(declare -> canManageEmpIds.contains(declare.getEmployeeId())).map(EmployeeDeclarePO::getCardNum).collect(Collectors.toList()); - // for (Map.Entry>> entry : map.entrySet()) { - // List> valueList = entry.getValue(); - // List> newvalueList = new ArrayList<>(); - // newvalueList.add(valueList.get(0)); - // for (int i =1; i value = valueList.get(i); - // String cardNum = Util.null2String(value.get(2)); - // if (canManageCardNum.contains(cardNum)) { - // newvalueList.add(value); - // } - // } - // map.put(entry.getKey(), newvalueList); - // } - // } return ExcelUtil.genWorkbookV2(map); } diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java index 56bb4a986..716d56807 100644 --- a/test/ParseTaxApi.java +++ b/test/ParseTaxApi.java @@ -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"); } From 88fee4eca0354700662b5b384d745705fe2f0a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 23 Jul 2024 14:47:12 +0800 Subject: [PATCH 203/298] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=AE=97=E7=A8=8E=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ....java => GetCompanyIncomesQueryParam.java} | 4 +- .../enums/salarysob/IncomeCategoryEnum.java | 148 +----------------- .../remote/tax/client/DeclareClient.java | 2 +- .../declare/GetCompanyIncomesResponse.java | 4 +- .../service/TaxDeclareRecordService.java | 9 +- .../impl/TaxDeclarationValueServiceImpl.java | 3 +- .../impl/TaxDeclareRecordServiceImpl.java | 38 +++-- .../salary/web/TaxDeclarationController.java | 22 +-- .../wrapper/TaxDeclareRecordWrapper.java | 10 +- 9 files changed, 56 insertions(+), 184 deletions(-) rename src/com/engine/salary/entity/taxdeclaration/param/{DeclareTaxResultFeedbackQueryParam.java => GetCompanyIncomesQueryParam.java} (87%) diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/GetCompanyIncomesQueryParam.java similarity index 87% rename from src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java rename to src/com/engine/salary/entity/taxdeclaration/param/GetCompanyIncomesQueryParam.java index dbcdfccc8..09af485df 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/GetCompanyIncomesQueryParam.java @@ -12,13 +12,11 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @NoArgsConstructor @AllArgsConstructor -public class DeclareTaxResultFeedbackQueryParam { +public class GetCompanyIncomesQueryParam { @DataCheck(require = true, message = "个税申报记录id不能为空!") Long id; @DataCheck(require = true, message = "申报类型不能为空!") Integer reportType; - - String requestId; } diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 65bfa1de2..d807e5c42 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -5,7 +5,6 @@ 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.GetCompanyIncomesResponse; -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; @@ -18,6 +17,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.*; +import java.util.stream.Collectors; /** * 应税项目 @@ -59,14 +59,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) { @Override @@ -96,16 +88,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } - - }, ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) { @Override @@ -135,14 +117,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) { @Override @@ -172,14 +146,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) { @Override @@ -209,13 +175,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) { @Override @@ -245,13 +204,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) { @Override @@ -281,13 +233,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) { @Override @@ -317,15 +262,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } - }, INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) { @Override @@ -355,15 +291,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } - }, REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) { @Override @@ -393,13 +320,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) { @Override @@ -429,15 +349,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } - }, REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) { @Override @@ -467,16 +378,8 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } }, ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) { - @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { Gson gs = new Gson(); @@ -504,18 +407,8 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); - List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); - result.put(this.getDefaultLabel(), zhsdSheetData); - return result; - } - }, NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { - @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { Gson gs = new Gson(); @@ -543,13 +436,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); - List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); - result.put(this.getDefaultLabel(), sheetData); - return result; - } }, NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -579,13 +465,6 @@ public enum IncomeCategoryEnum implements BaseEnum { } return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); - List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); - result.put(this.getDefaultLabel(), sheetData); - return result; - } }, NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -616,13 +495,6 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); - List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); - result.put(this.getDefaultLabel(), sheetData); - return result; - } }, NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override @@ -653,13 +525,6 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } - @Override - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { - List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); - List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); - result.put(this.getDefaultLabel(), sheetData); - return result; - } }; @@ -683,11 +548,12 @@ public enum IncomeCategoryEnum implements BaseEnum { public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO); - - public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); - - public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetCompanyIncomesResponse response){ - List sfmx = response.getBody().getSfmx(); + public Map>> parseGetCompanyIncomesResponse(Map>> result, GetCompanyIncomesResponse response) { + List sfmx = Optional.ofNullable(response.getBody().getSfmx()) + .orElse(new ArrayList<>()) + .stream() + .filter(mx -> this.getDefaultLabel().equals(mx.getSdxmmc())) + .collect(Collectors.toList()); List> sheetData = ExcelUtil.getExcelSheetData(GetCompanyIncomesResponse.sfmx.class, sfmx); result.put(this.getDefaultLabel(), sheetData); return result; diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index e8f0d36ee..cb9c6cb17 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -29,7 +29,7 @@ public class DeclareClient extends TaxBaseClient { } /** - * 申报内置算税结果查询 + * 查询企业申报数据明细 * * 已下架 * diff --git a/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java index 078ac90a5..779ec3671 100644 --- a/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java +++ b/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java @@ -55,8 +55,8 @@ public class GetCompanyIncomesResponse extends BaseResponse { /** * 证件类型 汇总申报为空 */ - @SalaryTableColumn(text = "证件类型", width = "10%", column = "zzlx") - @ExcelHead(title = "证件类型", dataIndex = "zzlx") + @SalaryTableColumn(text = "证件类型", width = "10%", column = "zjlx") + @ExcelHead(title = "证件类型", dataIndex = "zjlx") private String zjlx; /** * 证件号码 汇总申报为空 diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 75522ca3f..2b15ad623 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -2,7 +2,7 @@ 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.GetCompanyIncomesQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; @@ -134,14 +134,13 @@ public interface TaxDeclareRecordService { /** - * 申报内置算税结果查询 + * 查询企业申报数据明细 * - * @param id * @return */ - Object getDeclareTaxResultFeedback(Long id); + Object getCompanyIncomes(GetCompanyIncomesQueryParam param); - XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param); + XSSFWorkbook exportGetCompanyIncomes(GetCompanyIncomesQueryParam param); /** * 作废 diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 277e208ab..350e0ee20 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -362,7 +362,6 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar //线上数据 DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId()); - // 注册的企业信息-->请求参数 Map requestParam = declareClient.initRequestMap(); // 税款所属期 requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclaration.getTaxCycle())); @@ -373,7 +372,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar Map>> onlineDataMap = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, companyIncomes)); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetCompanyIncomesResponse(onlineDataMap, companyIncomes)); Map resultList = new HashMap<>(); List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 55d8ccb63..f76c8bb25 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -28,7 +28,7 @@ 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.AbnormalEmployeeListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam; +import com.engine.salary.entity.taxdeclaration.param.GetCompanyIncomesQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.*; @@ -48,7 +48,7 @@ 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.remote.tax.response.declare.GetCompanyIncomesResponse; import com.engine.salary.service.*; import com.engine.salary.service.factory.TaxPaymentServiceFactory; import com.engine.salary.util.*; @@ -997,28 +997,38 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe @Override - public Object getDeclareTaxResultFeedback(Long id) { - TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); - TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + public Object getCompanyIncomes(GetCompanyIncomesQueryParam param) { + Long id = param.getId(); + TaxDeclareRecordPO taxDeclareRecord = getById(id); DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); - GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); + Map requestParam = declareClient.initRequestMap(); + // 税款所属期 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + requestParam.put("pageSize", 10000); + requestParam.put("pageNo", 1); + requestParam.put("reportType", param.getReportType()); + GetCompanyIncomesResponse companyIncomes = declareClient.getCompanyIncomes(requestParam); Map>> map = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); - return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetCompanyIncomesResponse(map, companyIncomes)); + return map; } @Override - public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + public XSSFWorkbook exportGetCompanyIncomes(GetCompanyIncomesQueryParam 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 requestParam = declareClient.initRequestMap(); + // 税款所属期 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + requestParam.put("pageSize", 10000); + requestParam.put("pageNo", 1); + requestParam.put("reportType", param.getReportType()); + GetCompanyIncomesResponse companyIncomes = declareClient.getCompanyIncomes(requestParam); Map>> map = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); @@ -1026,8 +1036,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe .map(TaxDeclarationPO::getIncomeCategory) .map(IncomeCategoryEnum::parseByValue) .filter(incomeCategoryEnum -> incomeCategoryEnum.getReportType().getValue().equals(param.getReportType())) - .collect(Collectors.toList()).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); + .collect(Collectors.toList()) + .forEach(e -> e.parseGetCompanyIncomesResponse(map, companyIncomes)); return ExcelUtil.genWorkbookV2(map); } diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index c35e8e70f..07e282152 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -249,33 +249,33 @@ public class TaxDeclarationController { } /** - * 申报内置算税结果查询 + * 查询企业申报数据明细 * * @param * @return */ - @GET - @Path("/getDeclareTaxResultFeedback") + @POST + @Path("/getCompanyIncomes") @Produces(MediaType.APPLICATION_JSON) - public String getDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + public String getCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody GetCompanyIncomesQueryParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareTaxResultFeedback, id); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getCompanyIncomes, param); } /** - * 申报内置算税结果 + * 企业申报数据明细 * * @return */ @POST - @Path("/exportGetDeclareTaxResultFeedback") + @Path("/exportGetCompanyIncomes") @Produces(MediaType.APPLICATION_OCTET_STREAM) - public Response exportGetDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeclareTaxResultFeedbackQueryParam param) { + public Response exportGetCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody GetCompanyIncomesQueryParam param) { try { User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(param); - String fileName = "申报内置算税结果-" + LocalDate.now(); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetCompanyIncomes(param); + String fileName = "企业申报数据明细-" + LocalDate.now(); try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); } catch (UnsupportedEncodingException e) { @@ -289,7 +289,7 @@ public class TaxDeclarationController { 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); + log.error("企业申报数据明细导出异常", e); throw e; } } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 563fa0ec4..25b66bb40 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -509,13 +509,13 @@ public class TaxDeclareRecordWrapper extends Service { } - public Object getDeclareTaxResultFeedback(Long id) { - return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); + public Object getCompanyIncomes(GetCompanyIncomesQueryParam param) { + return getTaxDeclareRecordService(user).getCompanyIncomes(param); } - public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { - return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(param); + public XSSFWorkbook exportGetCompanyIncomes(GetCompanyIncomesQueryParam param) { + return getTaxDeclareRecordService(user).exportGetCompanyIncomes(param); } /** @@ -532,7 +532,7 @@ public class TaxDeclareRecordWrapper extends Service { @Override public void execute() { try { - getTaxDeclareRecordService(user).cancelDeclare(id, param.getReportType(),taxDeclarationRate); + getTaxDeclareRecordService(user).cancelDeclare(id, param.getReportType(), taxDeclarationRate); taxDeclarationRate.setFinish(true); } catch (SalaryRunTimeException e) { taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); From d86c77adb971a50a876319e1c8a940fe8eca4f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 23 Jul 2024 14:57:35 +0800 Subject: [PATCH 204/298] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E5=BA=94=E6=89=A3=E7=BC=B4=E7=A8=8E=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312190103.sql | 4 ---- resource/sqlupgrade/GS/sql202312190103.sql | 4 ---- resource/sqlupgrade/JC/sql202312190103.sql | 4 ---- resource/sqlupgrade/Mysql/sql202312190103.sql | 3 +-- resource/sqlupgrade/Oracle/sql202312190103.sql | 3 --- resource/sqlupgrade/PG/sql202312190103.sql | 3 +-- resource/sqlupgrade/SQLServer/sql202312190103.sql | 3 --- resource/sqlupgrade/ST/sql202312190103.sql | 4 ---- 8 files changed, 2 insertions(+), 26 deletions(-) diff --git a/resource/sqlupgrade/DM/sql202312190103.sql b/resource/sqlupgrade/DM/sql202312190103.sql index 659ca7b6d..3956b4605 100644 --- a/resource/sqlupgrade/DM/sql202312190103.sql +++ b/resource/sqlupgrade/DM/sql202312190103.sql @@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); / -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); -/ - INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); / diff --git a/resource/sqlupgrade/GS/sql202312190103.sql b/resource/sqlupgrade/GS/sql202312190103.sql index 659ca7b6d..3956b4605 100644 --- a/resource/sqlupgrade/GS/sql202312190103.sql +++ b/resource/sqlupgrade/GS/sql202312190103.sql @@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); / -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); -/ - INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); / diff --git a/resource/sqlupgrade/JC/sql202312190103.sql b/resource/sqlupgrade/JC/sql202312190103.sql index 659ca7b6d..3956b4605 100644 --- a/resource/sqlupgrade/JC/sql202312190103.sql +++ b/resource/sqlupgrade/JC/sql202312190103.sql @@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); / -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); -/ - INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); / diff --git a/resource/sqlupgrade/Mysql/sql202312190103.sql b/resource/sqlupgrade/Mysql/sql202312190103.sql index 9cc0240c6..006ea1239 100644 --- a/resource/sqlupgrade/Mysql/sql202312190103.sql +++ b/resource/sqlupgrade/Mysql/sql202312190103.sql @@ -33,8 +33,7 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); + INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); diff --git a/resource/sqlupgrade/Oracle/sql202312190103.sql b/resource/sqlupgrade/Oracle/sql202312190103.sql index 14ad11e18..033891dfd 100644 --- a/resource/sqlupgrade/Oracle/sql202312190103.sql +++ b/resource/sqlupgrade/Oracle/sql202312190103.sql @@ -45,9 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1) / -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1) -/ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1) diff --git a/resource/sqlupgrade/PG/sql202312190103.sql b/resource/sqlupgrade/PG/sql202312190103.sql index f999dbbc3..9f472713c 100644 --- a/resource/sqlupgrade/PG/sql202312190103.sql +++ b/resource/sqlupgrade/PG/sql202312190103.sql @@ -33,8 +33,7 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); + INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); diff --git a/resource/sqlupgrade/SQLServer/sql202312190103.sql b/resource/sqlupgrade/SQLServer/sql202312190103.sql index 1a0cd83fb..d2c020a34 100644 --- a/resource/sqlupgrade/SQLServer/sql202312190103.sql +++ b/resource/sqlupgrade/SQLServer/sql202312190103.sql @@ -45,9 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1) GO -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1) -GO INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1) diff --git a/resource/sqlupgrade/ST/sql202312190103.sql b/resource/sqlupgrade/ST/sql202312190103.sql index 659ca7b6d..3956b4605 100644 --- a/resource/sqlupgrade/ST/sql202312190103.sql +++ b/resource/sqlupgrade/ST/sql202312190103.sql @@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete (805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼƼ˰', 'addUpTaxDeduction', '', NULL, NULL,1); / -INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES -(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼӦ۽˰', 'addUpTaxPayable', '', NULL, NULL,1); -/ - INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES (805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ۼѽ˰', 'addUpAdvanceTax', '', NULL, NULL,1); / From 25d02d61c93f71a7ccf212720630de921b53b82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 31 Jul 2024 13:17:35 +0800 Subject: [PATCH 205/298] =?UTF-8?q?=E4=B8=89=E6=96=B9=E7=BC=B4=E6=AC=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SzyhApiConstant.java | 5 ++++ .../param/TaxPaymentQueryParam.java | 16 ++++++++--- .../remote/tax/client/TaxBaseClient.java | 4 +-- .../impl/SalaryCalcTaxServiceImpl.java | 7 +++++ .../TaxPaymentWithholdingServiceImpl.java | 16 ++++++++--- .../salary/wrapper/SalarySobWrapper.java | 27 ++++++++++--------- 6 files changed, 52 insertions(+), 23 deletions(-) diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 15ba4af9b..7697a206a 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -205,6 +205,11 @@ public class SzyhApiConstant { */ public static final String HANDLING_CODE = "000004"; + /** + * 异步计算任务还未结束 + */ + public static final String TASK_HANDLING_CODE = "100004"; + /** * 企业服务不可用 */ diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index 8e3fbbfef..11d145388 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxpayment.param; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import lombok.AllArgsConstructor; @@ -10,10 +11,12 @@ import java.util.Date; /** * 查询企业三方信息 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

* - * @author chengliming - * @date: 2022-12-06 17:25:28 - */ + * @author qiantao + * @version 1.0 + **/ @Data @NoArgsConstructor @AllArgsConstructor @@ -31,7 +34,7 @@ public class TaxPaymentQueryParam { private Long taxDeclareRecordId; /** - * TaxPaymentServiceTypeEnum + * @see TaxPaymentServiceTypeEnum */ //业务类型") private Integer type; @@ -39,6 +42,11 @@ public class TaxPaymentQueryParam { //三方协议号") private String protocolNumber; + /** + * 缴款帐号 + */ + private String paymentNumber; + //应缴税额") private String taxAmount; diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java index da59e71b1..686676a39 100644 --- a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -105,7 +105,7 @@ public class TaxBaseClient { } // 如果税友返回错误信息 String code = response.getHead().getCode(); - if (SzyhApiConstant.HANDLING_CODE.equals(code)) { + if (SzyhApiConstant.HANDLING_CODE.equals(code) || SzyhApiConstant.TASK_HANDLING_CODE.equals(code)) { //进行中的任务,重试 try { Thread.sleep(6 * 1000); @@ -141,7 +141,7 @@ public class TaxBaseClient { } // 如果税友返回错误信息 String code = response.getHead().getCode(); - if (SzyhApiConstant.HANDLING_CODE.equals(code)) { + if (SzyhApiConstant.HANDLING_CODE.equals(code) || SzyhApiConstant.TASK_HANDLING_CODE.equals(code)) { //进行中的任务,重试 try { Thread.sleep(6 * 1000); diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index 6d56f2121..9e8b9d0e7 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -27,11 +27,13 @@ import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTa import com.engine.salary.service.*; import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; import java.util.*; +@Slf4j public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxService { @@ -231,7 +233,12 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe if (Objects.isNull(feedbackResponse) || Objects.isNull(feedbackResponse.getHead())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); } + if (Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.TASK_HANDLING_CODE)) { + throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); + } if (!Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + log.error("获取个税反馈失败,核算id:{} ,原因:{}", salaryAcctRecord.getId(), feedbackResponse.getHead().getMsg()); + getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId()); throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); } List subSalaryAcctTaxAgents = salaryAcctTaxAgentMap.get(salaryAcctCalcTaxReq.getTaxAgentId()); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 678f125da..64d692f43 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -127,12 +127,20 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService TaxPaymentQueryParam param, TaxDeclarationApiConfigPO apiConfig, Class clazz) { - SalaryAssert.notBlank(param.getProtocolNumber(), SalaryI18nUtil.getI18nLabel(184071, "三方缴费参数错误")); + String protocolNumber = param.getProtocolNumber(); + String paymentNumber = param.getPaymentNumber(); + Integer reportType = param.getReportType(); + String taxAmount = param.getTaxAmount(); + SalaryAssert.notBlank(protocolNumber, SalaryI18nUtil.getI18nLabel(184071, "三方协议号为空")); + SalaryAssert.notBlank(paymentNumber, SalaryI18nUtil.getI18nLabel(184071, "缴款帐号为空")); + SalaryAssert.notNull(reportType, SalaryI18nUtil.getI18nLabel(184071, "报表类型为空")); + SalaryAssert.notBlank(taxAmount, SalaryI18nUtil.getI18nLabel(184071, "应纳税额为空")); String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING; Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); - requestParam.put("sfxyh", param.getProtocolNumber()); -// requestParam.put("ynse", param.getTaxAmount()); -// requestParam.put("sblx", "1"); + requestParam.put("sfxyh", protocolNumber); + requestParam.put("jkzh", paymentNumber); + requestParam.put("bblx", reportType); + requestParam.put("ynse", taxAmount); return postRequest(apiConfig, url, requestParam, clazz); } diff --git a/src/com/engine/salary/wrapper/SalarySobWrapper.java b/src/com/engine/salary/wrapper/SalarySobWrapper.java index 72f9f1518..37b16bfa1 100644 --- a/src/com/engine/salary/wrapper/SalarySobWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobWrapper.java @@ -18,6 +18,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobDefaultBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +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.exception.SalaryRunTimeException; @@ -71,7 +72,6 @@ public class SalarySobWrapper extends Service { } - /** * 薪资账套列表 * @@ -269,18 +269,19 @@ public class SalarySobWrapper extends Service { return taxAgentIds.contains(salarySobPO.getTaxAgentId()) || Objects.isNull(salarySobPO.getTaxAgentId()); } - public List> incomeCategoryList() { - IncomeCategoryEnum[] values = IncomeCategoryEnum.values(); - List> list = new ArrayList<>(values.length); - for (IncomeCategoryEnum value : values) { - Map map = new HashMap(); - 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); - } + public List> incomeCategoryList() { + List> list = new ArrayList<>(); + Arrays.stream(IncomeCategoryEnum.values()) + .filter(incomeCategory -> incomeCategory.getReportType() == DeclareReportTypeEnum.COMPREHENSIVE_INCOME) + .forEach(incomeCategory -> { + Map map = new HashMap(); + map.put("enum", incomeCategory); + map.put("value", incomeCategory.getValue()); + map.put("defaultLabel", incomeCategory.getDefaultLabel()); + map.put("labelId", incomeCategory.getLabelId()); + map.put("reportTypeName", incomeCategory.getReportType().getDefaultLabel()); + list.add(map); + }); return list; } } From c179a9aedf460d6547a99694fc6599ee54bcad21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 31 Jul 2024 16:02:11 +0800 Subject: [PATCH 206/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=97=E7=A8=8E?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/salarysob/IncomeCategoryEnum.java | 39 ++++++++++++++++ .../OnlineCalculateTaxException.java | 15 +++++++ ...ynIndividualIncomeTaxFeedbackResponse.java | 44 +++++++++++++++++-- .../impl/SalaryCalcTaxServiceImpl.java | 21 ++++----- 4 files changed, 103 insertions(+), 16 deletions(-) create mode 100644 src/com/engine/salary/exception/OnlineCalculateTaxException.java diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index d807e5c42..0a38ac78b 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,11 +1,16 @@ package com.engine.salary.enums.salarysob; +import cn.hutool.core.collection.CollectionUtil; +import com.engine.salary.constant.SzyhApiConstant; 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.exception.OnlineCalculateTaxException; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; import com.google.gson.Gson; @@ -34,6 +39,7 @@ public enum IncomeCategoryEnum implements BaseEnum { WAGES_AND_SALARIES(1, "0101", "正常工资薪金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -63,6 +69,7 @@ public enum IncomeCategoryEnum implements BaseEnum { REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -92,6 +99,7 @@ public enum IncomeCategoryEnum implements BaseEnum { ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -121,6 +129,7 @@ public enum IncomeCategoryEnum implements BaseEnum { COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -150,6 +159,7 @@ public enum IncomeCategoryEnum implements BaseEnum { COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -179,6 +189,7 @@ public enum IncomeCategoryEnum implements BaseEnum { INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -208,6 +219,7 @@ public enum IncomeCategoryEnum implements BaseEnum { ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -237,6 +249,7 @@ public enum IncomeCategoryEnum implements BaseEnum { INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -266,6 +279,7 @@ public enum IncomeCategoryEnum implements BaseEnum { INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -295,6 +309,7 @@ public enum IncomeCategoryEnum implements BaseEnum { REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -324,6 +339,7 @@ public enum IncomeCategoryEnum implements BaseEnum { REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -353,6 +369,7 @@ public enum IncomeCategoryEnum implements BaseEnum { REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -382,6 +399,7 @@ public enum IncomeCategoryEnum implements BaseEnum { ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -411,6 +429,7 @@ public enum IncomeCategoryEnum implements BaseEnum { NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -440,6 +459,7 @@ public enum IncomeCategoryEnum implements BaseEnum { NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -469,6 +489,7 @@ public enum IncomeCategoryEnum implements BaseEnum { NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -499,6 +520,7 @@ public enum IncomeCategoryEnum implements BaseEnum { NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); Gson gs = new Gson(); List taxRules = taxRuleDTO.getTaxRules(); @@ -548,6 +570,23 @@ public enum IncomeCategoryEnum implements BaseEnum { public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO); + private static void checkGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse){ + + if (Objects.isNull(feedbackResponse) || Objects.isNull(feedbackResponse.getHead())) { + throw new OnlineCalculateTaxException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); + } + if (Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.TASK_HANDLING_CODE)) { + throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); + } + if (!Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new OnlineCalculateTaxException(feedbackResponse.getHead().getMsg()); + } + List rysbsblb = feedbackResponse.getBody().getRysbsblb(); + if(CollectionUtil.isNotEmpty(rysbsblb)){ + String err = rysbsblb.stream().map(GetASynIndividualIncomeTaxFeedbackResponse.Body.rysbsb::getSbyy).collect(Collectors.joining(";")); + throw new OnlineCalculateTaxException(err); + } + } public Map>> parseGetCompanyIncomesResponse(Map>> result, GetCompanyIncomesResponse response) { List sfmx = Optional.ofNullable(response.getBody().getSfmx()) .orElse(new ArrayList<>()) diff --git a/src/com/engine/salary/exception/OnlineCalculateTaxException.java b/src/com/engine/salary/exception/OnlineCalculateTaxException.java new file mode 100644 index 000000000..3719f0ce5 --- /dev/null +++ b/src/com/engine/salary/exception/OnlineCalculateTaxException.java @@ -0,0 +1,15 @@ +package com.engine.salary.exception; + +public class OnlineCalculateTaxException extends RuntimeException { + public OnlineCalculateTaxException(String message) { + super(message); + } + + public OnlineCalculateTaxException(Throwable cause) { + super(cause); + } + + public OnlineCalculateTaxException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java index 741d0a9d5..ff4fb6484 100644 --- a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -58,10 +58,10 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { // * 限售股所得 必填:是 见限售股所得计算结果 // */ // private xsgsd xsgsd; -// /** -// * 人员申报失败列表 必填:是 参考人员代报结果对象 -// */ -// private rysbsblb rysbsblb; + /** + * 人员申报失败列表 必填:是 参考人员代报结果对象 + */ + private List rysbsblb; @Data @@ -741,6 +741,42 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { } } + @Data + public static class rysbsb { + /** + * 姓名 + */ + 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; + } + /** * 算税失败原因对象 diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java index 9e8b9d0e7..f76d1354a 100644 --- a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -21,6 +21,7 @@ import com.engine.salary.entity.taxdeclaration.response.DeclareTaxResponse; import com.engine.salary.enums.common.SalaryLogOperateTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.exception.OnlineCalculateTaxException; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.remote.tax.client.CalculateClient; import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; @@ -230,17 +231,6 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe 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.TASK_HANDLING_CODE)) { - throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); - } - if (!Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { - log.error("获取个税反馈失败,核算id:{} ,原因:{}", salaryAcctRecord.getId(), feedbackResponse.getHead().getMsg()); - getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId()); - throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); - } List subSalaryAcctTaxAgents = salaryAcctTaxAgentMap.get(salaryAcctCalcTaxReq.getTaxAgentId()); if (CollectionUtils.isEmpty(subSalaryAcctTaxAgents)) { continue; @@ -254,7 +244,14 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe continue; } SalarySobTaxRuleDTO taxRuleDTO = salarySobTaxRuleMap.get(incomeCategoryEnum.getValue().toString()); - Map empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares, taxRuleDTO); + Map empIdResult; + try { + empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares, taxRuleDTO); + } catch (OnlineCalculateTaxException e) { + log.error("获取在线算税结果异常", e); + getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId()); + throw new SalaryRunTimeException(e.getMessage()); + } List subSalaryAcctEmployees = salaryAcctEmployeeMap.get(salaryAcctTaxAgent.getTaxAgentId() + "-" + salaryAcctTaxAgent.getIncomeCategory()); if (CollectionUtils.isEmpty(subSalaryAcctEmployees)) { continue; From 1ede3736385e61649d23c8c0d3030a1e24a2e58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 1 Aug 2024 11:43:26 +0800 Subject: [PATCH 207/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=94=99=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/salarysob/IncomeCategoryEnum.java | 33 ++++++++++--------- .../remote/tax/client/CalculateClient.java | 2 +- .../impl/AddUpDeductionServiceImpl.java | 2 +- .../impl/TaxPaymentAgreementServiceImpl.java | 2 +- .../TaxPaymentWithholdingServiceImpl.java | 2 +- ...xPaymentWithholdingVoucherServiceImpl.java | 2 +- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 0a38ac78b..37fabaaa6 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -570,23 +570,24 @@ public enum IncomeCategoryEnum implements BaseEnum { public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO); - private static void checkGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse){ + private static void checkGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse) { + + if (Objects.isNull(feedbackResponse) || Objects.isNull(feedbackResponse.getHead())) { + throw new OnlineCalculateTaxException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); + } + if (Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.HANDLING_CODE) || Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.TASK_HANDLING_CODE)) { + throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); + } + if (!Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new OnlineCalculateTaxException(feedbackResponse.getHead().getMsg()); + } + List rysbsblb = feedbackResponse.getBody().getRysbsblb(); + if (CollectionUtil.isNotEmpty(rysbsblb)) { + String err = rysbsblb.stream().map(GetASynIndividualIncomeTaxFeedbackResponse.Body.rysbsb::getSbyy).collect(Collectors.joining(";")); + throw new OnlineCalculateTaxException(err); + } + } - if (Objects.isNull(feedbackResponse) || Objects.isNull(feedbackResponse.getHead())) { - throw new OnlineCalculateTaxException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); - } - if (Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.TASK_HANDLING_CODE)) { - throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); - } - if (!Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { - throw new OnlineCalculateTaxException(feedbackResponse.getHead().getMsg()); - } - List rysbsblb = feedbackResponse.getBody().getRysbsblb(); - if(CollectionUtil.isNotEmpty(rysbsblb)){ - String err = rysbsblb.stream().map(GetASynIndividualIncomeTaxFeedbackResponse.Body.rysbsb::getSbyy).collect(Collectors.joining(";")); - throw new OnlineCalculateTaxException(err); - } - } public Map>> parseGetCompanyIncomesResponse(Map>> result, GetCompanyIncomesResponse response) { List sfmx = Optional.ofNullable(response.getBody().getSfmx()) .orElse(new ArrayList<>()) diff --git a/src/com/engine/salary/remote/tax/client/CalculateClient.java b/src/com/engine/salary/remote/tax/client/CalculateClient.java index 4a120a015..0cfa8e933 100644 --- a/src/com/engine/salary/remote/tax/client/CalculateClient.java +++ b/src/com/engine/salary/remote/tax/client/CalculateClient.java @@ -26,7 +26,7 @@ public class CalculateClient extends TaxBaseClient{ String res = HttpUtil.getRequest(url, header, params); TaskUtil taskUtil = new TaskUtil(); taskUtil.writeApiTaskRecord(requestId, url, requestId, res); - log.info("getDeclareTaxResultFeedback res --- {}", res); + log.info("getASynIndividualIncomeTaxFeedback res --- {}", res); return JsonUtil.parseObject(res, GetASynIndividualIncomeTaxFeedbackResponse.class); } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 6343bd692..785939385 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1678,7 +1678,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction // 校验请求结果 String responseCode = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); String msg = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); - if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { // 如果接口仍在处理中,则继续轮询 return AddUpDeductionRequestResultDTO.builder().finish(false).build(); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java index 5b140dd83..e0cd2bb00 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -39,7 +39,7 @@ public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { String responseCode = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); String msg = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); TaxAgreementFormDTO agreementFormDTO = new TaxAgreementFormDTO(); - if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { // 如果接口仍在处理中,则继续轮询 return agreementFormDTO.setFinish(false); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 64d692f43..66b458146 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -45,7 +45,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService // 校验请求结果 String responseCode = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); String msg = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); - if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { // 如果接口仍在处理中,则继续轮询 throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缴款还在处理中,请稍后点击缴款反馈")); } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 6eaabba46..18d10a4ec 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -49,7 +49,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS // 校验请求结果 String responseCode = Optional.ofNullable(feedbackResponse).map(WithholdingVoucherFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); String msg = Optional.ofNullable(feedbackResponse).map(WithholdingVoucherFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); - if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) { + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { // 如果接口仍在处理中,则继续轮询 throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缴款还在处理中,请稍后点击缴款反馈")); } From 549edeeecb1fa8ffcca5fbf9f4dd82583da12a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 8 Aug 2024 11:52:10 +0800 Subject: [PATCH 208/298] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/EmployeeDeclareServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 3acec12b8..643d210ca 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -43,9 +43,6 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; -import com.engine.salary.remote.tax.client.EmployeeClient; -import com.engine.salary.remote.tax.request.employee.BatchInvalidSubmissionRequest; -import com.engine.salary.remote.tax.request.employee.InformationChangeRequest; import com.engine.salary.service.*; import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; @@ -477,7 +474,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()) //只需要正常的 .stream() - .filter(e ->Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) + .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) .collect(Collectors.toList()); // 查询个税扣缴义务人 TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId()); @@ -608,6 +605,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla Map params = new HashMap<>(1); Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("发起人员报送:{} 反馈{}", reqJson, res); DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class); if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) { log.error("服务异常:" + res); From 48687f8e65d49e0a5ff0372c9019e3e5b5b18ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 9 Aug 2024 16:19:56 +0800 Subject: [PATCH 209/298] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/TaxPaymentAgreementServiceImpl.java | 1 + .../salary/service/impl/TaxPaymentWithholdingServiceImpl.java | 3 ++- .../service/impl/TaxPaymentWithholdingVoucherServiceImpl.java | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java index e0cd2bb00..ca76573f1 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -95,6 +95,7 @@ public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { String url = apiConfig.getHost() + SzyhApiConstant.GET_AGREEMENT_QUERY_FEEDBACK; String res = getRequest(apiConfig, requestId, url); + log.info("getAgreementQueryFeedback:requestId {} res {} ", requestId, res); return JsonUtil.parseObject(res, AgreementQueryFeedbackResponse.class); } } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 66b458146..2d85f020c 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -45,7 +45,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService // 校验请求结果 String responseCode = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); String msg = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); - if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode) || SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { // 如果接口仍在处理中,则继续轮询 throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缴款还在处理中,请稍后点击缴款反馈")); } @@ -183,6 +183,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING_FEEDBACK; String res = getRequest(apiConfig, requestId, url); + log.info("getWithholdingFeedback:requestId {} res {} ", requestId, res); return JsonUtil.parseObject(res, WithholdingFeedbackResponse.class); } } diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 18d10a4ec..dda4b4f06 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -181,6 +181,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { String url = apiConfig.getHost() + SzyhApiConstant.WITHHOLDING_VOUCHER_FEEDBACK; String res = getRequest(apiConfig, requestId, url); + log.info("getWithholdingVoucherFeedback:requestId {} res {} ", requestId, res); return JsonUtil.parseObject(res, WithholdingVoucherFeedbackResponse.class); } } From ae72e8234a7c5dbe0bcbf8053256dd1dcf8d0eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 23 Aug 2024 10:12:33 +0800 Subject: [PATCH 210/298] =?UTF-8?q?fix=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalarySobServiceImpl.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 46dc5829c..69660704f 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -12,12 +12,11 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; -import com.engine.salary.entity.salarysob.bo.*; -import com.engine.salary.entity.salarysob.config.SalarySobConfig; import com.engine.salary.entity.salarysob.bo.SalarySobBackItemBO; import com.engine.salary.entity.salarysob.bo.SalarySobCycleBO; import com.engine.salary.entity.salarysob.bo.SalarySobDuplicateBO; import com.engine.salary.entity.salarysob.bo.SalarySobItemBO; +import com.engine.salary.entity.salarysob.config.SalarySobConfig; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.param.*; import com.engine.salary.entity.salarysob.po.*; @@ -152,14 +151,6 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user); } - private SalarySobItemService getSalarySobItemService(User user) { - return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); - } - - private SalaryFormulaService getSalaryFormulaService(User user) { - return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); - } - private SalarySobBackItemService getSalarySobBackItemService(User user) { return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); } From 30027dca36998c2b7d56886b77bb87954eb5ff82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 23 Aug 2024 10:22:34 +0800 Subject: [PATCH 211/298] =?UTF-8?q?=E5=8E=BB=E9=99=A4oracle=20sql=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/Oracle/sql202312270703.sql | 2 +- resource/sqlupgrade/Oracle/sql202403193303.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/sqlupgrade/Oracle/sql202312270703.sql b/resource/sqlupgrade/Oracle/sql202312270703.sql index e2477f553..817e4ba00 100644 --- a/resource/sqlupgrade/Oracle/sql202312270703.sql +++ b/resource/sqlupgrade/Oracle/sql202312270703.sql @@ -1,2 +1,2 @@ -update hrsa_tax_declaration_value set source = 0; +update hrsa_tax_declaration_value set source = 0 / \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202403193303.sql b/resource/sqlupgrade/Oracle/sql202403193303.sql index d8a365183..e12698cbc 100644 --- a/resource/sqlupgrade/Oracle/sql202403193303.sql +++ b/resource/sqlupgrade/Oracle/sql202403193303.sql @@ -4,7 +4,7 @@ birthplace varchar2(255) NULL , tax_reasons varchar2(255) NULL , entry_date date NULL , departure_date date NULL -); +) / update hrsa_employee_declare set nationality = 'й' where nationality is null From cfa5d2840c206c489640a8bcfb296163211b70fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 26 Aug 2024 16:57:21 +0800 Subject: [PATCH 212/298] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/salarysob/IncomeCategoryEnum.java | 121 ++++++++++++++++++ .../remote/tax/client/DeclareClient.java | 2 - .../impl/TaxDeclarationValueServiceImpl.java | 17 +-- 3 files changed, 127 insertions(+), 13 deletions(-) diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 37fabaaa6..5e38bb298 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -9,6 +9,7 @@ import com.engine.salary.exception.OnlineCalculateTaxException; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.excel.ExcelUtil; @@ -37,6 +38,14 @@ public enum IncomeCategoryEnum implements BaseEnum { // todo 多语言 WAGES_AND_SALARIES(1, "0101", "正常工资薪金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) { + + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -67,6 +76,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -97,6 +113,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -127,6 +150,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -157,6 +187,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -187,6 +224,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -217,6 +261,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -247,6 +298,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -277,6 +335,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -307,6 +372,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -337,6 +409,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -367,6 +446,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -397,6 +483,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -427,6 +520,12 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -457,6 +556,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -487,6 +593,13 @@ public enum IncomeCategoryEnum implements BaseEnum { } }, NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } + @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -518,6 +631,12 @@ public enum IncomeCategoryEnum implements BaseEnum { }, NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } @Override public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); @@ -568,6 +687,8 @@ public enum IncomeCategoryEnum implements BaseEnum { this.labelId = labelId; } + public abstract void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO); private static void checkGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse) { diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index cb9c6cb17..28cb0c92d 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -31,12 +31,10 @@ public class DeclareClient extends TaxBaseClient { /** * 查询企业申报数据明细 * - * 已下架 * * @param requestId * @return */ - @Deprecated public GetDeclareTaxResultFeedbackResponse getDeclareTaxResultFeedback(String requestId){ // 供应商信息 String url = super.apiConfig.getHost() + "/gateway/iit/report/getDeclareTaxResultFeedback"; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index 350e0ee20..f680c228c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -32,7 +32,7 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.remote.tax.client.DeclareClient; -import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.service.*; import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; @@ -344,10 +344,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar batchSave(autoAddValuePOs); } + @Override public Map contrast(ContrastQueryParam param) { - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); if (taxDeclaration == null) { throw new SalaryRunTimeException("无申报表"); @@ -359,20 +359,15 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar } Integer reportType = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType().getValue(); + TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(taxDeclareRecordPO.getId(), reportType); //线上数据 DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId()); - Map requestParam = declareClient.initRequestMap(); - // 税款所属期 - requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclaration.getTaxCycle())); - requestParam.put("pageSize", 10000); - requestParam.put("pageNo", 1); - requestParam.put("reportType", reportType); - GetCompanyIncomesResponse companyIncomes = declareClient.getCompanyIncomes(requestParam); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareStatus.getDeclareRequestId()); Map>> onlineDataMap = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetCompanyIncomesResponse(onlineDataMap, companyIncomes)); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); Map resultList = new HashMap<>(); List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); @@ -509,7 +504,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 获取线下对比结果 Map contrastMap = contrast(param); List header = ((List) contrastMap.get("columns")); - PageInfo> pageInfo = (PageInfo>) contrastMap.get("pageInfo"); + PageInfo> pageInfo = (PageInfo>)contrastMap.get("pageInfo"); List> list = pageInfo.getList(); List empInfoColumns = new ArrayList<>(); From b56cc59cde9a778db8a3ab7212eb0d00aa8a54bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 28 Aug 2024 10:44:29 +0800 Subject: [PATCH 213/298] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E7=AE=97=E7=A8=8E=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeclareTaxResultFeedbackQueryParam.java | 24 +++++++++++ .../service/TaxDeclareRecordService.java | 12 ++++++ .../impl/TaxDeclareRecordServiceImpl.java | 40 +++++++++++++++++-- .../salary/web/TaxDeclarationController.java | 32 +++++++++++++++ .../wrapper/TaxDeclareRecordWrapper.java | 9 +++++ 5 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java new file mode 100644 index 000000000..dbcdfccc8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class DeclareTaxResultFeedbackQueryParam { + + @DataCheck(require = true, message = "个税申报记录id不能为空!") + Long id; + + @DataCheck(require = true, message = "申报类型不能为空!") + Integer reportType; + + String requestId; +} diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 2b15ad623..0309c65a3 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -2,6 +2,7 @@ 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.GetCompanyIncomesQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; @@ -142,6 +143,17 @@ public interface TaxDeclareRecordService { XSSFWorkbook exportGetCompanyIncomes(GetCompanyIncomesQueryParam param); + /** + * 申报内置算税结果查询 + * + * @param id + * @return + */ + Object getDeclareTaxResultFeedback(Long id); + + XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param); + + /** * 作废 * diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index f76c8bb25..bb77848ad 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -27,10 +27,7 @@ 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.AbnormalEmployeeListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.GetCompanyIncomesQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; +import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.entity.taxdeclaration.po.*; import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; @@ -49,6 +46,7 @@ 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.GetCompanyIncomesResponse; +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.*; @@ -1042,6 +1040,40 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return ExcelUtil.genWorkbookV2(map); } + @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>> map = new HashMap<>(); + List 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>> map = new HashMap<>(); + List 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) { diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 07e282152..ef45368c9 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -294,6 +294,38 @@ public class TaxDeclarationController { } } + /** + * 申报内置算税结果 + * + * @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; + } + } + /** * 对比算税过程 * diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 25b66bb40..8b127dddd 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -518,6 +518,15 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclareRecordService(user).exportGetCompanyIncomes(param); } + public Object getDeclareTaxResultFeedback(Long id) { + return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); + } + + + public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(param); + } + /** * 作废 */ From e44ba034f7639be34e09a04247f230c198bc3e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 2 Sep 2024 11:09:35 +0800 Subject: [PATCH 214/298] =?UTF-8?q?oracle=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sqlupgrade/Oracle/sql202309050203.sql | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 resource/sqlupgrade/Oracle/sql202309050203.sql diff --git a/resource/sqlupgrade/Oracle/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql new file mode 100644 index 000000000..3caa7ac50 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202309050203.sql @@ -0,0 +1,23 @@ +alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255) +/ +alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255) +/ +alter table hrsa_add_up_situation add tax_adjustment varchar2(255) +/ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5) +/ +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6) +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, 'ǰۼƼ˰ϼ', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{нĿ.£Σ˰}+{ۼ.ۼƼ˰}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) +/ +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '£Σ˰', 1693896072589, 'salaryItem_taxDeduction', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) +/ +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, 'ۼƼ˰', 1693896072589, 'addUpSituation_addUpTaxSavings', '{ۼ.ۼƼ˰}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) +/ + +update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658 +/ + +update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658 +/ \ No newline at end of file From 80dce4add77905d91ba17aa416fc08be89a5fb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 15 Oct 2024 14:56:52 +0800 Subject: [PATCH 215/298] =?UTF-8?q?fix=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java index fd4f4e0f4..3a60d3b75 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java @@ -69,6 +69,5 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { private String workcode; - private List taxAgentIds; private Set salaryMonths; } From 47329fbcb96d948e7aa87014a7cba628aab86b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 18 Oct 2024 14:58:10 +0800 Subject: [PATCH 216/298] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9?= =?UTF-8?q?=E9=99=84=E5=8A=A0=E6=89=A3=E9=99=A4=E5=9C=A8=E7=BA=BF=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/AddUpDeductionMonthTaxAgentParam.java | 3 +++ .../service/impl/AddUpDeductionServiceImpl.java | 4 ++-- .../impl/SalaryAcctResultServiceImpl.java | 17 ----------------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java index b22d0fd84..e09c0a7e1 100644 --- a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * 数据采集-累计专项附加月份+扣缴主体参数 @@ -24,4 +25,6 @@ public class AddUpDeductionMonthTaxAgentParam { @ApiModelProperty("个税扣缴义务人的主键id") private Long taxAgentId; + @ApiModelProperty("个税扣缴义务人的主键id") + private List taxAgentIds; } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 785939385..1f8efff29 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1368,7 +1368,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction // 获取包装类 AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, apiConfig); // 获取报税信息 - List taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(requestWrapper.getTaxAgentMap().keySet()); + List taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(param.getTaxAgentIds()); List failReturnPOList = taxReturnPOList.stream().filter(e -> !TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(e.getCheckStatus())).collect(Collectors.toList()); SalaryAssert.isFalse(taxReturnPOList.size() == failReturnPOList.size(), SalaryI18nUtil.getI18nLabel(183781, "企业未通过验证,暂时无法获取累计专项附加扣除数据,请先在【个税扣缴义务人】菜单验证企业报税信息")); Map result = new HashMap<>(1); @@ -1680,7 +1680,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction String msg = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { // 如果接口仍在处理中,则继续轮询 - return AddUpDeductionRequestResultDTO.builder().finish(false).build(); + return AddUpDeductionRequestResultDTO.builder().finish(false).msg(msg).build(); } // 获取返回的人员信息列表 if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 134522648..4a834df1a 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -1035,21 +1035,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(103378, "薪资核算人员不能为空")); } - //核算锁定值 - List lockSalaryItemIds = salaryAcctRecordPO.getLockSalaryItemIds(); - Map acctResults = new HashMap<>(); - if (CollUtil.isNotEmpty(lockSalaryItemIds)) { - List acctResultPOS = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singleton(salaryAcctRecordId), lockSalaryItemIds); - acctResults = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().filter(po -> lockSalaryItemIds.contains(po.getSalaryItemId())).collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a)); - } - List lockEmpIds = salaryAcctEmployeePOS.stream().filter(po -> LockStatusEnum.LOCK.getValue().equals(po.getLockStatus())).map(SalaryAcctEmployeePO::getId).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(lockEmpIds)) { - List acctResultPOS = listBySalaryAcctEmployeeIds(lockEmpIds); - Map acctResultMaps = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a)); - acctResults.putAll(acctResultMaps); - } - - // 11.1、初始化进度 ProgressDTO initProgress = new ProgressDTO().setTitle(SalaryI18nUtil.getI18nLabel(97515, "核算中")).setTitleLabelId(97515L).setTotalQuantity(salaryAcctEmployeePOS.size() * 2 + 1).setCalculatedQuantity(0).setProgress(BigDecimal.ZERO).setStatus(true).setMessage(StringUtils.EMPTY); getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, initProgress); @@ -1070,8 +1055,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe .setSalarySobPO(salarySobPO) .setSalarySobCycleDTO(salarySobCycleDTO) .setOtherSalaryAcctRecordPOS(otherSalaryAcctRecordPOS) - .setSalaryAcctLockResultPOS(MapUtils.emptyIfNull(acctResults)) - .setLockSalaryItemIds(lockSalaryItemIds) .setSalarySobItemPOS(salarySobItemPOS) .setSalaryItemIdWithPriorityList(salarySobItemsWithPriority) .setExpressFormulas(expressFormulas) From e694d53eea0131351db8903bdc6bc1685233ca70 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 22 Oct 2024 17:32:00 +0800 Subject: [PATCH 217/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=89=88=E6=9C=AC=20?= =?UTF-8?q?=E6=B5=AE=E5=8A=A8=E8=96=AA=E9=85=ACbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalaryAcctResultServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index ed1db9bed..7e6dbb7af 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -1000,6 +1000,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe Map welfareColumns = getSIAccountService(user).welfareColumns(); // 7、查询考勤引用的所有字段 List attendQuoteFieldListDTOS = getAttendQuoteFieldService(user).listAll(); + List variableItemPOS = getVariableItemService(user).listAll(); // 8、查询公式详情 Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); @@ -1067,6 +1068,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe .setChildMonitor(childMonitor) .setResults(calculateResults) .setCalculateKey(calculateKey) + .setVariableItems(variableItemPOS) .setTaxDeclarationFunction(taxDeclarationFunction) .setTaxIds(taxIds); List finalSalarySobBackItems = salarySobBackItems; From 8cf9688862d1ec12fb437b9da61139b1d8b210a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 23 Oct 2024 15:14:18 +0800 Subject: [PATCH 218/298] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=A4=B1=E8=B4=A5=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TaxPaymentAgreementServiceImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java index ca76573f1..b27e4e6b4 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.taxpayment.dto.TaxAgreementBankFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxAgreementFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; import com.engine.salary.entity.taxpayment.response.AgreementQueryFeedbackResponse; import com.engine.salary.entity.taxpayment.response.BaseResponse; import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; @@ -39,13 +40,17 @@ public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { String responseCode = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); String msg = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); TaxAgreementFormDTO agreementFormDTO = new TaxAgreementFormDTO(); - if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode) || SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { // 如果接口仍在处理中,则继续轮询 return agreementFormDTO.setFinish(false); } // 获取返回的人员信息列表 if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { log.error("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + TaxPaymentRequestPO taxPaymentRequestPO = getTaxPaymentRequestPO(param); + if (taxPaymentRequestPO != null && taxPaymentRequestPO.getId() != null) { + getTaxPaymentRequestMapper().delete(taxPaymentRequestPO); + } throw new SalaryRunTimeException(msg); } List feedbacks = Optional.of(feedbackResponse) @@ -54,6 +59,10 @@ public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { .orElse(new ArrayList<>()); if (feedbacks.isEmpty()) { log.error("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + TaxPaymentRequestPO taxPaymentRequestPO = getTaxPaymentRequestPO(param); + if (taxPaymentRequestPO != null && taxPaymentRequestPO.getId() != null) { + getTaxPaymentRequestMapper().delete(taxPaymentRequestPO); + } throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); } // 更新缴款请求为已反馈 From b3c2047a3d4478a748a35d2092c0f4083493e3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 19 Nov 2024 15:07:42 +0800 Subject: [PATCH 219/298] =?UTF-8?q?=E6=B8=AF=E6=BE=B3=E9=80=9A=E8=A1=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java index 4b0af0325..6fb7bee15 100644 --- a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -16,7 +16,8 @@ import java.util.Objects; public enum CardTypeEnum implements BaseEnum { RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564), - FOREIGN_PASSPORT(1, "外国护照", 105564); + FOREIGN_PASSPORT(1, "外国护照", 105564), + HM_PASSPORT(2, "港澳居民来往内地通行证", 105564); CardTypeEnum(int value, String defaultLabel, int labelId) { this.value = value; From 199fe67374234aab6784f0f6349ec1303b04e3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 19 Nov 2024 16:44:08 +0800 Subject: [PATCH 220/298] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=B8=AF=E6=BE=B3?= =?UTF-8?q?=E5=8F=B0=E9=80=9A=E8=A1=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/EmployeeDeclareRefresh.java | 11 ++++++ .../salaryacct/bo/SalaryCalcTaxRequest.java | 2 +- .../enums/employeedeclare/CardTypeEnum.java | 3 +- .../salary/util/valid/SalaryCardUtil.java | 39 ++++++++++++++++++- .../wrapper/EmployeeDeclareWrapper.java | 3 +- 5 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index 484103c3a..72191b404 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -105,7 +105,18 @@ public class EmployeeDeclareRefresh { String idNum = hrmEmployeeComInfo.getIdNo() != null ? hrmEmployeeComInfo.getIdNo().toUpperCase() : ""; CardTypeEnum cardType = CardTypeEnum.RESIDENT_IDENTITY_CARDS; if (!SalaryCardUtil.checkIdNum(idNum)) { + //默认外国护照 cardType = CardTypeEnum.FOREIGN_PASSPORT; + + //港澳通行证 + if (SalaryCardUtil.checkHMPassportIdNum(idNum)) { + cardType = CardTypeEnum.HM_PASSPORT; + } + + //台湾通行证 + if (SalaryCardUtil.checkTPassportIdNum(idNum)) { + cardType = CardTypeEnum.T_PASSPORT; + } } EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), employeeId); employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java index 69c78a14c..7e836152a 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java @@ -233,7 +233,7 @@ public class SalaryCalcTaxRequest { // 姓名 requestParam.put("xm", employeeDeclare.getEmployeeName()); // 证件类型 - requestParam.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + requestParam.put("zzlx", CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()); // 证件号码 requestParam.put("zzhm", employeeDeclare.getCardNum()); // 所得项目 diff --git a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java index 6fb7bee15..095d3b155 100644 --- a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -17,7 +17,8 @@ public enum CardTypeEnum implements BaseEnum { RESIDENT_IDENTITY_CARDS(0, "居民身份证", 105564), FOREIGN_PASSPORT(1, "外国护照", 105564), - HM_PASSPORT(2, "港澳居民来往内地通行证", 105564); + HM_PASSPORT(2, "港澳居民来往内地通行证", 105564), + T_PASSPORT(3, "台湾居民来往大陆通行证", 105564); CardTypeEnum(int value, String defaultLabel, int labelId) { this.value = value; diff --git a/src/com/engine/salary/util/valid/SalaryCardUtil.java b/src/com/engine/salary/util/valid/SalaryCardUtil.java index d0dc2bf9e..fbd76bc2e 100644 --- a/src/com/engine/salary/util/valid/SalaryCardUtil.java +++ b/src/com/engine/salary/util/valid/SalaryCardUtil.java @@ -133,7 +133,6 @@ public class SalaryCardUtil { return validate18Idcard(idcard); } return false; - } /** @@ -471,4 +470,42 @@ public class SalaryCardUtil { } return a; } + + /** + * 验证港澳通行证 + * + * @param idcard + * 身份证 + * @return 合法返回true,否则返回false + */ + public static boolean checkHMPassportIdNum(String idcard) { + + if (idcard == null || "".equals(idcard)) { + return false; + } + + if (idcard.length() == 9) { + return true; + } + + return false; + } + + /** + * 验证台湾通行证 + * @param idcard + * @return + */ + public static boolean checkTPassportIdNum(String idcard) { + + if (idcard == null || "".equals(idcard)) { + return false; + } + + if (idcard.length() == 8) { + return true; + } + + return false; + } } diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index cdfe83d18..fca9ed934 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -98,9 +98,8 @@ public class EmployeeDeclareWrapper extends Service { taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList()); } // 分页 - List taxAgentPOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), taxAgents); List dtoList = Lists.newArrayList(); - for (TaxAgentPO taxAgent : taxAgentPOS) { + for (TaxAgentPO taxAgent : taxAgents) { TaxAgentDeclareListDTO dto = new TaxAgentDeclareListDTO().setId(taxAgent.getId()).setTaxAgentName(taxAgent.getName()); dtoList.add(dto); } From b373f062c7ce335978f10314b4f6d8de825e63b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 11 Dec 2024 11:07:36 +0800 Subject: [PATCH 221/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/wrapper/SalaryCommonWrapper.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java index 93265ca9f..7a961cb35 100644 --- a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java @@ -5,8 +5,6 @@ import com.engine.core.impl.Service; import com.engine.salary.entity.browser.dto.BrowserDataDTO; import com.engine.salary.entity.browser.param.BrowserDataQueryParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; -import com.engine.salary.entity.setting.param.PageListSettingQueryParam; -import com.engine.salary.entity.setting.param.PageListSettingSaveParam; import com.engine.salary.entity.setting.dto.PageListTemplateDTO; import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO; import com.engine.salary.entity.setting.param.*; @@ -16,17 +14,13 @@ import com.engine.salary.service.SalarySobItemService; import com.engine.salary.service.SettingService; import com.engine.salary.service.impl.SalaryCacheServiceImpl; import com.engine.salary.service.impl.SalarySobItemServiceImpl; +import com.engine.salary.service.impl.SettingServiceImpl; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import org.apache.commons.lang3.StringUtils; -import com.engine.salary.service.impl.SettingServiceImpl; -import com.engine.salary.util.page.PageInfo; import weaver.hrm.User; -import java.util.List; -import java.util.Map; - import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -73,9 +67,6 @@ public class SalaryCommonWrapper extends Service { return null; } - - public void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam) { - getSettingService(user).savePageListSetting(pageListSettingSaveParam); public void savePageListSetting(PageListSettingSaveParam param) { getSettingService(user).savePageListSetting(param); } @@ -91,7 +82,7 @@ public class SalaryCommonWrapper extends Service { public PageListTemplateDetailDTO getPageListTemplate(PageListTemplateQueryParam param) { - return getSettingService(user).getPageListTemplate(param); + return getSettingService(user).getPageListTemplate(param); } public List getPageListTemplates(PageListTemplateQueryParam param) { @@ -107,7 +98,7 @@ public class SalaryCommonWrapper extends Service { } public void deletePageListTemplate(PageListTemplateDeleteParam param) { - getSettingService(user).deletePageListTemplate(param); + getSettingService(user).deletePageListTemplate(param); } public void changePageListTemplate(PageListTemplateChangeParam param) { From 8c83e8ed6cf92a71e123f7ca0572a4005a5d4a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 16 Dec 2024 17:48:03 +0800 Subject: [PATCH 222/298] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=8D=E7=A8=8E?= =?UTF-8?q?=E6=94=B6=E5=85=A5=E3=80=81=E5=95=86=E4=B8=9A=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E4=BF=9D=E9=99=A9=E3=80=81=E7=A8=8E=E5=BB=B6=E5=85=BB=E8=80=81?= =?UTF-8?q?=E4=BF=9D=E9=99=A9=E3=80=81=E5=87=86=E4=BA=88=E6=89=A3=E9=99=A4?= =?UTF-8?q?=E7=9A=84=E6=8D=90=E8=B5=A0=E9=A2=9D=E3=80=81=E5=87=8F=E5=85=8D?= =?UTF-8?q?=E7=A8=8E=E9=A2=9D=E3=80=81=E5=85=B6=E4=BB=96=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202412160303.sql | 122 +++++ resource/sqlupgrade/DM/sql202412160403.sql | 18 + resource/sqlupgrade/GS/sql202412160303.sql | 122 +++++ resource/sqlupgrade/GS/sql202412160403.sql | 18 + resource/sqlupgrade/JC/sql202412160303.sql | 122 +++++ resource/sqlupgrade/JC/sql202412160403.sql | 18 + resource/sqlupgrade/Mysql/sql202412160303.sql | 132 ++++++ resource/sqlupgrade/Mysql/sql202412160403.sql | 12 + .../sqlupgrade/Oracle/sql202412160303.sql | 127 ++++++ .../sqlupgrade/Oracle/sql202412160403.sql | 12 + resource/sqlupgrade/PG/sql202412160303.sql | 125 ++++++ resource/sqlupgrade/PG/sql202412160403.sql | 12 + .../sqlupgrade/SQLServer/sql202412160303.sql | 126 ++++++ .../sqlupgrade/SQLServer/sql202412160403.sql | 12 + resource/sqlupgrade/ST/sql202412160303.sql | 122 +++++ resource/sqlupgrade/ST/sql202412160403.sql | 18 + .../dto/OtherDeductionRecordDTO.java | 1 + .../datacollection/po/DerateDeductionPO.java | 77 ++++ .../po/EndowmentInsurancePO.java | 86 ++++ .../datacollection/po/FreeIncomePO.java | 75 ++++ .../datacollection/po/GrantDonationPO.java | 87 ++++ .../datacollection/po/HealthInsurancePO.java | 81 ++++ .../datacollection/po/OtherDeductionPO.java | 17 + .../po/OtherDerateDeductionPO.java | 74 ++++ .../datacollection/po/PersonalPensionPO.java | 92 ++++ .../bo/TaxDeclarationRequest.java | 2 + .../EnumDeductionDataSource.java | 70 +++ .../EndowmentInsuranceMapper.java | 73 +++ .../EndowmentInsuranceMapper.xml | 360 +++++++++++++++ .../datacollection/FreeIncomeMapper.java | 72 +++ .../datacollection/FreeIncomeMapper.xml | 315 +++++++++++++ .../datacollection/GrantDonationMapper.java | 73 +++ .../datacollection/GrantDonationMapper.xml | 375 ++++++++++++++++ .../datacollection/HealthInsuranceMapper.java | 73 +++ .../datacollection/HealthInsuranceMapper.xml | 345 +++++++++++++++ .../OtherDerateDeductionMapper.java | 79 ++++ .../OtherDerateDeductionMapper.xml | 417 ++++++++++++++++++ 37 files changed, 3962 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202412160303.sql create mode 100644 resource/sqlupgrade/DM/sql202412160403.sql create mode 100644 resource/sqlupgrade/GS/sql202412160303.sql create mode 100644 resource/sqlupgrade/GS/sql202412160403.sql create mode 100644 resource/sqlupgrade/JC/sql202412160303.sql create mode 100644 resource/sqlupgrade/JC/sql202412160403.sql create mode 100644 resource/sqlupgrade/Mysql/sql202412160303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202412160403.sql create mode 100644 resource/sqlupgrade/Oracle/sql202412160303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202412160403.sql create mode 100644 resource/sqlupgrade/PG/sql202412160303.sql create mode 100644 resource/sqlupgrade/PG/sql202412160403.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202412160303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202412160403.sql create mode 100644 resource/sqlupgrade/ST/sql202412160303.sql create mode 100644 resource/sqlupgrade/ST/sql202412160403.sql create mode 100644 src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java create mode 100644 src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java create mode 100644 src/com/engine/salary/enums/datacollection/EnumDeductionDataSource.java create mode 100644 src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml create mode 100644 src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml create mode 100644 src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml create mode 100644 src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml create mode 100644 src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml diff --git a/resource/sqlupgrade/DM/sql202412160303.sql b/resource/sqlupgrade/DM/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202412160403.sql b/resource/sqlupgrade/DM/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/resource/sqlupgrade/GS/sql202412160303.sql b/resource/sqlupgrade/GS/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202412160403.sql b/resource/sqlupgrade/GS/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/resource/sqlupgrade/JC/sql202412160303.sql b/resource/sqlupgrade/JC/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202412160403.sql b/resource/sqlupgrade/JC/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202412160303.sql b/resource/sqlupgrade/Mysql/sql202412160303.sql new file mode 100644 index 000000000..c10d7fee8 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412160303.sql @@ -0,0 +1,132 @@ +create table hrsa_other_derate_deduction +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + main_id bigint comment 'id' , + tax_year_month date comment '˰' , + employee_id bigint comment 'Աid' , + tax_agent_id bigint comment '˰۽id' , + file_status int comment '鵵״̬ 0δ鵵 1ѹ鵵' , + other_deduction varchar(50) comment '˰' , + remark varchar(255) comment 'ע' +) +; + + +create table hrsa_health_insurance +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + main_id bigint comment 'id' , + tax_year_month date comment '˰' , + employee_id bigint comment 'Աid' , + tax_agent_id bigint comment '˰۽id' , + file_status int comment '鵵״̬ 0δ鵵 1ѹ鵵' , + identification_number varchar(255) comment '˰ʶ' , + effective_date date comment 'Ч' , + year_premium varchar(50) comment 'ȱ' , + month_premium varchar(50) comment '¶ȱ' , + current_deduction varchar(50) comment 'ڿ۳' +) +; + + +create table hrsa_grant_donation +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + main_id bigint comment 'id' , + tax_year_month date comment '˰' , + employee_id bigint comment 'Աid' , + tax_agent_id bigint comment '˰۽id' , + file_status int comment '鵵״̬ 0δ鵵 1ѹ鵵' , + recipient_name varchar(255) comment 'λ' , + tax_code varchar(255) comment 'λ˰ʶ' , + donation_number varchar(255) comment 'ƾ֤' , + donate_date date comment '' , + donate_amount varchar(50) comment '' , + deduction_proportion varchar(10) comment '۳' , + actual_deduction varchar(50) comment 'ʵʿ۳' +) +; + + + +create table hrsa_endowment_insurance +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + main_id bigint comment 'id' , + tax_year_month date comment '˰' , + employee_id bigint comment 'Աid' , + tax_agent_id bigint comment '˰۽id' , + file_status int comment '鵵״̬ 0δ鵵 1ѹ鵵' , + account_number varchar(255) comment '˰˻' , + check_code varchar(255) comment '˰У' , + year_premium varchar(50) comment 'ȱ' , + month_premium varchar(50) comment '¶ȱ' , + current_deduction varchar(50) comment 'ڿ۳' , + deduction_month date comment '۳·' +) +; + + +create table hrsa_derate_deduction +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + main_id bigint comment 'id' , + tax_year_month date comment '˰' , + employee_id bigint comment 'Աid' , + tax_agent_id bigint comment '˰۽id' , + file_status int comment '鵵״̬ 0δ鵵 1ѹ鵵' , + derate_item varchar(255) comment '' , + derate_property varchar(255) comment '' , + derate_amount varchar(255) comment '˰' +) +; + + + +create table hrsa_free_income +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + main_id bigint comment 'id' , + tax_year_month date comment '˰' , + employee_id bigint comment 'Աid' , + tax_agent_id bigint comment '˰۽id' , + file_status int comment '鵵״̬ 0δ鵵 1ѹ鵵' , + free_item varchar(255) comment '˰' , + free_property varchar(255) comment '˰' , + free_amount varchar(255) comment '˰' +) +; + + + + diff --git a/resource/sqlupgrade/Mysql/sql202412160403.sql b/resource/sqlupgrade/Mysql/sql202412160403.sql new file mode 100644 index 000000000..601430556 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int +; +alter table hrsa_endowment_insurance add employee_type int +; +alter table hrsa_free_income add employee_type int +; +alter table hrsa_grant_donation add employee_type int +; +alter table hrsa_health_insurance add employee_type int +; +alter table hrsa_other_derate_deduction add employee_type int +; diff --git a/resource/sqlupgrade/Oracle/sql202412160303.sql b/resource/sqlupgrade/Oracle/sql202412160303.sql new file mode 100644 index 000000000..e5f509f83 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412160303.sql @@ -0,0 +1,127 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +) +/ + + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +) +/ + + + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +) +/ + + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +) +/ + + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +) +/ + + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412160403.sql b/resource/sqlupgrade/Oracle/sql202412160403.sql new file mode 100644 index 000000000..b17420382 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int +/ +alter table hrsa_endowment_insurance add employee_type int +/ +alter table hrsa_free_income add employee_type int +/ +alter table hrsa_grant_donation add employee_type int +/ +alter table hrsa_health_insurance add employee_type int +/ +alter table hrsa_other_derate_deduction add employee_type int +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412160303.sql b/resource/sqlupgrade/PG/sql202412160303.sql new file mode 100644 index 000000000..214e842a1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412160303.sql @@ -0,0 +1,125 @@ +create table hrsa_other_derate_deduction +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + other_deduction varchar(50), + remark varchar(255) +); +/ + +create table hrsa_health_insurance +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + identification_number varchar(255), + effective_date date, + year_premium varchar(50), + month_premium varchar(50), + current_deduction varchar(50) +); +/ + + +create table hrsa_grant_donation +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + recipient_name varchar(255), + tax_code varchar(255), + donation_number varchar(255), + donate_date date, + donate_amount varchar(50), + deduction_proportion varchar(10), + actual_deduction varchar(50) +); +/ + + +create table hrsa_endowment_insurance +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + account_number varchar(255), + check_code varchar(255), + year_premium varchar(50), + month_premium varchar(50), + current_deduction varchar(50), + deduction_month date +); +/ + + +create table hrsa_derate_deduction +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + derate_item varchar(255), + derate_property varchar(255), + derate_amount varchar(255) +); +/ + + +create table hrsa_free_income +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + free_item varchar(255), + free_property varchar(255), + free_amount varchar(255) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412160403.sql b/resource/sqlupgrade/PG/sql202412160403.sql new file mode 100644 index 000000000..89d123c70 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int; +/ +alter table hrsa_endowment_insurance add employee_type int; +/ +alter table hrsa_free_income add employee_type int; +/ +alter table hrsa_grant_donation add employee_type int; +/ +alter table hrsa_health_insurance add employee_type int; +/ +alter table hrsa_other_derate_deduction add employee_type int; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412160303.sql b/resource/sqlupgrade/SQLServer/sql202412160303.sql new file mode 100644 index 000000000..de7f1091f --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412160303.sql @@ -0,0 +1,126 @@ +create table hrsa_other_derate_deduction +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + other_deduction nvarchar(50), + remark nvarchar(255) +) +GO + + +create table hrsa_health_insurance +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + identification_number nvarchar(255), + effective_date datetime, + year_premium nvarchar(50), + month_premium nvarchar(50), + current_deduction nvarchar(50) +) +GO + + +create table hrsa_grant_donation +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + recipient_name nvarchar(255), + tax_code nvarchar(255), + donation_number nvarchar(255), + donate_date datetime, + donate_amount nvarchar(50), + deduction_proportion nvarchar(10), + actual_deduction nvarchar(50) +) +GO + + +create table hrsa_endowment_insurance +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + account_number nvarchar(255), + check_code nvarchar(255), + year_premium nvarchar(50), + month_premium nvarchar(50), + current_deduction nvarchar(50), + deduction_month datetime +) +GO + + +create table hrsa_derate_deduction +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + derate_item nvarchar(255), + derate_property nvarchar(255), + derate_amount nvarchar(255) +) +GO + + +create table hrsa_free_income +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + free_item nvarchar(255), + free_property nvarchar(255), + free_amount nvarchar(255) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412160403.sql b/resource/sqlupgrade/SQLServer/sql202412160403.sql new file mode 100644 index 000000000..1ebced6cb --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int +GO +alter table hrsa_endowment_insurance add employee_type int +GO +alter table hrsa_free_income add employee_type int +GO +alter table hrsa_grant_donation add employee_type int +GO +alter table hrsa_health_insurance add employee_type int +GO +alter table hrsa_other_derate_deduction add employee_type int +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202412160303.sql b/resource/sqlupgrade/ST/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202412160403.sql b/resource/sqlupgrade/ST/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java index 5cdbec166..4bb115d7a 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java @@ -47,6 +47,7 @@ public class OtherDeductionRecordDTO { @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") private String taxAgentName; + /** * 个税扣缴义务人id */ diff --git a/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java new file mode 100644 index 000000000..d27f93e59 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java @@ -0,0 +1,77 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-减免税额 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("其他免税扣除-减免税额") +//hrsa_derate_deduction +@ElogTransform(name = "其他免税扣除-减免税额") +public class DerateDeductionPO{ + @ElogTransform(name = "主键id") + private Long id; + + @ElogTransform(name = "主表数据Id") + private Long mainId; + + @ElogTransform(name = "税款所属期") + private Date taxYearMonth; + + @ElogTransform(name = "人员") + private Long employeeId; + + @ElogTransform(name = "个税扣缴义务人") + private Long taxAgentId; + + @ElogTransform(name = "减免事项") + private String derateItem; + + @ElogTransform(name = "减免性质") + private String derateProperty; + + @ElogTransform(name = "减免金额") + private String derateAmount; + + @ElogTransform(name = "归档状态 0未归档 1已归档") + private Integer fileStatus; + + /** + * 人员类型 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "人员类型") + private Integer employeeType; + + @ElogTransform(name = "创建时间", ignore = true) + private Date createTime; + + @ElogTransform(name = "更新时间", ignore = true) + private Date updateTime; + + @ElogTransform(name = "创建人", ignore = true) + private Long creator; + + @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java new file mode 100644 index 000000000..1688dbcf9 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java @@ -0,0 +1,86 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-税延养老保险 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_endowment_insurance") +@ElogTransform(name = "其他免税扣除-税延养老保险") +public class EndowmentInsurancePO { + + @ElogTransform(name = "主键") + private Long id; + + @ElogTransform(name = "主表数据Id") + private Long mainId; + + @ElogTransform(name = "税款所属期") + private Date taxYearMonth; + + @ElogTransform(name = "人员id") + private Long employeeId; + + @ElogTransform(name = "个税扣缴义务人ID") + private Long taxAgentId; + + @ElogTransform(name = "申报扣除月份") + private Date deductionMonth; + + @ElogTransform(name = "税延养老账户编号") + private String accountNumber; + + @ElogTransform(name = "报税校验码") + private String checkCode; + + @ElogTransform(name = "年度保费") + private String yearPremium; + + @ElogTransform(name = "月度保费") + private String monthPremium; + + @ElogTransform(name = "本期扣除金额") + private String currentDeduction; + + @ElogTransform(name = "归档状态 0未归档 1已归档") + private Integer fileStatus; + + /** + * 人员类型 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "人员类型") + private Integer employeeType; + + @ElogTransform(name = "创建时间", ignore = true) + private Date createTime; + + @ElogTransform(name = "更新时间", ignore = true) + private Date updateTime; + + @ElogTransform(name = "创建人", ignore = true) + private Long creator; + + @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java new file mode 100644 index 000000000..59aa0afd6 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java @@ -0,0 +1,75 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-免税收入表单 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_free_income +@ElogTransform(name = "其他免税扣除-免税收入") +public class FreeIncomePO { + @ElogTransform(name = "主键id") + private Long id; + + @ElogTransform(name = "主表数据Id") + private Long mainId; + + @ElogTransform(name = "税款所属期") + private Date taxYearMonth; + + @ElogTransform(name = "人员") + private Long employeeId; + + @ElogTransform(name = "个税扣缴义务人") + private Long taxAgentId; + + @ElogTransform(name = "免税事项") + private String freeItem; + + @ElogTransform(name = "免税性质") + private String freeProperty; + + @ElogTransform(name = "免税金额") + private String freeAmount; + + @ElogTransform(name = "归档状态 0未归档 1已归档") + private Integer fileStatus; + + /** + * 人员类型 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "人员类型") + private Integer employeeType; + + @ElogTransform(name = "创建时间", ignore = true) + private Date createTime; + + @ElogTransform(name = "更新时间", ignore = true) + private Date updateTime; + + @ElogTransform(name = "创建人", ignore = true) + private Long creator; + + @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java new file mode 100644 index 000000000..d85239da4 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java @@ -0,0 +1,87 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-准予扣除的捐赠额 + * + * @author chengliming + * @date 2023-06-09 15:03:45 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_grant_donation") +@ElogTransform(name = "其他免税扣除-准予扣除的捐赠额") +public class GrantDonationPO { + @ElogTransform(name = "主键id") + private Long id; + + @ElogTransform(name = "主表数据Id") + private Long mainId; + + @ElogTransform(name = "税款所属期") + private Date taxYearMonth; + + @ElogTransform(name = "人员") + private Long employeeId; + + @ElogTransform(name = "个税扣缴义务人") + private Long taxAgentId; + + @ElogTransform(name = "受赠单位名称") + private String recipientName; + + @ElogTransform(name = "受赠单位纳税人识别号") + private String taxCode; + + @ElogTransform(name = "捐赠凭证号") + private String donationNumber; + + @ElogTransform(name = "捐赠日期") + private Date donateDate; + + @ElogTransform(name = "捐赠金额") + private String donateAmount; + + @ElogTransform(name = "扣除比例") + private String deductionProportion; + + @ElogTransform(name = "实际扣除金额") + private String actualDeduction; + + @ElogTransform(name = "归档状态 0未归档 1已归档") + private Integer fileStatus; + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "人员类型") + private Integer employeeType; + + @ElogTransform(name = "创建时间", ignore = true) + private Date createTime; + + @ElogTransform(name = "更新时间", ignore = true) + private Date updateTime; + + @ElogTransform(name = "创建人", ignore = true) + private Long creator; + + @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java new file mode 100644 index 000000000..c27dc5061 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java @@ -0,0 +1,81 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-商业健康保险表单 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_health_insurance") +@ElogTransform(name = "其他免税扣除-商业健康保险表单") +public class HealthInsurancePO { + @ElogTransform(name = "主键id") + private Long id; + + @ElogTransform(name = "主表数据Id") + private Long mainId; + + @ElogTransform(name = "税款所属期") + private Date taxYearMonth; + + @ElogTransform(name = "人员") + private Long employeeId; + + @ElogTransform(name = "个税扣缴义务人") + private Long taxAgentId; + + @ElogTransform(name = "税优识别码") + private String identificationNumber; + + @ElogTransform(name = "保单生效日期") + private Date effectiveDate; + + @ElogTransform(name = "年度保费") + private String yearPremium; + + @ElogTransform(name = "月度保费") + private String monthPremium; + + @ElogTransform(name = "本期扣除金额") + private String currentDeduction; + + @ElogTransform(name = "归档状态 0未归档 1已归档") + private Integer fileStatus; + + /** + * 人员类型 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "人员类型") + private Integer employeeType; + + @ElogTransform(name = "创建时间", ignore = true) + private Date createTime; + + @ElogTransform(name = "更新时间", ignore = true) + private Date updateTime; + + @ElogTransform(name = "创建人", ignore = true) + private Long creator; + + @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index 83f1ec932..a3af82274 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -46,6 +46,15 @@ public class OtherDeductionPO { @ElogTransform( name ="税款所属期") private Date declareMonth; + /** + * 免税收入 + */ + @ElogTransform(name = "免税收入") + @SalaryFormulaVar(defaultLabel = "免税收入", labelId = 91238, dataType = "number") + @Encrypt + private String freeIncome; + + /** * 商业健康保险 */ @@ -62,6 +71,14 @@ public class OtherDeductionPO { @Encrypt private String taxDelayEndowmentInsurance; + /** + * 减免税额 + */ + @ElogTransform(name = "减免税额") + @SalaryFormulaVar(defaultLabel = "减免税额", labelId = 102810, dataType = "number") + @Encrypt + private String derateDeduction; + /** * 其他 */ diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java new file mode 100644 index 000000000..0dbcd99e6 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -0,0 +1,74 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 其他免税扣除-减免税额 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_other_derate_deduction +@ElogTransform(name = "其他免税扣除-减免税额") +public class OtherDerateDeductionPO { + @ElogTransform(name = "主键id") + private Long id; + + @ElogTransform(name = "主表数据Id") + private Long mainId; + + @ElogTransform(name = "税款所属期") + private Date taxYearMonth; + + @ElogTransform(name = "人员") + private Long employeeId; + + @ElogTransform(name = "个税扣缴义务人") + private Long taxAgentId; + + @ElogTransform(name = "减免税额") + private String otherDeduction; + + @ElogTransform(name = "备注") + private String remark; + + @ElogTransform(name = "归档状态 0未归档 1已归档") + private Integer fileStatus; + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "人员类型") + private Integer employeeType; + + @ElogTransform(name = "创建时间", ignore = true) + private LocalDateTime createTime; + + @ElogTransform(name = "更新时间", ignore = true) + private LocalDateTime updateTime; + + @ElogTransform(name = "创建人", ignore = true) + private Long creator; + + @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java new file mode 100644 index 000000000..6af983b1f --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java @@ -0,0 +1,92 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-个人养老金 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_personal_pension") +@ElogTransform(name = "其他免税扣除-个人养老金") +public class PersonalPensionPO{ + + @ElogTransform(name = "主键id") + private Long id; + + @ElogTransform(name = "主表数据Id") + private Long mainId; + + @ElogTransform(name = "税款所属期") + private Date taxYearMonth; + + @ElogTransform(name = "缴费月度") + private Date payMonth; + + @ElogTransform(name = "人员") + private Long employeeId; + + @ElogTransform(name = "个税扣缴义务人") + private Long taxAgentId; + + @ElogTransform(name = "凭证类别") + private Integer voucherType; + + @ElogTransform(name = "凭证类别名称") + private String voucherTypeName; + + @ElogTransform(name = "凭证编码") + private String voucherNo; + + @ElogTransform(name = "缴费金额") + private String payAmount; + + @ElogTransform(name = "归档状态 0未归档 1已归档") + private Integer fileStatus; + + /** + * 人员类型 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "人员类型") + private Integer employeeType; + + /** + * @see EnumDeductionDataSource + */ + @ElogTransform(name = "数据来源") + private Integer dataSource; + + @ElogTransform(name = "采集来源") + private String collectSource; + + @ElogTransform(name = "创建时间", ignore = true) + private Date createTime; + + @ElogTransform(name = "更新时间", ignore = true) + private Date updateTime; + + @ElogTransform(name = "创建人", ignore = true) + private Long creator; + + @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "租户key", ignore = true) + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index b64ac8b12..5c2c82770 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -126,6 +126,8 @@ public class TaxDeclarationRequest { List> employeeRequestParams = listRequestParam.computeIfAbsent("txq", k -> Lists.newArrayList()); employeeRequestParams.add(employeeRequestParam); } + // 其他免税扣除附表 +// buildOtherDeductionDetailParams(taxFreeMap, listRequestParam, employeeDeclare, incomeCategoryEnum, employeeRequestParam); } } diff --git a/src/com/engine/salary/enums/datacollection/EnumDeductionDataSource.java b/src/com/engine/salary/enums/datacollection/EnumDeductionDataSource.java new file mode 100644 index 000000000..cbec3e616 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/EnumDeductionDataSource.java @@ -0,0 +1,70 @@ +package com.engine.salary.enums.datacollection; + +import java.util.HashMap; +import java.util.Map; + + +/** + * 各类专项扣除数据来源 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum EnumDeductionDataSource { + /** + * 人工输入 + */ + MANUAL(1, "人工输入", 153339), + /** + * 在线获取 + */ + ONLINE(2, "在线获取", 153340), + /** + * 自动计算 + */ + AUTO_CALC(3, "自动计算", 233727), + ; + + private int value; + + private String defaultLabel; + + private int labelId; + + EnumDeductionDataSource(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private static final Map VALUE_NAME_MAP; + + static { + final EnumDeductionDataSource[] values = EnumDeductionDataSource.values(); + VALUE_NAME_MAP = new HashMap<>(values.length); + for (EnumDeductionDataSource value : values) { + VALUE_NAME_MAP.put(value.getValue(), value); + } + } + + public Integer getValue() { + return value; + } + + public Integer getLabelId() { + return labelId; + } + + public static EnumDeductionDataSource parseByValue(Integer index) { + if (index == null) { + return null; + } + return VALUE_NAME_MAP.get(index); + } + + public String getDefaultLabel() { + return defaultLabel; + } +} diff --git a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java new file mode 100644 index 000000000..a045a9ee2 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.EndowmentInsurancePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface EndowmentInsuranceMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(EndowmentInsurancePO endowmentInsurance); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + EndowmentInsurancePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param endowmentInsurance 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(EndowmentInsurancePO endowmentInsurance); + + + /** + * 修改,修改所有字段 + * + * @param endowmentInsurance 修改的记录 + * @return 返回影响行数 + */ + int update(EndowmentInsurancePO endowmentInsurance); + + /** + * 修改,忽略null字段 + * + * @param endowmentInsurance 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(EndowmentInsurancePO endowmentInsurance); + + /** + * 删除记录 + * + * @param endowmentInsurance 待删除的记录 + * @return 返回影响行数 + */ + int delete(EndowmentInsurancePO endowmentInsurance); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml new file mode 100644 index 000000000..277843ea4 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + account_number + , t.check_code + , t.create_time + , t.creator + , t.current_deduction + , t.deduction_month + , t.delete_type + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.month_premium + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.year_premium + + + + + + + + + + + + + + + INSERT INTO hrsa_endowment_insurance + + + + account_number, + + + check_code, + + + create_time, + + + creator, + + + current_deduction, + + + deduction_month, + + + delete_type, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + month_premium, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + year_premium, + + + + + #{accountNumber}, + + + #{checkCode}, + + + #{createTime}, + + + #{creator}, + + + #{currentDeduction}, + + + #{deductionMonth}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{monthPremium}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{yearPremium}, + + + + + + + + UPDATE hrsa_endowment_insurance + + account_number=#{accountNumber}, + check_code=#{checkCode}, + create_time=#{createTime}, + creator=#{creator}, + current_deduction=#{currentDeduction}, + deduction_month=#{deductionMonth}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + month_premium=#{monthPremium}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year_premium=#{yearPremium}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_endowment_insurance + + + account_number=#{accountNumber}, + + + check_code=#{checkCode}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + current_deduction=#{currentDeduction}, + + + deduction_month=#{deductionMonth}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + month_premium=#{monthPremium}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year_premium=#{yearPremium}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_endowment_insurance + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_endowment_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java new file mode 100644 index 000000000..1c7489927 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java @@ -0,0 +1,72 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.FreeIncomePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface FreeIncomeMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(FreeIncomePO freeIncome); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + FreeIncomePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param freeIncome 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(FreeIncomePO freeIncome); + + /** + * 修改,修改所有字段 + * + * @param freeIncome 修改的记录 + * @return 返回影响行数 + */ + int update(FreeIncomePO freeIncome); + + /** + * 修改,忽略null字段 + * + * @param freeIncome 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(FreeIncomePO freeIncome); + + /** + * 删除记录 + * + * @param freeIncome 待删除的记录 + * @return 返回影响行数 + */ + int delete(FreeIncomePO freeIncome); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml new file mode 100644 index 000000000..e10253fc0 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.employee_id + , t.employee_type + , t.file_status + , t.free_amount + , t.free_item + , t.free_property + , t.id + , t.main_id + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_free_income + + + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + employee_type, + + + file_status, + + + free_amount, + + + free_item, + + + free_property, + + + id, + + + main_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{freeAmount}, + + + #{freeItem}, + + + #{freeProperty}, + + + #{id}, + + + #{mainId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + UPDATE hrsa_free_income + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + free_amount=#{freeAmount}, + free_item=#{freeItem}, + free_property=#{freeProperty}, + main_id=#{mainId}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_free_income + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + free_amount=#{freeAmount}, + + + free_item=#{freeItem}, + + + free_property=#{freeProperty}, + + + main_id=#{mainId}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_free_income + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_free_income + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java new file mode 100644 index 000000000..5612833de --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.GrantDonationPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface GrantDonationMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(GrantDonationPO grantDonation); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + GrantDonationPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param grantDonation 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(GrantDonationPO grantDonation); + + + /** + * 修改,修改所有字段 + * + * @param grantDonation 修改的记录 + * @return 返回影响行数 + */ + int update(GrantDonationPO grantDonation); + + /** + * 修改,忽略null字段 + * + * @param grantDonation 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(GrantDonationPO grantDonation); + + /** + * 删除记录 + * + * @param grantDonation 待删除的记录 + * @return 返回影响行数 + */ + int delete(GrantDonationPO grantDonation); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml new file mode 100644 index 000000000..2a68136eb --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml @@ -0,0 +1,375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + actual_deduction + , t.create_time + , t.creator + , t.deduction_proportion + , t.delete_type + , t.donate_amount + , t.donate_date + , t.donation_number + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.recipient_name + , t.tax_agent_id + , t.tax_code + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_grant_donation + + + + actual_deduction, + + + create_time, + + + creator, + + + deduction_proportion, + + + delete_type, + + + donate_amount, + + + donate_date, + + + donation_number, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + recipient_name, + + + tax_agent_id, + + + tax_code, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{actualDeduction}, + + + #{createTime}, + + + #{creator}, + + + #{deductionProportion}, + + + #{deleteType}, + + + #{donateAmount}, + + + #{donateDate}, + + + #{donationNumber}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{recipientName}, + + + #{taxAgentId}, + + + #{taxCode}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + UPDATE hrsa_grant_donation + + actual_deduction=#{actualDeduction}, + create_time=#{createTime}, + creator=#{creator}, + deduction_proportion=#{deductionProportion}, + delete_type=#{deleteType}, + donate_amount=#{donateAmount}, + donate_date=#{donateDate}, + donation_number=#{donationNumber}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + recipient_name=#{recipientName}, + tax_agent_id=#{taxAgentId}, + tax_code=#{taxCode}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_grant_donation + + + actual_deduction=#{actualDeduction}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + deduction_proportion=#{deductionProportion}, + + + delete_type=#{deleteType}, + + + donate_amount=#{donateAmount}, + + + donate_date=#{donateDate}, + + + donation_number=#{donationNumber}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + recipient_name=#{recipientName}, + + + tax_agent_id=#{taxAgentId}, + + + tax_code=#{taxCode}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_grant_donation + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_grant_donation + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java new file mode 100644 index 000000000..b382963f2 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.HealthInsurancePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface HealthInsuranceMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(HealthInsurancePO healthInsurance); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + HealthInsurancePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param healthInsurance 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(HealthInsurancePO healthInsurance); + + + /** + * 修改,修改所有字段 + * + * @param healthInsurance 修改的记录 + * @return 返回影响行数 + */ + int update(HealthInsurancePO healthInsurance); + + /** + * 修改,忽略null字段 + * + * @param healthInsurance 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(HealthInsurancePO healthInsurance); + + /** + * 删除记录 + * + * @param healthInsurance 待删除的记录 + * @return 返回影响行数 + */ + int delete(HealthInsurancePO healthInsurance); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml new file mode 100644 index 000000000..71d4cdde1 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.current_deduction + , t.delete_type + , t.effective_date + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.identification_number + , t.main_id + , t.month_premium + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.year_premium + + + + + + + + + + + + + + + INSERT INTO hrsa_health_insurance + + + + create_time, + + + creator, + + + current_deduction, + + + delete_type, + + + effective_date, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + identification_number, + + + main_id, + + + month_premium, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + year_premium, + + + + + #{createTime}, + + + #{creator}, + + + #{currentDeduction}, + + + #{deleteType}, + + + #{effectiveDate}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{identificationNumber}, + + + #{mainId}, + + + #{monthPremium}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{yearPremium}, + + + + + + + + UPDATE hrsa_health_insurance + + create_time=#{createTime}, + creator=#{creator}, + current_deduction=#{currentDeduction}, + delete_type=#{deleteType}, + effective_date=#{effectiveDate}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + identification_number=#{identificationNumber}, + main_id=#{mainId}, + month_premium=#{monthPremium}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year_premium=#{yearPremium}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_health_insurance + + + create_time=#{createTime}, + + + creator=#{creator}, + + + current_deduction=#{currentDeduction}, + + + delete_type=#{deleteType}, + + + effective_date=#{effectiveDate}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + identification_number=#{identificationNumber}, + + + main_id=#{mainId}, + + + month_premium=#{monthPremium}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year_premium=#{yearPremium}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_health_insurance + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_health_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.java new file mode 100644 index 000000000..79ce006b3 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.java @@ -0,0 +1,79 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.OtherDerateDeductionPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface OtherDerateDeductionMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(OtherDerateDeductionPO otherDerateDeduction); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + OtherDerateDeductionPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param otherDerateDeduction 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 批量插入 + * + * @param otherDerateDeduction + */ + void batchInsert(@Param("collection") List otherDerateDeduction); + + /** + * 修改,修改所有字段 + * + * @param otherDerateDeduction 修改的记录 + * @return 返回影响行数 + */ + int update(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 修改,忽略null字段 + * + * @param otherDerateDeduction 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 删除记录 + * + * @param otherDerateDeduction 待删除的记录 + * @return 返回影响行数 + */ + int delete(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml new file mode 100644 index 000000000..1d7b0e0be --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + t.create_time + , t.creator + , t.delete_type + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.other_deduction + , t.remark + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_other_derate_deduction + + + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + other_deduction, + + + remark, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{otherDeduction}, + + + #{remark}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + INSERT INTO hrsa_other_derate_deduction + ( + create_time, + creator, + delete_type, + employee_id, + employee_type, + file_status, + id, + main_id, + other_deduction, + remark, + tax_agent_id, + tax_year_month, + tenant_key, + update_time, + ) + VALUES + + + ( + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.employeeId}, + #{item.employeeType}, + #{item.fileStatus}, + #{item.id}, + #{item.mainId}, + #{item.otherDeduction}, + #{item.remark}, + #{item.taxAgentId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime}, + ) + + + + + + + INSERT INTO hrsa_other_derate_deduction ( + create_time, + creator, + delete_type, + employee_id, + employee_type, + file_status, + id, + main_id, + other_deduction, + remark, + tax_agent_id, + tax_year_month, + tenant_key, + update_time, + ) + + + select + #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.employeeId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.employeeType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.fileStatus,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.mainId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.otherDeduction,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.remark,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.taxYearMonth,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, + from dual + + + + + + + INSERT INTO hrsa_other_derate_deduction ( + create_time, + creator, + delete_type, + employee_id, + employee_type, + file_status, + id, + main_id, + other_deduction, + remark, + tax_agent_id, + tax_year_month, + tenant_key, + update_time, + ) + VALUES + ( + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.employeeId}, + #{item.employeeType}, + #{item.fileStatus}, + #{item.id}, + #{item.mainId}, + #{item.otherDeduction}, + #{item.remark}, + #{item.taxAgentId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime}, + ) + + + + + + UPDATE hrsa_other_derate_deduction + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + other_deduction=#{otherDeduction}, + remark=#{remark}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_other_derate_deduction + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + other_deduction=#{otherDeduction}, + + + remark=#{remark}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_other_derate_deduction + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + + UPDATE hrsa_other_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file From d14ac4bda356a43160f1f989028079167d092e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 17 Dec 2024 14:05:05 +0800 Subject: [PATCH 223/298] =?UTF-8?q?=E5=85=8D=E7=A8=8E=E6=94=B6=E5=85=A5?= =?UTF-8?q?=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/OtherDeductionListDTO.java | 26 +- .../dto/OtherDeductionRecordDTO.java | 12 + .../param/OtherDeductionParam.java | 10 + .../datacollection/po/OtherDeductionPO.java | 14 +- .../po/OtherDerateDeductionPO.java | 5 +- .../datacollection/OtherDeductionMapper.xml | 70 +- .../OtherDerateDeductionMapper.xml | 625 +++++++----------- .../impl/OtherDeductionServiceImpl.java | 25 +- .../impl/SalarySysConfServiceImpl.java | 4 + 9 files changed, 381 insertions(+), 410 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java index 94f3580d0..abfffc82f 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java @@ -82,35 +82,51 @@ public class OtherDeductionListDTO { @TableTitle(title = "入职日期", dataIndex = "hiredate", key = "hiredate") private String hiredate; - //商业健康保险 + /** + * 免税收入 + */ @ExcelProperty(index = 7) + @SalaryTableColumn(text = "免税收入", width = "10%", column = "freeIncome") + @TableTitle(title = "免税收入", dataIndex = "freeIncome", key = "freeIncome") + private String freeIncome; + + /** + * 减免税额 + */ + @ExcelProperty(index = 8) + @SalaryTableColumn(text = "入职日期", width = "10%", column = "derateDeduction") + @TableTitle(title = "减免税额", dataIndex = "derateDeduction", key = "derateDeduction") + private String derateDeduction; + + //商业健康保险 + @ExcelProperty(index = 9) @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "businessHealthyInsurance") @TableTitle(title = "商业健康保险", dataIndex = "businessHealthyInsurance", key = "businessHealthyInsurance") @Encrypt private String businessHealthyInsurance; //税延养老保险 - @ExcelProperty(index = 8) + @ExcelProperty(index = 10) @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "taxDelayEndowmentInsurance") @TableTitle(title = "税延养老保险", dataIndex = "taxDelayEndowmentInsurance", key = "taxDelayEndowmentInsurance") @Encrypt private String taxDelayEndowmentInsurance; //其他 - @ExcelProperty(index = 9) + @ExcelProperty(index = 11) @SalaryTableColumn(text = "其他", width = "10%", column = "otherDeduction") @TableTitle(title = "其他", dataIndex = "otherDeduction", key = "otherDeduction") @Encrypt private String otherDeduction; //准予扣除的捐赠额 - @ExcelProperty(index = 10) + @ExcelProperty(index = 12) @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "deductionAllowedDonation") @TableTitle(title = "准予扣除的捐赠额", dataIndex = "deductionAllowedDonation", key = "deductionAllowedDonation") @Encrypt private String deductionAllowedDonation; - @ExcelProperty(index = 11) + @ExcelProperty(index = 13) @SalaryTableColumn(text = "个人养老金", width = "10%", column = "privatePension") @TableTitle(title = "个人养老金", dataIndex = "privatePension", key = "privatePension") @Encrypt diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java index 4bb115d7a..7f5290520 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java @@ -71,6 +71,18 @@ public class OtherDeductionRecordDTO { @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") private String jobNum; + //免税收入 + @SalaryTableColumn(text = "免税收入", width = "10%", column = "freeIncome") + @TableTitle(title = "免税收入", dataIndex = "freeIncome", key = "freeIncome") + @Encrypt + private String freeIncome; + + //减免税额 + @SalaryTableColumn(text = "减免税额", width = "10%", column = "derateDeduction") + @TableTitle(title = "减免税额", dataIndex = "derateDeduction", key = "derateDeduction") + @Encrypt + private String derateDeduction; + //商业健康保险 @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "businessHealthyInsurance") @TableTitle(title = "商业健康保险", dataIndex = "businessHealthyInsurance", key = "businessHealthyInsurance") diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java index 06311ed20..d615856f7 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java @@ -44,6 +44,16 @@ public class OtherDeductionParam { // 工号 private String jobNum; + /** + * 免税收入 + */ + private String freeIncome; + + /** + * 减免税额 + */ + private String derateDeduction; + // 商业健康保险 private String businessHealthyInsurance; diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index a3af82274..072f078fe 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -54,6 +54,13 @@ public class OtherDeductionPO { @Encrypt private String freeIncome; + /** + * 减免税额 + */ + @ElogTransform(name = "减免税额") + @SalaryFormulaVar(defaultLabel = "减免税额", labelId = 102810, dataType = "number") + @Encrypt + private String derateDeduction; /** * 商业健康保险 @@ -71,13 +78,6 @@ public class OtherDeductionPO { @Encrypt private String taxDelayEndowmentInsurance; - /** - * 减免税额 - */ - @ElogTransform(name = "减免税额") - @SalaryFormulaVar(defaultLabel = "减免税额", labelId = 102810, dataType = "number") - @Encrypt - private String derateDeduction; /** * 其他 diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java index 0dbcd99e6..c9f86d3c6 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -7,7 +7,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; import java.util.Date; /** @@ -58,10 +57,10 @@ public class OtherDerateDeductionPO { private Integer employeeType; @ElogTransform(name = "创建时间", ignore = true) - private LocalDateTime createTime; + private Date createTime; @ElogTransform(name = "更新时间", ignore = true) - private LocalDateTime updateTime; + private Date updateTime; @ElogTransform(name = "创建人", ignore = true) private Long creator; diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index f21fed4a1..03c20d1bb 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -16,6 +16,8 @@ + + @@ -36,6 +38,8 @@ , t.delete_type , t.tenant_key , t.private_pension + , t.free_income + , t.derate_deduction @@ -59,8 +63,6 @@ - - t1 . @@ -80,7 +82,9 @@ t1.tax_delay_endowment_insurance, t1.other_deduction, t1.deduction_allowed_donation, - t1.private_pension + t1.private_pension, + t1.free_income, + t1.derate_deduction @@ -284,7 +288,7 @@ - ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -310,7 +314,7 @@ FROM hrsa_other_deduction t WHERE delete_type = 0 - and declare_month = #{param.declareMonth} + and declare_month = #{param.declareMonth} AND t.employee_id IN @@ -336,6 +340,8 @@ other_deduction, deduction_allowed_donation, private_pension, + free_income, + derate_deduction, create_time, update_time, creator, @@ -352,6 +358,8 @@ #{item.otherDeduction}, #{item.deductionAllowedDonation}, #{item.privatePension}, + #{item.freeIncome}, + #{item.derateDeduction}, #{item.createTime}, #{item.updateTime}, #{item.creator}, @@ -369,6 +377,8 @@ other_deduction, deduction_allowed_donation, private_pension, + free_income, + derate_deduction, create_time, update_time, creator, @@ -385,6 +395,8 @@ #{item.otherDeduction,jdbcType=VARCHAR}, #{item.deductionAllowedDonation,jdbcType=VARCHAR}, #{item.privatePension,jdbcType=VARCHAR}, + #{item.freeIncome,jdbcType=VARCHAR}, + #{item.derateDeduction,jdbcType=VARCHAR}, #{item.createTime,jdbcType=DATE}, #{item.updateTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, @@ -394,21 +406,23 @@ - INSERT INTO hrsa_other_deduction( - employee_id, - tax_agent_id, - declare_month, - business_healthy_insurance, - tax_delay_endowment_insurance, - other_deduction, - deduction_allowed_donation, - private_pension, - create_time, - update_time, - creator, - tenant_key - ) - VALUES + INSERT INTO hrsa_other_deduction( + employee_id, + tax_agent_id, + declare_month, + business_healthy_insurance, + tax_delay_endowment_insurance, + other_deduction, + deduction_allowed_donation, + private_pension, + free_income, + derate_deduction, + create_time, + update_time, + creator, + tenant_key + ) + VALUES ( #{item.employeeId}, #{item.taxAgentId}, @@ -418,6 +432,8 @@ #{item.otherDeduction}, #{item.deductionAllowedDonation}, #{item.privatePension}, + #{item.freeIncome}, + #{item.derateDeduction}, #{item.createTime}, #{item.updateTime}, #{item.creator}, @@ -464,6 +480,20 @@ + + + + when id=#{item.id} then #{item.freeIncome} + + + + + + + when id=#{item.id} then #{item.derateDeduction} + + + diff --git a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml index 1d7b0e0be..25c8ca88c 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml @@ -1,26 +1,28 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - t.create_time + t + . + create_time , t.creator , t.delete_type , t.employee_id @@ -34,378 +36,260 @@ , t.tax_year_month , t.tenant_key , t.update_time - - + + - - + + + - + SELECT + + FROM hrsa_other_derate_deduction t + WHERE id = #{id} AND delete_type = 0 + + - + SELECT + + FROM hrsa_other_derate_deduction t + WHERE delete_type = 0 + + AND create_time = #{createTime} + + + AND creator = #{creator} + + + AND delete_type = #{deleteType} + + + AND employee_id = #{employeeId} + + + AND employee_type = #{employeeType} + + + AND file_status = #{fileStatus} + + + AND id = #{id} + + + AND main_id = #{mainId} + + + AND other_deduction = #{otherDeduction} + + + AND remark = #{remark} + + + AND tax_agent_id = #{taxAgentId} + + + AND tax_year_month = #{taxYearMonth} + + + AND tenant_key = #{tenantKey} + + + AND update_time = #{updateTime} + + AND id IN #{id} ORDER BY id DESC - - - + + + - - INSERT INTO hrsa_other_derate_deduction - - - - create_time, - - - creator, - - - delete_type, - - - employee_id, - - - employee_type, - - - file_status, - - - id, - - - main_id, - - - other_deduction, - - - remark, - - - tax_agent_id, - - - tax_year_month, - - - tenant_key, - - - update_time, - - - - - #{createTime}, - - - #{creator}, - - - #{deleteType}, - - - #{employeeId}, - - - #{employeeType}, - - - #{fileStatus}, - - - #{id}, - - - #{mainId}, - - - #{otherDeduction}, - - - #{remark}, - - - #{taxAgentId}, - - - #{taxYearMonth}, - - - #{tenantKey}, - - - #{updateTime}, - - - - - - - + INSERT INTO hrsa_other_derate_deduction - ( - create_time, - creator, - delete_type, - employee_id, - employee_type, - file_status, - id, - main_id, - other_deduction, - remark, - tax_agent_id, - tax_year_month, - tenant_key, - update_time, - ) - VALUES - - - ( - #{item.createTime}, - #{item.creator}, - #{item.deleteType}, - #{item.employeeId}, - #{item.employeeType}, - #{item.fileStatus}, - #{item.id}, - #{item.mainId}, - #{item.otherDeduction}, - #{item.remark}, - #{item.taxAgentId}, - #{item.taxYearMonth}, - #{item.tenantKey}, - #{item.updateTime}, - ) - - - - - - - INSERT INTO hrsa_other_derate_deduction ( - create_time, - creator, - delete_type, - employee_id, - employee_type, - file_status, - id, - main_id, - other_deduction, - remark, - tax_agent_id, - tax_year_month, - tenant_key, - update_time, - ) + - - select - #{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.employeeId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.employeeType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.fileStatus,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.mainId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.otherDeduction,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.remark,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.taxYearMonth,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - #{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER}, - from dual - - - - - - - INSERT INTO hrsa_other_derate_deduction ( - create_time, - creator, - delete_type, - employee_id, - employee_type, - file_status, - id, - main_id, - other_deduction, - remark, - tax_agent_id, - tax_year_month, - tenant_key, - update_time, - ) - VALUES - ( - #{item.createTime}, - #{item.creator}, - #{item.deleteType}, - #{item.employeeId}, - #{item.employeeType}, - #{item.fileStatus}, - #{item.id}, - #{item.mainId}, - #{item.otherDeduction}, - #{item.remark}, - #{item.taxAgentId}, - #{item.taxYearMonth}, - #{item.tenantKey}, - #{item.updateTime}, - ) - + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + other_deduction, + + + remark, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{otherDeduction}, + + + #{remark}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + - - - UPDATE hrsa_other_derate_deduction - - create_time=#{createTime}, - creator=#{creator}, - delete_type=#{deleteType}, - employee_id=#{employeeId}, - employee_type=#{employeeType}, - file_status=#{fileStatus}, - main_id=#{mainId}, - other_deduction=#{otherDeduction}, - remark=#{remark}, - tax_agent_id=#{taxAgentId}, - tax_year_month=#{taxYearMonth}, - tenant_key=#{tenantKey}, - update_time=#{updateTime}, - - WHERE id = #{id} AND delete_type = 0 - - - - - - UPDATE hrsa_other_derate_deduction - - - create_time=#{createTime}, - - - creator=#{creator}, - - - delete_type=#{deleteType}, - - - employee_id=#{employeeId}, - - - employee_type=#{employeeType}, - - - file_status=#{fileStatus}, - - - main_id=#{mainId}, - - - other_deduction=#{otherDeduction}, - - - remark=#{remark}, - - - tax_agent_id=#{taxAgentId}, - - - tax_year_month=#{taxYearMonth}, - - - tenant_key=#{tenantKey}, - - - update_time=#{updateTime}, - - - WHERE id = #{id} AND delete_type = 0 + + + + UPDATE hrsa_other_derate_deduction + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + other_deduction=#{otherDeduction}, + remark=#{remark}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 - - - - UPDATE hrsa_other_derate_deduction - SET delete_type=1 - WHERE id = #{id} AND delete_type = 0 - - + + + + UPDATE hrsa_other_derate_deduction + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + other_deduction=#{otherDeduction}, + + + remark=#{remark}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_other_derate_deduction + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + UPDATE hrsa_other_derate_deduction SET delete_type = 1 - WHERE delete_type = 0 + WHERE delete_type = 0 AND id IN #{id} @@ -413,5 +297,4 @@ - \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 8347f1045..44c9f7148 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -257,7 +257,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List employeeSameIds = new ArrayList<>(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo,null); + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() @@ -327,6 +327,12 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + //免税收入 + String freeIncome = dto.getFreeIncome(); + po.setFreeIncome(freeIncome); + //减免税额 + String derateDeduction = dto.getDerateDeduction(); + po.setDerateDeduction(derateDeduction); //商业健康保险 String businessHealthyInsurance = dto.getBusinessHealthyInsurance(); po.setBusinessHealthyInsurance(businessHealthyInsurance); @@ -504,7 +510,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction private List> getExcelRowList(OtherDeductionQueryParam param, boolean hasData) { long employeeId = user.getUID(); //excel标题 - List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); + List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); List> rowList = new ArrayList<>(); rowList.add(title); @@ -536,6 +542,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction cellList.add(Util.null2String(dto.getJobNum())); cellList.add(Util.null2String(dto.getIdNo())); cellList.add(Util.null2String(dto.getHiredate())); + cellList.add(NumberUtil.isNumber(dto.getFreeIncome()) ? new BigDecimal(dto.getFreeIncome()) : Util.null2String(dto.getFreeIncome())); + cellList.add(NumberUtil.isNumber(dto.getDerateDeduction()) ? new BigDecimal(dto.getDerateDeduction()) : Util.null2String(dto.getDerateDeduction())); cellList.add(NumberUtil.isNumber(dto.getBusinessHealthyInsurance()) ? new BigDecimal(dto.getBusinessHealthyInsurance()) : Util.null2String(dto.getBusinessHealthyInsurance())); cellList.add(NumberUtil.isNumber(dto.getTaxDelayEndowmentInsurance()) ? new BigDecimal(dto.getTaxDelayEndowmentInsurance()) : Util.null2String(dto.getTaxDelayEndowmentInsurance())); cellList.add(NumberUtil.isNumber(dto.getOtherDeduction()) ? new BigDecimal(dto.getOtherDeduction()) : Util.null2String(dto.getOtherDeduction())); @@ -603,7 +611,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction */ private List> getExcelRowDetailList(OtherDeductionQueryParam param) { //excel标题 - List title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); + List title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 @@ -619,6 +627,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction cellList.add(Util.null2String(dto.getDepartmentName())); cellList.add(Util.null2String(dto.getMobile())); cellList.add(Util.null2String(dto.getJobNum())); + cellList.add(NumberUtil.isNumber(dto.getFreeIncome()) ? new BigDecimal(dto.getFreeIncome()) : Util.null2String(dto.getFreeIncome())); + cellList.add(NumberUtil.isNumber(dto.getDerateDeduction()) ? new BigDecimal(dto.getDerateDeduction()) : Util.null2String(dto.getDerateDeduction())); cellList.add(NumberUtil.isNumber(dto.getBusinessHealthyInsurance()) ? new BigDecimal(dto.getBusinessHealthyInsurance()) : Util.null2String(dto.getBusinessHealthyInsurance())); cellList.add(NumberUtil.isNumber(dto.getTaxDelayEndowmentInsurance()) ? new BigDecimal(dto.getTaxDelayEndowmentInsurance()) : Util.null2String(dto.getTaxDelayEndowmentInsurance())); cellList.add(NumberUtil.isNumber(dto.getOtherDeduction()) ? new BigDecimal(dto.getOtherDeduction()) : Util.null2String(dto.getOtherDeduction())); @@ -674,6 +684,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction ArrayList updateList = new ArrayList<>(); OtherDeductionPO build = OtherDeductionPO.builder() .id(otherDeductionParam.getId()) + .freeIncome(otherDeductionParam.getFreeIncome()) + .derateDeduction(otherDeductionParam.getDerateDeduction()) .businessHealthyInsurance(otherDeductionParam.getBusinessHealthyInsurance()) .taxDelayEndowmentInsurance(otherDeductionParam.getTaxDelayEndowmentInsurance()) .otherDeduction(otherDeductionParam.getOtherDeduction()) @@ -753,7 +765,12 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内"); } } - + //免税收入 + String freeIncome = otherDeductionParam.getFreeIncome(); + po.setFreeIncome(freeIncome); + //减免税额 + String derateDeduction = otherDeductionParam.getDerateDeduction(); + po.setDerateDeduction(derateDeduction); //商业健康保险 String businessHealthyInsurance = otherDeductionParam.getBusinessHealthyInsurance(); po.setBusinessHealthyInsurance(businessHealthyInsurance); diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 145a8a72b..e517b6c06 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -1060,12 +1060,16 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe if (CollectionUtils.isNotEmpty(otherDeductionPos)) { otherDeductionPos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { + po.setFreeIncome(AESEncryptUtil.closeEncryptSetting(po.getFreeIncome(), sysConfPo)); + po.setDerateDeduction(AESEncryptUtil.closeEncryptSetting(po.getDerateDeduction(), sysConfPo)); po.setBusinessHealthyInsurance(AESEncryptUtil.closeEncryptSetting(po.getBusinessHealthyInsurance(), sysConfPo)); po.setTaxDelayEndowmentInsurance(AESEncryptUtil.closeEncryptSetting(po.getTaxDelayEndowmentInsurance(), sysConfPo)); po.setOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getOtherDeduction(), sysConfPo)); po.setDeductionAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getDeductionAllowedDonation(), sysConfPo)); po.setPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getPrivatePension(), sysConfPo)); } else { + po.setFreeIncome(AESEncryptUtil.encrypt(po.getFreeIncome())); + po.setDerateDeduction(AESEncryptUtil.encrypt(po.getDerateDeduction())); po.setBusinessHealthyInsurance(AESEncryptUtil.encrypt(po.getBusinessHealthyInsurance())); po.setTaxDelayEndowmentInsurance(AESEncryptUtil.encrypt(po.getTaxDelayEndowmentInsurance())); po.setOtherDeduction(AESEncryptUtil.encrypt(po.getOtherDeduction())); From 4a9a001311da0abd6caa7fa84977f0e132223e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 19 Dec 2024 09:53:56 +0800 Subject: [PATCH 224/298] =?UTF-8?q?=E5=87=A0=E4=B8=AA=E9=99=84=E8=A1=A8?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/DerateDeductionListDTO.java | 102 ++++++ .../dto/EndowmentInsuranceListDTO.java | 106 ++++++ .../datacollection/dto/FreeIncomeListDTO.java | 100 ++++++ .../dto/GrantDonationListDTO.java | 121 +++++++ .../dto/HealthInsuranceListDTO.java | 108 ++++++ .../dto/OtherDeductionListDTO.java | 36 +- .../dto/OtherDerateDeductionListDTO.java | 95 ++++++ .../param/OtherDeductionImportParam.java | 4 - .../datacollection/po/FreeIncomePO.java | 3 +- .../datacollection/po/OtherDeductionPO.java | 5 + .../po/OtherDerateDeductionPO.java | 4 +- .../enums/datacollection/TaxFreeTypeEnum.java | 62 ++++ .../datacollection/DerateDeductionMapper.java | 73 ++++ .../datacollection/DerateDeductionMapper.xml | 313 ++++++++++++++++++ .../salary/service/OtherDeductionService.java | 14 +- .../TaxDeclarationApiConfigService.java | 6 + .../impl/OtherDeductionServiceImpl.java | 265 ++++++++++++++- .../TaxDeclarationApiConfigServiceImpl.java | 6 + .../salary/wrapper/OtherDeductionWrapper.java | 25 +- 19 files changed, 1403 insertions(+), 45 deletions(-) create mode 100644 src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java create mode 100644 src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java create mode 100644 src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml diff --git a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java new file mode 100644 index 000000000..c761c4971 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java @@ -0,0 +1,102 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 免税收入 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DerateDeductionListDTO { + + private Long id; + + private Long mainId; + + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @ExcelProperty(index = 5) + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "减免事项", dataIndex = "derateItem", key = "derateItem") + private String derateItem; + + @ExcelProperty(index = 8) + @TableTitle(title = "减免性质", dataIndex = "derateProperty", key = "derateProperty") + @ElogTransform(name = "减免性质") + private String derateProperty; + + @ExcelProperty(index = 9) + @TableTitle(title = "减免金额", dataIndex = "derateAmount", key = "derateAmount") + @ElogTransform(name = "减免金额") + private String derateAmount; + + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java new file mode 100644 index 000000000..cfd7e773d --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java @@ -0,0 +1,106 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 免税收入 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class EndowmentInsuranceListDTO { + + private Long id; + + private Long mainId; + + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @ExcelProperty(index = 5) + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "税延养老账户编号", dataIndex = "accountNumber", key = "accountNumber") + private String accountNumber; + + @ExcelProperty(index = 7) + @TableTitle(title = "报税校验码", dataIndex = "checkCode", key = "checkCode") + private String checkCode; + + @ExcelProperty(index = 8) + @TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium") + private String yearPremium; + + @ExcelProperty(index = 9) + @TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium") + private String monthPremium; + + @ExcelProperty(index = 10) + @TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction") + private String currentDeduction; + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java new file mode 100644 index 000000000..a8e132c47 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java @@ -0,0 +1,100 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.Encrypt; +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 免税收入 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FreeIncomeListDTO { + + private Long id; + + private Long mainId; + + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @ExcelProperty(index = 5) + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "免税事项", dataIndex = "freeItem", key = "freeItem") + private String freeItem; + + @ExcelProperty(index = 7) + @TableTitle(title = "免税性质", dataIndex = "freeProperty", key = "freeProperty") + private String freeProperty; + + @ExcelProperty(index = 8) + @TableTitle(title = "免税金额", dataIndex = "freeAmount", key = "freeAmount") + @Encrypt + private String freeAmount; + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java new file mode 100644 index 000000000..a6fd88268 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java @@ -0,0 +1,121 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 准予扣除的捐赠额 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class GrantDonationListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @SalaryTableColumn(text = "姓名", width = "10%", column = "username") + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + //部门 + @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @SalaryTableColumn(text = "手机号", width = "10%", column = "mobile") + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo") + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "受赠单位名称", dataIndex = "recipientName", key = "recipientName") + private String recipientName; + + @ExcelProperty(index = 7) + @TableTitle(title = "受赠单位纳税人识别号", dataIndex = "taxCode", key = "taxCode") + private String taxCode; + + @ExcelProperty(index = 8) + @TableTitle(title = "捐赠凭证号", dataIndex = "donationNumber", key = "donationNumber") + private String donationNumber; + + @ExcelProperty(index = 9) + @TableTitle(title = "捐赠日期", dataIndex = "donateDate", key = "donateDate") + private Date donateDate; + + @ExcelProperty(index = 10) + @TableTitle(title = "捐赠金额", dataIndex = "donateAmount", key = "donateAmount") + private String donateAmount; + + @ExcelProperty(index = 11) + @TableTitle(title = "扣除比例", dataIndex = "deductionProportion", key = "deductionProportion") + private String deductionProportion; + + @ExcelProperty(index = 12) + @TableTitle(title = "实际扣除金额", dataIndex = "actualDeduction", key = "actualDeduction") + private String actualDeduction; + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java new file mode 100644 index 000000000..5790a528e --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java @@ -0,0 +1,108 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 商业健康保险 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HealthInsuranceListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo") + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "税优识别码", dataIndex = "identificationNumber", key = "identificationNumber") + private String identificationNumber; + + @ExcelProperty(index = 7) + @TableTitle(title = "保单生效日期", dataIndex = "effectiveDate", key = "effectiveDate") + private Date effectiveDate; + + @ExcelProperty(index = 8) + @TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium") + + private String yearPremium; + + @ExcelProperty(index = 9) + @TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium") + private String monthPremium; + + @ExcelProperty(index = 10) + @TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction") + private String currentDeduction; + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java index abfffc82f..aaa2b4109 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java @@ -90,42 +90,44 @@ public class OtherDeductionListDTO { @TableTitle(title = "免税收入", dataIndex = "freeIncome", key = "freeIncome") private String freeIncome; - /** - * 减免税额 - */ - @ExcelProperty(index = 8) - @SalaryTableColumn(text = "入职日期", width = "10%", column = "derateDeduction") - @TableTitle(title = "减免税额", dataIndex = "derateDeduction", key = "derateDeduction") - private String derateDeduction; + //商业健康保险 - @ExcelProperty(index = 9) + @ExcelProperty(index = 8) @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "businessHealthyInsurance") @TableTitle(title = "商业健康保险", dataIndex = "businessHealthyInsurance", key = "businessHealthyInsurance") @Encrypt private String businessHealthyInsurance; //税延养老保险 - @ExcelProperty(index = 10) + @ExcelProperty(index = 9) @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "taxDelayEndowmentInsurance") @TableTitle(title = "税延养老保险", dataIndex = "taxDelayEndowmentInsurance", key = "taxDelayEndowmentInsurance") @Encrypt private String taxDelayEndowmentInsurance; - //其他 - @ExcelProperty(index = 11) - @SalaryTableColumn(text = "其他", width = "10%", column = "otherDeduction") - @TableTitle(title = "其他", dataIndex = "otherDeduction", key = "otherDeduction") - @Encrypt - private String otherDeduction; - //准予扣除的捐赠额 - @ExcelProperty(index = 12) + @ExcelProperty(index = 10) @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "deductionAllowedDonation") @TableTitle(title = "准予扣除的捐赠额", dataIndex = "deductionAllowedDonation", key = "deductionAllowedDonation") @Encrypt private String deductionAllowedDonation; + /** + * 减免税额 + */ + @ExcelProperty(index = 11) + @SalaryTableColumn(text = "减免税额", width = "10%", column = "derateDeduction") + @TableTitle(title = "减免税额", dataIndex = "derateDeduction", key = "derateDeduction") + private String derateDeduction; + + //其他 + @ExcelProperty(index = 12) + @SalaryTableColumn(text = "其他", width = "10%", column = "otherDeduction") + @TableTitle(title = "其他", dataIndex = "otherDeduction", key = "otherDeduction") + @Encrypt + private String otherDeduction; + @ExcelProperty(index = 13) @SalaryTableColumn(text = "个人养老金", width = "10%", column = "privatePension") @TableTitle(title = "个人养老金", dataIndex = "privatePension", key = "privatePension") diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java new file mode 100644 index 000000000..42cff95a6 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java @@ -0,0 +1,95 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 商业健康保险 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDerateDeductionListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo") + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "减免税额", dataIndex = "otherDeduction", key = "otherDeduction") + private String otherDeduction; + + @ExcelProperty(index = 7) + @TableTitle(title = "备注", dataIndex = "remark", key = "remark") + private String remark; + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java index 3ac3a98c9..509f3f7cc 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java @@ -24,8 +24,4 @@ public class OtherDeductionImportParam { //税款所属期 String declareMonth; - - //个税扣缴义务人 - String taxAgentId; - } diff --git a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java index 59aa0afd6..cd017fa54 100644 --- a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java +++ b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java @@ -23,7 +23,7 @@ import java.util.Date; @AllArgsConstructor //hrsa_free_income @ElogTransform(name = "其他免税扣除-免税收入") -public class FreeIncomePO { +public class FreeIncomePO { @ElogTransform(name = "主键id") private Long id; @@ -53,6 +53,7 @@ public class FreeIncomePO { /** * 人员类型 + * * @see DataCollectionEmployeeTypeEnum */ @ElogTransform(name = "人员类型") diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index 072f078fe..2d13dcced 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -135,4 +135,9 @@ public class OtherDeductionPO { private List employeeIds; private Collection taxAgentIds; + /** + * 减免税额 + */ + private List freeIncomeList; + } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java index c9f86d3c6..2396dd973 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -10,7 +10,7 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * 其他免税扣除-减免税额 + * 其他免税扣除-其他 *

Copyright: Copyright (c) 2024

*

Company: 泛微软件

* @@ -22,7 +22,7 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_other_derate_deduction -@ElogTransform(name = "其他免税扣除-减免税额") +@ElogTransform(name = "其他免税扣除-其他") public class OtherDerateDeductionPO { @ElogTransform(name = "主键id") private Long id; diff --git a/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java b/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java new file mode 100644 index 000000000..1edf03f98 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java @@ -0,0 +1,62 @@ +package com.engine.salary.enums.datacollection; + +import java.util.HashMap; +import java.util.Map; + +/** + * 免税归档状态 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxFreeTypeEnum { + + FREE_INCOME(32, "免税收入", 105147), + HEALTH_INSURANCE(16, "商业健康保险", 91238), + ENDOWMENT_INSURANCE(8, "税延养老保险", 91239), + GRANT_DONATION(4, "准予扣除的捐赠额", 91240), + DERATE_DEDUCTION(2, "减免税额", 102810), + OTHER_DERATE_DEDUCTION(1, "其他", 84500), + PERSONAL_PENSION(64, "个人养老金", 252256), + ; + + private final Integer value; + + private final String defaultLabel; + + private final Integer labelId; + + private static final Map VALUE_NAME_MAP; + + static { + final TaxFreeTypeEnum[] values = TaxFreeTypeEnum.values(); + VALUE_NAME_MAP = new HashMap<>(values.length); + for (TaxFreeTypeEnum value : values) { + VALUE_NAME_MAP.put(value.name(), value); + } + } + + TaxFreeTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public Integer getValue() { + return value; + } + + public Integer getLabelId() { + return labelId; + } + + public static TaxFreeTypeEnum parse(String defaultLabel) { + return VALUE_NAME_MAP.get(defaultLabel); + } +} diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java new file mode 100644 index 000000000..35ca29ab5 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.DerateDeductionPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface DerateDeductionMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(DerateDeductionPO derateDeduction); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + DerateDeductionPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param derateDeduction 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(DerateDeductionPO derateDeduction); + + + /** + * 修改,修改所有字段 + * + * @param derateDeduction 修改的记录 + * @return 返回影响行数 + */ + int update(DerateDeductionPO derateDeduction); + + /** + * 修改,忽略null字段 + * + * @param derateDeduction 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(DerateDeductionPO derateDeduction); + + /** + * 删除记录 + * + * @param derateDeduction 待删除的记录 + * @return 返回影响行数 + */ + int delete(DerateDeductionPO derateDeduction); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml new file mode 100644 index 000000000..c6641f0d6 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + + + + + + t.create_time + , t.creator + , t.delete_type + , t.derate_amount + , t.derate_item + , t.derate_property + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_derate_deduction + + + + create_time, + + + creator, + + + delete_type, + + + derate_amount, + + + derate_item, + + + derate_property, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{derateAmount}, + + + #{derateItem}, + + + #{derateProperty}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + + UPDATE hrsa_derate_deduction + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + derate_amount=#{derateAmount}, + derate_item=#{derateItem}, + derate_property=#{derateProperty}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_derate_deduction + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + derate_amount=#{derateAmount}, + + + derate_item=#{derateItem}, + + + derate_property=#{derateProperty}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_derate_deduction + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + + UPDATE hrsa_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index e77c70995..854286a0f 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -65,6 +65,13 @@ public interface OtherDeductionService { */ XSSFWorkbook downloadTemplate(OtherDeductionQueryParam param); + /** + * 下载明细模板 + * @param param + * @return + */ + XSSFWorkbook downloadDetailTemplate(OtherDeductionQueryParam param); + /** * 预览 */ @@ -75,7 +82,12 @@ public interface OtherDeductionService { */ Map importData(OtherDeductionImportParam importParam); - + /** + * 导入明细数据 + * @param importParam + * @return + */ + Map importDetailData(OtherDeductionImportParam importParam); /** * 获取其他免税扣除数据 diff --git a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java index c43db36c9..c239d6339 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java @@ -43,4 +43,10 @@ public interface TaxDeclarationApiConfigService { void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam); void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam); + + /** + * 是否开启智能算薪 + * @return + */ + boolean enableUse(); } diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 44c9f7148..ac1a306be 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -12,17 +12,20 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; +import com.engine.salary.entity.datacollection.po.FreeIncomePO; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.datacollection.OtherDeductionMapper; +import com.engine.salary.mapper.datacollection.*; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.AddUpDeductionService; import com.engine.salary.service.OtherDeductionService; @@ -96,6 +99,33 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + + private FreeIncomeMapper getFreeIncomeMapper() { + return MapperProxyFactory.getProxy(FreeIncomeMapper.class); + } + + private HealthInsuranceMapper getHealthInsuranceMapper() { + return MapperProxyFactory.getProxy(HealthInsuranceMapper.class); + } + + private EndowmentInsuranceMapper getEndowmentInsuranceMapper() { + return MapperProxyFactory.getProxy(EndowmentInsuranceMapper.class); + } + + private GrantDonationMapper getGrantDonationMapper() { + return MapperProxyFactory.getProxy(GrantDonationMapper.class); + } + + private DerateDeductionMapper getDerateDeductionMapper() { + return MapperProxyFactory.getProxy(DerateDeductionMapper.class); + } + + + private OtherDerateDeductionMapper getOtherDerateDeductionMapper() { + return MapperProxyFactory.getProxy(OtherDerateDeductionMapper.class); + } + + @Override public OtherDeductionPO getById(Long id) { return getOtherDeductionMapper().getById(id); @@ -200,13 +230,11 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Validate.notBlank(imageId, "imageId为空"); //税款所属期 String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); - //个税扣缴义务人 - String taxAgentId = Util.null2String(importParam.getTaxAgentId()); InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 12, "OtherDeductionTemplate.xlsx"); + List OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 14, "OtherDeductionTemplate.xlsx"); int total = OtherDeductions.size(); int index = 0; @@ -308,16 +336,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } else { Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); if (optionalTemp.isPresent()) { - if (StringUtils.isNotEmpty(taxAgentId) && !optionalTemp.get().getTaxAgentId().equals(Long.valueOf(taxAgentId))) { - //个税扣缴义务人与导入时选择的不一致 - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + "个税扣缴义务人与导入时选择的不一致"); - errorData.add(errorMessageMap); - errorSum += 1; - } else { - po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); - taxAgentEmployees = optionalTemp.get().getEmployeeList(); - } + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + taxAgentEmployees = optionalTemp.get().getEmployeeList(); } else { //个税扣缴义务人不存在 Map errorMessageMap = Maps.newHashMap(); @@ -387,6 +407,192 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return apidatas; } + @Override + public Map importDetailData(OtherDeductionImportParam importParam) { + + long currentEmployeeId = user.getUID(); + Map apidatas = new HashMap(); + OtherDeductionBiz OtherDeductionBiz = new OtherDeductionBiz(); + + //查询对于人员信息导入筛选的全局配置 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + + //检验参数 + checkImportParam(importParam); + + //excel文件id + String imageId = Util.null2String(importParam.getImageId()); + Validate.notBlank(imageId, "imageId为空"); + //税款所属期 + String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); + + InputStream fileInputStream = null; + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + //人员信息 + List employees = getSalaryEmployeeService(user).listEmployee(); + // 获取所有个税扣缴义务人 + Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); + //税款所属期 + Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01"); + // 获取已经核算的数据 + List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); + // 查询已有数据 + List list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build()); + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List eligibleData = new ArrayList<>(); + //免税收入 + List freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 9, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < freeIncomeList.size(); i++) { + FreeIncomeListDTO dto = freeIncomeList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO po = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + FreeIncomePO freeIncomePO = FreeIncomePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + po.setEmployeeId(employeeId); + freeIncomePO.setEmployeeId(employeeId); + freeIncomePO.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + freeIncomePO.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + //免税收入 + String freeIncome = dto.getFreeItem(); + String freeProperty = dto.getFreeProperty(); + String freeAmount = dto.getFreeAmount(); + freeIncomePO.setFreeItem(freeIncome); + freeIncomePO.setFreeProperty(freeProperty); + freeIncomePO.setFreeAmount(freeAmount); + + + if (errorSum == 0) { + successCount += 1; + String key = po.getEmployeeId() + "-" + po.getTaxAgentId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getFreeIncomeList().add(freeIncomePO); + } else { + po.getFreeIncomeList().add(freeIncomePO); + eligibleData.add(po); + } + + } else { + errorCount += 1; + // 添加错误数据 + } + } + + //入库 +// handleImportDetailData(eligibleData); + + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", errorData); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; + } + /** * 处理导入数据 * @@ -464,8 +670,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction String imageId = Util.null2String(importParam.getImageId()); //税款所属期 String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); - //个税扣缴义务人 - String taxAgentId = Util.null2String(importParam.getTaxAgentId()); if (StringUtils.isBlank(imageId)) { throw new SalaryRunTimeException("文件不存在"); @@ -510,7 +714,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction private List> getExcelRowList(OtherDeductionQueryParam param, boolean hasData) { long employeeId = user.getUID(); //excel标题 - List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); + List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "商业健康保险", "税延养老保险", "准予扣除的捐赠额", "减免税额", "其他", "个人养老金"); List> rowList = new ArrayList<>(); rowList.add(title); @@ -611,7 +815,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction */ private List> getExcelRowDetailList(OtherDeductionQueryParam param) { //excel标题 - List title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); + List title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "商业健康保险", "税延养老保险", "准予扣除的捐赠额", "减免税额", "其他", "个人养老金"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 @@ -1044,4 +1248,29 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return book; } + @Override + public XSSFWorkbook downloadDetailTemplate(OtherDeductionQueryParam param) { + + + Map>> map = new LinkedHashMap<>(); + + List freeIncomeTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "免税事项", "免税性质", "免税金额"); + map.put("免税收入", Arrays.asList(freeIncomeTitle)); + List healthInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税优识别码", "保单生效日期", "年度保费", "月度保费", "本期扣除金额"); + map.put("商业健康保险", Arrays.asList(healthInsuranceTitle)); + List endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额"); + map.put("税延养老保险", Arrays.asList(endowmentInsuranceTitle)); + List grantDonationTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "受赠单位名称", "受赠单位纳税人识别号", "凭证号", "捐赠日期", "捐赠金额", "扣除比例", "实际扣除金额"); + map.put("准予扣除的捐赠额", Arrays.asList(grantDonationTitle)); + List derateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "减免事项", "减免性质", "减免金额"); + map.put("减免税额", Arrays.asList(derateDeductionTitle)); + List otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "其他免税扣除金额", "备注"); + map.put("其他", Arrays.asList(otherDerateDeductionTitle)); +// map.put("个人养老金", rowList); + + + XSSFWorkbook book = ExcelUtil.genWorkbookV2(map); + return book; + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java index 9d44300cc..ade9b3e6c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -100,6 +100,12 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe } } + @Override + public boolean enableUse() { + TaxDeclarationApiConfigPO config = getConfig(false); + return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); + } + private String getApiHost() { List apiProfiles = getTaxDeclarationApiProfileMapper().listAll(); if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index 3002e8cfd..f8a261828 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -14,9 +14,11 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.OtherDeductionService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.service.impl.OtherDeductionServiceImpl; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -43,6 +45,10 @@ public class OtherDeductionWrapper extends Service { return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + private TaxAgentService getTaxAgentV2Service(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -196,7 +202,15 @@ public class OtherDeductionWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam queryParam) { - return getOtherDeductionService(user).downloadTemplate(queryParam); + + //是否开启了智能算薪 + boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); + + if(enableUse){ + return getOtherDeductionService(user).downloadDetailTemplate(queryParam); + }else { + return getOtherDeductionService(user).downloadTemplate(queryParam); + } } /** @@ -210,7 +224,14 @@ public class OtherDeductionWrapper extends Service { * 导入数据 */ public Map importData(OtherDeductionImportParam importParam) { - return getOtherDeductionService(user).importData(importParam); + //是否开启了智能算薪 + boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); + + if(enableUse){ + return getOtherDeductionService(user).importDetailData(importParam); + }else { + return getOtherDeductionService(user).importData(importParam); + } } /** From fe8910f2c5a591f2786865925408aa381e483be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 19 Dec 2024 10:46:04 +0800 Subject: [PATCH 225/298] =?UTF-8?q?=E5=87=8F=E5=85=8D=E7=A8=8E=E9=A2=9D?= =?UTF-8?q?=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/DerateDeductionListDTO.java | 6 +- .../datacollection/po/OtherDeductionPO.java | 9 +- .../impl/OtherDeductionServiceImpl.java | 203 ++++++++++++++++-- 3 files changed, 193 insertions(+), 25 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java index c761c4971..4b36ec418 100644 --- a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java @@ -13,7 +13,7 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * 免税收入 + * 减免税额 *

Copyright: Copyright (c) 2022

*

Company: 泛微软件

* @@ -85,12 +85,12 @@ public class DerateDeductionListDTO { @TableTitle(title = "减免事项", dataIndex = "derateItem", key = "derateItem") private String derateItem; - @ExcelProperty(index = 8) + @ExcelProperty(index = 7) @TableTitle(title = "减免性质", dataIndex = "derateProperty", key = "derateProperty") @ElogTransform(name = "减免性质") private String derateProperty; - @ExcelProperty(index = 9) + @ExcelProperty(index = 8) @TableTitle(title = "减免金额", dataIndex = "derateAmount", key = "derateAmount") @ElogTransform(name = "减免金额") private String derateAmount; diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index 2d13dcced..c602d6ede 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -135,9 +135,12 @@ public class OtherDeductionPO { private List employeeIds; private Collection taxAgentIds; - /** - * 减免税额 - */ + private List freeIncomeList; + private List derateDeductionList; + private List endowmentInsuranceList; + private List grantDonationList; + private List healthInsuranceList; + private List otherDerateDeductionList; } \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index ac1a306be..05736d8c1 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -12,10 +12,12 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.datacollection.dto.DerateDeductionListDTO; import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; +import com.engine.salary.entity.datacollection.po.DerateDeductionPO; import com.engine.salary.entity.datacollection.po.FreeIncomePO; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -427,29 +429,30 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction //税款所属期 String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); + //人员信息 + List employees = getSalaryEmployeeService(user).listEmployee(); + // 获取所有个税扣缴义务人 + Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); + //税款所属期 + Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01"); + // 获取已经核算的数据 + List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); + // 查询已有数据 + List list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build()); + InputStream fileInputStream = null; + List eligibleData = new ArrayList<>(); + try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); int successCount = 0; int errorCount = 0; - //人员信息 - List employees = getSalaryEmployeeService(user).listEmployee(); - // 获取所有个税扣缴义务人 - Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); - //税款所属期 - Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01"); - // 获取已经核算的数据 - List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); - // 查询已有数据 - List list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build()); - // 错误excel内容 List errorData = new ArrayList<>(); - List eligibleData = new ArrayList<>(); //免税收入 List freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 9, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < freeIncomeList.size(); i++) { @@ -460,6 +463,11 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction OtherDeductionPO po = OtherDeductionPO.builder() .declareMonth(declareMonth) .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) .createTime(now) .updateTime(now) .creator((long) user.getUID()) @@ -565,7 +573,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction if (errorSum == 0) { successCount += 1; - String key = po.getEmployeeId() + "-" + po.getTaxAgentId(); + String key = po.getTaxAgentId() + "-" + po.getEmployeeId(); Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); if (deductionPOMap.containsKey(key)) { deductionPOMap.get(key).getFreeIncomeList().add(freeIncomePO); @@ -580,16 +588,173 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } - //入库 -// handleImportDetailData(eligibleData); - - apidatas.put("successCount", successCount); - apidatas.put("errorCount", errorCount); - apidatas.put("errorData", errorData); + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("freeIncome", dataMap); } finally { IOUtils.closeQuietly(fileInputStream); } + + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, DerateDeductionListDTO.class, 4, 1, 9, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < derateDeductionList.size(); i++) { + DerateDeductionListDTO dto = derateDeductionList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + DerateDeductionPO po = DerateDeductionPO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + String derateAmount = dto.getDerateAmount(); + String derateItem = dto.getDerateItem(); + String derateProperty = dto.getDerateProperty(); + po.setDerateAmount(derateAmount); + po.setDerateItem(derateItem); + po.setDerateProperty(derateProperty); + + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getDerateDeductionList().add(po); + } else { + mainPo.getDerateDeductionList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + // 添加错误数据 + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + + + + return apidatas; } From e6f8b31f694ac9193f0a9df2ec8c0bf761d6a5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 19 Dec 2024 10:57:21 +0800 Subject: [PATCH 226/298] =?UTF-8?q?=E5=BB=B6=E7=A8=8E=E5=85=BB=E8=80=81?= =?UTF-8?q?=E4=BF=9D=E9=99=A9=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/EndowmentInsuranceListDTO.java | 2 +- .../impl/OtherDeductionServiceImpl.java | 154 +++++++++++++++++- 2 files changed, 151 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java index cfd7e773d..699054258 100644 --- a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java @@ -12,7 +12,7 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * 免税收入 + * 税延养老保险 *

Copyright: Copyright (c) 2022

*

Company: 泛微软件

* diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 05736d8c1..e95365a82 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -12,12 +12,10 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.datacollection.dto.DerateDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.entity.datacollection.po.DerateDeductionPO; +import com.engine.salary.entity.datacollection.po.EndowmentInsurancePO; import com.engine.salary.entity.datacollection.po.FreeIncomePO; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -752,7 +750,155 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + int successCount = 0; + int errorCount = 0; + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < derateDeductionList.size(); i++) { + EndowmentInsuranceListDTO dto = derateDeductionList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + EndowmentInsurancePO po = EndowmentInsurancePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + po.setAccountNumber(dto.getAccountNumber()); + po.setCheckCode(dto.getCheckCode()); + po.setYearPremium(dto.getYearPremium()); + po.setMonthPremium(dto.getMonthPremium()); + po.setCurrentDeduction(dto.getCurrentDeduction()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getEndowmentInsuranceList().add(po); + } else { + mainPo.getEndowmentInsuranceList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + // 添加错误数据 + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } return apidatas; From d1a4b83f3360c36a7ae286191313d74f25c0fdd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 19 Dec 2024 11:23:59 +0800 Subject: [PATCH 227/298] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E4=BF=9D=E9=99=A9?= =?UTF-8?q?=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/OtherDerateDeductionListDTO.java | 2 +- .../impl/OtherDeductionServiceImpl.java | 479 +++++++++++++++++- 2 files changed, 462 insertions(+), 19 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java index 42cff95a6..cfbdd1874 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java @@ -13,7 +13,7 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * 商业健康保险 + * 其他 *

Copyright: Copyright (c) 2022

*

Company: 泛微软件

* diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index e95365a82..5bdb007c8 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -14,10 +14,7 @@ import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; -import com.engine.salary.entity.datacollection.po.DerateDeductionPO; -import com.engine.salary.entity.datacollection.po.EndowmentInsurancePO; -import com.engine.salary.entity.datacollection.po.FreeIncomePO; -import com.engine.salary.entity.datacollection.po.OtherDeductionPO; +import com.engine.salary.entity.datacollection.po.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -596,6 +593,457 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction IOUtils.closeQuietly(fileInputStream); } + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, HealthInsuranceListDTO.class, 1, 1, 11, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + HealthInsuranceListDTO dto = dtoList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + HealthInsurancePO po = HealthInsurancePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + po.setIdentificationNumber(dto.getIdentificationNumber()); + po.setEffectiveDate(dto.getEffectiveDate()); + po.setYearPremium(dto.getYearPremium()); + po.setMonthPremium(dto.getMonthPremium()); + po.setCurrentDeduction(dto.getCurrentDeduction()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getHealthInsuranceList().add(po); + } else { + mainPo.getHealthInsuranceList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < derateDeductionList.size(); i++) { + EndowmentInsuranceListDTO dto = derateDeductionList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + EndowmentInsurancePO po = EndowmentInsurancePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + po.setAccountNumber(dto.getAccountNumber()); + po.setCheckCode(dto.getCheckCode()); + po.setYearPremium(dto.getYearPremium()); + po.setMonthPremium(dto.getMonthPremium()); + po.setCurrentDeduction(dto.getCurrentDeduction()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getEndowmentInsuranceList().add(po); + } else { + mainPo.getEndowmentInsuranceList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + // 添加错误数据 + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, GrantDonationListDTO.class, 3, 1, 13, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + GrantDonationListDTO dto = dtoList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + GrantDonationPO po = GrantDonationPO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + po.setRecipientName(dto.getRecipientName()); + po.setTaxCode(dto.getTaxCode()); + po.setDonationNumber(dto.getDonationNumber()); + po.setDonateDate(dto.getDonateDate()); + po.setDonateAmount(dto.getDonateAmount()); + po.setDeductionProportion(dto.getDeductionProportion()); + po.setActualDeduction(dto.getActualDeduction()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getGrantDonationList().add(po); + } else { + mainPo.getGrantDonationList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); @@ -749,7 +1197,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction IOUtils.closeQuietly(fileInputStream); } - try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); @@ -759,9 +1206,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx"); - for (int i = 0; i < derateDeductionList.size(); i++) { - EndowmentInsuranceListDTO dto = derateDeductionList.get(i); + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, OtherDerateDeductionListDTO.class, 5, 1, 8, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + OtherDerateDeductionListDTO dto = dtoList.get(i); Date now = new Date(); //待插入数据库对象 @@ -779,7 +1226,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .tenantKey(DEFAULT_TENANT_KEY) .build(); - EndowmentInsurancePO po = EndowmentInsurancePO.builder() + OtherDerateDeductionPO po = OtherDerateDeductionPO.builder() .taxYearMonth(declareMonth) .fileStatus(1) .creator((long) user.getUID()) @@ -867,26 +1314,23 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } - po.setAccountNumber(dto.getAccountNumber()); - po.setCheckCode(dto.getCheckCode()); - po.setYearPremium(dto.getYearPremium()); - po.setMonthPremium(dto.getMonthPremium()); - po.setCurrentDeduction(dto.getCurrentDeduction()); + po.setOtherDeduction(dto.getOtherDeduction()); + po.setRemark(dto.getRemark()); + if (errorSum == 0) { successCount += 1; String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); if (deductionPOMap.containsKey(key)) { - deductionPOMap.get(key).getEndowmentInsuranceList().add(po); + deductionPOMap.get(key).getOtherDerateDeductionList().add(po); } else { - mainPo.getEndowmentInsuranceList().add(po); + mainPo.getOtherDerateDeductionList().add(po); eligibleData.add(mainPo); } } else { errorCount += 1; - // 添加错误数据 } } @@ -900,7 +1344,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction IOUtils.closeQuietly(fileInputStream); } - return apidatas; } From fda791624e008bc2169bf709ca16a14687dd7505 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 19 Dec 2024 16:34:32 +0800 Subject: [PATCH 228/298] =?UTF-8?q?=E8=8E=B7=E5=8F=96token=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0https=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/util/SalaryTokenUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/util/SalaryTokenUtil.java b/src/com/engine/salary/util/SalaryTokenUtil.java index aaa53e1d9..653a0a821 100644 --- a/src/com/engine/salary/util/SalaryTokenUtil.java +++ b/src/com/engine/salary/util/SalaryTokenUtil.java @@ -90,6 +90,9 @@ public class SalaryTokenUtil { return heads; } BaseBean baseBean = new BaseBean(); + // 获取是否是https + String isHttps = baseBean.getPropValue("hrmSalaryBillToken", "is_https"); + String httpKey = (StringUtils.isNotBlank(isHttps) && isHttps.equals("true")) ? "https://" : "http://"; RecordSet rs = new RecordSet(); Map resultMap = new HashMap<>(); @@ -123,7 +126,7 @@ public class SalaryTokenUtil { heads.put("appid", appid); heads.put("cpk", cpk); // 调用ECOLOGY系统接口进行注册 - String data = post("http://" + ip + "/api/ec/dev/auth/regist", null, heads); + String data = post(httpKey + ip + "/api/ec/dev/auth/regist", null, heads); Map datas = JSONObject.parseObject(data, new TypeReference>() {}); // ECOLOGY返回的系统公钥 String spk = (String) (datas.get("spk")); @@ -144,7 +147,7 @@ public class SalaryTokenUtil { heads.put("appid", appid); heads.put("secret", secret); //调用ECOLOGY系统接口进行注册 - String data2 = post("http://" + ip + "/api/ec/dev/auth/applytoken", null, heads); + String data2 = post(httpKey + ip + "/api/ec/dev/auth/applytoken", null, heads); // 通过第一步注册许可时返回spk公钥对userid进行加密生成的密文 sql= " SELECT conf_value FROM hrsa_salary_sys_conf t WHERE delete_type = 0 AND conf_key = 'SALARY_TOKEN_SPK'"; rs.execute(sql); From cf253ecfb04b4d3a7cb9d88271aa044739585500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 23 Dec 2024 16:41:42 +0800 Subject: [PATCH 229/298] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=85=BB=E8=80=81?= =?UTF-8?q?=E9=87=91=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202412230103.sql | 25 ++ resource/sqlupgrade/GS/sql202412230103.sql | 25 ++ resource/sqlupgrade/JC/sql202412230103.sql | 25 ++ resource/sqlupgrade/Mysql/sql202412230103.sql | 24 ++ .../sqlupgrade/Oracle/sql202412230103.sql | 24 ++ resource/sqlupgrade/PG/sql202412230103.sql | 24 ++ .../sqlupgrade/SQLServer/sql202412230103.sql | 24 ++ resource/sqlupgrade/ST/sql202412230103.sql | 25 ++ .../dto/PersonalPensionListDTO.java | 127 ++++++ .../param/DerateDeductionSaveParam.java | 48 +++ .../param/EndowmentInsuranceSaveParam.java | 60 +++ .../param/FreeIncomeSaveParam.java | 48 +++ .../param/GrantDonationSaveParam.java | 59 +++ .../param/HealthInsuranceSaveParam.java | 54 +++ .../param/OtherDerateDeductionSaveParam.java | 45 ++ .../datacollection/po/OtherDeductionPO.java | 1 + .../PersonalPensionVoucherTypeEnum.java | 52 +++ .../datacollection/PersonalPensionMapper.java | 73 ++++ .../datacollection/PersonalPensionMapper.xml | 390 ++++++++++++++++++ .../salary/service/OtherDeductionService.java | 19 +- .../impl/OtherDeductionServiceImpl.java | 193 ++++++++- 21 files changed, 1361 insertions(+), 4 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202412230103.sql create mode 100644 resource/sqlupgrade/GS/sql202412230103.sql create mode 100644 resource/sqlupgrade/JC/sql202412230103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202412230103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202412230103.sql create mode 100644 resource/sqlupgrade/PG/sql202412230103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202412230103.sql create mode 100644 resource/sqlupgrade/ST/sql202412230103.sql create mode 100644 src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java create mode 100644 src/com/engine/salary/enums/datacollection/PersonalPensionVoucherTypeEnum.java create mode 100644 src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml diff --git a/resource/sqlupgrade/DM/sql202412230103.sql b/resource/sqlupgrade/DM/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/resource/sqlupgrade/GS/sql202412230103.sql b/resource/sqlupgrade/GS/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/resource/sqlupgrade/JC/sql202412230103.sql b/resource/sqlupgrade/JC/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202412230103.sql b/resource/sqlupgrade/Mysql/sql202412230103.sql new file mode 100644 index 000000000..1905ea452 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + id bigint primary key comment 'ID' , + create_time datetime comment 'ʱ' , + update_time datetime comment '޸ʱ' , + creator bigint comment 'id' , + delete_type int default 0 comment 'Ƿɾ' , + tenant_key varchar(10) comment '⻧KEY' , + main_id bigint comment 'id' , + tax_year_month date comment '˰' , + employee_id bigint comment 'Աid' , + tax_agent_id bigint comment '˰۽id' , + file_status int comment '鵵״̬ 0δ鵵 1ѹ鵵' , + voucher_type varchar(255) comment 'ƾ֤' , + voucher_no varchar(255) comment 'ƾ֤' , + pay_amount varchar(255) comment '' , + data_source int comment 'Դ' , + collect_source varchar(50) comment 'ɼԴ' , + pay_month date comment 'ɷ¶' , + eb_data_id bigint comment 'ebid' , + voucher_type_name varchar(50) comment 'ƾ֤' , + employee_type int comment 'Ա' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412230103.sql b/resource/sqlupgrade/Oracle/sql202412230103.sql new file mode 100644 index 000000000..e84bbd88e --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412230103.sql b/resource/sqlupgrade/PG/sql202412230103.sql new file mode 100644 index 000000000..9e48e428d --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + voucher_type varchar(255), + voucher_no varchar(255), + pay_amount varchar(255), + data_source int, + collect_source varchar(50), + pay_month date, + eb_data_id bigint, + voucher_type_name varchar(50), + employee_type int +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412230103.sql b/resource/sqlupgrade/SQLServer/sql202412230103.sql new file mode 100644 index 000000000..6fd85b259 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + voucher_type nvarchar(255), + voucher_no nvarchar(255), + pay_amount nvarchar(255), + data_source int, + collect_source nvarchar(50), + pay_month datetime, + eb_data_id bigint, + voucher_type_name nvarchar(50), + employee_type int +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202412230103.sql b/resource/sqlupgrade/ST/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java new file mode 100644 index 000000000..01becf206 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java @@ -0,0 +1,127 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-个人养老金 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_personal_pension +//其他免税扣除-个人养老金 +public class PersonalPensionListDTO { + + private Long id; + + private Long mainId; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @ExcelProperty(index = 5) + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + private String idNo; + + + //缴费月度 + private Date payMonth; + + //凭证类别 + private Integer voucherType; + + //凭证类别名称 + @ExcelProperty(index = 6) + @TableTitle(title = "凭证类型", dataIndex = "voucherTypeName", key = "voucherTypeName") + private String voucherTypeName; + + //凭证编码 + @ExcelProperty(index = 7) + @TableTitle(title = "凭证编码", dataIndex = "voucherNo", key = "voucherNo") + private String voucherNo; + + //缴费金额 + @ExcelProperty(index = 8) + @TableTitle(title = "缴费金额", dataIndex = "payAmount", key = "payAmount") + private String payAmount; + + //归档状态 0未归档 1已归档 + private Integer fileStatus; + + /** + * @see EnumDeductionDataSource + */ + //数据来源 + private Integer dataSource; + + //采集来源 + private String collectSource; + + //创建时间 + private Date createTime; + + //更新时间 + private Date updateTime; + + //创建人 + private Long creator; + +} diff --git a/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java new file mode 100644 index 000000000..0eaf002cb --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 减免税额 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_derate_deduction +//其他免税扣除-减免税额 +public class DerateDeductionSaveParam { + //主键id + private Long id; + + //主表数据Id + private Long mainId; + + //税款所属期 + private Date taxYearMonth; + + //人员 + private Long employeeId; + + //个税扣缴义务人 + private Long taxAgentId; + + //减免事项 + private String derateItem; + + //减免性质 + private String derateProperty; + + //减免金额 + private String derateAmount; +} diff --git a/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java b/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java new file mode 100644 index 000000000..7a5b6ffba --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java @@ -0,0 +1,60 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 税延养老保险 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_endowment_insurance +//其他免税扣除-税延养老保险 +public class EndowmentInsuranceSaveParam { + + //主键 + private Long id; + + //主表数据Id + private Long mainId; + + //税款所属期 + private Date taxYearMonth; + + //人员id + private Long employeeId; + + //个税扣缴义务人ID + private Long taxAgentId; + + //申报扣除月份 + private Date deductionMonth; + + //税延养老账户编号 + private String accountNumber; + + //报税校验码 + private String checkCode; + + //年度保费 + private String yearPremium; + + //月度保费 + private String monthPremium; + + //本期扣除金额 + private String currentDeduction; + + +} diff --git a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java new file mode 100644 index 000000000..70e05f6bc --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-免税收入表单 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_free_income +//其他免税扣除-免税收入 +public class FreeIncomeSaveParam { + //主键id + private Long id; + + //主表数据Id + private Long mainId; + + //税款所属期 + private Date taxYearMonth; + + //人员 + private Long employeeId; + + //个税扣缴义务人 + private Long taxAgentId; + + //免税事项 + private String freeItem; + + //免税性质 + private String freeProperty; + + //免税金额 + private String freeAmount; +} diff --git a/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java b/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java new file mode 100644 index 000000000..6b8256e0a --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java @@ -0,0 +1,59 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-准予扣除的捐赠额 + * + * @author chengliming + * @date 2023-06-09 15:03:45 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_grant_donation +//其他免税扣除-准予扣除的捐赠额 +public class GrantDonationSaveParam { + //主键id + private Long id; + + //主表数据Id + private Long mainId; + + //税款所属期 + private Date taxYearMonth; + + //人员 + private Long employeeId; + + //个税扣缴义务人 + private Long taxAgentId; + + //受赠单位名称 + private String recipientName; + + //受赠单位纳税人识别号 + private String taxCode; + + //捐赠凭证号 + private String donationNumber; + + //捐赠日期 + private Date donateDate; + + //捐赠金额 + private String donateAmount; + + //扣除比例 + private String deductionProportion; + + //实际扣除金额 + private String actualDeduction; + +} diff --git a/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java b/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java new file mode 100644 index 000000000..6a24c8192 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java @@ -0,0 +1,54 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 商业健康保险 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_health_insurance +//其他免税扣除-商业健康保险表单 +public class HealthInsuranceSaveParam { + //主键id + private Long id; + + //主表数据Id + private Long mainId; + + //税款所属期 + private Date taxYearMonth; + + //人员 + private Long employeeId; + + //个税扣缴义务人 + private Long taxAgentId; + + //税优识别码 + private String identificationNumber; + + //保单生效日期 + private Date effectiveDate; + + //年度保费 + private String yearPremium; + + //月度保费 + private String monthPremium; + + //本期扣除金额 + private String currentDeduction; +} diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java new file mode 100644 index 000000000..160a296a2 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-其他 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_other_derate_deduction +//其他免税扣除-其他 +public class OtherDerateDeductionSaveParam { + //主键id + private Long id; + + //主表数据Id + private Long mainId; + + //税款所属期 + private Date taxYearMonth; + + //人员 + private Long employeeId; + + //个税扣缴义务人 + private Long taxAgentId; + + //减免税额 + private String otherDeduction; + + //备注 + private String remark; +} diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index c602d6ede..82d83784c 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -142,5 +142,6 @@ public class OtherDeductionPO { private List grantDonationList; private List healthInsuranceList; private List otherDerateDeductionList; + private List personalPensionList; } \ No newline at end of file diff --git a/src/com/engine/salary/enums/datacollection/PersonalPensionVoucherTypeEnum.java b/src/com/engine/salary/enums/datacollection/PersonalPensionVoucherTypeEnum.java new file mode 100644 index 000000000..7646c3246 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/PersonalPensionVoucherTypeEnum.java @@ -0,0 +1,52 @@ +package com.engine.salary.enums.datacollection; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; +import java.util.Optional; + +/** + * 个人养老金凭证类别 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum PersonalPensionVoucherTypeEnum implements BaseEnum { + YEAR(1, "月度", 173218), + MONTH(2, "年度", 157163); + + private int value; + + private String defaultLabel; + + private int labelId; + + PersonalPensionVoucherTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public Integer getLabelId() { + return labelId; + } + + public static String getDefaultLabelByValue(Integer value) { + Optional optional = Arrays.stream(PersonalPensionVoucherTypeEnum.values()).filter(r -> Integer.valueOf(r.getValue()).equals(value)).findFirst(); + return optional.isPresent() ? optional.get().getDefaultLabel() : ""; + } + + public static PersonalPensionVoucherTypeEnum parseByValue(int value) { + return Arrays.stream(values()).filter(e -> e.getValue() == value).findFirst().orElse(null); + } +} diff --git a/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.java b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.java new file mode 100644 index 000000000..08681c5ce --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.PersonalPensionPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface PersonalPensionMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(PersonalPensionPO personalPension); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + PersonalPensionPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param personalPension 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(PersonalPensionPO personalPension); + + + /** + * 修改,修改所有字段 + * + * @param personalPension 修改的记录 + * @return 返回影响行数 + */ + int update(PersonalPensionPO personalPension); + + /** + * 修改,忽略null字段 + * + * @param personalPension 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(PersonalPensionPO personalPension); + + /** + * 删除记录 + * + * @param personalPension 待删除的记录 + * @return 返回影响行数 + */ + int delete(PersonalPensionPO personalPension); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml new file mode 100644 index 000000000..675af0871 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml @@ -0,0 +1,390 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + collect_source + , t.create_time + , t.creator + , t.data_source + , t.delete_type + , t.eb_data_id + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.pay_amount + , t.pay_month + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.voucher_no + , t.voucher_type + , t.voucher_type_name + + + + + + + + + + + + + + + INSERT INTO hrsa_personal_pension + + + + collect_source, + + + create_time, + + + creator, + + + data_source, + + + delete_type, + + + eb_data_id, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + pay_amount, + + + pay_month, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + voucher_no, + + + voucher_type, + + + voucher_type_name, + + + + + #{collectSource}, + + + #{createTime}, + + + #{creator}, + + + #{dataSource}, + + + #{deleteType}, + + + #{ebDataId}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{payAmount}, + + + #{payMonth}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{voucherNo}, + + + #{voucherType}, + + + #{voucherTypeName}, + + + + + + + + UPDATE hrsa_personal_pension + + collect_source=#{collectSource}, + create_time=#{createTime}, + creator=#{creator}, + data_source=#{dataSource}, + delete_type=#{deleteType}, + eb_data_id=#{ebDataId}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + pay_amount=#{payAmount}, + pay_month=#{payMonth}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + voucher_no=#{voucherNo}, + voucher_type=#{voucherType}, + voucher_type_name=#{voucherTypeName}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_personal_pension + + + collect_source=#{collectSource}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + data_source=#{dataSource}, + + + delete_type=#{deleteType}, + + + eb_data_id=#{ebDataId}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + pay_amount=#{payAmount}, + + + pay_month=#{payMonth}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + voucher_no=#{voucherNo}, + + + voucher_type=#{voucherType}, + + + voucher_type_name=#{voucherTypeName}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_personal_pension + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_personal_pension + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index 854286a0f..f2f8b2efa 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -47,15 +47,13 @@ public interface OtherDeductionService { /** * 导出 - * */ XSSFWorkbook export(OtherDeductionQueryParam queryParam); /** * 导出详情 - * */ - XSSFWorkbook exportDetail( OtherDeductionQueryParam queryParam); + XSSFWorkbook exportDetail(OtherDeductionQueryParam queryParam); /** * 下载导入模板 @@ -67,6 +65,7 @@ public interface OtherDeductionService { /** * 下载明细模板 + * * @param param * @return */ @@ -84,6 +83,7 @@ public interface OtherDeductionService { /** * 导入明细数据 + * * @param importParam * @return */ @@ -124,4 +124,17 @@ public interface OtherDeductionService { OtherDeductionRecordDTO getOtherDeduction(OtherDeductionParam otherDeductionParam); String extendToLastMonth(OtherDeductionExtendLastParam param); + + /** + * 保存免税收入 + * @param param + */ + void saveFreeIncome(FreeIncomeSaveParam param); +// void saveEndowmentInsurance(EndowmentInsuranceSaveParam param); +// void saveGrantDonation(GrantDonationSaveParam param); +// void saveHealthInsurance(HealthInsuranceSaveParam param); +// void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param); +// void saveDerateDeduction(DerateDeductionSaveParam param); + + } diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 5bdb007c8..c8d98a3f8 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -21,6 +21,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.*; import com.engine.salary.mapper.sys.SalarySysConfMapper; @@ -1344,6 +1345,154 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction IOUtils.closeQuietly(fileInputStream); } + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, PersonalPensionListDTO.class, 6, 1, 9, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + PersonalPensionListDTO dto = dtoList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + PersonalPensionPO po = PersonalPensionPO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + po.setVoucherTypeName(dto.getVoucherTypeName()); + po.setVoucherNo(dto.getVoucherNo()); + po.setPayAmount(dto.getPayAmount()); + + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getPersonalPensionList().add(po); + } else { + mainPo.getPersonalPensionList().add(po); + eligibleData.add(mainPo); + } + } else { + errorCount += 1; + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; } @@ -2020,11 +2169,53 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction map.put("减免税额", Arrays.asList(derateDeductionTitle)); List otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "其他免税扣除金额", "备注"); map.put("其他", Arrays.asList(otherDerateDeductionTitle)); -// map.put("个人养老金", rowList); + List personalPensionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "凭证类型", "凭证编码", "缴费金额"); + map.put("个人养老金", Arrays.asList(personalPensionTitle)); XSSFWorkbook book = ExcelUtil.genWorkbookV2(map); return book; } + + @Override + public void saveFreeIncome(FreeIncomeSaveParam param) { + Date now = new Date(); + + Long id = param.getId(); + if (id == null) { + FreeIncomePO po = FreeIncomePO.builder() + .id(id) + .mainId(param.getMainId()) + .taxYearMonth(param.getTaxYearMonth()) + .employeeId(param.getEmployeeId()) + .taxAgentId(param.getTaxAgentId()) + .freeItem(param.getFreeItem()) + .freeProperty(param.getFreeProperty()) + .freeAmount(param.getFreeAmount()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getFreeIncomeMapper().insertIgnoreNull(po); + } else { + FreeIncomePO po = getFreeIncomeMapper().getById(id); + + po.setTaxYearMonth(param.getTaxYearMonth()); + po.setEmployeeId(param.getEmployeeId()); + po.setTaxAgentId(param.getTaxAgentId()); + po.setFreeItem(param.getFreeItem()); + po.setFreeProperty(param.getFreeProperty()); + po.setFreeAmount(param.getFreeAmount()); + po.setEmployeeType(0); + po.setUpdateTime(now); + + getFreeIncomeMapper().updateIgnoreNull(po); + } + } + } From 412d3488d1c853bd4270ad1034a3baace6b67dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 24 Dec 2024 10:54:57 +0800 Subject: [PATCH 230/298] =?UTF-8?q?=E5=87=8F=E5=85=8D=E7=A8=8E=E9=A2=9D?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=92=8C=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202412240103.sql | 10 ++++++ resource/sqlupgrade/GS/sql202412240103.sql | 10 ++++++ resource/sqlupgrade/JC/sql202412240103.sql | 10 ++++++ resource/sqlupgrade/Mysql/sql202412240103.sql | 3 ++ .../sqlupgrade/Oracle/sql202412240103.sql | 9 +++++ resource/sqlupgrade/PG/sql202412240103.sql | 3 ++ .../sqlupgrade/SQLServer/sql202412240103.sql | 5 +++ resource/sqlupgrade/ST/sql202412240103.sql | 10 ++++++ .../param/FreeIncomeSaveParam.java | 19 +++++------ .../param/OtherDeductionDetailQueryParam.java | 25 ++++++++++++++ .../datacollection/po/DerateDeductionPO.java | 4 +++ .../po/EndowmentInsurancePO.java | 4 +++ .../datacollection/po/FreeIncomePO.java | 4 +++ .../datacollection/po/GrantDonationPO.java | 4 +++ .../datacollection/po/HealthInsurancePO.java | 4 +++ .../po/OtherDerateDeductionPO.java | 4 +++ .../datacollection/po/PersonalPensionPO.java | 4 +++ .../salary/service/OtherDeductionService.java | 3 ++ .../impl/OtherDeductionServiceImpl.java | 30 +++++++++++++---- .../salary/web/OtherDeductionController.java | 33 +++++++++++++++---- .../salary/wrapper/OtherDeductionWrapper.java | 9 +++++ 21 files changed, 183 insertions(+), 24 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202412240103.sql create mode 100644 resource/sqlupgrade/GS/sql202412240103.sql create mode 100644 resource/sqlupgrade/JC/sql202412240103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202412240103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202412240103.sql create mode 100644 resource/sqlupgrade/PG/sql202412240103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202412240103.sql create mode 100644 resource/sqlupgrade/ST/sql202412240103.sql create mode 100644 src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java diff --git a/resource/sqlupgrade/DM/sql202412240103.sql b/resource/sqlupgrade/DM/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/GS/sql202412240103.sql b/resource/sqlupgrade/GS/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/JC/sql202412240103.sql b/resource/sqlupgrade/JC/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202412240103.sql b/resource/sqlupgrade/Mysql/sql202412240103.sql new file mode 100644 index 000000000..fb1d84ef2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412240103.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_other_deduction +ADD COLUMN free_income varchar(255) , +ADD COLUMN derate_deduction varchar(255) ; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412240103.sql b/resource/sqlupgrade/Oracle/sql202412240103.sql new file mode 100644 index 000000000..ca85eff16 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412240103.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +) +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412240103.sql b/resource/sqlupgrade/PG/sql202412240103.sql new file mode 100644 index 000000000..4820d7cee --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412240103.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_other_deduction ADD COLUMN free_income varchar(255) NULL; + +ALTER TABLE hrsa_other_deduction ADD COLUMN derate_deduction varchar(255) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412240103.sql b/resource/sqlupgrade/SQLServer/sql202412240103.sql new file mode 100644 index 000000000..cfb59073c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412240103.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_other_deduction ADD free_income varchar(255) NULL +GO + +ALTER TABLE hrsa_other_deduction ADD derate_deduction varchar(255) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202412240103.sql b/resource/sqlupgrade/ST/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java index 70e05f6bc..c75354b73 100644 --- a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java @@ -5,8 +5,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.Date; - /** * 其他免税扣除-免税收入表单 *

Copyright: Copyright (c) 2024

@@ -28,14 +26,15 @@ public class FreeIncomeSaveParam { //主表数据Id private Long mainId; - //税款所属期 - private Date taxYearMonth; - - //人员 - private Long employeeId; - - //个税扣缴义务人 - private Long taxAgentId; +// //税款所属期 +// @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") +// private Date taxYearMonth; +// +// //人员 +// private Long employeeId; +// +// //个税扣缴义务人 +// private Long taxAgentId; //免税事项 private String freeItem; diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java new file mode 100644 index 000000000..c01fc3edd --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 其他免税扣除,附表查询列表 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDeductionDetailQueryParam extends BaseQueryParam { + + private Long id; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java index d27f93e59..5d94d3627 100644 --- a/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java @@ -8,6 +8,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -74,4 +75,7 @@ public class DerateDeductionPO{ @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java index 1688dbcf9..9bb444ebe 100644 --- a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java +++ b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -83,4 +84,7 @@ public class EndowmentInsurancePO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + //主键id + private Collection ids; + } diff --git a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java index cd017fa54..085b7f751 100644 --- a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java +++ b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -73,4 +74,7 @@ public class FreeIncomePO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java index d85239da4..f65f73caa 100644 --- a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java +++ b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -84,4 +85,7 @@ public class GrantDonationPO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + //主键id + private Collection ids; + } diff --git a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java index c27dc5061..86152ffef 100644 --- a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java +++ b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -78,4 +79,7 @@ public class HealthInsurancePO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java index 2396dd973..74f403bab 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -70,4 +71,7 @@ public class OtherDerateDeductionPO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java index 6af983b1f..8732c4af5 100644 --- a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java @@ -8,6 +8,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -89,4 +90,7 @@ public class PersonalPensionPO{ @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index f2f8b2efa..9b7875f76 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; @@ -125,6 +126,8 @@ public interface OtherDeductionService { String extendToLastMonth(OtherDeductionExtendLastParam param); + PageInfo freeIncomeList(OtherDeductionDetailQueryParam param); + /** * 保存免税收入 * @param param diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index c8d98a3f8..62eb03d76 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -51,6 +51,7 @@ import org.apache.commons.lang3.Validate; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; @@ -2182,14 +2183,17 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction public void saveFreeIncome(FreeIncomeSaveParam param) { Date now = new Date(); + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getOtherDeductionMapper().getById(mainId); + Long id = param.getId(); if (id == null) { FreeIncomePO po = FreeIncomePO.builder() .id(id) - .mainId(param.getMainId()) - .taxYearMonth(param.getTaxYearMonth()) - .employeeId(param.getEmployeeId()) - .taxAgentId(param.getTaxAgentId()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) .freeItem(param.getFreeItem()) .freeProperty(param.getFreeProperty()) .freeAmount(param.getFreeAmount()) @@ -2205,9 +2209,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } else { FreeIncomePO po = getFreeIncomeMapper().getById(id); - po.setTaxYearMonth(param.getTaxYearMonth()); - po.setEmployeeId(param.getEmployeeId()); - po.setTaxAgentId(param.getTaxAgentId()); +// po.setTaxYearMonth(param.getTaxYearMonth()); +// po.setEmployeeId(param.getEmployeeId()); +// po.setTaxAgentId(param.getTaxAgentId()); po.setFreeItem(param.getFreeItem()); po.setFreeProperty(param.getFreeProperty()); po.setFreeAmount(param.getFreeAmount()); @@ -2218,4 +2222,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + @Override + public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + + List freeIncomePOS = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); + List listDTOS = freeIncomePOS.stream().map(po -> { + FreeIncomeListDTO freeIncomeListDTO = new FreeIncomeListDTO(); + BeanUtils.copyProperties(po, freeIncomeListDTO); + return freeIncomeListDTO; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, FreeIncomeListDTO.class); + } + } diff --git a/src/com/engine/salary/web/OtherDeductionController.java b/src/com/engine/salary/web/OtherDeductionController.java index 251507f68..f041392ee 100644 --- a/src/com/engine/salary/web/OtherDeductionController.java +++ b/src/com/engine/salary/web/OtherDeductionController.java @@ -1,6 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; @@ -279,8 +280,8 @@ public class OtherDeductionController { } /** - * @description 编辑其他免税扣除 * @return String + * @description 编辑其他免税扣除 * @author Harryxzy * @date 2022/10/26 9:41 */ @@ -293,8 +294,8 @@ public class OtherDeductionController { } /** - * @description 获取其他免税扣除数据 * @return String + * @description 获取其他免税扣除数据 * @author Harryxzy * @date 2022/10/31 13:42 */ @@ -307,8 +308,8 @@ public class OtherDeductionController { } /** - * @description 新建其他免税扣除 * @return String + * @description 新建其他免税扣除 * @author Harryxzy * @date 2022/10/27 14:41 */ @@ -321,8 +322,8 @@ public class OtherDeductionController { } /** - * @description 删除所选其他免税扣除 * @return String + * @description 删除所选其他免税扣除 * @author Harryxzy * @date 2022/10/27 14:41 */ @@ -335,8 +336,8 @@ public class OtherDeductionController { } /** - * @description 一键清空其他免税扣除 * @return null + * @description 一键清空其他免税扣除 * @author Harryxzy * @date 2022/10/27 15:15 */ @@ -351,9 +352,27 @@ public class OtherDeductionController { @POST @Path("/extendToLastMonth") @Produces(MediaType.APPLICATION_JSON) - public String extendToLastMonth(@Context HttpServletRequest request, @Context HttpServletResponse response, - @RequestBody OtherDeductionExtendLastParam param) { + public String extendToLastMonth(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionExtendLastParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getOtherDeductionWrapper(user)::extendToLastMonth, param); } + + //减免税额列表 + @POST + @Path("/freeIncomeList") + @Produces(MediaType.APPLICATION_JSON) + public String detailList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::freeIncomeList, param); + } + + @POST + @Path("/saveFreeIncome") + @Produces(MediaType.APPLICATION_JSON) + public String saveFreeIncome(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody FreeIncomeSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveFreeIncome, param); + } + + } diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index f8a261828..d8e87a630 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -6,6 +6,7 @@ import com.api.browser.util.ConditionFactory; import com.api.browser.util.ConditionType; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; @@ -288,4 +289,12 @@ public class OtherDeductionWrapper extends Service { param.setYearMonthTime(localDate); return getOtherDeductionService(user).extendToLastMonth(param); } + + public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).freeIncomeList(param); + } + + public void saveFreeIncome(FreeIncomeSaveParam param) { + getOtherDeductionService(user).saveFreeIncome(param); + } } From 9c99e53288036c20193cd7beb3fc4ebf861e1ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 24 Dec 2024 15:52:36 +0800 Subject: [PATCH 231/298] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=92=8C=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/PersonalPensionSaveParam.java | 74 ++++ .../salary/service/OtherDeductionService.java | 21 +- .../impl/OtherDeductionServiceImpl.java | 394 +++++++++++++++++- 3 files changed, 460 insertions(+), 29 deletions(-) create mode 100644 src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java diff --git a/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java new file mode 100644 index 000000000..814206dae --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java @@ -0,0 +1,74 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 其他免税扣除-个人养老金 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_personal_pension +//其他免税扣除-个人养老金 +public class PersonalPensionSaveParam { + + //主键id + private Long id; + + //主表数据Id + private Long mainId; + + //税款所属期 + private Date taxYearMonth; + + //缴费月度 + private Date payMonth; + + //人员 + private Long employeeId; + + //个税扣缴义务人 + private Long taxAgentId; + + //凭证类别 + private Integer voucherType; + + //凭证类别名称 + private String voucherTypeName; + + //凭证编码 + private String voucherNo; + + //缴费金额 + private String payAmount; + + + /** + * 人员类型 + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + /** + * 数据来源 + * @see EnumDeductionDataSource + */ + private Integer dataSource; + + //采集来源 + private String collectSource; + +} diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index 9b7875f76..21307f57b 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -1,8 +1,6 @@ package com.engine.salary.service; -import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.util.page.PageInfo; @@ -127,17 +125,24 @@ public interface OtherDeductionService { String extendToLastMonth(OtherDeductionExtendLastParam param); PageInfo freeIncomeList(OtherDeductionDetailQueryParam param); + PageInfo derateDeductionListDTOList(OtherDeductionDetailQueryParam param); + PageInfo endowmentInsuranceListDTOList(OtherDeductionDetailQueryParam param); + PageInfo grantDonationListDTOList(OtherDeductionDetailQueryParam param); + PageInfo healthInsuranceListDTOList(OtherDeductionDetailQueryParam param); + PageInfo otherDerateDeductionListDTOList(OtherDeductionDetailQueryParam param); + PageInfo personalPensionListDTOList(OtherDeductionDetailQueryParam param); /** * 保存免税收入 * @param param */ void saveFreeIncome(FreeIncomeSaveParam param); -// void saveEndowmentInsurance(EndowmentInsuranceSaveParam param); -// void saveGrantDonation(GrantDonationSaveParam param); -// void saveHealthInsurance(HealthInsuranceSaveParam param); -// void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param); -// void saveDerateDeduction(DerateDeductionSaveParam param); + void saveEndowmentInsurance(EndowmentInsuranceSaveParam param); + void saveGrantDonation(GrantDonationSaveParam param); + void saveHealthInsurance(HealthInsuranceSaveParam param); + void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param); + void saveDerateDeduction(DerateDeductionSaveParam param); + void savePersonalPension(PersonalPensionSaveParam param); } diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 62eb03d76..f4555c9a3 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -124,6 +124,10 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return MapperProxyFactory.getProxy(OtherDerateDeductionMapper.class); } + private PersonalPensionMapper getPersonalPensionMapper() { + return MapperProxyFactory.getProxy(PersonalPensionMapper.class); + } + @Override public OtherDeductionPO getById(Long id) { @@ -1164,13 +1168,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } - String derateAmount = dto.getDerateAmount(); - String derateItem = dto.getDerateItem(); - String derateProperty = dto.getDerateProperty(); - po.setDerateAmount(derateAmount); - po.setDerateItem(derateItem); - po.setDerateProperty(derateProperty); - + po.setDerateAmount(dto.getDerateAmount()); + po.setDerateItem(dto.getDerateItem()); + po.setDerateProperty(dto.getDerateProperty()); if (errorSum == 0) { successCount += 1; @@ -2178,13 +2178,94 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return book; } + @Override + public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + + List freeIncomePOS = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); + List listDTOS = freeIncomePOS.stream().map(po -> { + FreeIncomeListDTO freeIncomeListDTO = new FreeIncomeListDTO(); + BeanUtils.copyProperties(po, freeIncomeListDTO); + return freeIncomeListDTO; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, FreeIncomeListDTO.class); + } + + @Override + public PageInfo derateDeductionListDTOList(OtherDeductionDetailQueryParam param) { + List pos = getDerateDeductionMapper().listSome(DerateDeductionPO.builder().mainId(param.getId()).build()); + List listDTOS = pos.stream().map(po -> { + DerateDeductionListDTO dtos = new DerateDeductionListDTO(); + BeanUtils.copyProperties(po, dtos); + return dtos; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, DerateDeductionListDTO.class); + } + + @Override + public PageInfo endowmentInsuranceListDTOList(OtherDeductionDetailQueryParam param) { + List pos = getEndowmentInsuranceMapper().listSome(EndowmentInsurancePO.builder().mainId(param.getId()).build()); + List listDTOS = pos.stream().map(po -> { + EndowmentInsuranceListDTO dtos = new EndowmentInsuranceListDTO(); + BeanUtils.copyProperties(po, dtos); + return dtos; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, EndowmentInsuranceListDTO.class); + } + + @Override + public PageInfo grantDonationListDTOList(OtherDeductionDetailQueryParam param) { + List pos = getGrantDonationMapper().listSome(GrantDonationPO.builder().mainId(param.getId()).build()); + List listDTOS = pos.stream().map(po -> { + GrantDonationListDTO dtos = new GrantDonationListDTO(); + BeanUtils.copyProperties(po, dtos); + return dtos; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, GrantDonationListDTO.class); + } + + @Override + public PageInfo healthInsuranceListDTOList(OtherDeductionDetailQueryParam param) { + List pos = getHealthInsuranceMapper().listSome(HealthInsurancePO.builder().mainId(param.getId()).build()); + List listDTOS = pos.stream().map(po -> { + HealthInsuranceListDTO dtos = new HealthInsuranceListDTO(); + BeanUtils.copyProperties(po, dtos); + return dtos; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, HealthInsuranceListDTO.class); + } + + @Override + public PageInfo otherDerateDeductionListDTOList(OtherDeductionDetailQueryParam param) { + List pos = getOtherDerateDeductionMapper().listSome(OtherDerateDeductionPO.builder().mainId(param.getId()).build()); + List listDTOS = pos.stream().map(po -> { + OtherDerateDeductionListDTO dtos = new OtherDerateDeductionListDTO(); + BeanUtils.copyProperties(po, dtos); + return dtos; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, OtherDerateDeductionListDTO.class); + } + + @Override + public PageInfo personalPensionListDTOList(OtherDeductionDetailQueryParam param) { + List pos = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); + List listDTOS = pos.stream().map(po -> { + PersonalPensionListDTO dtos = new PersonalPensionListDTO(); + BeanUtils.copyProperties(po, dtos); + return dtos; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, PersonalPensionListDTO.class); + } + @Override public void saveFreeIncome(FreeIncomeSaveParam param) { Date now = new Date(); Long mainId = param.getMainId(); - OtherDeductionPO deductionPO = getOtherDeductionMapper().getById(mainId); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("主表不存在!"); + } Long id = param.getId(); if (id == null) { @@ -2208,30 +2289,301 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getFreeIncomeMapper().insertIgnoreNull(po); } else { FreeIncomePO po = getFreeIncomeMapper().getById(id); + if (po == null){ + throw new SalaryRunTimeException("记录不存在!"); + } -// po.setTaxYearMonth(param.getTaxYearMonth()); -// po.setEmployeeId(param.getEmployeeId()); -// po.setTaxAgentId(param.getTaxAgentId()); + po.setUpdateTime(now); po.setFreeItem(param.getFreeItem()); po.setFreeProperty(param.getFreeProperty()); po.setFreeAmount(param.getFreeAmount()); - po.setEmployeeType(0); - po.setUpdateTime(now); getFreeIncomeMapper().updateIgnoreNull(po); } } @Override - public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + public void saveEndowmentInsurance(EndowmentInsuranceSaveParam param) { + Date now = new Date(); - List freeIncomePOS = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); - List listDTOS = freeIncomePOS.stream().map(po -> { - FreeIncomeListDTO freeIncomeListDTO = new FreeIncomeListDTO(); - BeanUtils.copyProperties(po, freeIncomeListDTO); - return freeIncomeListDTO; - }).collect(Collectors.toList()); - return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, FreeIncomeListDTO.class); + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("主表不存在!"); + } + + Long id = param.getId(); + if (id == null) { + EndowmentInsurancePO po = EndowmentInsurancePO.builder() + .id(id) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .accountNumber(param.getAccountNumber()) + .checkCode(param.getCheckCode()) + .yearPremium(param.getYearPremium()) + .monthPremium(param.getMonthPremium()) + .currentDeduction(param.getCurrentDeduction()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getEndowmentInsuranceMapper().insertIgnoreNull(po); + } else { + EndowmentInsurancePO po = getEndowmentInsuranceMapper().getById(id); + if (po == null){ + throw new SalaryRunTimeException("记录不存在!"); + } + + po.setUpdateTime(now); + po.setAccountNumber(param.getAccountNumber()); + po.setCheckCode(param.getCheckCode()); + po.setYearPremium(param.getYearPremium()); + po.setMonthPremium(param.getMonthPremium()); + po.setCurrentDeduction(param.getCurrentDeduction()); + + getEndowmentInsuranceMapper().updateIgnoreNull(po); + } + } + + @Override + public void saveGrantDonation(GrantDonationSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("主表不存在!"); + } + + Long id = param.getId(); + if (id == null) { + GrantDonationPO po = GrantDonationPO.builder() + .id(id) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .recipientName(param.getRecipientName()) + .taxCode(param.getTaxCode()) + .donationNumber(param.getDonationNumber()) + .donateDate(param.getDonateDate()) + .donateAmount(param.getDonateAmount()) + .deductionProportion(param.getDeductionProportion()) + .actualDeduction(param.getActualDeduction()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getGrantDonationMapper().insertIgnoreNull(po); + } else { + GrantDonationPO po = getGrantDonationMapper().getById(id); + if (po == null){ + throw new SalaryRunTimeException("记录不存在!"); + } + + po.setUpdateTime(now); + po.setRecipientName(param.getRecipientName()); + po.setTaxCode(param.getTaxCode()); + po.setDonationNumber(param.getDonationNumber()); + po.setDonateDate(param.getDonateDate()); + po.setDonateAmount(param.getDonateAmount()); + po.setDeductionProportion(param.getDeductionProportion()); + po.setActualDeduction(param.getActualDeduction()); + + getGrantDonationMapper().updateIgnoreNull(po); + } + } + + @Override + public void saveHealthInsurance(HealthInsuranceSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("主表不存在!"); + } + + Long id = param.getId(); + if (id == null) { + HealthInsurancePO po = HealthInsurancePO.builder() + .id(id) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .identificationNumber(param.getIdentificationNumber()) + .effectiveDate(param.getEffectiveDate()) + .yearPremium(param.getYearPremium()) + .monthPremium(param.getMonthPremium()) + .currentDeduction(param.getCurrentDeduction()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getHealthInsuranceMapper().insertIgnoreNull(po); + } else { + HealthInsurancePO po = getHealthInsuranceMapper().getById(id); + if (po == null){ + throw new SalaryRunTimeException("记录不存在!"); + } + + po.setUpdateTime(now); + po.setIdentificationNumber(param.getIdentificationNumber()); + po.setEffectiveDate(param.getEffectiveDate()); + po.setYearPremium(param.getYearPremium()); + po.setMonthPremium(param.getMonthPremium()); + po.setCurrentDeduction(param.getCurrentDeduction()); + + getHealthInsuranceMapper().updateIgnoreNull(po); + } + } + + @Override + public void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("主表不存在!"); + } + + Long id = param.getId(); + if (id == null) { + OtherDerateDeductionPO po = OtherDerateDeductionPO.builder() + .id(id) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .otherDeduction(param.getOtherDeduction()) + .remark(param.getRemark()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getOtherDerateDeductionMapper().insertIgnoreNull(po); + } else { + OtherDerateDeductionPO po = getOtherDerateDeductionMapper().getById(id); + if (po == null){ + throw new SalaryRunTimeException("记录不存在!"); + } + + po.setUpdateTime(now); + po.setOtherDeduction(param.getOtherDeduction()); + po.setRemark(param.getRemark()); + + getOtherDerateDeductionMapper().updateIgnoreNull(po); + } + } + + @Override + public void saveDerateDeduction(DerateDeductionSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("主表不存在!"); + } + + Long id = param.getId(); + if (id == null) { + DerateDeductionPO po = DerateDeductionPO.builder() + .id(id) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .derateAmount(param.getDerateAmount()) + .derateItem(param.getDerateItem()) + .derateProperty(param.getDerateProperty()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getDerateDeductionMapper().insertIgnoreNull(po); + } else { + DerateDeductionPO po = getDerateDeductionMapper().getById(id); + if (po == null){ + throw new SalaryRunTimeException("记录不存在!"); + } + + po.setUpdateTime(now); + po.setDerateAmount(param.getDerateAmount()); + po.setDerateItem(param.getDerateItem()); + po.setDerateProperty(param.getDerateProperty()); + + getDerateDeductionMapper().updateIgnoreNull(po); + } + } + + @Override + public void savePersonalPension(PersonalPensionSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("主表不存在!"); + } + + Long id = param.getId(); + if (id == null) { + PersonalPensionPO po = PersonalPensionPO.builder() + .id(id) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .voucherTypeName(param.getVoucherTypeName()) + .voucherNo(param.getVoucherNo()) + .payAmount(param.getPayAmount()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getPersonalPensionMapper().insertIgnoreNull(po); + } else { + PersonalPensionPO po = getPersonalPensionMapper().getById(id); + if (po == null){ + throw new SalaryRunTimeException("记录不存在!"); + } + + po.setUpdateTime(now); + po.setVoucherTypeName(param.getVoucherTypeName()); + po.setVoucherNo(param.getVoucherNo()); + po.setPayAmount(param.getPayAmount()); + + getPersonalPensionMapper().updateIgnoreNull(po); + } } } From 2e4c3ddaffd4fa67d58bfc3b72141d13b8b38a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 25 Dec 2024 10:36:37 +0800 Subject: [PATCH 232/298] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/DerateDeductionListDTO.java | 2 + .../dto/EndowmentInsuranceListDTO.java | 2 + .../datacollection/dto/FreeIncomeListDTO.java | 2 + .../dto/GrantDonationListDTO.java | 2 + .../dto/HealthInsuranceListDTO.java | 2 + .../dto/OtherDerateDeductionListDTO.java | 2 + .../dto/PersonalPensionListDTO.java | 2 + .../OtherDeductionDetailDeleteParam.java | 26 +++ .../salary/service/OtherDeductionService.java | 23 +- .../impl/OtherDeductionServiceImpl.java | 215 ++++++++++++++---- .../salary/web/OtherDeductionController.java | 170 +++++++++++++- .../salary/wrapper/OtherDeductionWrapper.java | 93 +++++++- 12 files changed, 474 insertions(+), 67 deletions(-) create mode 100644 src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailDeleteParam.java diff --git a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java index 4b36ec418..c0751492b 100644 --- a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.I18n; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -46,6 +47,7 @@ public class DerateDeductionListDTO { private Integer employeeType; @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxYearMonth; //姓名 diff --git a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java index 699054258..0af824f19 100644 --- a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java @@ -4,6 +4,7 @@ import com.engine.salary.annotation.I18n; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -45,6 +46,7 @@ public class EndowmentInsuranceListDTO { private Integer employeeType; @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxYearMonth; //姓名 diff --git a/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java index a8e132c47..698dcbde0 100644 --- a/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.I18n; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -46,6 +47,7 @@ public class FreeIncomeListDTO { private Integer employeeType; @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxYearMonth; //姓名 diff --git a/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java index a6fd88268..6255c4043 100644 --- a/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -41,6 +42,7 @@ public class GrantDonationListDTO { private Integer employeeType; @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxYearMonth; //姓名 diff --git a/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java index 5790a528e..9cc8d0b4f 100644 --- a/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -42,6 +43,7 @@ public class HealthInsuranceListDTO { private Integer employeeType; @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxYearMonth; //姓名 diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java index cfbdd1874..d4d292a14 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -42,6 +43,7 @@ public class OtherDerateDeductionListDTO { private Integer employeeType; @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date taxYearMonth; //姓名 diff --git a/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java index 01becf206..9bfb90790 100644 --- a/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.datacollection.EnumDeductionDataSource; import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -47,6 +48,7 @@ public class PersonalPensionListDTO { private Integer employeeType; @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxYearMonth; //姓名 diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailDeleteParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailDeleteParam.java new file mode 100644 index 000000000..447c04b87 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailDeleteParam.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 删除参数 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDeductionDetailDeleteParam { + + // 主键id + private List ids; +} diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index 21307f57b..3e4c0c7d7 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -125,17 +125,13 @@ public interface OtherDeductionService { String extendToLastMonth(OtherDeductionExtendLastParam param); PageInfo freeIncomeList(OtherDeductionDetailQueryParam param); - PageInfo derateDeductionListDTOList(OtherDeductionDetailQueryParam param); - PageInfo endowmentInsuranceListDTOList(OtherDeductionDetailQueryParam param); - PageInfo grantDonationListDTOList(OtherDeductionDetailQueryParam param); - PageInfo healthInsuranceListDTOList(OtherDeductionDetailQueryParam param); - PageInfo otherDerateDeductionListDTOList(OtherDeductionDetailQueryParam param); - PageInfo personalPensionListDTOList(OtherDeductionDetailQueryParam param); + PageInfo derateDeductionList(OtherDeductionDetailQueryParam param); + PageInfo endowmentInsuranceList(OtherDeductionDetailQueryParam param); + PageInfo grantDonationList(OtherDeductionDetailQueryParam param); + PageInfo healthInsuranceList(OtherDeductionDetailQueryParam param); + PageInfo otherDerateDeductionList(OtherDeductionDetailQueryParam param); + PageInfo personalPensionList(OtherDeductionDetailQueryParam param); - /** - * 保存免税收入 - * @param param - */ void saveFreeIncome(FreeIncomeSaveParam param); void saveEndowmentInsurance(EndowmentInsuranceSaveParam param); void saveGrantDonation(GrantDonationSaveParam param); @@ -144,5 +140,12 @@ public interface OtherDeductionService { void saveDerateDeduction(DerateDeductionSaveParam param); void savePersonalPension(PersonalPensionSaveParam param); + void deleteFreeIncome(OtherDeductionDetailDeleteParam param); + void deleteEndowmentInsurance(OtherDeductionDetailDeleteParam param); + void deleteGrantDonation(OtherDeductionDetailDeleteParam param); + void deleteHealthInsurance(OtherDeductionDetailDeleteParam param); + void deleteOtherDerateDeduction(OtherDeductionDetailDeleteParam param); + void deleteDerateDeduction(OtherDeductionDetailDeleteParam param); + void deletePersonalPension(OtherDeductionDetailDeleteParam param); } diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index f4555c9a3..6a2ec896b 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -36,6 +36,7 @@ import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; @@ -2181,77 +2182,168 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { - List freeIncomePOS = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); - List listDTOS = freeIncomePOS.stream().map(po -> { - FreeIncomeListDTO freeIncomeListDTO = new FreeIncomeListDTO(); - BeanUtils.copyProperties(po, freeIncomeListDTO); - return freeIncomeListDTO; + List pos = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); + List empIds = SalaryEntityUtil.properties(pos, FreeIncomePO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + FreeIncomeListDTO dto = new FreeIncomeListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; }).collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, FreeIncomeListDTO.class); } @Override - public PageInfo derateDeductionListDTOList(OtherDeductionDetailQueryParam param) { + public PageInfo derateDeductionList(OtherDeductionDetailQueryParam param) { List pos = getDerateDeductionMapper().listSome(DerateDeductionPO.builder().mainId(param.getId()).build()); + List empIds = SalaryEntityUtil.properties(pos, DerateDeductionPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); List listDTOS = pos.stream().map(po -> { - DerateDeductionListDTO dtos = new DerateDeductionListDTO(); - BeanUtils.copyProperties(po, dtos); - return dtos; + DerateDeductionListDTO dto = new DerateDeductionListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; }).collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, DerateDeductionListDTO.class); } @Override - public PageInfo endowmentInsuranceListDTOList(OtherDeductionDetailQueryParam param) { + public PageInfo endowmentInsuranceList(OtherDeductionDetailQueryParam param) { List pos = getEndowmentInsuranceMapper().listSome(EndowmentInsurancePO.builder().mainId(param.getId()).build()); + List empIds = SalaryEntityUtil.properties(pos, EndowmentInsurancePO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); List listDTOS = pos.stream().map(po -> { - EndowmentInsuranceListDTO dtos = new EndowmentInsuranceListDTO(); - BeanUtils.copyProperties(po, dtos); - return dtos; + EndowmentInsuranceListDTO dto = new EndowmentInsuranceListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; }).collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, EndowmentInsuranceListDTO.class); } @Override - public PageInfo grantDonationListDTOList(OtherDeductionDetailQueryParam param) { + public PageInfo grantDonationList(OtherDeductionDetailQueryParam param) { List pos = getGrantDonationMapper().listSome(GrantDonationPO.builder().mainId(param.getId()).build()); + List empIds = SalaryEntityUtil.properties(pos, GrantDonationPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); List listDTOS = pos.stream().map(po -> { - GrantDonationListDTO dtos = new GrantDonationListDTO(); - BeanUtils.copyProperties(po, dtos); - return dtos; + GrantDonationListDTO dto = new GrantDonationListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; }).collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, GrantDonationListDTO.class); } @Override - public PageInfo healthInsuranceListDTOList(OtherDeductionDetailQueryParam param) { + public PageInfo healthInsuranceList(OtherDeductionDetailQueryParam param) { List pos = getHealthInsuranceMapper().listSome(HealthInsurancePO.builder().mainId(param.getId()).build()); + List empIds = SalaryEntityUtil.properties(pos, HealthInsurancePO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); List listDTOS = pos.stream().map(po -> { - HealthInsuranceListDTO dtos = new HealthInsuranceListDTO(); - BeanUtils.copyProperties(po, dtos); - return dtos; + HealthInsuranceListDTO dto = new HealthInsuranceListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; }).collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, HealthInsuranceListDTO.class); } @Override - public PageInfo otherDerateDeductionListDTOList(OtherDeductionDetailQueryParam param) { + public PageInfo otherDerateDeductionList(OtherDeductionDetailQueryParam param) { List pos = getOtherDerateDeductionMapper().listSome(OtherDerateDeductionPO.builder().mainId(param.getId()).build()); + List empIds = SalaryEntityUtil.properties(pos, OtherDerateDeductionPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); List listDTOS = pos.stream().map(po -> { - OtherDerateDeductionListDTO dtos = new OtherDerateDeductionListDTO(); - BeanUtils.copyProperties(po, dtos); - return dtos; + OtherDerateDeductionListDTO dto = new OtherDerateDeductionListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; }).collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, OtherDerateDeductionListDTO.class); } @Override - public PageInfo personalPensionListDTOList(OtherDeductionDetailQueryParam param) { - List pos = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); + public PageInfo personalPensionList(OtherDeductionDetailQueryParam param) { + List pos = getPersonalPensionMapper().listSome(PersonalPensionPO.builder().mainId(param.getId()).build()); + List empIds = SalaryEntityUtil.properties(pos, PersonalPensionPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); List listDTOS = pos.stream().map(po -> { - PersonalPensionListDTO dtos = new PersonalPensionListDTO(); - BeanUtils.copyProperties(po, dtos); - return dtos; + PersonalPensionListDTO dto = new PersonalPensionListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; }).collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, PersonalPensionListDTO.class); } @@ -2270,7 +2362,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Long id = param.getId(); if (id == null) { FreeIncomePO po = FreeIncomePO.builder() - .id(id) + .id(IdGenerator.generate()) .mainId(mainId) .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) @@ -2289,7 +2381,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getFreeIncomeMapper().insertIgnoreNull(po); } else { FreeIncomePO po = getFreeIncomeMapper().getById(id); - if (po == null){ + if (po == null) { throw new SalaryRunTimeException("记录不存在!"); } @@ -2315,7 +2407,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Long id = param.getId(); if (id == null) { EndowmentInsurancePO po = EndowmentInsurancePO.builder() - .id(id) + .id(IdGenerator.generate()) .mainId(mainId) .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) @@ -2336,7 +2428,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getEndowmentInsuranceMapper().insertIgnoreNull(po); } else { EndowmentInsurancePO po = getEndowmentInsuranceMapper().getById(id); - if (po == null){ + if (po == null) { throw new SalaryRunTimeException("记录不存在!"); } @@ -2364,7 +2456,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Long id = param.getId(); if (id == null) { GrantDonationPO po = GrantDonationPO.builder() - .id(id) + .id(IdGenerator.generate()) .mainId(mainId) .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) @@ -2387,7 +2479,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getGrantDonationMapper().insertIgnoreNull(po); } else { GrantDonationPO po = getGrantDonationMapper().getById(id); - if (po == null){ + if (po == null) { throw new SalaryRunTimeException("记录不存在!"); } @@ -2417,7 +2509,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Long id = param.getId(); if (id == null) { HealthInsurancePO po = HealthInsurancePO.builder() - .id(id) + .id(IdGenerator.generate()) .mainId(mainId) .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) @@ -2438,7 +2530,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getHealthInsuranceMapper().insertIgnoreNull(po); } else { HealthInsurancePO po = getHealthInsuranceMapper().getById(id); - if (po == null){ + if (po == null) { throw new SalaryRunTimeException("记录不存在!"); } @@ -2466,7 +2558,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Long id = param.getId(); if (id == null) { OtherDerateDeductionPO po = OtherDerateDeductionPO.builder() - .id(id) + .id(IdGenerator.generate()) .mainId(mainId) .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) @@ -2484,7 +2576,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getOtherDerateDeductionMapper().insertIgnoreNull(po); } else { OtherDerateDeductionPO po = getOtherDerateDeductionMapper().getById(id); - if (po == null){ + if (po == null) { throw new SalaryRunTimeException("记录不存在!"); } @@ -2509,7 +2601,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Long id = param.getId(); if (id == null) { DerateDeductionPO po = DerateDeductionPO.builder() - .id(id) + .id(IdGenerator.generate()) .mainId(mainId) .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) @@ -2528,7 +2620,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getDerateDeductionMapper().insertIgnoreNull(po); } else { DerateDeductionPO po = getDerateDeductionMapper().getById(id); - if (po == null){ + if (po == null) { throw new SalaryRunTimeException("记录不存在!"); } @@ -2554,7 +2646,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Long id = param.getId(); if (id == null) { PersonalPensionPO po = PersonalPensionPO.builder() - .id(id) + .id(IdGenerator.generate()) .mainId(mainId) .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) @@ -2573,7 +2665,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getPersonalPensionMapper().insertIgnoreNull(po); } else { PersonalPensionPO po = getPersonalPensionMapper().getById(id); - if (po == null){ + if (po == null) { throw new SalaryRunTimeException("记录不存在!"); } @@ -2586,4 +2678,39 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + @Override + public void deleteFreeIncome(OtherDeductionDetailDeleteParam param) { + getFreeIncomeMapper().deleteByIds(param.getIds()); + } + + @Override + public void deleteEndowmentInsurance(OtherDeductionDetailDeleteParam param) { + getEndowmentInsuranceMapper().deleteByIds(param.getIds()); + } + + @Override + public void deleteGrantDonation(OtherDeductionDetailDeleteParam param) { + getGrantDonationMapper().deleteByIds(param.getIds()); + } + + @Override + public void deleteHealthInsurance(OtherDeductionDetailDeleteParam param) { + getHealthInsuranceMapper().deleteByIds(param.getIds()); + } + + @Override + public void deleteOtherDerateDeduction(OtherDeductionDetailDeleteParam param) { + getOtherDerateDeductionMapper().deleteByIds(param.getIds()); + } + + @Override + public void deleteDerateDeduction(OtherDeductionDetailDeleteParam param) { + getDerateDeductionMapper().deleteByIds(param.getIds()); + } + + @Override + public void deletePersonalPension(OtherDeductionDetailDeleteParam param) { + getPersonalPensionMapper().deleteByIds(param.getIds()); + } + } diff --git a/src/com/engine/salary/web/OtherDeductionController.java b/src/com/engine/salary/web/OtherDeductionController.java index f041392ee..6a6bed689 100644 --- a/src/com/engine/salary/web/OtherDeductionController.java +++ b/src/com/engine/salary/web/OtherDeductionController.java @@ -1,9 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryDateUtil; @@ -361,11 +359,64 @@ public class OtherDeductionController { @POST @Path("/freeIncomeList") @Produces(MediaType.APPLICATION_JSON) - public String detailList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + public String freeIncomeList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::freeIncomeList, param); } + + @POST + @Path("/healthInsuranceList") + @Produces(MediaType.APPLICATION_JSON) + public String healthInsuranceList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::healthInsuranceList, param); + } + + + @POST + @Path("/endowmentInsuranceList") + @Produces(MediaType.APPLICATION_JSON) + public String endowmentInsuranceList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::endowmentInsuranceList, param); + } + + @POST + @Path("/grantDonationList") + @Produces(MediaType.APPLICATION_JSON) + public String grantDonationList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::grantDonationList, param); + } + + + @POST + @Path("/derateDeductionList") + @Produces(MediaType.APPLICATION_JSON) + public String derateDeductionList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::derateDeductionList, param); + } + + + @POST + @Path("/otherDerateDeductionList") + @Produces(MediaType.APPLICATION_JSON) + public String otherDerateDeductionList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::otherDerateDeductionList, param); + } + + @POST + @Path("/personalPensionList") + @Produces(MediaType.APPLICATION_JSON) + public String personalPensionList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::personalPensionList, param); + } + + @POST @Path("/saveFreeIncome") @Produces(MediaType.APPLICATION_JSON) @@ -374,5 +425,116 @@ public class OtherDeductionController { return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveFreeIncome, param); } + @POST + @Path("/saveHealthInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String saveHealthInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody HealthInsuranceSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveHealthInsurance, param); + } + + + @POST + @Path("/saveEndowmentInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String saveEndowmentInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EndowmentInsuranceSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveEndowmentInsurance, param); + } + + @POST + @Path("/saveGrantDonation") + @Produces(MediaType.APPLICATION_JSON) + public String saveGrantDonation(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody GrantDonationSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveGrantDonation, param); + } + + @POST + @Path("/saveDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String saveDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DerateDeductionSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveDerateDeduction, param); + } + + + @POST + @Path("/saveOtherDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String saveOtherDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDerateDeductionSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveOtherDerateDeduction, param); + } + + @POST + @Path("/savePersonalPension") + @Produces(MediaType.APPLICATION_JSON) + public String savePersonalPension(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PersonalPensionSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::savePersonalPension, param); + } + + + @POST + @Path("/deleteFreeIncome") + @Produces(MediaType.APPLICATION_JSON) + public String deleteFreeIncome(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteFreeIncome, param); + } + + @POST + @Path("/deleteHealthInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String deleteHealthInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteHealthInsurance, param); + } + + + @POST + @Path("/deleteEndowmentInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String deleteEndowmentInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteEndowmentInsurance, param); + } + + @POST + @Path("/deleteGrantDonation") + @Produces(MediaType.APPLICATION_JSON) + public String deleteGrantDonation(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteGrantDonation, param); + } + + @POST + @Path("/deleteDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String deleteDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteDerateDeduction, param); + } + + + @POST + @Path("/deleteOtherDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String deleteOtherDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteOtherDerateDeduction, param); + } + + + + @POST + @Path("/deletePersonalPension") + @Produces(MediaType.APPLICATION_JSON) + public String deletePersonalPension(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deletePersonalPension, param); + } + } diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index d8e87a630..4782d3af0 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -6,9 +6,7 @@ import com.api.browser.util.ConditionFactory; import com.api.browser.util.ConditionType; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.exception.SalaryRunTimeException; @@ -207,9 +205,9 @@ public class OtherDeductionWrapper extends Service { //是否开启了智能算薪 boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); - if(enableUse){ + if (enableUse) { return getOtherDeductionService(user).downloadDetailTemplate(queryParam); - }else { + } else { return getOtherDeductionService(user).downloadTemplate(queryParam); } } @@ -228,9 +226,9 @@ public class OtherDeductionWrapper extends Service { //是否开启了智能算薪 boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); - if(enableUse){ + if (enableUse) { return getOtherDeductionService(user).importDetailData(importParam); - }else { + } else { return getOtherDeductionService(user).importData(importParam); } } @@ -291,10 +289,87 @@ public class OtherDeductionWrapper extends Service { } public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { - return getOtherDeductionService(user).freeIncomeList(param); + return getOtherDeductionService(user).freeIncomeList(param); + } + + public PageInfo derateDeductionList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).derateDeductionList(param); + } + + public PageInfo endowmentInsuranceList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).endowmentInsuranceList(param); + } + + public PageInfo grantDonationList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).grantDonationList(param); + } + + public PageInfo healthInsuranceList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).healthInsuranceList(param); + } + + public PageInfo otherDerateDeductionList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).otherDerateDeductionList(param); + } + + public PageInfo personalPensionList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).personalPensionList(param); } public void saveFreeIncome(FreeIncomeSaveParam param) { getOtherDeductionService(user).saveFreeIncome(param); } -} + + public void saveEndowmentInsurance(EndowmentInsuranceSaveParam param) { + getOtherDeductionService(user).saveEndowmentInsurance(param); + } + + public void saveGrantDonation(GrantDonationSaveParam param) { + getOtherDeductionService(user).saveGrantDonation(param); + } + + public void saveHealthInsurance(HealthInsuranceSaveParam param) { + getOtherDeductionService(user).saveHealthInsurance(param); + } + + public void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param) { + getOtherDeductionService(user).saveOtherDerateDeduction(param); + } + + public void saveDerateDeduction(DerateDeductionSaveParam param) { + getOtherDeductionService(user).saveDerateDeduction(param); + } + + public void savePersonalPension(PersonalPensionSaveParam param) { + getOtherDeductionService(user).savePersonalPension(param); + } + + public void deleteFreeIncome(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteFreeIncome(param); + } + + public void deleteEndowmentInsurance(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteEndowmentInsurance(param); + } + + public void deleteGrantDonation(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteGrantDonation(param); + } + + public void deleteHealthInsurance(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteHealthInsurance(param); + } + + public void deleteOtherDerateDeduction(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteOtherDerateDeduction(param); + } + + public void deleteDerateDeduction(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteDerateDeduction(param); + } + + public void deletePersonalPension(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deletePersonalPension(param); + } + +} \ No newline at end of file From 18bd6509dbc049bc6b81ed4a769ec692c8a82fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 25 Dec 2024 16:28:21 +0800 Subject: [PATCH 233/298] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacollection/po/OtherDeductionPO.java | 88 ++- .../datacollection/po/PersonalPensionPO.java | 2 + .../datacollection/DerateDeductionMapper.java | 3 + .../datacollection/DerateDeductionMapper.xml | 533 +++++++++--------- .../EndowmentInsuranceMapper.java | 3 +- .../EndowmentInsuranceMapper.xml | 8 + .../datacollection/FreeIncomeMapper.java | 4 +- .../datacollection/FreeIncomeMapper.xml | 8 + .../datacollection/GrantDonationMapper.java | 3 +- .../datacollection/GrantDonationMapper.xml | 7 + .../datacollection/HealthInsuranceMapper.java | 3 +- .../datacollection/HealthInsuranceMapper.xml | 7 + .../datacollection/OtherDeductionMapper.java | 70 ++- .../datacollection/OtherDeductionMapper.xml | 222 ++++++++ .../OtherDerateDeductionMapper.java | 2 + .../OtherDerateDeductionMapper.xml | 8 + .../datacollection/PersonalPensionMapper.java | 2 + .../datacollection/PersonalPensionMapper.xml | 8 + .../impl/OtherDeductionServiceImpl.java | 62 ++ 19 files changed, 736 insertions(+), 307 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index 82d83784c..bea18e842 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -1,8 +1,9 @@ package com.engine.salary.entity.datacollection.po; +import cn.hutool.core.util.NumberUtil; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryFormulaVar; -import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,31 +20,31 @@ import java.util.List; @Builder @NoArgsConstructor @AllArgsConstructor -@ElogTransform( name = "其他免税扣除") +@ElogTransform(name = "其他免税扣除") public class OtherDeductionPO { /** * 主键 */ - @ElogTransform( name="主键id" ) + @ElogTransform(name = "主键id") private Long id; /** * 人员信息表的主键id */ - @ElogTransform( name ="人员id") + @ElogTransform(name = "人员id") private Long employeeId; /** * 个税扣缴义务人的主键id */ - @ElogTransform( name ="个税扣缴义务人id") + @ElogTransform(name = "个税扣缴义务人id") private Long taxAgentId; /** * 申报月份 */ - @ElogTransform( name ="税款所属期") + @ElogTransform(name = "税款所属期") private Date declareMonth; /** @@ -65,7 +66,7 @@ public class OtherDeductionPO { /** * 商业健康保险 */ - @ElogTransform( name ="商业健康保险") + @ElogTransform(name = "商业健康保险") @SalaryFormulaVar(defaultLabel = "商业健康保险", labelId = 91238, dataType = "number") @Encrypt private String businessHealthyInsurance; @@ -73,7 +74,7 @@ public class OtherDeductionPO { /** * 税延养老保险 */ - @ElogTransform( name ="税延养老保险") + @ElogTransform(name = "税延养老保险") @SalaryFormulaVar(defaultLabel = "税延养老保险", labelId = 91239, dataType = "number") @Encrypt private String taxDelayEndowmentInsurance; @@ -82,7 +83,7 @@ public class OtherDeductionPO { /** * 其他 */ - @ElogTransform( name ="其他") + @ElogTransform(name = "其他") @SalaryFormulaVar(defaultLabel = "其他", labelId = 84500, dataType = "number") @Encrypt private String otherDeduction; @@ -90,7 +91,7 @@ public class OtherDeductionPO { /** * 准予扣除的捐赠额 */ - @ElogTransform( name ="准予扣除的捐赠额") + @ElogTransform(name = "准予扣除的捐赠额") @SalaryFormulaVar(defaultLabel = "准予扣除的捐赠额", labelId = 91240, dataType = "number") @Encrypt private String deductionAllowedDonation; @@ -98,7 +99,7 @@ public class OtherDeductionPO { /** * 个人养老金 */ - @ElogTransform( name ="个人养老金") + @ElogTransform(name = "个人养老金") @SalaryFormulaVar(defaultLabel = "个人养老金", labelId = 91240, dataType = "number") @Encrypt private String privatePension; @@ -106,19 +107,19 @@ public class OtherDeductionPO { /** * 创建时间 */ - @ElogTransform( name ="创建时间") + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ - @ElogTransform( name ="更新时间") + @ElogTransform(name = "更新时间") private Date updateTime; /** * 创建人 */ - @ElogTransform( name ="创建人id") + @ElogTransform(name = "创建人id") private Long creator; /** @@ -129,7 +130,7 @@ public class OtherDeductionPO { /** * 租户ID */ - @ElogTransform( name ="租户") + @ElogTransform(name = "租户") private String tenantKey; private List employeeIds; @@ -137,11 +138,64 @@ public class OtherDeductionPO { private List freeIncomeList; - private List derateDeductionList; + private List healthInsuranceList; private List endowmentInsuranceList; private List grantDonationList; - private List healthInsuranceList; + private List derateDeductionList; private List otherDerateDeductionList; private List personalPensionList; + + public void handleList() { + freeIncome = freeIncomeList + .stream() + .map(FreeIncomePO::getFreeAmount) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + derateDeduction = derateDeductionList + .stream() + .map(DerateDeductionPO::getDerateAmount) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + taxDelayEndowmentInsurance = endowmentInsuranceList + .stream() + .map(EndowmentInsurancePO::getCurrentDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + deductionAllowedDonation = grantDonationList + .stream() + .map(GrantDonationPO::getActualDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + businessHealthyInsurance = healthInsuranceList + .stream() + .map(HealthInsurancePO::getCurrentDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + otherDeduction = otherDerateDeductionList + .stream() + .map(OtherDerateDeductionPO::getOtherDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + privatePension = personalPensionList + .stream() + .map(PersonalPensionPO::getPayAmount) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + } + } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java index 8732c4af5..766ad4783 100644 --- a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java @@ -76,6 +76,8 @@ public class PersonalPensionPO{ @ElogTransform(name = "采集来源") private String collectSource; + private Long ebDataId; + @ElogTransform(name = "创建时间", ignore = true) private Date createTime; diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java index 35ca29ab5..0fbb3b143 100644 --- a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java @@ -69,5 +69,8 @@ public interface DerateDeductionMapper { * @param ids 主键id集合 */ void deleteByIds(@Param("ids") Collection ids); + + + void deleteByMainId(Long mainId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml index c6641f0d6..e3585c01f 100644 --- a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml @@ -1,27 +1,29 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - t.create_time + t + . + create_time , t.creator , t.delete_type , t.derate_amount @@ -36,278 +38,285 @@ , t.tax_year_month , t.tenant_key , t.update_time - - + + - - + + + - + SELECT + + FROM hrsa_derate_deduction t + WHERE id = #{id} AND delete_type = 0 + + - + SELECT + + FROM hrsa_derate_deduction t + WHERE delete_type = 0 + + AND create_time = #{createTime} + + + AND creator = #{creator} + + + AND delete_type = #{deleteType} + + + AND derate_amount = #{derateAmount} + + + AND derate_item = #{derateItem} + + + AND derate_property = #{derateProperty} + + + AND employee_id = #{employeeId} + + + AND employee_type = #{employeeType} + + + AND file_status = #{fileStatus} + + + AND id = #{id} + + + AND main_id = #{mainId} + + + AND tax_agent_id = #{taxAgentId} + + + AND tax_year_month = #{taxYearMonth} + + + AND tenant_key = #{tenantKey} + + + AND update_time = #{updateTime} + + AND id IN #{id} ORDER BY id DESC - - - + + + - INSERT INTO hrsa_derate_deduction - + INSERT INTO hrsa_derate_deduction + - - create_time, - - - creator, - - - delete_type, - - - derate_amount, - - - derate_item, - - - derate_property, - - - employee_id, - - - employee_type, - - - file_status, - - - id, - - - main_id, - - - tax_agent_id, - - - tax_year_month, - - - tenant_key, - - - update_time, - - - - - #{createTime}, - - - #{creator}, - - - #{deleteType}, - - - #{derateAmount}, - - - #{derateItem}, - - - #{derateProperty}, - - - #{employeeId}, - - - #{employeeType}, - - - #{fileStatus}, - - - #{id}, - - - #{mainId}, - - - #{taxAgentId}, - - - #{taxYearMonth}, - - - #{tenantKey}, - - - #{updateTime}, - - + + create_time, + + + creator, + + + delete_type, + + + derate_amount, + + + derate_item, + + + derate_property, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{derateAmount}, + + + #{derateItem}, + + + #{derateProperty}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + - - + - UPDATE hrsa_derate_deduction - - create_time=#{createTime}, - creator=#{creator}, - delete_type=#{deleteType}, - derate_amount=#{derateAmount}, - derate_item=#{derateItem}, - derate_property=#{derateProperty}, - employee_id=#{employeeId}, - employee_type=#{employeeType}, - file_status=#{fileStatus}, - main_id=#{mainId}, - tax_agent_id=#{taxAgentId}, - tax_year_month=#{taxYearMonth}, - tenant_key=#{tenantKey}, - update_time=#{updateTime}, - - WHERE id = #{id} AND delete_type = 0 - - - - - - UPDATE hrsa_derate_deduction - - - create_time=#{createTime}, - - - creator=#{creator}, - - - delete_type=#{deleteType}, - - - derate_amount=#{derateAmount}, - - - derate_item=#{derateItem}, - - - derate_property=#{derateProperty}, - - - employee_id=#{employeeId}, - - - employee_type=#{employeeType}, - - - file_status=#{fileStatus}, - - - main_id=#{mainId}, - - - tax_agent_id=#{taxAgentId}, - - - tax_year_month=#{taxYearMonth}, - - - tenant_key=#{tenantKey}, - - - update_time=#{updateTime}, - - - WHERE id = #{id} AND delete_type = 0 + UPDATE hrsa_derate_deduction + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + derate_amount=#{derateAmount}, + derate_item=#{derateItem}, + derate_property=#{derateProperty}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 - - - - UPDATE hrsa_derate_deduction - SET delete_type=1 - WHERE id = #{id} AND delete_type = 0 - - + + + + UPDATE hrsa_derate_deduction + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + derate_amount=#{derateAmount}, + + + derate_item=#{derateItem}, + + + derate_property=#{derateProperty}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_derate_deduction + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + UPDATE hrsa_derate_deduction SET delete_type = 1 - WHERE delete_type = 0 + WHERE delete_type = 0 AND id IN #{id} + + UPDATE hrsa_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java index a045a9ee2..7d9bcb083 100644 --- a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java +++ b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.java @@ -69,5 +69,6 @@ public interface EndowmentInsuranceMapper { * @param ids 主键id集合 */ void deleteByIds(@Param("ids") Collection ids); - + + void deleteByMainId(Long mainId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml index 277843ea4..8d673f35b 100644 --- a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml @@ -356,5 +356,13 @@ + + UPDATE hrsa_endowment_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java index 1c7489927..a977ee060 100644 --- a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java +++ b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java @@ -68,5 +68,7 @@ public interface FreeIncomeMapper { * @param ids 主键id集合 */ void deleteByIds(@Param("ids") Collection ids); - + + void deleteByMainId(Long mainId); + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml index e10253fc0..87ed57c0c 100644 --- a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml @@ -311,5 +311,13 @@ + + UPDATE hrsa_free_income + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java index 5612833de..b5df0a8e1 100644 --- a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java +++ b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java @@ -69,5 +69,6 @@ public interface GrantDonationMapper { * @param ids 主键id集合 */ void deleteByIds(@Param("ids") Collection ids); - + + void deleteByMainId(Long mainId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml index 2a68136eb..8fa17414e 100644 --- a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml @@ -371,5 +371,12 @@ + + UPDATE hrsa_grant_donation + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java index b382963f2..2bd55f7b9 100644 --- a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java +++ b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java @@ -69,5 +69,6 @@ public interface HealthInsuranceMapper { * @param ids 主键id集合 */ void deleteByIds(@Param("ids") Collection ids); - + + void deleteByMainId(Long mainId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml index 71d4cdde1..4ed0bd9a1 100644 --- a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml @@ -341,5 +341,12 @@ + + UPDATE hrsa_health_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java index 7638a60cc..0eaa2b5c2 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java @@ -11,42 +11,64 @@ import java.util.List; public interface OtherDeductionMapper { - /** + /** * 根据主键查询 * * @param id 主键 * @return 返回记录,没有返回null */ - OtherDeductionPO getById(Long id); + OtherDeductionPO getById(Long id); - /** - * 查询数据采集-其他免税扣除列表 - * @param param - * @return - */ - List list(@Param("param") OtherDeductionQueryParam param); + /** + * 查询数据采集-其他免税扣除列表 + * + * @param param + * @return + */ + List list(@Param("param") OtherDeductionQueryParam param); - List recordList(@Param("param") OtherDeductionQueryParam param); + List recordList(@Param("param") OtherDeductionQueryParam param); - List listSome(@Param("param") OtherDeductionPO param); + List listSome(@Param("param") OtherDeductionPO param); - /** - * 批量插入 - * @param pos - */ - void insertData(@Param("collection") List pos); + /** + * 批量插入 + * + * @param pos + */ + void insertData(@Param("collection") List pos); - /** - * 批量修改 - * @param pos - */ - void updateData(@Param("collection") List pos); + /** + * 批量修改 + * + * @param pos + */ + void updateData(@Param("collection") List pos); - /** - * 批量删除 - * @param longs - */ + /** + * 新增,忽略null字段 + * + * @param otherDeduction 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(OtherDeductionPO otherDeduction); + + /** + * 批量删除 + * + * @param longs + */ void deleteData(List longs); + + /** + * 删除记录 + * + * @param otherDeduction 待删除的记录 + * @return 返回影响行数 + */ + int delete(OtherDeductionPO otherDeduction); + + OtherDeductionPO getByTaxAgentIdAndEmployeeId(@Param("taxAgentId") Long taxAgentId, @Param("employeeId") Long employeeId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index 03c20d1bb..f17af4a9c 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -53,6 +53,22 @@ + + UPDATE hrsa_other_deduction + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + + + + diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 49b627e22..b2d7cc2d0 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -763,7 +763,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 12, "OtherDeductionTemplate.xlsx"); + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < derateDeductionList.size(); i++) { EndowmentInsuranceListDTO dto = derateDeductionList.get(i); @@ -1510,7 +1510,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction po.handleList(); //清除旧数据 - OtherDeductionPO otherDeductionPO = getOtherDeductionMapper().getByTaxAgentIdAndEmployeeId(po.getTaxAgentId(), po.getEmployeeId()); + OtherDeductionPO otherDeductionPO = getOtherDeductionMapper().getByTaxAgentIdAndEmployeeIdAndDeclareMonth(po.getTaxAgentId(), po.getEmployeeId(), po.getDeclareMonth()); if (otherDeductionPO != null) { getOtherDeductionMapper().delete(otherDeductionPO); getFreeIncomeMapper().deleteByMainId(otherDeductionPO.getId()); From 894b9cd1fc97da00c477cda53f312f0085d8796b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 10 Mar 2025 15:31:33 +0800 Subject: [PATCH 252/298] =?UTF-8?q?1=E3=80=81=E6=89=A3=E9=99=A4=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E8=AF=A2=202=E3=80=81=E6=89=A3=E9=99=A4?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/web/DeductionAmountController.java | 15 + .../param/DeductionAmountAddParam.java | 45 ++ .../param/DeductionAmountConfirmParam.java | 31 ++ .../DeductionAmountOnlineQueryParam.java | 31 ++ .../param/DeductionAmountQueryParam.java | 31 ++ .../deductionamount/po/DeductionAmountPO.java | 128 +++++ .../DeductionAmountMapper.java | 74 +++ .../deductionamount/DeductionAmountMapper.xml | 345 ++++++++++++++ .../tax/client/DeductionAmountClient.java | 93 ++++ .../remote/tax/client/EmployeeClient.java | 4 +- .../ConfirmPreDeductRequest.java | 95 ++++ .../QueryDeductionAmountRequest.java | 64 +++ .../service/DeductionAmountService.java | 19 + .../impl/DeductionAmountServiceImpl.java | 112 +++++ .../salary/web/DeductionAmountController.java | 442 ++++++++++++++++++ .../wrapper/DeductionAmountWrapper.java | 34 ++ test/ParseTaxApi.java | 4 +- 17 files changed, 1563 insertions(+), 4 deletions(-) create mode 100644 src/com/api/salary/web/DeductionAmountController.java create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java create mode 100644 src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java create mode 100644 src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java create mode 100644 src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml create mode 100644 src/com/engine/salary/remote/tax/client/DeductionAmountClient.java create mode 100644 src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java create mode 100644 src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java create mode 100644 src/com/engine/salary/service/DeductionAmountService.java create mode 100644 src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java create mode 100644 src/com/engine/salary/web/DeductionAmountController.java create mode 100644 src/com/engine/salary/wrapper/DeductionAmountWrapper.java diff --git a/src/com/api/salary/web/DeductionAmountController.java b/src/com/api/salary/web/DeductionAmountController.java new file mode 100644 index 000000000..b18635031 --- /dev/null +++ b/src/com/api/salary/web/DeductionAmountController.java @@ -0,0 +1,15 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Path("/bs/hrmsalary/deductionAmount") +public class DeductionAmountController extends com.engine.salary.web.DeductionAmountController { +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java new file mode 100644 index 000000000..0deb8966f --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountAddParam { + /** + * ID + */ + private Long id; + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + /** + * 税款所属年度 + */ + @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误") + private String year; + + /** + * 报送人员ids + */ + private List employeeDeclareIds; +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java new file mode 100644 index 000000000..e5fe93593 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountConfirmParam { + + // 个税扣缴义务人id + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + // 税款所属年度 + @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java new file mode 100644 index 000000000..cd5c8f2ee --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountOnlineQueryParam { + + // 个税扣缴义务人id + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + // 税款所属年度 + @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java new file mode 100644 index 000000000..d6b87fb23 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountQueryParam { + + // 个税扣缴义务人id + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + // 税款所属年度 + @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java new file mode 100644 index 000000000..d3ae06169 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java @@ -0,0 +1,128 @@ +package com.engine.salary.entity.deductionamount.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 人员报送记录 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_deduction_amount +public class DeductionAmountPO { + + /** + * ID + */ + @ElogTransform(name = "ID") + private Long id; + + /** + * 个税扣缴义务人ID + */ + @ElogTransform(name = "个税扣缴义务人ID") + private Long taxAgentId; + + + /** + * 税款所属年度 + */ + @ElogTransform(name = "税款所属年度") + private String year; + /** + * 人员id + */ + @ElogTransform(name = "人员id") + private Long employeeId; + + /** + * 姓名 + */ + @ElogTransform(name = "姓名") + private String employeeName; + + /** + * 人员类型 + */ + @ElogTransform(name = "人员类型") + private Byte employeeType; + + /** + * 工号 + */ + @ElogTransform(name = "工号") + private String jobNum; + + /** + * 证件号码 + */ + @ElogTransform(name = "证件号码") + private String cardNum; + + /** + * 证件类型 + */ + @ElogTransform(name = "证件类型") + private Byte cardType; + + /** + * 报送状态 + */ + @ElogTransform(name = "报送状态") + private Byte declareStatus; + + /** + * 是否扣除 + */ + @ElogTransform(name = "是否扣除") + private Byte deductFlag; + /** + * 是否成功报送过 + */ + @ElogTransform(name = "是否成功报送过") + private Byte successfullyDeclared; + + + /** + * 创建时间 + */ + @ElogTransform(name = "创建时间") + private Date createTime; + + + /** + * 修改时间 + */ + @ElogTransform(name = "修改时间") + private Date updateTime; + + /** + * 创建人id + */ + @ElogTransform(name = "创建人id") + private Long creator; + + /** + * 是否删除 + */ + @ElogTransform(name = "是否删除") + private Integer deleteType; + + /** + * 租户KEY + */ + @ElogTransform(name = "租户KEY") + private String tenantKey; + + //主键id集合 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java new file mode 100644 index 000000000..352d00a2e --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.deductionamount; + +import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface DeductionAmountMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(DeductionAmountPO deductionAmount); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + DeductionAmountPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param deductionAmount 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(DeductionAmountPO deductionAmount); + + + /** + * 修改,修改所有字段 + * + * @param deductionAmount 修改的记录 + * @return 返回影响行数 + */ + int update(DeductionAmountPO deductionAmount); + + /** + * 修改,忽略null字段 + * + * @param deductionAmount 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(DeductionAmountPO deductionAmount); + + /** + * 删除记录 + * + * @param deductionAmount 待删除的记录 + * @return 返回影响行数 + */ + int delete(DeductionAmountPO deductionAmount); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml new file mode 100644 index 000000000..f41492135 --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + card_num + , t.card_type + , t.create_time + , t.creator + , t.declare_status + , t.deduct_flag + , t.delete_type + , t.employee_id + , t.employee_name + , t.employee_type + , t.id + , t.job_num + , t.successfully_declared + , t.tax_agent_id + , t.tenant_key + , t.update_time + , t.year + + + + + + + + + + + + + + + INSERT INTO hrsa_deduction_amount + + + + card_num, + + + card_type, + + + create_time, + + + creator, + + + declare_status, + + + deduct_flag, + + + delete_type, + + + employee_id, + + + employee_name, + + + employee_type, + + + id, + + + job_num, + + + successfully_declared, + + + tax_agent_id, + + + tenant_key, + + + update_time, + + + year, + + + + + #{cardNum}, + + + #{cardType}, + + + #{createTime}, + + + #{creator}, + + + #{declareStatus}, + + + #{deductFlag}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeName}, + + + #{employeeType}, + + + #{id}, + + + #{jobNum}, + + + #{successfullyDeclared}, + + + #{taxAgentId}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{year}, + + + + + + + + UPDATE hrsa_deduction_amount + + card_num=#{cardNum}, + card_type=#{cardType}, + create_time=#{createTime}, + creator=#{creator}, + declare_status=#{declareStatus}, + deduct_flag=#{deductFlag}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_name=#{employeeName}, + employee_type=#{employeeType}, + job_num=#{jobNum}, + successfully_declared=#{successfullyDeclared}, + tax_agent_id=#{taxAgentId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year=#{year}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount + + + card_num=#{cardNum}, + + + card_type=#{cardType}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + declare_status=#{declareStatus}, + + + deduct_flag=#{deductFlag}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_name=#{employeeName}, + + + employee_type=#{employeeType}, + + + job_num=#{jobNum}, + + + successfully_declared=#{successfullyDeclared}, + + + tax_agent_id=#{taxAgentId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year=#{year}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_deduction_amount + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java new file mode 100644 index 000000000..bb9b92e9c --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java @@ -0,0 +1,93 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest; +import com.engine.salary.remote.tax.request.deductionAmount.QueryDeductionAmountRequest; +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SingnatureData; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * 申报扣减客户端 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountClient extends TaxBaseClient { + + public DeductionAmountClient(Long taxAgentId) { + super(taxAgentId); + } + + public String query(String taxYear) { + + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/queryPreDeduct"; + QueryDeductionAmountRequest queryDeductionAmountRequest = new QueryDeductionAmountRequest(); + queryDeductionAmountRequest.setNsrsbh(returnPO.getTaxCode()); + queryDeductionAmountRequest.setBizNo(UUID.randomUUID().toString().replace("-", "")); + queryDeductionAmountRequest.setQymc(returnPO.getTaxAgentName()); + queryDeductionAmountRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + queryDeductionAmountRequest.setAreaid(returnPO.getAreaCode()); + queryDeductionAmountRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + queryDeductionAmountRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + queryDeductionAmountRequest.setJmsbmm("1"); + queryDeductionAmountRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + queryDeductionAmountRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + queryDeductionAmountRequest.setJmsmmm("1"); + queryDeductionAmountRequest.setMmlx("" + returnPO.getPasswordType()); + queryDeductionAmountRequest.setSkssnd(taxYear); + + String reqJson = JsonUtil.toJsonString(queryDeductionAmountRequest); + log.info("queryDeductionAmountRequest params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("queryDeductionAmountRequest res --- {}", res); + return res; + } + + + + public String confirmPreDeduct(String year) { + + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/queryPreDeduct"; + ConfirmPreDeductRequest request = new ConfirmPreDeductRequest(); + request.setNsrsbh(returnPO.getTaxCode()); + request.setBizNo(UUID.randomUUID().toString().replace("-", "")); + request.setQymc(returnPO.getTaxAgentName()); + request.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + request.setAreaid(returnPO.getAreaCode()); + request.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + request.setSbmm(realNamePwd ? null : returnPO.getPwd()); + request.setJmsbmm("1"); + request.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + request.setSmmm(realNamePwd ? returnPO.getPwd() : null); + request.setJmsmmm("1"); + request.setMmlx("" + returnPO.getPasswordType()); + request.setSkssnd(year); + request.setKczglb(null); + + String reqJson = JsonUtil.toJsonString(request); + log.info("queryDeductionAmountRequest params --- \n{}\n", reqJson); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + + // 开始请求 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("queryDeductionAmountRequest res --- {}", res); + return res; + } +} diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java index 480d00e53..5a246b398 100644 --- a/src/com/engine/salary/remote/tax/client/EmployeeClient.java +++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java @@ -39,10 +39,10 @@ public class EmployeeClient extends TaxBaseClient { mergedEmployeeArchivesRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); mergedEmployeeArchivesRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); - mergedEmployeeArchivesRequest.setJmsbmm("0"); + mergedEmployeeArchivesRequest.setJmsbmm("1"); mergedEmployeeArchivesRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); mergedEmployeeArchivesRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); - mergedEmployeeArchivesRequest.setJmsmmm("0"); + mergedEmployeeArchivesRequest.setJmsmmm("1"); mergedEmployeeArchivesRequest.setMmlx("" + returnPO.getPasswordType()); diff --git a/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java new file mode 100644 index 000000000..035c90543 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java @@ -0,0 +1,95 @@ +package com.engine.salary.remote.tax.request.deductionAmount; + +import lombok.Data; + +import java.util.List; + +@Data +public class ConfirmPreDeductRequest { + /** + * 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID + */ + private String bizNo; + /** + * 企业名称 必填:是 代报企业全称 + */ + private String qymc; + /** + * 密码类型 必填:否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码 + */ + private String mmlx; + /** + * 实名账号 必填:选择必填 当mmlx=2时,必填 + */ + private String smzh; + /** + * 实名密码 必填:选择必填 当mmlx=2时,必填 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明 + */ + private String jmsmmm; + /** + * 登记序号 必填:否 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:否 分部门代报时必传 + */ + private String bmbh; + /** + * 部门名称 必填:否 + */ + private String bmmc; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 税款所属年度 必填:必填 yyyy + */ + private String skssnd; + + /** + * 扣除资格列表 + */ + private List kczglb; + + + public static class kczg { + /** + * 姓名 + */ + private String xm; + /** + * 证件类型 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 证件号码 + */ + private String zzhm; + /** + * 国籍 + */ + private String gj; + /** + * 扣除标识 是/否 + */ + private String kcbs; + } + +} diff --git a/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java b/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java new file mode 100644 index 000000000..1aaa0a3a1 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java @@ -0,0 +1,64 @@ +package com.engine.salary.remote.tax.request.deductionAmount; + +import lombok.Data; + +@Data +public class QueryDeductionAmountRequest { + /** + * 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID + */ + private String bizNo; + /** + * 企业名称 必填:是 代报企业全称 + */ + private String qymc; + /** + * 密码类型 必填:否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码 + */ + private String mmlx; + /** + * 实名账号 必填:选择必填 当mmlx=2时,必填 + */ + private String smzh; + /** + * 实名密码 必填:选择必填 当mmlx=2时,必填 + */ + private String smmm; + /** + * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明 + */ + private String jmsmmm; + /** + * 登记序号 必填:否 存在多个登记序号时,需要指定传入一个.例:10117440105249764755 + */ + private String djxhid; + /** + * 税号 必填:是 扣缴单位纳税人识别号 + */ + private String nsrsbh; + /** + * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码 + */ + private String areaid; + /** + * 部门编号 必填:否 分部门代报时必传 + */ + private String bmbh; + /** + * 部门名称 必填:否 + */ + private String bmmc; + /** + * 申报密码 必填:条件必填 当mmlx=0时,必填 + */ + private String sbmm; + /** + * 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 + */ + private String jmsbmm; + /** + * 税款所属年度 必填:必填 yyyy + */ + private String skssnd; + +} diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java new file mode 100644 index 000000000..a72534724 --- /dev/null +++ b/src/com/engine/salary/service/DeductionAmountService.java @@ -0,0 +1,19 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; + +/** + * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface DeductionAmountService { + + Object query(DeductionAmountOnlineQueryParam queryParam); + + void add(DeductionAmountAddParam param); +} diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java new file mode 100644 index 000000000..e501287a7 --- /dev/null +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -0,0 +1,112 @@ +package com.engine.salary.service.impl; + + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; +import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.mapper.deductionamount.DeductionAmountMapper; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; +import com.engine.salary.remote.tax.client.DeductionAmountClient; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.valid.ValidUtil; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountServiceImpl extends Service implements DeductionAmountService { + + private DeductionAmountMapper getDeductionAmountMapper() { + return MapperProxyFactory.getProxy(DeductionAmountMapper.class); + } + + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private EmployeeDeclareRecordService getEmployeeDeclareRecordService(User user) { + return ServiceUtil.getService(EmployeeDeclareRecordServiceImpl.class, user); + } + + private TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + + @Override + public Object query(DeductionAmountOnlineQueryParam queryParam) { + Long taxAgentId = queryParam.getTaxAgentId(); + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); + return deductionAmountClient.query(queryParam.getYear()); + } + + @Override + public void add(DeductionAmountAddParam param) { + ValidUtil.doValidator(param); + + //已存在 + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(param.getTaxAgentId()).year(param.getYear()).build()); + List oldIds = SalaryEntityUtil.properties(deductionAmountPOS, DeductionAmountPO::getEmployeeId, Collectors.toList()); + + //本次新增 + List employeeDeclareIds = param.getEmployeeDeclareIds(); + List employeeDeclarePOS = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(employeeDeclareIds).build()); + +// employeeDeclarePOS.stream() +// .filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId())) +// .map(employeeDeclarePO -> { +// DeductionAmountPO.builder() +// .id(employeeDeclarePO.getEmployeeId()) +// .taxAgentId(employeeDeclarePO.getEmployeeId()) +// .year(param.getYear()) +// .employeeId(employeeDeclarePO.getEmployeeId()) +// .employeeName(employeeDeclarePO.getEmployeeName()) +// .employeeType(employeeDeclarePO.getEmployeeId()) +// .jobNum(employeeDeclarePO.getEmployeeId()) +// .cardNum(employeeDeclarePO.getEmployeeId()) +// .cardType(employeeDeclarePO.getEmployeeId()) +// .declareStatus(employeeDeclarePO.getEmployeeId()) +// .deductFlag(employeeDeclarePO.getEmployeeId()) +// .successfullyDeclared(employeeDeclarePO.getEmployeeId()) +// .creator(employeeId) +// .createTime(now) +// .updateTime(now) +// .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) +// .deleteType(NumberUtils.INTEGER_ZERO) +// }); + } +} diff --git a/src/com/engine/salary/web/DeductionAmountController.java b/src/com/engine/salary/web/DeductionAmountController.java new file mode 100644 index 000000000..e9ad983fc --- /dev/null +++ b/src/com/engine/salary/web/DeductionAmountController.java @@ -0,0 +1,442 @@ +package com.engine.salary.web; + + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.DeductionAmountWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountController { + + private DeductionAmountWrapper getDeductionAmountWrapper(User user) { + return ServiceUtil.getService(DeductionAmountWrapper.class, user); + } + + @POST + @Path("/add") + @Produces(MediaType.APPLICATION_JSON) + public String add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountAddParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::add, param); + } + + @POST + @Path("/query") + @Produces(MediaType.APPLICATION_JSON) + public String queryPreDeduct(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountOnlineQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::query, queryParam); + } + +// @POST +// @Path("/confirmPreDeduct") +// @Produces(MediaType.APPLICATION_JSON) +// public String queryPreDeduct(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountConfirmParam param) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); +// } + +// /** +// * 人员报送-个税扣缴义务人列表 +// * +// * @param param 查询条件 +// * @return +// */ +// @POST +// @Path("/taxAgentDeclareList") +// @Produces(MediaType.APPLICATION_JSON) +// public String taxAgentDeclareList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentDeclareListQueryParam param) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::taxAgentDeclareList, param); +// } +// +// /** +// * 人员报送-全部人员列表 +// * +// * @param queryParam 查询条件 +// * @return +// */ +// @POST +// @Path("/list") +// @Produces(MediaType.APPLICATION_JSON) +// public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list, queryParam); +// } +// +// /** +// * 人员报送-本月新增人员列表 +// * +// * @param queryParam 查询条件 +// * @return +// */ +// @POST +// @Path("/list4Add") +// @Produces(MediaType.APPLICATION_JSON) +// public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Add, queryParam); +// } +// +// /** +// * 人员报送-本月信息变动列表 +// * +// * @param queryParam 查询条件 +// * @return +// */ +// @POST +// @Path("/list4Update") +// @Produces(MediaType.APPLICATION_JSON) +// public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Update, queryParam); +// } +// +// /** +// * 人员报送-本月报送失败人员列表 +// * +// * @param queryParam 查询条件 +// * @return +// */ +// @POST +// @Path("/list4Fail") +// @Produces(MediaType.APPLICATION_JSON) +// public String list4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareFailListQueryParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Fail, queryParam); +// } +// +// /** +// * 人员报送-获取新建或编辑的表单 +// * +// * @param id 报送人员列表的主键id +// * @return +// */ +// @GET +// @Path("/getForm") +// @Produces(MediaType.APPLICATION_JSON) +// public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::getForm, id); +// } +// +//// @GetMapping("/getBatchUpdateForm") +//// @ApiOperation("人员报送-获取批量编辑的表单") +//// @Produces(MediaType.APPLICATION_JSON) +//// public WeaResult getBatchUpdateForm() { +//// WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm(); +//// return WeaResult.success(weaForm); +//// } +//// +//// @GetMapping("/getSearchCondition") +//// @ApiOperation("人员报送-获取高级搜索条件") +//// @Produces(MediaType.APPLICATION_JSON) +//// public WeaResult getSearchCondition() { +//// WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition(); +//// return WeaResult.success(searchCondition); +//// } +// +// /** +// * 人员报送-新增人员/编辑人员保存 +// * +// * @param saveParam 保存参数 +// * @return +// */ +// @POST +// @Path("/save") +// @Produces(MediaType.APPLICATION_JSON) +// public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareSaveParam saveParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::save, saveParam); +// } +// +//// /** +//// * 人员报送-批量编辑 +//// * +//// * @param batchUpdateParam 批量编辑参数 +//// * @return +//// */ +//// @Path("/batchUpdate") +//// @ApiOperation("人员报送-批量编辑") +//// @Produces(MediaType.APPLICATION_JSON) +//// public WeaResult batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) { +//// employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +//// return WeaResult.success(null); +//// } +// +// /** +// * 人员报送-删除 +// * +// * @param ids 待删除的主键id +// * @return +// */ +// @POST +// @Path("/delete") +// @Produces(MediaType.APPLICATION_JSON) +// public String deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult, String>(user).run(getEmployeeDeclareWrapper(user)::deleteByIds, ids); +// } +// +// /** +// * 人员报送-刷新数据 +// * +// * @param refreshParam 刷新数据的参数 +// * @return +// */ +// @POST +// @Path("/refresh") +// @Produces(MediaType.APPLICATION_JSON) +// public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::refresh, refreshParam); +// } +// +// /** +// * 人员报送-获取整体的报送情况 +// * +// * @param employeeDeclareParam 获取整体的报送情况的参数 +// * @return +// */ +// @POST +// @Path("/getDeclareInfo") +// @Produces(MediaType.APPLICATION_JSON) +// public String getDeclareInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam); +// } +// +// /** +// * 人员报送-全部报送 +// * +// * @param employeeDeclareParam 在线报送 +// * @return +// */ +// @POST +// @Path("/declare") +// @Produces(MediaType.APPLICATION_JSON) +// public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam); +// } +// +// /** +// * 人员报送-获取报送结果反馈 +// * +// * @param employeeDeclareParam 获取反馈 +// * @return +// */ +// @POST +// @Path("/getDeclareFeedback") +// @Produces(MediaType.APPLICATION_JSON) +// public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); +// } +// +// +// /** +// * 人员报送-后端业务逻辑是否已经完成 +// * +// * @param index 进度索引 +// * @return +// */ +// @GET +// @Path("/getRate") +// @Produces(MediaType.APPLICATION_JSON) +// public String getRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "index") String index) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getRate, index); +// } +// +// /** +// * 人员报送-下载导入模板 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @POST +// @Path("/exportTemplate") +// @Produces(MediaType.APPLICATION_OCTET_STREAM) +// public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { +// +// try { +// User user = HrmUserVarify.getUser(request, response); +// XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).exportTemplate(queryParam); +// 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 queryParam 导出参数 +// * @return +// */ +// @POST +// @Path("/preview") +// @Produces(MediaType.APPLICATION_JSON) +// public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::preview, queryParam); +// } +// +// /** +// * 人员报送-导入 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @POST +// @Path("/importData") +// @Produces(MediaType.APPLICATION_JSON) +// public String importData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::importData, queryParam); +// } +// +// +// /** +// * 人员报送-导出全部人员 +// * +// * @param param 导出参数 +// * @return +// */ +// @POST +// @Path("/export") +// @Produces(MediaType.APPLICATION_OCTET_STREAM) +// public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam param) { +// +// try { +// User user = HrmUserVarify.getUser(request, response); +// XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(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 queryParam 导出参数 +// * @return +// */ +// @Path("/export4Add") +// @ApiOperation("人员报送-导出本月新增人员") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// /** +// * 人员报送-导出本月信息变动人员 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @Path("/export4Update") +// @ApiOperation("人员报送-导出本月信息变动人员") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// /** +// * 人员报送-导出本月报送失败的人员 +// * +// * @param queryParam 导出参数 +// * @return +// */ +// @Path("/export4Fail") +// @ApiOperation("人员报送-导出本月报送失败的人员") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// @Path("/getImportParam") +// @ApiOperation("人员报送-获取导入参数") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult getAcctResultImportParams() { +// String tenantKey = TenantContext.getCurrentTenantKey(); +// Long currentEmployeeId = UserContext.getCurrentEmployeeId(); +// return WeaResult.success(salaryBatchService.buildImportParam("importEmployeeDeclare", +// "importEmployeeDeclare", +// SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 158769, "人员信息报送"), +// null, +// null)); +// } +// +// /** +// * 人员报送-导出导入模板 +// * +// * @param importParam 获取导入模板 +// * @return +// */ +// @Path("/exportTemplate") +// @ApiOperation("人员报送-导出导入模板") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) { +// Map exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } + + + //4.2.5年收入不足6万元的纳税人暂不预扣预缴税款 + + +} diff --git a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java new file mode 100644 index 000000000..697621d67 --- /dev/null +++ b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java @@ -0,0 +1,34 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +/** + * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountWrapper extends Service { + private DeductionAmountService getDeductionAmountService(User user) { + return ServiceUtil.getService(DeductionAmountServiceImpl.class, user); + } + + + public Object query(DeductionAmountOnlineQueryParam queryParam) { + return getDeductionAmountService(user).query(queryParam); + } + + public void add(DeductionAmountAddParam param) { + getDeductionAmountService(user).add(param); + } +} diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java index 716d56807..56bb4a986 100644 --- a/test/ParseTaxApi.java +++ b/test/ParseTaxApi.java @@ -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"); } From 0eb2b140e980078c13024ede1dbab60a24072015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 10 Mar 2025 17:46:40 +0800 Subject: [PATCH 253/298] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=95=B0=E6=8D=AE=E8=AF=B7=E6=B1=82=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/FailEmployeeListDTO.java | 4 +- .../impl/TaxDeclareRecordServiceImpl.java | 85 ++++++++++++++----- 2 files changed, 67 insertions(+), 22 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index a6e79e5ec..a5d1ef376 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -48,7 +48,7 @@ public class FailEmployeeListDTO { private String errorMsg; //所得项目 - @TableTitle(title = "所得项目", dataIndex = "incomeCategory", key = "incomeCategory") - @ExcelHead(title = "所得项目", dataIndex = "incomeCategory") +// @TableTitle(title = "所得项目", dataIndex = "incomeCategory", key = "incomeCategory") +// @ExcelHead(title = "所得项目", dataIndex = "incomeCategory") private String incomeCategory; } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index f5d3f94b6..af3d81c1c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -822,27 +822,72 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { List failInfoList = JsonUtil.parseList(Util.null2String(declareTaxFeedbackResponse.getBody().getOrDefault("fknr", "")).replace("\\\"", "\""), Map.class); for (Map map : failInfoList) { - String msg = Util.null2String(map.get("msg")); - if (StringUtils.isNotEmpty(msg)) { - errorMsg.add(msg); - } - List details = JsonUtil.parseList(map.get("details"), List.class); - if (details != null) { - for (List detail : details) { - String employeeName = Util.null2String(detail.get(0)); - String cardNum = Util.null2String(detail.get(2)); - String incomeCategoryCode = Util.null2String(detail.get(4)); - TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecord.getId()).employeeName(employeeName).cardNum(cardNum).incomeCategory(incomeCategoryCode).errorMsg(msg).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).creator((long) user.getUID()).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).createTime(now).updateTime(now).build(); - taxDeclareFails.add(taxDeclareFailPO); - // 流量使用记录 - EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); - if (Objects.isNull(employeeDeclarePO)) { - continue; + if (map.containsKey("details")) { + List details = JsonUtil.parseList(map.get("details"), List.class); + if (details != null) { + for (List detail : details) { + String employeeName = Util.null2String(detail.get(0)); + String cardNum = Util.null2String(detail.get(2)); + String detailMsg = Util.null2String(detail.get(1)); + errorMsg.add("【" + employeeName + "】" + detailMsg); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecord.getId()) + .employeeName(employeeName) + .cardNum(cardNum) + .incomeCategory("") + .errorMsg(detailMsg) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + taxDeclareFails.add(taxDeclareFailPO); + // 流量使用记录 + EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); + if (Objects.isNull(employeeDeclarePO)) { + continue; + } + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + employeeInfoMap.remove(employeeName + "-" + cardNum); + } + } + } + if (map.containsKey("employeeList")) { + List emps = JsonUtil.parseList(map.get("employeeList"), Map.class); + if (emps != null) { + for (Map detail : emps) { + String employeeName = Util.null2String(detail.get("xm")); + String cardNum = Util.null2String(detail.get("zzhm")); + String detailMsg = Util.null2String(detail.get("cwxx")); + errorMsg.add("【" + employeeName + "】" + detailMsg); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder() + .id(IdGenerator.generate()). + taxDeclareRecordId(taxDeclareRecord.getId()) + .employeeName(employeeName) + .cardNum(cardNum) + .incomeCategory("") + .errorMsg(detailMsg) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + taxDeclareFails.add(taxDeclareFailPO); + // 流量使用记录 + EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); + if (Objects.isNull(employeeDeclarePO)) { + continue; + } + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + employeeInfoMap.remove(employeeName + "-" + cardNum); } - TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); - flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); - apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); - employeeInfoMap.remove(employeeName + "-" + cardNum); } } } From 12bbfeceae045480081e915101fda3e5f48c211a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 11 Mar 2025 11:15:08 +0800 Subject: [PATCH 254/298] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=A3=E9=99=A4?= =?UTF-8?q?=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deductionamount/po/DeductionAmountPO.java | 10 ++-- .../impl/DeductionAmountServiceImpl.java | 48 ++++++++++--------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java index d3ae06169..642b98098 100644 --- a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java @@ -53,7 +53,7 @@ public class DeductionAmountPO { * 人员类型 */ @ElogTransform(name = "人员类型") - private Byte employeeType; + private Integer employeeType; /** * 工号 @@ -71,24 +71,24 @@ public class DeductionAmountPO { * 证件类型 */ @ElogTransform(name = "证件类型") - private Byte cardType; + private Integer cardType; /** * 报送状态 */ @ElogTransform(name = "报送状态") - private Byte declareStatus; + private Integer declareStatus; /** * 是否扣除 */ @ElogTransform(name = "是否扣除") - private Byte deductFlag; + private Integer deductFlag; /** * 是否成功报送过 */ @ElogTransform(name = "是否成功报送过") - private Byte successfullyDeclared; + private Integer successfullyDeclared; /** diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java index e501287a7..7fd9c25bb 100644 --- a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -3,6 +3,7 @@ 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.entity.deductionamount.param.DeductionAmountAddParam; import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; @@ -15,8 +16,10 @@ import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.valid.ValidUtil; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -86,27 +89,28 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou List employeeDeclareIds = param.getEmployeeDeclareIds(); List employeeDeclarePOS = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(employeeDeclareIds).build()); -// employeeDeclarePOS.stream() -// .filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId())) -// .map(employeeDeclarePO -> { -// DeductionAmountPO.builder() -// .id(employeeDeclarePO.getEmployeeId()) -// .taxAgentId(employeeDeclarePO.getEmployeeId()) -// .year(param.getYear()) -// .employeeId(employeeDeclarePO.getEmployeeId()) -// .employeeName(employeeDeclarePO.getEmployeeName()) -// .employeeType(employeeDeclarePO.getEmployeeId()) -// .jobNum(employeeDeclarePO.getEmployeeId()) -// .cardNum(employeeDeclarePO.getEmployeeId()) -// .cardType(employeeDeclarePO.getEmployeeId()) -// .declareStatus(employeeDeclarePO.getEmployeeId()) -// .deductFlag(employeeDeclarePO.getEmployeeId()) -// .successfullyDeclared(employeeDeclarePO.getEmployeeId()) -// .creator(employeeId) -// .createTime(now) -// .updateTime(now) -// .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) -// .deleteType(NumberUtils.INTEGER_ZERO) -// }); + Date now = new Date(); + employeeDeclarePOS.stream() + .filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId())) + .map(employeeDeclarePO -> { + DeductionAmountPO.builder() + .id(employeeDeclarePO.getEmployeeId()) + .taxAgentId(employeeDeclarePO.getEmployeeId()) + .year(param.getYear()) + .employeeId(employeeDeclarePO.getEmployeeId()) + .employeeName(employeeDeclarePO.getEmployeeName()) + .employeeType(employeeDeclarePO.getEmployeeType()) + .jobNum(employeeDeclarePO.getJobNum()) + .cardNum(employeeDeclarePO.getCardNum()) + .cardType(employeeDeclarePO.getCardType()) + .declareStatus(0) + .deductFlag(1) + .successfullyDeclared(0) + .creator((long)user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(NumberUtils.INTEGER_ZERO); + }); } } From a119e7c7cde6a6e117ab5be81d58dcba65ef43db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 12 Mar 2025 13:55:59 +0800 Subject: [PATCH 255/298] =?UTF-8?q?=E6=89=A3=E9=99=A4=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/DeductionAmountDTO.java | 123 ++++++++++++++++++ .../param/DeductionAmountListParam.java | 36 +++++ .../deductionamount/po/DeductionAmountPO.java | 6 + .../deductionamount/DeductionAmountMapper.xml | 15 +++ .../tax/client/DeductionAmountClient.java | 9 +- .../ConfirmPreDeductRequest.java | 1 + .../service/DeductionAmountService.java | 12 +- .../impl/DeductionAmountServiceImpl.java | 109 ++++++++++++---- .../salary/web/DeductionAmountController.java | 24 +++- .../wrapper/DeductionAmountWrapper.java | 21 ++- 10 files changed, 320 insertions(+), 36 deletions(-) create mode 100644 src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java diff --git a/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java new file mode 100644 index 000000000..d5a2d3fcb --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java @@ -0,0 +1,123 @@ +package com.engine.salary.entity.deductionamount.dto; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 人员报送记录 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_deduction_amount +public class DeductionAmountDTO { + + /** + * ID + */ + private Long id; + + /** + * 个税扣缴义务人ID + */ + private Long taxAgentId; + + + /** + * 税款所属年度 + */ + @TableTitle(title = "税款所属年度", dataIndex = "year", key = "year") + private String year; + /** + * 人员id + */ + private Long employeeId; + + /** + * 姓名 + */ + @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + /** + * 人员类型 + */ + private Integer employeeType; + + /** + * 工号 + */ + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + /** + * 证件号码 + */ + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + /** + * 证件类型 + */ + private Integer cardType; + + /** + * 国籍 + */ + @TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality") + private String nationality; + + /** + * 是否扣除 + */ + @TableTitle(title = "是否扣除", dataIndex = "deductFlag", key = "deductFlag") + private Integer deductFlag; + + /** + * 报送状态 + */ + @TableTitle(title = "报送状态", dataIndex = "declareStatus", key = "declareStatus") + private Integer declareStatus; + + + /** + * 是否成功报送过 + */ + private Integer successfullyDeclared; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 租户KEY + */ + private String tenantKey; + + //主键id集合 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java new file mode 100644 index 000000000..0ce30402b --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountListParam extends BaseQueryParam { + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + /** + * 税款所属年度 + */ + @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java index 642b98098..731a211da 100644 --- a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java @@ -61,6 +61,12 @@ public class DeductionAmountPO { @ElogTransform(name = "工号") private String jobNum; + /** + * 国籍 + */ + @ElogTransform(name = "国籍") + private String nationality; + /** * 证件号码 */ diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml index f41492135..db85a9649 100644 --- a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml @@ -19,6 +19,7 @@ + @@ -42,6 +43,7 @@ , t.tenant_key , t.update_time , t.year + , t.nationality @@ -118,6 +120,9 @@ AND year = #{year} + + AND nationality = #{nationality} + AND id IN @@ -184,6 +189,9 @@ year, + + nationality, + @@ -237,6 +245,9 @@ #{year}, + + #{nationality}, + @@ -261,6 +272,7 @@ tenant_key=#{tenantKey}, update_time=#{updateTime}, year=#{year}, + nationality=#{nationality}, WHERE id = #{id} AND delete_type = 0 @@ -318,6 +330,9 @@ year=#{year}, + + nationality=#{nationality}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java index bb9b92e9c..32e129c94 100644 --- a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java +++ b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java @@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.UUID; @@ -60,7 +61,7 @@ public class DeductionAmountClient extends TaxBaseClient { - public String confirmPreDeduct(String year) { + public String confirmPreDeduct(String year, List kczglb ) { String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/queryPreDeduct"; ConfirmPreDeductRequest request = new ConfirmPreDeductRequest(); @@ -78,16 +79,16 @@ public class DeductionAmountClient extends TaxBaseClient { request.setJmsmmm("1"); request.setMmlx("" + returnPO.getPasswordType()); request.setSkssnd(year); - request.setKczglb(null); + request.setKczglb(kczglb); String reqJson = JsonUtil.toJsonString(request); - log.info("queryDeductionAmountRequest params --- \n{}\n", reqJson); + log.info("confirmPreDeduct params --- \n{}\n", reqJson); Map params = new HashMap<>(1); Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); // 开始请求 String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - log.info("queryDeductionAmountRequest res --- {}", res); + log.info("confirmPreDeduct res --- {}", res); return res; } } diff --git a/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java index 035c90543..635c146ec 100644 --- a/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java +++ b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java @@ -69,6 +69,7 @@ public class ConfirmPreDeductRequest { private List kczglb; + @Data public static class kczg { /** * 姓名 diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java index a72534724..16a86ffbe 100644 --- a/src/com/engine/salary/service/DeductionAmountService.java +++ b/src/com/engine/salary/service/DeductionAmountService.java @@ -1,6 +1,10 @@ package com.engine.salary.service; +import com.engine.salary.component.PageInfo; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; /** @@ -13,7 +17,13 @@ import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQuery **/ public interface DeductionAmountService { - Object query(DeductionAmountOnlineQueryParam queryParam); + PageInfo list(DeductionAmountListParam param); void add(DeductionAmountAddParam param); + + Object query(DeductionAmountOnlineQueryParam param); + + Object confirm(DeductionAmountConfirmParam param); + + } diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java index 7fd9c25bb..73083cf2b 100644 --- a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -3,17 +3,25 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.component.PageInfo; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.mapper.deductionamount.DeductionAmountMapper; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.remote.tax.client.DeductionAmountClient; +import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.math.NumberUtils; @@ -70,11 +78,35 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); } + @Override - public Object query(DeductionAmountOnlineQueryParam queryParam) { - Long taxAgentId = queryParam.getTaxAgentId(); - DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); - return deductionAmountClient.query(queryParam.getYear()); + public PageInfo list(DeductionAmountListParam param) { + ValidUtil.doValidator(param); + + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().year(param.getYear()).taxAgentId(param.getTaxAgentId()).build()); + + List list = deductionAmountPOS.stream().map(deductionAmountPO -> { + return DeductionAmountDTO.builder() + .id(deductionAmountPO.getId()) + .taxAgentId(deductionAmountPO.getEmployeeId()) + .year(deductionAmountPO.getYear()) + .employeeId(deductionAmountPO.getEmployeeId()) + .employeeName(deductionAmountPO.getEmployeeName()) + .employeeType(deductionAmountPO.getEmployeeType()) + .jobNum(deductionAmountPO.getJobNum()) + .nationality(deductionAmountPO.getNationality()) + .cardNum(deductionAmountPO.getCardNum()) + .cardType(deductionAmountPO.getCardType()) + .declareStatus(deductionAmountPO.getDeclareStatus()) + .deductFlag(deductionAmountPO.getDeductFlag()) + .successfullyDeclared(deductionAmountPO.getSuccessfullyDeclared()) + .creator(deductionAmountPO.getCreator()) + .createTime(deductionAmountPO.getCreateTime()) + .updateTime(deductionAmountPO.getUpdateTime()) + .build(); + }).collect(Collectors.toList()); + + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, DeductionAmountDTO.class); } @Override @@ -92,25 +124,54 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou Date now = new Date(); employeeDeclarePOS.stream() .filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId())) - .map(employeeDeclarePO -> { - DeductionAmountPO.builder() - .id(employeeDeclarePO.getEmployeeId()) - .taxAgentId(employeeDeclarePO.getEmployeeId()) - .year(param.getYear()) - .employeeId(employeeDeclarePO.getEmployeeId()) - .employeeName(employeeDeclarePO.getEmployeeName()) - .employeeType(employeeDeclarePO.getEmployeeType()) - .jobNum(employeeDeclarePO.getJobNum()) - .cardNum(employeeDeclarePO.getCardNum()) - .cardType(employeeDeclarePO.getCardType()) - .declareStatus(0) - .deductFlag(1) - .successfullyDeclared(0) - .creator((long)user.getUID()) - .createTime(now) - .updateTime(now) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .deleteType(NumberUtils.INTEGER_ZERO); - }); + .map(employeeDeclarePO -> DeductionAmountPO.builder() + .id(employeeDeclarePO.getEmployeeId()) + .taxAgentId(employeeDeclarePO.getEmployeeId()) + .year(param.getYear()) + .employeeId(employeeDeclarePO.getEmployeeId()) + .employeeName(employeeDeclarePO.getEmployeeName()) + .employeeType(employeeDeclarePO.getEmployeeType()) + .jobNum(employeeDeclarePO.getJobNum()) + .cardNum(employeeDeclarePO.getCardNum()) + .cardType(employeeDeclarePO.getCardType()) + .nationality(employeeDeclarePO.getNationality()) + .declareStatus(0) + .deductFlag(1) + .successfullyDeclared(0) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(NumberUtils.INTEGER_ZERO) + .build()) + .forEach(deductionAmountPO -> getDeductionAmountMapper().insertIgnoreNull(deductionAmountPO)); + } + + @Override + public Object query(DeductionAmountOnlineQueryParam param) { + Long taxAgentId = param.getTaxAgentId(); + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); + return deductionAmountClient.query(param.getYear()); + } + + @Override + public Object confirm(DeductionAmountConfirmParam param) { + ValidUtil.doValidator(param); + Long taxAgentId = param.getTaxAgentId(); + String year = param.getYear(); + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(taxAgentId).year(year).build()); + List kczglb = deductionAmountPOS.stream() + .map(deductionAmountPO -> { + ConfirmPreDeductRequest.kczg kczg = new ConfirmPreDeductRequest.kczg(); + kczg.setXm(deductionAmountPO.getEmployeeName()); + kczg.setZzhm(deductionAmountPO.getCardNum()); + kczg.setZzlx(CardTypeEnum.getByValue(deductionAmountPO.getCardType()).getDefaultLabel()); + kczg.setGj(deductionAmountPO.getNationality()); + kczg.setKcbs(SalaryOnOffEnum.parseByValue(deductionAmountPO.getDeductFlag()).getDefaultLabel()); + return kczg; + }).collect(Collectors.toList()); + + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); + return deductionAmountClient.confirmPreDeduct(year, kczglb); } } diff --git a/src/com/engine/salary/web/DeductionAmountController.java b/src/com/engine/salary/web/DeductionAmountController.java index e9ad983fc..819598cb9 100644 --- a/src/com/engine/salary/web/DeductionAmountController.java +++ b/src/com/engine/salary/web/DeductionAmountController.java @@ -2,7 +2,11 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.component.PageInfo; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; import com.engine.salary.util.ResponseResult; import com.engine.salary.wrapper.DeductionAmountWrapper; @@ -34,6 +38,14 @@ public class DeductionAmountController { return ServiceUtil.getService(DeductionAmountWrapper.class, user); } + @POST + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountListParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getDeductionAmountWrapper(user)::list, param); + } + @POST @Path("/add") @Produces(MediaType.APPLICATION_JSON) @@ -45,9 +57,17 @@ public class DeductionAmountController { @POST @Path("/query") @Produces(MediaType.APPLICATION_JSON) - public String queryPreDeduct(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountOnlineQueryParam queryParam) { + public String query(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountOnlineQueryParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getDeductionAmountWrapper(user)::query, queryParam); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::query, param); + } + + @POST + @Path("/confirm") + @Produces(MediaType.APPLICATION_JSON) + public String confirm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountConfirmParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); } // @POST diff --git a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java index 697621d67..c9bada6fa 100644 --- a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java +++ b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java @@ -2,10 +2,14 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.component.PageInfo; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; +import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; -import com.engine.salary.service.*; -import com.engine.salary.service.impl.*; +import com.engine.salary.service.DeductionAmountService; +import com.engine.salary.service.impl.DeductionAmountServiceImpl; import lombok.extern.slf4j.Slf4j; import weaver.hrm.User; @@ -23,12 +27,19 @@ public class DeductionAmountWrapper extends Service { return ServiceUtil.getService(DeductionAmountServiceImpl.class, user); } - - public Object query(DeductionAmountOnlineQueryParam queryParam) { - return getDeductionAmountService(user).query(queryParam); + public PageInfo list(DeductionAmountListParam param) { + return getDeductionAmountService(user).list(param); } public void add(DeductionAmountAddParam param) { getDeductionAmountService(user).add(param); } + + public Object query(DeductionAmountOnlineQueryParam param) { + return getDeductionAmountService(user).query(param); + } + + public Object confirm(DeductionAmountConfirmParam param) { + return getDeductionAmountService(user).confirm(param); + } } From bad6928f34da84ad53d509211e1bb07812e4a4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 14 Mar 2025 15:56:28 +0800 Subject: [PATCH 256/298] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/DeductionAmountDeleteParam.java | 27 ++ .../service/DeductionAmountService.java | 7 +- .../impl/DeductionAmountServiceImpl.java | 18 +- .../salary/web/DeductionAmountController.java | 386 ------------------ .../wrapper/DeductionAmountWrapper.java | 9 +- 5 files changed, 48 insertions(+), 399 deletions(-) create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java new file mode 100644 index 000000000..922884a44 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.deductionamount.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountDeleteParam { + /** + * ID + */ + private List ids; +} diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java index 16a86ffbe..6e005cbc2 100644 --- a/src/com/engine/salary/service/DeductionAmountService.java +++ b/src/com/engine/salary/service/DeductionAmountService.java @@ -2,10 +2,7 @@ package com.engine.salary.service; import com.engine.salary.component.PageInfo; import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; -import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; +import com.engine.salary.entity.deductionamount.param.*; /** * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单 @@ -21,6 +18,8 @@ public interface DeductionAmountService { void add(DeductionAmountAddParam param); + void delete(DeductionAmountDeleteParam param); + Object query(DeductionAmountOnlineQueryParam param); Object confirm(DeductionAmountConfirmParam param); diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java index 73083cf2b..700e8c622 100644 --- a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -1,15 +1,13 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.PageInfo; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; -import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; +import com.engine.salary.entity.deductionamount.param.*; import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.enums.SalaryOnOffEnum; @@ -106,7 +104,7 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou .build(); }).collect(Collectors.toList()); - return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, DeductionAmountDTO.class); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, DeductionAmountDTO.class); } @Override @@ -147,6 +145,16 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou .forEach(deductionAmountPO -> getDeductionAmountMapper().insertIgnoreNull(deductionAmountPO)); } + @Override + public void delete(DeductionAmountDeleteParam param) { + if (CollUtil.isEmpty(param.getIds())) { + return; + } + param.getIds().forEach(id -> { + getDeductionAmountMapper().delete(DeductionAmountPO.builder().id(id).build()); + }); + } + @Override public Object query(DeductionAmountOnlineQueryParam param) { Long taxAgentId = param.getTaxAgentId(); diff --git a/src/com/engine/salary/web/DeductionAmountController.java b/src/com/engine/salary/web/DeductionAmountController.java index 819598cb9..6c0950cd7 100644 --- a/src/com/engine/salary/web/DeductionAmountController.java +++ b/src/com/engine/salary/web/DeductionAmountController.java @@ -70,393 +70,7 @@ public class DeductionAmountController { return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); } -// @POST -// @Path("/confirmPreDeduct") -// @Produces(MediaType.APPLICATION_JSON) -// public String queryPreDeduct(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountConfirmParam param) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); -// } -// /** -// * 人员报送-个税扣缴义务人列表 -// * -// * @param param 查询条件 -// * @return -// */ -// @POST -// @Path("/taxAgentDeclareList") -// @Produces(MediaType.APPLICATION_JSON) -// public String taxAgentDeclareList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentDeclareListQueryParam param) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::taxAgentDeclareList, param); -// } -// -// /** -// * 人员报送-全部人员列表 -// * -// * @param queryParam 查询条件 -// * @return -// */ -// @POST -// @Path("/list") -// @Produces(MediaType.APPLICATION_JSON) -// public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list, queryParam); -// } -// -// /** -// * 人员报送-本月新增人员列表 -// * -// * @param queryParam 查询条件 -// * @return -// */ -// @POST -// @Path("/list4Add") -// @Produces(MediaType.APPLICATION_JSON) -// public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Add, queryParam); -// } -// -// /** -// * 人员报送-本月信息变动列表 -// * -// * @param queryParam 查询条件 -// * @return -// */ -// @POST -// @Path("/list4Update") -// @Produces(MediaType.APPLICATION_JSON) -// public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Update, queryParam); -// } -// -// /** -// * 人员报送-本月报送失败人员列表 -// * -// * @param queryParam 查询条件 -// * @return -// */ -// @POST -// @Path("/list4Fail") -// @Produces(MediaType.APPLICATION_JSON) -// public String list4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareFailListQueryParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Fail, queryParam); -// } -// -// /** -// * 人员报送-获取新建或编辑的表单 -// * -// * @param id 报送人员列表的主键id -// * @return -// */ -// @GET -// @Path("/getForm") -// @Produces(MediaType.APPLICATION_JSON) -// public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::getForm, id); -// } -// -//// @GetMapping("/getBatchUpdateForm") -//// @ApiOperation("人员报送-获取批量编辑的表单") -//// @Produces(MediaType.APPLICATION_JSON) -//// public WeaResult getBatchUpdateForm() { -//// WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm(); -//// return WeaResult.success(weaForm); -//// } -//// -//// @GetMapping("/getSearchCondition") -//// @ApiOperation("人员报送-获取高级搜索条件") -//// @Produces(MediaType.APPLICATION_JSON) -//// public WeaResult getSearchCondition() { -//// WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition(); -//// return WeaResult.success(searchCondition); -//// } -// -// /** -// * 人员报送-新增人员/编辑人员保存 -// * -// * @param saveParam 保存参数 -// * @return -// */ -// @POST -// @Path("/save") -// @Produces(MediaType.APPLICATION_JSON) -// public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareSaveParam saveParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::save, saveParam); -// } -// -//// /** -//// * 人员报送-批量编辑 -//// * -//// * @param batchUpdateParam 批量编辑参数 -//// * @return -//// */ -//// @Path("/batchUpdate") -//// @ApiOperation("人员报送-批量编辑") -//// @Produces(MediaType.APPLICATION_JSON) -//// public WeaResult batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) { -//// employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); -//// return WeaResult.success(null); -//// } -// -// /** -// * 人员报送-删除 -// * -// * @param ids 待删除的主键id -// * @return -// */ -// @POST -// @Path("/delete") -// @Produces(MediaType.APPLICATION_JSON) -// public String deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult, String>(user).run(getEmployeeDeclareWrapper(user)::deleteByIds, ids); -// } -// -// /** -// * 人员报送-刷新数据 -// * -// * @param refreshParam 刷新数据的参数 -// * @return -// */ -// @POST -// @Path("/refresh") -// @Produces(MediaType.APPLICATION_JSON) -// public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::refresh, refreshParam); -// } -// -// /** -// * 人员报送-获取整体的报送情况 -// * -// * @param employeeDeclareParam 获取整体的报送情况的参数 -// * @return -// */ -// @POST -// @Path("/getDeclareInfo") -// @Produces(MediaType.APPLICATION_JSON) -// public String getDeclareInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam); -// } -// -// /** -// * 人员报送-全部报送 -// * -// * @param employeeDeclareParam 在线报送 -// * @return -// */ -// @POST -// @Path("/declare") -// @Produces(MediaType.APPLICATION_JSON) -// public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam); -// } -// -// /** -// * 人员报送-获取报送结果反馈 -// * -// * @param employeeDeclareParam 获取反馈 -// * @return -// */ -// @POST -// @Path("/getDeclareFeedback") -// @Produces(MediaType.APPLICATION_JSON) -// public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); -// } -// -// -// /** -// * 人员报送-后端业务逻辑是否已经完成 -// * -// * @param index 进度索引 -// * @return -// */ -// @GET -// @Path("/getRate") -// @Produces(MediaType.APPLICATION_JSON) -// public String getRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "index") String index) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getRate, index); -// } -// -// /** -// * 人员报送-下载导入模板 -// * -// * @param queryParam 导出参数 -// * @return -// */ -// @POST -// @Path("/exportTemplate") -// @Produces(MediaType.APPLICATION_OCTET_STREAM) -// public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { -// -// try { -// User user = HrmUserVarify.getUser(request, response); -// XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).exportTemplate(queryParam); -// 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 queryParam 导出参数 -// * @return -// */ -// @POST -// @Path("/preview") -// @Produces(MediaType.APPLICATION_JSON) -// public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::preview, queryParam); -// } -// -// /** -// * 人员报送-导入 -// * -// * @param queryParam 导出参数 -// * @return -// */ -// @POST -// @Path("/importData") -// @Produces(MediaType.APPLICATION_JSON) -// public String importData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { -// User user = HrmUserVarify.getUser(request, response); -// return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::importData, queryParam); -// } -// -// -// /** -// * 人员报送-导出全部人员 -// * -// * @param param 导出参数 -// * @return -// */ -// @POST -// @Path("/export") -// @Produces(MediaType.APPLICATION_OCTET_STREAM) -// public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam param) { -// -// try { -// User user = HrmUserVarify.getUser(request, response); -// XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(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 queryParam 导出参数 -// * @return -// */ -// @Path("/export4Add") -// @ApiOperation("人员报送-导出本月新增人员") -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) { -// Map exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser()); -// return WeaResult.success(exportMap); -// } -// -// /** -// * 人员报送-导出本月信息变动人员 -// * -// * @param queryParam 导出参数 -// * @return -// */ -// @Path("/export4Update") -// @ApiOperation("人员报送-导出本月信息变动人员") -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { -// Map exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser()); -// return WeaResult.success(exportMap); -// } -// -// /** -// * 人员报送-导出本月报送失败的人员 -// * -// * @param queryParam 导出参数 -// * @return -// */ -// @Path("/export4Fail") -// @ApiOperation("人员报送-导出本月报送失败的人员") -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) { -// Map exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser()); -// return WeaResult.success(exportMap); -// } -// -// @Path("/getImportParam") -// @ApiOperation("人员报送-获取导入参数") -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult getAcctResultImportParams() { -// String tenantKey = TenantContext.getCurrentTenantKey(); -// Long currentEmployeeId = UserContext.getCurrentEmployeeId(); -// return WeaResult.success(salaryBatchService.buildImportParam("importEmployeeDeclare", -// "importEmployeeDeclare", -// SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 158769, "人员信息报送"), -// null, -// null)); -// } -// -// /** -// * 人员报送-导出导入模板 -// * -// * @param importParam 获取导入模板 -// * @return -// */ -// @Path("/exportTemplate") -// @ApiOperation("人员报送-导出导入模板") -// @Produces(MediaType.APPLICATION_JSON) -// public WeaResult exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) { -// Map exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser()); -// return WeaResult.success(exportMap); -// } - - - //4.2.5年收入不足6万元的纳税人暂不预扣预缴税款 } diff --git a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java index c9bada6fa..9b03e533d 100644 --- a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java +++ b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java @@ -4,10 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.PageInfo; import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; -import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; +import com.engine.salary.entity.deductionamount.param.*; import com.engine.salary.service.DeductionAmountService; import com.engine.salary.service.impl.DeductionAmountServiceImpl; import lombok.extern.slf4j.Slf4j; @@ -35,6 +32,10 @@ public class DeductionAmountWrapper extends Service { getDeductionAmountService(user).add(param); } + public void delete(DeductionAmountDeleteParam param) { + getDeductionAmountService(user).delete(param); + } + public Object query(DeductionAmountOnlineQueryParam param) { return getDeductionAmountService(user).query(param); } From 660a2718a132bd7cf459ef12d760ed589a82eca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Mar 2025 18:59:16 +0800 Subject: [PATCH 257/298] =?UTF-8?q?=E6=89=A3=E5=87=8F=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=92=8C=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/DeductionAmountFeedBackParam.java | 30 +++++++++++++++++++ .../tax/client/DeductionAmountClient.java | 22 +++++++++----- .../service/DeductionAmountService.java | 2 +- .../impl/DeductionAmountServiceImpl.java | 14 +++++++-- .../salary/web/DeductionAmountController.java | 22 ++++++++++---- .../wrapper/DeductionAmountWrapper.java | 4 +++ 6 files changed, 77 insertions(+), 17 deletions(-) create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java new file mode 100644 index 000000000..9cd7ad6f5 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountFeedBackParam { + + // 个税扣缴义务人id + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") + private Long taxAgentId; + + @DataCheck(require = true, message = "参数错误,requestId不能为空") + private String requestId; + +} diff --git a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java index 32e129c94..2eb13159d 100644 --- a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java +++ b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java @@ -9,10 +9,7 @@ import com.engine.salary.util.SingnatureData; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; /** * 申报扣减客户端 @@ -60,10 +57,9 @@ public class DeductionAmountClient extends TaxBaseClient { } + public String confirm(String year, List kczglb ) { - public String confirmPreDeduct(String year, List kczglb ) { - - String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/queryPreDeduct"; + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/confirmPreDeduct"; ConfirmPreDeductRequest request = new ConfirmPreDeductRequest(); request.setNsrsbh(returnPO.getTaxCode()); request.setBizNo(UUID.randomUUID().toString().replace("-", "")); @@ -91,4 +87,16 @@ public class DeductionAmountClient extends TaxBaseClient { log.info("confirmPreDeduct res --- {}", res); return res; } + + public String feedback(String requestId) { + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/getPreDeductConfirmFeedback"; + + Map params = new HashMap<>(1); + params.put("requestId", requestId); + log.info("getPreDeductConfirmFeedback requestId --- \n{}\n", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("getPreDeductConfirmFeedback res --- {}", res); + return res; + } } diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java index 6e005cbc2..7d8b49879 100644 --- a/src/com/engine/salary/service/DeductionAmountService.java +++ b/src/com/engine/salary/service/DeductionAmountService.java @@ -24,5 +24,5 @@ public interface DeductionAmountService { Object confirm(DeductionAmountConfirmParam param); - + void feedback(DeductionAmountFeedBackParam param); } diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java index 700e8c622..4855fd950 100644 --- a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -18,6 +18,7 @@ import com.engine.salary.remote.tax.client.DeductionAmountClient; import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; @@ -123,8 +124,8 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou employeeDeclarePOS.stream() .filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId())) .map(employeeDeclarePO -> DeductionAmountPO.builder() - .id(employeeDeclarePO.getEmployeeId()) - .taxAgentId(employeeDeclarePO.getEmployeeId()) + .id(IdGenerator.generate()) + .taxAgentId(employeeDeclarePO.getTaxAgentId()) .year(param.getYear()) .employeeId(employeeDeclarePO.getEmployeeId()) .employeeName(employeeDeclarePO.getEmployeeName()) @@ -180,6 +181,13 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou }).collect(Collectors.toList()); DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); - return deductionAmountClient.confirmPreDeduct(year, kczglb); + return deductionAmountClient.confirm(year, kczglb); + } + + @Override + public void feedback(DeductionAmountFeedBackParam param) { + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(param.getTaxAgentId()); + String feedback = deductionAmountClient.feedback(param.getRequestId()); + } } diff --git a/src/com/engine/salary/web/DeductionAmountController.java b/src/com/engine/salary/web/DeductionAmountController.java index 6c0950cd7..b900b6872 100644 --- a/src/com/engine/salary/web/DeductionAmountController.java +++ b/src/com/engine/salary/web/DeductionAmountController.java @@ -4,10 +4,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.component.PageInfo; import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; -import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam; -import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam; +import com.engine.salary.entity.deductionamount.param.*; import com.engine.salary.util.ResponseResult; import com.engine.salary.wrapper.DeductionAmountWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; @@ -54,6 +51,14 @@ public class DeductionAmountController { return new ResponseResult(user).run(getDeductionAmountWrapper(user)::add, param); } + @POST + @Path("/delete") + @Produces(MediaType.APPLICATION_JSON) + public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::delete, param); + } + @POST @Path("/query") @Produces(MediaType.APPLICATION_JSON) @@ -70,7 +75,12 @@ public class DeductionAmountController { return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); } - - + @POST + @Path("/feedback") + @Produces(MediaType.APPLICATION_JSON) + public String feedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountFeedBackParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::feedback, param); + } } diff --git a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java index 9b03e533d..7a474421f 100644 --- a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java +++ b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java @@ -43,4 +43,8 @@ public class DeductionAmountWrapper extends Service { public Object confirm(DeductionAmountConfirmParam param) { return getDeductionAmountService(user).confirm(param); } + + public void feedback(DeductionAmountFeedBackParam param) { + getDeductionAmountService(user).feedback(param); + } } From 47dbfeb8dbdb9aac3038e483797cc0d70a076c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Mar 2025 15:26:06 +0800 Subject: [PATCH 258/298] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/DeductionAmountDTO.java | 1 + .../param/DeductionAmountFeedBackParam.java | 6 +- .../deductionamount/po/DeductionAmountPO.java | 18 +- .../po/DeductionAmountRecordPO.java | 66 +++++ .../deductionamount/DeductionAmountMapper.xml | 15 ++ .../DeductionAmountRecordMapper.java | 77 ++++++ .../DeductionAmountRecordMapper.xml | 239 ++++++++++++++++++ .../tax/client/DeductionAmountClient.java | 35 ++- .../ConfirmFeedbackResponse.java | 75 ++++++ .../service/DeductionAmountService.java | 4 +- .../impl/DeductionAmountServiceImpl.java | 166 +++++++----- .../impl/EmployeeDeclareServiceImpl.java | 2 - .../salary/web/DeductionAmountController.java | 4 +- .../wrapper/DeductionAmountWrapper.java | 6 +- 14 files changed, 619 insertions(+), 95 deletions(-) create mode 100644 src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java create mode 100644 src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java create mode 100644 src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml create mode 100644 src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java diff --git a/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java index d5a2d3fcb..43fc7de83 100644 --- a/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java +++ b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java @@ -85,6 +85,7 @@ public class DeductionAmountDTO { */ @TableTitle(title = "报送状态", dataIndex = "declareStatus", key = "declareStatus") private Integer declareStatus; + private String declareErrorMsg; /** diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java index 9cd7ad6f5..111c7011e 100644 --- a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java @@ -24,7 +24,7 @@ public class DeductionAmountFeedBackParam { @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") private Long taxAgentId; - @DataCheck(require = true, message = "参数错误,requestId不能为空") - private String requestId; - + // 税款所属年度 + @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误") + private String year; } diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java index 731a211da..e203655e7 100644 --- a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java @@ -79,12 +79,6 @@ public class DeductionAmountPO { @ElogTransform(name = "证件类型") private Integer cardType; - /** - * 报送状态 - */ - @ElogTransform(name = "报送状态") - private Integer declareStatus; - /** * 是否扣除 */ @@ -96,6 +90,18 @@ public class DeductionAmountPO { @ElogTransform(name = "是否成功报送过") private Integer successfullyDeclared; + /** + * 报送状态 + */ + @ElogTransform(name = "报送状态") + private Integer declareStatus; + + /** + * 申报失败的错误信息 + */ + @ElogTransform(name = "失败的错误信息") + private String declareErrorMsg; + /** * 创建时间 diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java new file mode 100644 index 000000000..f476627f1 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java @@ -0,0 +1,66 @@ +package com.engine.salary.entity.deductionamount.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Collection; +import java.util.Date; + +/** + * 扣减报送记录 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor +//"hrsa_employee_declare_record") +public class DeductionAmountRecordPO { + + /** + * 主键id + */ + private Long id; + /** + * 个税扣缴义务人 + */ + private Long taxAgentId; + /** + * 税款所属年 + */ + private String year; + /** + * 请求的requestId + */ + private String requestId; + /** + * 租户key + */ + private String tenantKey; + /** + * 创建人id + */ + private Long creator; + /** + * 是否删除 + */ + private Integer deleteType; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新时间 + */ + private Date updateTime; + + private Collection ids; +} diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml index db85a9649..023a41f81 100644 --- a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml @@ -15,6 +15,7 @@ + @@ -39,6 +40,7 @@ , t.id , t.job_num , t.successfully_declared + , t.declare_error_msg , t.tax_agent_id , t.tenant_key , t.update_time @@ -108,6 +110,9 @@ AND successfully_declared = #{successfullyDeclared} + + AND declare_error_msg = #{declareErrorMsg} + AND tax_agent_id = #{taxAgentId} @@ -177,6 +182,9 @@ successfully_declared, + + declare_error_msg, + tax_agent_id, @@ -233,6 +241,9 @@ #{successfullyDeclared}, + + #{declareErrorMsg}, + #{taxAgentId}, @@ -268,6 +279,7 @@ employee_type=#{employeeType}, job_num=#{jobNum}, successfully_declared=#{successfullyDeclared}, + declare_error_msg=#{declareErrorMsg}, tax_agent_id=#{taxAgentId}, tenant_key=#{tenantKey}, update_time=#{updateTime}, @@ -318,6 +330,9 @@ successfully_declared=#{successfullyDeclared}, + + declare_error_msg=#{declareErrorMsg}, + tax_agent_id=#{taxAgentId}, diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java new file mode 100644 index 000000000..ca2815680 --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java @@ -0,0 +1,77 @@ +package com.engine.salary.mapper.deductionamount; + +import com.engine.salary.entity.deductionamount.po.DeductionAmountRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface DeductionAmountRecordMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(DeductionAmountRecordPO deductionAmountRecord); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + DeductionAmountRecordPO getById(Long id); + + + DeductionAmountRecordPO getByTaxAgentIdAndYear(@Param("taxAgentId")Long taxAgentId,@Param("year") String year); + + /** + * 新增,忽略null字段 + * + * @param deductionAmountRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 修改,修改所有字段 + * + * @param deductionAmountRecord 修改的记录 + * @return 返回影响行数 + */ + int update(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 修改,忽略null字段 + * + * @param deductionAmountRecord 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 删除记录 + * + * @param deductionAmountRecord 待删除的记录 + * @return 返回影响行数 + */ + int delete(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByTaxAgentIdAndYear(@Param("taxAgentId")Long taxAgentId,@Param("year") String year); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml new file mode 100644 index 000000000..930371420 --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.id + , t.request_id + , t.tax_agent_id + , t.tenant_key + , t.update_time + , t.year + + + + + + + + + + + + + + + + + INSERT INTO hrsa_deduction_amount_record + + + + create_time, + + + creator, + + + delete_type, + + + id, + + + request_id, + + + tax_agent_id, + + + tenant_key, + + + update_time, + + + year, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{requestId}, + + + #{taxAgentId}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{year}, + + + + + + + UPDATE hrsa_deduction_amount_record + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + request_id=#{requestId}, + tax_agent_id=#{taxAgentId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year=#{year}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount_record + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + request_id=#{requestId}, + + + tax_agent_id=#{taxAgentId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year=#{year}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_deduction_amount_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_deduction_amount_record + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_agent_id=#{taxAgentId} + AND year=#{year} + + \ No newline at end of file diff --git a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java index 2eb13159d..05c3d3482 100644 --- a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java +++ b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java @@ -3,11 +3,14 @@ package com.engine.salary.remote.tax.client; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest; import com.engine.salary.remote.tax.request.deductionAmount.QueryDeductionAmountRequest; +import com.engine.salary.remote.tax.response.deductionAmount.ConfirmFeedbackResponse; import com.engine.salary.util.HttpUtil; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SingnatureData; +import com.engine.salary.util.TaskUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; import java.util.*; @@ -57,7 +60,7 @@ public class DeductionAmountClient extends TaxBaseClient { } - public String confirm(String year, List kczglb ) { + public String confirm(String year, List kczglb) { String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/confirmPreDeduct"; ConfirmPreDeductRequest request = new ConfirmPreDeductRequest(); @@ -77,26 +80,22 @@ public class DeductionAmountClient extends TaxBaseClient { request.setSkssnd(year); request.setKczglb(kczglb); - String reqJson = JsonUtil.toJsonString(request); - log.info("confirmPreDeduct params --- \n{}\n", reqJson); - Map params = new HashMap<>(1); - Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); - - // 开始请求 - String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - log.info("confirmPreDeduct res --- {}", res); - return res; + String requestId = request(url, JsonUtil.parseMap(request, Object.class)); + return requestId; } - public String feedback(String requestId) { + public ConfirmFeedbackResponse feedback(String requestId) { + TaskUtil taskUtil = new TaskUtil(); + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/getPreDeductConfirmFeedback"; - Map params = new HashMap<>(1); - params.put("requestId", requestId); - log.info("getPreDeductConfirmFeedback requestId --- \n{}\n", requestId); - Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); - String res = HttpUtil.getRequest(url, header, params); - log.info("getPreDeductConfirmFeedback res --- {}", res); - return res; + Map param = new HashMap<>(1); + param.put("requestId", requestId); + + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, param); + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + ConfirmFeedbackResponse response = JsonUtil.parseBean(res, ConfirmFeedbackResponse.class); + return response; } } diff --git a/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java new file mode 100644 index 000000000..783f5f359 --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java @@ -0,0 +1,75 @@ +package com.engine.salary.remote.tax.response.deductionAmount; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 扣除名单确认反馈 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class ConfirmFeedbackResponse extends BaseResponse { + + /** + * 返回数据 + */ + private Body body; + + /** + * 神州云合接口返回状态实体类 + **/ + @Data + public static class Body { + + /** + * 总人数 + */ + private String zrs; + /** + * 成功人数 + */ + private String cgrs; + /** + * 失败人数 + */ + private String sbrs; + /** + * 扣除确认失败列表 + */ + private List kcqrsblb; + + @Data + public static class kcqrsb { + + /** + * 姓名 + */ + private String xm; + /** + * 证件类型 见证件类型字典 + */ + private String zzlx; + /** + * 证件号码 证件号码 + */ + private String zzhm; + /** + * 国籍 + */ + private String gj; + /** + * 失败原因 + */ + private String sbyy; + } + } + +} diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java index 7d8b49879..3d7da8fad 100644 --- a/src/com/engine/salary/service/DeductionAmountService.java +++ b/src/com/engine/salary/service/DeductionAmountService.java @@ -22,7 +22,7 @@ public interface DeductionAmountService { Object query(DeductionAmountOnlineQueryParam param); - Object confirm(DeductionAmountConfirmParam param); + String confirm(DeductionAmountConfirmParam param); - void feedback(DeductionAmountFeedBackParam param); + String feedback(DeductionAmountFeedBackParam param); } diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java index 4855fd950..5b30ff10d 100644 --- a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -2,32 +2,38 @@ package com.engine.salary.service.impl; import cn.hutool.core.collection.CollUtil; -import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.PageInfo; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; import com.engine.salary.entity.deductionamount.param.*; import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; +import com.engine.salary.entity.deductionamount.po.DeductionAmountRecordPO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.deductionamount.DeductionAmountMapper; +import com.engine.salary.mapper.deductionamount.DeductionAmountRecordMapper; import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.remote.tax.client.DeductionAmountClient; import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest; -import com.engine.salary.service.*; +import com.engine.salary.remote.tax.response.deductionAmount.ConfirmFeedbackResponse; +import com.engine.salary.service.DeductionAmountService; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.math.NumberUtils; -import weaver.hrm.User; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -41,6 +47,10 @@ import java.util.stream.Collectors; @Slf4j public class DeductionAmountServiceImpl extends Service implements DeductionAmountService { + private DeductionAmountRecordMapper getDeductionAmountRecordMapper() { + return MapperProxyFactory.getProxy(DeductionAmountRecordMapper.class); + } + private DeductionAmountMapper getDeductionAmountMapper() { return MapperProxyFactory.getProxy(DeductionAmountMapper.class); } @@ -49,34 +59,6 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); } - private TaxAgentService getTaxAgentService(User user) { - return ServiceUtil.getService(TaxAgentServiceImpl.class, user); - } - - private SalaryEmployeeService getSalaryEmployeeService(User user) { - return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); - } - - private SalaryArchiveService getSalaryArchiveService(User user) { - return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); - } - - private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { - return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); - } - - private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { - return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); - } - - private EmployeeDeclareRecordService getEmployeeDeclareRecordService(User user) { - return ServiceUtil.getService(EmployeeDeclareRecordServiceImpl.class, user); - } - - private TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { - return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); - } - @Override public PageInfo list(DeductionAmountListParam param) { @@ -84,26 +66,27 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().year(param.getYear()).taxAgentId(param.getTaxAgentId()).build()); - List list = deductionAmountPOS.stream().map(deductionAmountPO -> { - return DeductionAmountDTO.builder() - .id(deductionAmountPO.getId()) - .taxAgentId(deductionAmountPO.getEmployeeId()) - .year(deductionAmountPO.getYear()) - .employeeId(deductionAmountPO.getEmployeeId()) - .employeeName(deductionAmountPO.getEmployeeName()) - .employeeType(deductionAmountPO.getEmployeeType()) - .jobNum(deductionAmountPO.getJobNum()) - .nationality(deductionAmountPO.getNationality()) - .cardNum(deductionAmountPO.getCardNum()) - .cardType(deductionAmountPO.getCardType()) - .declareStatus(deductionAmountPO.getDeclareStatus()) - .deductFlag(deductionAmountPO.getDeductFlag()) - .successfullyDeclared(deductionAmountPO.getSuccessfullyDeclared()) - .creator(deductionAmountPO.getCreator()) - .createTime(deductionAmountPO.getCreateTime()) - .updateTime(deductionAmountPO.getUpdateTime()) - .build(); - }).collect(Collectors.toList()); + List list = deductionAmountPOS.stream() + .map(deductionAmountPO -> DeductionAmountDTO.builder() + .id(deductionAmountPO.getId()) + .taxAgentId(deductionAmountPO.getEmployeeId()) + .year(deductionAmountPO.getYear()) + .employeeId(deductionAmountPO.getEmployeeId()) + .employeeName(deductionAmountPO.getEmployeeName()) + .employeeType(deductionAmountPO.getEmployeeType()) + .jobNum(deductionAmountPO.getJobNum()) + .nationality(deductionAmountPO.getNationality()) + .cardNum(deductionAmountPO.getCardNum()) + .cardType(deductionAmountPO.getCardType()) + .declareStatus(deductionAmountPO.getDeclareStatus()) + .declareErrorMsg(deductionAmountPO.getDeclareErrorMsg()) + .deductFlag(deductionAmountPO.getDeductFlag()) + .successfullyDeclared(deductionAmountPO.getSuccessfullyDeclared()) + .creator(deductionAmountPO.getCreator()) + .createTime(deductionAmountPO.getCreateTime()) + .updateTime(deductionAmountPO.getUpdateTime()) + .build()) + .collect(Collectors.toList()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, DeductionAmountDTO.class); } @@ -134,9 +117,9 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou .cardNum(employeeDeclarePO.getCardNum()) .cardType(employeeDeclarePO.getCardType()) .nationality(employeeDeclarePO.getNationality()) - .declareStatus(0) - .deductFlag(1) - .successfullyDeclared(0) + .declareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .deductFlag(SalaryOnOffEnum.OFF.getValue()) + .successfullyDeclared(SalaryOnOffEnum.OFF.getValue()) .creator((long) user.getUID()) .createTime(now) .updateTime(now) @@ -164,7 +147,7 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou } @Override - public Object confirm(DeductionAmountConfirmParam param) { + public String confirm(DeductionAmountConfirmParam param) { ValidUtil.doValidator(param); Long taxAgentId = param.getTaxAgentId(); String year = param.getYear(); @@ -181,13 +164,78 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou }).collect(Collectors.toList()); DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); - return deductionAmountClient.confirm(year, kczglb); + String requestId = deductionAmountClient.confirm(year, kczglb); + + //更新状态 + deductionAmountPOS.forEach(deductionAmountPO -> { + deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARING.getValue()); + getDeductionAmountMapper().updateIgnoreNull(deductionAmountPO); + }); + + //插入记录 + getDeductionAmountRecordMapper().deleteByTaxAgentIdAndYear(taxAgentId, year); + DeductionAmountRecordPO recordPO = DeductionAmountRecordPO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentId) + .year(year) + .requestId(requestId) + .creator((long) user.getUID()) + .createTime(new Date()) + .updateTime(new Date()) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getDeductionAmountRecordMapper().insertIgnoreNull(recordPO); + + return requestId; } @Override - public void feedback(DeductionAmountFeedBackParam param) { - DeductionAmountClient deductionAmountClient = new DeductionAmountClient(param.getTaxAgentId()); - String feedback = deductionAmountClient.feedback(param.getRequestId()); + public String feedback(DeductionAmountFeedBackParam param) { + Long taxAgentId = param.getTaxAgentId(); + String year = param.getYear(); + DeductionAmountRecordPO recordPO = getDeductionAmountRecordMapper().getByTaxAgentIdAndYear(taxAgentId, year); + + if (recordPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "请先点击报送扣除名单,再点击反馈")); + } + + String requestId = recordPO.getRequestId(); + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); + ConfirmFeedbackResponse feedback = deductionAmountClient.feedback(requestId); + + if (feedback == null || feedback.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试")); + } + // 如果税友返回错误信息 + String code = feedback.getHead().getCode(); + if (SzyhApiConstant.HANDLING_CODE.equals(code) || SzyhApiConstant.TASK_HANDLING_CODE.equals(code)) { + //进行中的任务,重试 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "任务还在处理中,请稍后点击反馈")); + } + + if (!SzyhApiConstant.SUCCESS_CODE.equals(code)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, feedback.getHead().getMsg())); + } + + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(taxAgentId).year(year).build()); + + List kcqrsblb = feedback.getBody().getKcqrsblb(); + Map failMap = SalaryEntityUtil.convert2Map(kcqrsblb, ConfirmFeedbackResponse.Body.kcqrsb::getZzhm, ConfirmFeedbackResponse.Body.kcqrsb::getSbyy); + + deductionAmountPOS.forEach(deductionAmountPO -> { + String cardNum = deductionAmountPO.getCardNum(); + if (failMap.containsKey(cardNum)) { + deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + deductionAmountPO.setDeclareErrorMsg(failMap.get(cardNum)); + } else { + deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()); + deductionAmountPO.setSuccessfullyDeclared(SalaryOnOffEnum.ON.getValue()); + } + getDeductionAmountMapper().updateIgnoreNull(deductionAmountPO); + }); + + return String.format("成功%s条,失败%s条", feedback.getBody().getCgrs(), feedback.getBody().getSbrs()); } } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 643d210ca..7e7da0c23 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -706,9 +706,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla } // 更新员工的报送状态 if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { - //todo needUpdateEmployeeDeclares.forEach(getEmployeeDeclareMapper()::updateIgnoreNull); -// updateBatchById(needUpdateEmployeeDeclares); } // 删除原来的人员报送记录 getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); diff --git a/src/com/engine/salary/web/DeductionAmountController.java b/src/com/engine/salary/web/DeductionAmountController.java index b900b6872..3657d6f83 100644 --- a/src/com/engine/salary/web/DeductionAmountController.java +++ b/src/com/engine/salary/web/DeductionAmountController.java @@ -72,7 +72,7 @@ public class DeductionAmountController { @Produces(MediaType.APPLICATION_JSON) public String confirm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountConfirmParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); } @POST @@ -80,7 +80,7 @@ public class DeductionAmountController { @Produces(MediaType.APPLICATION_JSON) public String feedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountFeedBackParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getDeductionAmountWrapper(user)::feedback, param); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::feedback, param); } } diff --git a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java index 7a474421f..a4f0628e9 100644 --- a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java +++ b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java @@ -40,11 +40,11 @@ public class DeductionAmountWrapper extends Service { return getDeductionAmountService(user).query(param); } - public Object confirm(DeductionAmountConfirmParam param) { + public String confirm(DeductionAmountConfirmParam param) { return getDeductionAmountService(user).confirm(param); } - public void feedback(DeductionAmountFeedBackParam param) { - getDeductionAmountService(user).feedback(param); + public String feedback(DeductionAmountFeedBackParam param) { + return getDeductionAmountService(user).feedback(param); } } From 10f1ec1629280b9754d58427becd62359d45c9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Mar 2025 16:03:12 +0800 Subject: [PATCH 259/298] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=90=8D=E5=8D=95sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202503190103.sql | 38 +++++++++++++++++++ resource/sqlupgrade/GS/sql202503190103.sql | 38 +++++++++++++++++++ resource/sqlupgrade/JC/sql202503190103.sql | 38 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202503190103.sql | 37 ++++++++++++++++++ .../sqlupgrade/Oracle/sql202503190103.sql | 37 ++++++++++++++++++ resource/sqlupgrade/PG/sql202503190103.sql | 37 ++++++++++++++++++ .../sqlupgrade/SQLServer/sql202503190103.sql | 37 ++++++++++++++++++ resource/sqlupgrade/ST/sql202503190103.sql | 38 +++++++++++++++++++ 8 files changed, 300 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202503190103.sql create mode 100644 resource/sqlupgrade/GS/sql202503190103.sql create mode 100644 resource/sqlupgrade/JC/sql202503190103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202503190103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202503190103.sql create mode 100644 resource/sqlupgrade/PG/sql202503190103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202503190103.sql create mode 100644 resource/sqlupgrade/ST/sql202503190103.sql diff --git a/resource/sqlupgrade/DM/sql202503190103.sql b/resource/sqlupgrade/DM/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202503190103.sql b/resource/sqlupgrade/GS/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202503190103.sql b/resource/sqlupgrade/JC/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202503190103.sql b/resource/sqlupgrade/Mysql/sql202503190103.sql new file mode 100644 index 000000000..6c78f00ed --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202503190103.sql @@ -0,0 +1,37 @@ +CREATE TABLE hrsa_deduction_amount +( + id bigint(0), + create_time datetime(0), + update_time datetime(0), + creator bigint(0), + delete_type int(0), + tenant_key varchar(10), + tax_agent_id bigint(0), + year varchar(100), + employee_id bigint(0), + employee_type tinyint(0), + employee_name varchar(100), + job_num varchar(100), + card_type tinyint(0), + card_num varchar(100), + nationality varchar(200), + deduct_flag tinyint(0), + successfully_declared tinyint(0), + declare_status tinyint(0), + declare_error_msg varchar(3000), + PRIMARY KEY (id) USING BTREE +); + +CREATE TABLE hrsa_deduction_amount_record +( + id bigint(0), + create_time datetime(0), + update_time datetime(0), + creator bigint(0), + delete_type int(0), + tenant_key varchar(10), + tax_agent_id bigint(0), + year varchar(255), + request_id varchar(100), + PRIMARY KEY (id) USING BTREE +); diff --git a/resource/sqlupgrade/Oracle/sql202503190103.sql b/resource/sqlupgrade/Oracle/sql202503190103.sql new file mode 100644 index 000000000..172207806 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202503190103.sql @@ -0,0 +1,37 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +) +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202503190103.sql b/resource/sqlupgrade/PG/sql202503190103.sql new file mode 100644 index 000000000..7f39dcf84 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202503190103.sql @@ -0,0 +1,37 @@ +create table hrsa_deduction_amount +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int, + tenant_key varchar(10), + tax_agent_id bigint, + year varchar(100), + employee_id bigint, + employee_type smallint, + employee_name varchar(100), + job_num varchar(100), + card_type smallint, + card_num varchar(100), + nationality varchar(200), + deduct_flag smallint, + successfully_declared smallint, + declare_status smallint, + declare_error_msg varchar(3000) +); +/ + +create table hrsa_deduction_amount_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + year varchar(100), + request_id varchar(100) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202503190103.sql b/resource/sqlupgrade/SQLServer/sql202503190103.sql new file mode 100644 index 000000000..3aaee1960 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202503190103.sql @@ -0,0 +1,37 @@ +create table hrsa_deduction_amount +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int, + tenant_key nvarchar(10), + tax_agent_id bigint, + year nvarchar(100), + employee_id bigint, + employee_type tinyint, + employee_name nvarchar(100), + job_num nvarchar(100), + card_type tinyint, + card_num nvarchar(100), + nationality nvarchar(255), + deduct_flag tinyint, + successfully_declared tinyint, + declare_status tinyint, + declare_error_msg nvarchar(3000) +) +GO + +create table hrsa_deduction_amount_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int, + tenant_key nvarchar(10), + tax_agent_id bigint, + year nvarchar(100), + request_id nvarchar(100) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202503190103.sql b/resource/sqlupgrade/ST/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + From d7702d7caeb76c126a56f3842a15188fafaa48e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Mar 2025 16:25:42 +0800 Subject: [PATCH 260/298] =?UTF-8?q?=E6=89=A3=E9=99=A4=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/DeductionAmountEditParam.java | 30 +++++++++++++++++++ .../deductionamount/po/DeductionAmountPO.java | 2 +- .../service/DeductionAmountService.java | 2 ++ .../impl/DeductionAmountServiceImpl.java | 13 ++++++++ .../salary/web/DeductionAmountController.java | 8 +++++ .../wrapper/DeductionAmountWrapper.java | 5 ++++ 6 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java new file mode 100644 index 000000000..f0e2a2412 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扣除名单查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountEditParam { + /** + * ID + */ + @DataCheck(require = true, message = "参数错误,id不能为空") + private Long id; + + @DataCheck(require = true, message = "请选择是否扣除") + private Integer deductFlag; +} diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java index e203655e7..24bd438a2 100644 --- a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java @@ -10,7 +10,7 @@ import java.util.Collection; import java.util.Date; /** - * 人员报送记录 + * 扣除名单 */ @Data @Builder diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java index 3d7da8fad..5609882e9 100644 --- a/src/com/engine/salary/service/DeductionAmountService.java +++ b/src/com/engine/salary/service/DeductionAmountService.java @@ -18,6 +18,8 @@ public interface DeductionAmountService { void add(DeductionAmountAddParam param); + void edit(DeductionAmountEditParam param); + void delete(DeductionAmountDeleteParam param); Object query(DeductionAmountOnlineQueryParam param); diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java index 5b30ff10d..d36575ca8 100644 --- a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -129,6 +129,19 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou .forEach(deductionAmountPO -> getDeductionAmountMapper().insertIgnoreNull(deductionAmountPO)); } + @Override + public void edit(DeductionAmountEditParam param) { + ValidUtil.doValidator(param); + + DeductionAmountPO po = getDeductionAmountMapper().getById(param.getId()); + if (po == null) { + throw new SalaryRunTimeException("扣除名单不存在"); + } + + po.setDeductFlag(param.getDeductFlag()); + getDeductionAmountMapper().updateIgnoreNull(po); + } + @Override public void delete(DeductionAmountDeleteParam param) { if (CollUtil.isEmpty(param.getIds())) { diff --git a/src/com/engine/salary/web/DeductionAmountController.java b/src/com/engine/salary/web/DeductionAmountController.java index 3657d6f83..617c36920 100644 --- a/src/com/engine/salary/web/DeductionAmountController.java +++ b/src/com/engine/salary/web/DeductionAmountController.java @@ -51,6 +51,14 @@ public class DeductionAmountController { return new ResponseResult(user).run(getDeductionAmountWrapper(user)::add, param); } + @POST + @Path("/edit") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountEditParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::edit, param); + } + @POST @Path("/delete") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java index a4f0628e9..a9586cafb 100644 --- a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java +++ b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java @@ -32,6 +32,10 @@ public class DeductionAmountWrapper extends Service { getDeductionAmountService(user).add(param); } + public void edit(DeductionAmountEditParam param) { + getDeductionAmountService(user).edit(param); + } + public void delete(DeductionAmountDeleteParam param) { getDeductionAmountService(user).delete(param); } @@ -47,4 +51,5 @@ public class DeductionAmountWrapper extends Service { public String feedback(DeductionAmountFeedBackParam param) { return getDeductionAmountService(user).feedback(param); } + } From e25c1f59d27782ffe4ba626ba8117403a85c727c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Mar 2025 09:51:44 +0800 Subject: [PATCH 261/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= =?UTF-8?q?=EF=BC=8C=E4=B8=9A=E5=8A=A1=E7=BA=BF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/WEB-INF/salaryoptconfig.xml | 5 +++ .../dto/TaxAgentDeclareListDTO.java | 4 +++ .../wrapper/EmployeeDeclareWrapper.java | 32 +++++++------------ 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/resource/WEB-INF/salaryoptconfig.xml b/resource/WEB-INF/salaryoptconfig.xml index cc4c607b8..11ea398bc 100644 --- a/resource/WEB-INF/salaryoptconfig.xml +++ b/resource/WEB-INF/salaryoptconfig.xml @@ -39,6 +39,11 @@ + + + + + diff --git a/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java index 6b1286c03..a241b008e 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java @@ -6,6 +6,8 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; +import java.util.Set; + /** * 人员报送(个税扣缴义务人)列表 *

Copyright: Copyright (c) 2023

@@ -26,4 +28,6 @@ public class TaxAgentDeclareListDTO { // 个税扣缴义务人 private String taxAgentName; + + Set opts; } diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index fca9ed934..9372a990a 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -11,8 +11,10 @@ import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; import com.engine.salary.entity.employeedeclare.dto.*; import com.engine.salary.entity.employeedeclare.param.*; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.employeedeclare.*; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -28,6 +30,7 @@ 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 com.google.common.collect.Sets; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; @@ -83,24 +86,21 @@ public class EmployeeDeclareWrapper extends Service { * @return */ public PageInfo taxAgentDeclareList(TaxAgentDeclareListQueryParam queryParam) { - // 判断是否是“总管理员” - Boolean isChief = getTaxAgentService(user).isChief(Long.valueOf(user.getUID())); - // 是否开启分权 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 查询个税扣缴义务人 - List taxAgents = Lists.newArrayList(); - if (!openDevolution || isChief) { - taxAgents = getTaxAgentService(user).listAll(); - } else { - taxAgents = new ArrayList<>(getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID()))); - } + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + List taxAgents = getTaxAgentService(user).listAuth(param); + if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList()); } // 分页 List dtoList = Lists.newArrayList(); for (TaxAgentPO taxAgent : taxAgents) { - TaxAgentDeclareListDTO dto = new TaxAgentDeclareListDTO().setId(taxAgent.getId()).setTaxAgentName(taxAgent.getName()); + TaxAgentDeclareListDTO dto = TaxAgentDeclareListDTO.builder() + .id(taxAgent.getId()) + .taxAgentName(taxAgent.getName()) + .opts(Sets.newHashSet("admin")) + .build(); dtoList.add(dto); } return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, TaxAgentDeclareListDTO.class); @@ -122,14 +122,6 @@ public class EmployeeDeclareWrapper extends Service { List convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS); pageInfo.setList(convert); -// // 判断是否开启分部 -// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); -// if (!subcompanySupport) { -// weaTable.getColumns().stream() -// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) -// .findAny() -// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); -// } SalaryWeaTable table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class); WeaResultMsg result = new WeaResultMsg(false); result.putAll(table.makeDataResult()); From f3dd68792c36b68f77500d5101cf5cb258de76b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Mar 2025 14:44:47 +0800 Subject: [PATCH 262/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=BA=BF=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/SalarySobServiceImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index c313e42c9..c1762112d 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -338,10 +338,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { //保存个税扣缴义务人联系 saveSobTaxLink(saveParam.getTaxAgentIds(), salarySobPO); - // 新建薪资账套时,保存默认的员工信息字段 - saveDefaultEmpField(salarySobPO); - // 新建薪资账套时,保存默认的薪资项目 - saveDefaultItem(salarySobPO); + // 新建薪资账套时,保存默认的关联人员范围及从范围中排除 saveDefaultEmployeeRange(salarySobPO); // 返回薪资账套的主键id From 7fe109a1aff5248cb8ec96cee5e0782a8c75a376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Mar 2025 17:12:37 +0800 Subject: [PATCH 263/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/AddUpDeductionServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index ca998e4b7..28a142b39 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1650,7 +1650,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } private void setExistedDataMap(AddUpDeductionOnlineRequestWrapper requestWrapper) { - List taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId, Collectors.toList()); + Set taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId); List poList = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(requestWrapper.getRequestPOList().get(0).getTaxYearMonth()).taxAgentIds(taxAgentIds).build()); requestWrapper.setExistedDataMap(SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId(), AddUpDeduction::getId)); } From 993cba21bdbe1a797761272afaa5fda50eadc6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 31 Mar 2025 17:15:01 +0800 Subject: [PATCH 264/298] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=8F=96=E5=80=BC=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/TaxDeclarationCommon.java | 128 +++++++++++++++--- 1 file changed, 108 insertions(+), 20 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index e870f624e..19d0e742f 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -1,5 +1,7 @@ package com.engine.salary.entity.taxdeclaration.bo; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.AddUpSituation; @@ -20,7 +22,6 @@ import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.IdGenerator; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Field; import java.math.BigDecimal; @@ -49,29 +50,116 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { - // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 - SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); - for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { - SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); - SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); - if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { - lastSalaryAcctEmployee = salaryAcctEmployee; - } - } + Map valueMap = Maps.newHashMap(); for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) { - SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() - .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); - List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); String value = ""; - if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { - value = salaryAcctResultValue.stream() - .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) - .findFirst() - .orElse(new SalaryAcctResultPO()) - .getResultValue(); + + List firstValueList = Lists.newArrayList( + "taxFreeIncome", + "endowmentInsurance", + "medicalInsurance", + "unemploymentInsurance", + "housingProvidentFund", + "addUpChildEducation", + "addUpHousingLoanInterest", + "addUpHousingRent", + "addUpSupportElderly", + "addUpContinuingEducation", + "addUpInfantCare", + "annuity", + "commercialHealthInsurance", + "taxDeferredEndowmentInsurance", + "other", + "allowedDonation", + "taxDeduction", + "description", + "addUpAdvanceTax"); + + List lastValueList = Lists.newArrayList( + "addUpIncome", + "addUpTaxFreeIncome", + "addUpSubtraction", + "addUpSpecialDeduction", + "addUpOtherDeduction", + "addUpAllowedDonation", + "addUpTaxableIncome", + "taxRate", + "quickDeductionFactor", + "addUpTaxPayable", + "addUpTaxDeduction" + ); + + List mergeValueList = Lists.newArrayList( + "income", + "refundedOrSupplementedTax" + ); + + //取第一次值 + if (firstValueList.contains(taxReportColumn.getReportColumnDataIndex())) { + SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); + for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { + SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); + SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); + if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) < 0) { + lastSalaryAcctEmployee = salaryAcctEmployee; + } + } + SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { + value = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + value = StrUtil.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; + } + //取多次累计值 + else if (mergeValueList.contains(taxReportColumn.getReportColumnDataIndex()) && Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { + List employeePOS = employeeIdEntry.getValue(); + BigDecimal income = new BigDecimal("0.00"); + for (SalaryAcctEmployeePO salaryAcctEmployeePO : employeePOS) { + SalarySobTaxReportRulePO incomeRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(salaryAcctEmployeePO.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployeePO.getId()); + if (incomeRule != null && salaryAcctResultValue != null) { + String incomeValue = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(incomeRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + if (StrUtil.isNotBlank(incomeValue) && NumberUtil.isNumber(incomeValue)) { + income = income.add(new BigDecimal(incomeValue)); + } + } + } + value = income.toPlainString(); + } + //取最后一次值 + else { + SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); + for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { + SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); + SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); + if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { + lastSalaryAcctEmployee = salaryAcctEmployee; + } + } + SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { + value = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + value = StrUtil.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; } - value = StringUtils.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); } TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() From 1a4ab02bdce64490d1a7ea2a9ae351b388fab1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 31 Mar 2025 18:23:12 +0800 Subject: [PATCH 265/298] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E8=BD=AC=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deductionamount/dto/DeductionAmountDTO.java | 4 +++- .../enums/employeedeclare/DeclareStatusEnum.java | 11 +++++++++++ .../service/impl/DeductionAmountServiceImpl.java | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java index 43fc7de83..234ec01cd 100644 --- a/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java +++ b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java @@ -83,8 +83,10 @@ public class DeductionAmountDTO { /** * 报送状态 */ - @TableTitle(title = "报送状态", dataIndex = "declareStatus", key = "declareStatus") + @TableTitle(title = "报送状态", dataIndex = "declareStatusName", key = "declareStatusName") + private String declareStatusName; private Integer declareStatus; + private String declareErrorMsg; diff --git a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java index 2a91aafde..e0d759613 100644 --- a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Objects; + /** * 人员报送状态 *

Copyright: Copyright (c) 2023

@@ -43,4 +45,13 @@ public enum DeclareStatusEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static DeclareStatusEnum getByValue(Integer value) { + for (DeclareStatusEnum e : DeclareStatusEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return NOT_DECLARE; + } } diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java index d36575ca8..e6b3c6b4c 100644 --- a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -79,6 +79,7 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou .cardNum(deductionAmountPO.getCardNum()) .cardType(deductionAmountPO.getCardType()) .declareStatus(deductionAmountPO.getDeclareStatus()) + .declareStatusName(DeclareStatusEnum.getByValue(deductionAmountPO.getDeclareStatus()).getDefaultLabel()) .declareErrorMsg(deductionAmountPO.getDeclareErrorMsg()) .deductFlag(deductionAmountPO.getDeductFlag()) .successfullyDeclared(deductionAmountPO.getSuccessfullyDeclared()) @@ -118,7 +119,7 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou .cardType(employeeDeclarePO.getCardType()) .nationality(employeeDeclarePO.getNationality()) .declareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) - .deductFlag(SalaryOnOffEnum.OFF.getValue()) + .deductFlag(SalaryOnOffEnum.ON.getValue()) .successfullyDeclared(SalaryOnOffEnum.OFF.getValue()) .creator((long) user.getUID()) .createTime(now) From 6532bfdd0775e9795f40ac2afaf37b5a67b2c2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 22 Apr 2025 15:33:28 +0800 Subject: [PATCH 266/298] =?UTF-8?q?=E6=8B=93=E6=89=91=E5=9B=BE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=9D=9E=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalarySobItemServiceImpl.java | 221 ++++++++++++++++-- 1 file changed, 202 insertions(+), 19 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 781c99af5..15a14933e 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -9,20 +9,29 @@ import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpDeduction; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.datacollection.dto.AttendQuoteDataDTO; +import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; +import com.engine.salary.entity.datacollection.po.OtherDeductionPO; +import com.engine.salary.entity.datacollection.po.VariableItemPO; +import com.engine.salary.entity.salaryacct.bo.CalculateFormulaVarBO; +import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig; +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.salaryarchive.config.ArchiveFieldConfig; +import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; import com.engine.salary.entity.salaryformula.ExpressFormula; -import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryformula.config.FormluaConfig; import com.engine.salary.entity.salaryformula.po.FormulaPO; import com.engine.salary.entity.salaryformula.po.FormulaVar; -import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig; -import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; +import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; @@ -31,6 +40,7 @@ import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -46,11 +56,13 @@ import com.engine.salary.util.valid.ValidUtil; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.general.BaseBean; import weaver.hrm.User; +import java.time.Month; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -121,6 +133,59 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } // private LoggerTemplate salarySobLoggerTemplate; + private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { + return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); + } + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private SIAccountService getSIAccountService(User user) { + return ServiceUtil.getService(SIAccountServiceImpl.class, user); + } + + private AttendQuoteFieldService getAttendQuoteFieldService(User user) { + return ServiceUtil.getService(AttendQuoteFieldServiceImpl.class, user); + } + + private VariableItemService getVariableItemService(User user) { + return ServiceUtil.getService(VariableItemServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + + private AddUpSituationService getAddUpSituationService(User user) { + return ServiceUtil.getService(AddUpSituationServiceImpl.class, user); + } + + private AddUpDeductionService getAddUpDeductionService(User user) { + return ServiceUtil.getService(AddUpDeductionServiceImpl.class, user); + } + + private OtherDeductionService getOtherDeductionService(User user) { + return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); + } + + private AttendQuoteDataService getAttendQuoteDataService(User user) { + return ServiceUtil.getService(AttendQuoteDataServiceImpl.class, user); + } + + private VariableArchiveService getVariableArchiveService(User user) { + return ServiceUtil.getService(VariableArchiveServiceImpl.class, user); + } + + @Override public List list() { return salarySobItemMapper.listAll(); @@ -629,7 +694,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } salarySobItemPO.setFormula(formulaPO); } - if(SalaryEntityUtil.isNotNullOrEmpty(salarySobItemPO.getSalaryItemId())){ + if (SalaryEntityUtil.isNotNullOrEmpty(salarySobItemPO.getSalaryItemId())) { SalaryItemPO salaryItemPO = itemIdMap.get(salarySobItemPO.getSalaryItemId()); salarySobItemPO.setSalaryItem(salaryItemPO); } @@ -677,7 +742,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe salarySobItemFormDTO .setId(salarySobItemPO.getId()) .setName(salaryItemPO.getName()) - .setItemHide(salarySobItemPO.getItemHide()==null?0:Integer.parseInt(salarySobItemPO.getItemHide().toString())) + .setItemHide(salarySobItemPO.getItemHide() == null ? 0 : Integer.parseInt(salarySobItemPO.getItemHide().toString())) .setDataType(salaryItemPO.getDataType()) .setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode()) .setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern()) @@ -726,7 +791,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe salaryItemTopologyDTO.setSalaryItemId(salaryItemPO.getId()); salaryItemTopologyDTO.setSalaryItemName(salaryItemPO.getName()); salaryItemTopologyDTO.setFormula(expressFormula); - salaryItemTopologyDTO.setResult(topologyData.getResultItemMap().getOrDefault(salaryItemPO.getId(), "")); + salaryItemTopologyDTO.setResult(topologyData.getResultItemMap().getOrDefault(SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + "_" + salaryItemPO.getCode(), "")); topology(salaryItemTopologyDTO, topologyData); @@ -767,7 +832,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe for (int i = 0; i < parameters.size(); i++) { FormulaVar formulaVar = parameters.get(i); String source = formulaVar.getSource(); - String fieldId = formulaVar.getFieldId().replace(source + "_", ""); + String fieldId = formulaVar.getFieldId(); + String code = fieldId.replace(source + "_", ""); String name = formulaVar.getName(); String fieldName = formulaVar.getFieldName(); //是否是薪资项目 @@ -785,26 +851,26 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } ExpressFormula expressFormula; - if (salarySobItemCodeMap.containsKey(fieldId)) { + if (salarySobItemCodeMap.containsKey(code)) { // 如果薪资账套下重新定义了薪资项目的公式,则使用薪资账套下的公式,否则使用薪资项目本身的公式 - expressFormula = expressFormulaIdMap.get(salarySobItemCodeMap.get(fieldId).getFormulaId()); - } else if (salaryItemCodeMap.containsKey(fieldId)) { - expressFormula = expressFormulaIdMap.get(salaryItemCodeMap.get(fieldId).getFormulaId()); + expressFormula = expressFormulaIdMap.get(salarySobItemCodeMap.get(code).getFormulaId()); + } else if (salaryItemCodeMap.containsKey(code)) { + expressFormula = expressFormulaIdMap.get(salaryItemCodeMap.get(code).getFormulaId()); } else { expressFormula = null; } - SalaryItemPO salaryItemChild = isSalaryItemVar ? salaryItemCodeMap.get(fieldId) : new SalaryItemPO(); + SalaryItemPO salaryItemChild = isSalaryItemVar ? salaryItemCodeMap.get(code) : new SalaryItemPO(); SalaryItemTopologyDTO salaryItemTopologyChild = new SalaryItemTopologyDTO(); salaryItemTopologyChild.setSalaryItemId(isSalaryItemVar ? salaryItemChild.getId() : null); salaryItemTopologyChild.setSalaryItemName(isSalaryItemVar ? salaryItemChild.getName() : fieldName); salaryItemTopologyChild.setFormula(expressFormula); - salaryItemTopologyChild.setResult(isSalaryItemVar ? topologyData.getResultItemMap().getOrDefault(salaryItemChild.getId(), "") : ""); + salaryItemTopologyChild.setResult(topologyData.getResultItemMap().getOrDefault(fieldId, "")); salaryItemTopologyDTOChildren.add(salaryItemTopologyChild); if (isSalaryItemVar) { - SalaryItemPO salaryItemChildChild = salaryItemCodeMap.get(fieldId); + SalaryItemPO salaryItemChildChild = salaryItemCodeMap.get(code); SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(salaryItemChildChild.getValueType()); if (salaryValueTypeEnum != SalaryValueTypeEnum.INPUT) { topologyData.setSalaryItemId(salaryItemChildChild.getId()); @@ -849,9 +915,126 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe //薪资结果 Long acctEmpId = param.getAcctEmpId(); if (acctEmpId != null) { - List results = getSalaryAcctResultService(user).listBySalaryAcctEmployeeId(acctEmpId); - Map resultItemMap = SalaryEntityUtil.convert2Map(results, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); - topologyData.setResultItemMap(resultItemMap); + SalaryAcctEmployeePO acctEmployeePO = getSalaryAcctEmployeeService(user).getById(acctEmpId); + List acctEmployeePOS = new ArrayList<>(); + acctEmployeePOS.add(acctEmployeePO); + + Long salaryAcctRecordId = acctEmployeePO.getSalaryAcctRecordId(); + + // 1、查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + //查询对应账套 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资账套不存在或已被删除")); + } + + // 不是查询薪资账套下实时的薪资项目,而是查询发起薪资核算时存储的薪资项目快照 + SalaryAcctConfig salaryAcctSobConfig = getSalaryAcctSobConfigService(user).getSalaryAcctConfig(salaryAcctRecordId); + + // 1.1、如果薪资核算记录已经归档了,就不能继续核算 + if (!Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99148, "当前薪资核算记录已归档,请重新打开后再进行核算")); + } + // 2、查询薪资核算记录的薪资周期、考勤周期等 + SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctRecordId); + // 3、查询薪资核算记录所用薪资账套的薪资项目副本 + List salarySobItemPOS = salaryAcctSobConfig.getSalarySobItems(); + if (CollectionUtils.isEmpty(salarySobItemPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99151, "当前所用的薪资账套未选择任何薪资项目,无法核算")); + } + // 回算薪资项目 + List salarySobBackItems = Collections.emptyList(); + if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), 1)) { + salarySobBackItems = salaryAcctSobConfig.getSalarySobBackItems(); + } + // 4、查询当前租户的所有薪资项目 + List salaryItemPOS = getSalaryItemService(user).listAll(); + // 6、查询社保福利的所有字段 + Map welfareColumns = getSIAccountService(user).welfareColumns(); + // 7、查询考勤引用的所有字段 + List attendQuoteFieldListDTOS = getAttendQuoteFieldService(user).listAll(); + List variableItemPOS = getVariableItemService(user).listAll(); + + // 8、查询公式详情 + Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); + formulaIds.addAll(SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId)); + formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); + List formulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + // 本次运算的回算薪资项目所涉及的变量 +// Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); + + // 10、根据id查询其他合并计税的薪资核算记录 + List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); + + // 12.3、生成本次运算的key + String calculateKey = UUID.randomUUID().toString(); + // 12.5、多线程运算,运算结果存放在临时表中 + SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO() + .setSalaryAcctRecordPO(salaryAcctRecordPO) + .setSalarySobPO(salarySobPO) + .setSalarySobCycleDTO(salarySobCycleDTO) + .setOtherSalaryAcctRecordPOS(otherSalaryAcctRecordPOS) + .setSalarySobItemPOS(salarySobItemPOS) + .setSalaryItemIdWithPriorityList(new ArrayList<>()) + .setExpressFormulas(formulas) + .setSalaryItemPOS(salaryItemPOS) + .setSalarySobAdjustRulePOS(new ArrayList<>()) + .setWelfareColumns(MapUtils.emptyIfNull(welfareColumns)) + .setAttendQuoteFieldListDTOS(attendQuoteFieldListDTOS) + .setSalaryAcctEmployeePOS(acctEmployeePOS) + .setIssuedFieldIds(new HashSet<>()) + .setResults(null) + .setCalculateKey(calculateKey) + .setVariableItems(variableItemPOS) + .setTaxDeclarationFunction(null) + .setTaxIds(null); + + + List employeeIds = Collections.singletonList(acctEmployeePO.getEmployeeId()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); + Long taxAgentId = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentId(); + List salaryArchiveData = getSalaryArchiveService(user).getSalaryArchiveData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentId); + List addUpSituationPOS; + if (salarySobCycleDTO.getTaxCycle().getMonth() == Month.JANUARY) { + // 3.1、如果当前税款所属期是本年度第一个税款所属期,就不需要查询往期累计情况 + addUpSituationPOS = Collections.emptyList(); + } else { + addUpSituationPOS = getAddUpSituationService(user).getAddUpSituationList(salarySobCycleDTO.getTaxCycle().plusMonths(-1), employeeIds); + } + List addUpDeductionPOS = getAddUpDeductionService(user).getAddUpDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId); + List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId); + List> welfareData = new ArrayList<>(); + welfareData.addAll(getSIAccountService(user).welfareData(salarySobCycleDTO.getSocialSecurityCycle().toString(), employeeIds, taxAgentId)); + List attendQuoteDataDTOS = getAttendQuoteDataService(user).getAttendQuoteData(salarySobCycleDTO.getSalaryMonth(), salarySobCycleDTO.getSalarySobId(), employeeIds); + List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList()); + List salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); + Map empItemValueMap = SalaryEntityUtil.convert2Map(salaryAcctResultPOS, p -> p.getSalaryAcctEmpId() + "_" + p.getSalaryItemId(), SalaryAcctResultPO::getResultValue); + List> variableArchiveList = getVariableArchiveService(user).listBySalaryMonthAndEmployeeIds(salarySobCycleDTO.getSalaryMonth(), employeeIds, taxAgentId); + Map> collect = salaryAcctResultPOS.stream().collect(Collectors.groupingBy(k -> k.getEmployeeId() + "-" + k.getTaxAgentId() + "-" + k.getSalaryItemId())); + Map salaryAcctResultPOMap = new HashMap<>(); + for (Map.Entry> et : collect.entrySet()) { + salaryAcctResultPOMap.put(et.getKey(), et.getValue().get(0).getOriginResultValue()); + } + Set otherSalaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getOtherSalaryAcctRecordPOS(), SalaryAcctRecordPO::getId); + List otherSalaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds); + Map> otherSalaryAcctResultPOMap = SalaryEntityUtil.group2Map(otherSalaryAcctResultPOS, e -> e.getEmployeeId() + "_" + e.getTaxAgentId()); + List otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds); + Map> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()); +// List lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds); + CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList); + Map> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO); + + Map resultMap = new HashMap<>(); + formulaVarMap.entrySet().forEach(e -> { + e.getValue().forEach(f -> { + resultMap.put(f.getFieldId(), f.getFieldValue()); + }); + }); + topologyData.setResultItemMap(resultMap); } else { topologyData.setResultItemMap(new HashMap<>()); } @@ -885,7 +1068,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe /** * 核算结果 */ - Map resultItemMap; + Map resultItemMap; } From 595fceddaa0ec77012a7337c320a150b5921d19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 22 Apr 2025 15:41:11 +0800 Subject: [PATCH 267/298] =?UTF-8?q?=E6=8B=93=E6=89=91=E5=9B=BE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=9D=9E=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalarySobItemServiceImpl.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 96a8c7abf..76ec0d017 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -41,15 +41,16 @@ import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; -import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper; import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper; import com.engine.salary.mapper.salarysob.SalarySobItemMapper; import com.engine.salary.service.*; +import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; @@ -992,8 +993,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe List employeeIds = Collections.singletonList(acctEmployeePO.getEmployeeId()); List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); - Long taxAgentId = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentId(); - List salaryArchiveData = getSalaryArchiveService(user).getSalaryArchiveData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentId); + List taxAgentIds = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentIds(); + List salaryArchiveData = getSalaryArchiveService(user).getSalaryArchiveData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds); List addUpSituationPOS; if (salarySobCycleDTO.getTaxCycle().getMonth() == Month.JANUARY) { // 3.1、如果当前税款所属期是本年度第一个税款所属期,就不需要查询往期累计情况 @@ -1001,15 +1002,16 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } else { addUpSituationPOS = getAddUpSituationService(user).getAddUpSituationList(salarySobCycleDTO.getTaxCycle().plusMonths(-1), employeeIds); } - List addUpDeductionPOS = getAddUpDeductionService(user).getAddUpDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId); - List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId); + List addUpDeductionPOS = getAddUpDeductionService(user).getAddUpDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds); + List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds); List> welfareData = new ArrayList<>(); - welfareData.addAll(getSIAccountService(user).welfareData(salarySobCycleDTO.getSocialSecurityCycle().toString(), employeeIds, taxAgentId)); + taxAgentIds.forEach(id -> { + welfareData.addAll(getSIAccountService(user).welfareData(salarySobCycleDTO.getSocialSecurityCycle().toString(), employeeIds, id)); + }); List attendQuoteDataDTOS = getAttendQuoteDataService(user).getAttendQuoteData(salarySobCycleDTO.getSalaryMonth(), salarySobCycleDTO.getSalarySobId(), employeeIds); List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList()); List salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); - Map empItemValueMap = SalaryEntityUtil.convert2Map(salaryAcctResultPOS, p -> p.getSalaryAcctEmpId() + "_" + p.getSalaryItemId(), SalaryAcctResultPO::getResultValue); - List> variableArchiveList = getVariableArchiveService(user).listBySalaryMonthAndEmployeeIds(salarySobCycleDTO.getSalaryMonth(), employeeIds, taxAgentId); + List> variableArchiveList = getVariableArchiveService(user).listBySalaryMonthAndEmployeeIds(salarySobCycleDTO.getSalaryMonth(), employeeIds, taxAgentIds); Map> collect = salaryAcctResultPOS.stream().collect(Collectors.groupingBy(k -> k.getEmployeeId() + "-" + k.getTaxAgentId() + "-" + k.getSalaryItemId())); Map salaryAcctResultPOMap = new HashMap<>(); for (Map.Entry> et : collect.entrySet()) { @@ -1020,8 +1022,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe Map> otherSalaryAcctResultPOMap = SalaryEntityUtil.group2Map(otherSalaryAcctResultPOS, e -> e.getEmployeeId() + "_" + e.getTaxAgentId()); List otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds); Map> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()); -// List lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds); - CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList); + List lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds); + CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList,lastMonthResultPOS); Map> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO); Map resultMap = new HashMap<>(); From 47c267ba3ba7c5d61d7a486ed810094bdc97a108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 22 Apr 2025 15:45:56 +0800 Subject: [PATCH 268/298] =?UTF-8?q?=E6=8B=93=E6=89=91=E5=9B=BE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=9D=9E=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalarySobItemServiceImpl.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 76ec0d017..e830f6f9c 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -1017,11 +1017,6 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe for (Map.Entry> et : collect.entrySet()) { salaryAcctResultPOMap.put(et.getKey(), et.getValue().get(0).getOriginResultValue()); } - Set otherSalaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getOtherSalaryAcctRecordPOS(), SalaryAcctRecordPO::getId); - List otherSalaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds); - Map> otherSalaryAcctResultPOMap = SalaryEntityUtil.group2Map(otherSalaryAcctResultPOS, e -> e.getEmployeeId() + "_" + e.getTaxAgentId()); - List otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds); - Map> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()); List lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds); CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList,lastMonthResultPOS); Map> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO); From 0bdc48f1c20fc0be2bbe728d4d61c6e36ba0ec72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 24 Apr 2025 11:03:13 +0800 Subject: [PATCH 269/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E5=90=8E=E6=9F=A5=E7=9C=8B=E6=8B=93=E6=89=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalarySobItemServiceImpl.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 15a14933e..3e4d548b5 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -40,7 +40,6 @@ import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; -import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -935,17 +934,10 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe // 不是查询薪资账套下实时的薪资项目,而是查询发起薪资核算时存储的薪资项目快照 SalaryAcctConfig salaryAcctSobConfig = getSalaryAcctSobConfigService(user).getSalaryAcctConfig(salaryAcctRecordId); - // 1.1、如果薪资核算记录已经归档了,就不能继续核算 - if (!Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99148, "当前薪资核算记录已归档,请重新打开后再进行核算")); - } // 2、查询薪资核算记录的薪资周期、考勤周期等 SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctRecordId); // 3、查询薪资核算记录所用薪资账套的薪资项目副本 List salarySobItemPOS = salaryAcctSobConfig.getSalarySobItems(); - if (CollectionUtils.isEmpty(salarySobItemPOS)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99151, "当前所用的薪资账套未选择任何薪资项目,无法核算")); - } // 回算薪资项目 List salarySobBackItems = Collections.emptyList(); if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), 1)) { From ee3fd8da8e46cea728f10f04631b0938b04564cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 24 Apr 2025 16:19:23 +0800 Subject: [PATCH 270/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E6=89=A3=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/TaxDeclareRecordServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index af3d81c1c..cdec3def1 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.util.StrUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.hrmelog.entity.dto.LoggerContext; @@ -23,6 +24,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; @@ -250,6 +252,13 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } List taxDeclareRecordPOS = getTaxDeclareRecordMapper().listSome(build); + + if (StrUtil.isNotBlank(queryParam.getTaxAgentName())) { + List taxAgentPOs = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build()); + Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOs, TaxAgentPO::getId); + taxDeclareRecordPOS = taxDeclareRecordPOS.stream().filter(tax -> taxAgentIds.contains(tax.getTaxAgentId())).collect(Collectors.toList()); + } + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclareRecordPOS, TaxDeclareRecordPO.class); } From efd2eafd1ecb459897673135331c64657b863858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 24 Apr 2025 16:45:24 +0800 Subject: [PATCH 271/298] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=88=86=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/PushServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/PushServiceImpl.java b/src/com/engine/salary/service/impl/PushServiceImpl.java index cf01efde8..3dbb7f735 100644 --- a/src/com/engine/salary/service/impl/PushServiceImpl.java +++ b/src/com/engine/salary/service/impl/PushServiceImpl.java @@ -543,7 +543,8 @@ public class PushServiceImpl extends Service implements PushService { .build()) .collect(Collectors.toList()); - PageInfo pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, PushRecordDTO.class); + PageInfo pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), PushRecordDTO.class); + pageInfo.setList(listDTOS); pageInfo.setTotal(pushRecordPOS.size()); return pageInfo; } From 8c4fbf79191d57391752e56537262a3894d97708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 9 May 2025 11:45:06 +0800 Subject: [PATCH 272/298] =?UTF-8?q?=E6=8B=BC=E6=8E=A5=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 83892cf9a..504e7d3d7 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -711,7 +711,7 @@ public enum IncomeCategoryEnum implements BaseEnum { } List rysbsblb = feedbackResponse.getBody().getRysbsblb(); if (CollectionUtil.isNotEmpty(rysbsblb)) { - String err = rysbsblb.stream().map(GetASynIndividualIncomeTaxFeedbackResponse.Body.rysbsb::getSbyy).collect(Collectors.joining(";")); + String err = rysbsblb.stream().map(sb -> Util.null2String(sb.getXm()) + Util.null2String(sb.getSbyy())).collect(Collectors.joining(";")); throw new OnlineCalculateTaxException(err); } } From 24e7cbb32e3a1ac2905bb67b0a0e0d3415e6ced8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 9 May 2025 19:46:32 +0800 Subject: [PATCH 273/298] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E4=BA=BA=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/TaxDeclareRecordServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index cdec3def1..334ea2f51 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; @@ -917,7 +918,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); // 申报类型 declareStatus.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); - declareStatus.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); + String nsrc = Util.null2String(declareTaxFeedbackResponse.getBody().get("nsrc")); + declareStatus.setPersonNum(Integer.parseInt(NumberUtil.isNumber(nsrc) ? nsrc : "0")); declareStatus.setDeclareRequestId(declareStatus.getRequestId()); declareStatus.setRequestId(""); //实缴(不含滞纳金) From 48712d7d37014c3e60b17df24dab7f9fc32152e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 12 May 2025 15:24:21 +0800 Subject: [PATCH 274/298] =?UTF-8?q?=E6=89=93=E5=8D=B0=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=8A=A5=E9=80=81=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/EmployeeDeclareServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 7e7da0c23..a74f33cf9 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -660,6 +660,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla ImmutableMap requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, requestParam); + log.info("人员报送反馈:{}", res); DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class); if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) { log.error("服务异常:" + res); From 4a2821d793dc8abec72deb1c27bbdf7d4e6e67a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 15 May 2025 14:08:12 +0800 Subject: [PATCH 275/298] =?UTF-8?q?=E7=A6=BB=E8=81=8C=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=AF=BC=E5=85=A5=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EmployeeDeclareExcelServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index 067b4acfd..d8a01f687 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -601,10 +601,14 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee Set emptyNames = new HashSet<>(); for (PropertyDescriptor pd : pds) { - Object srcValue = src.getPropertyValue(pd.getName()); + String name = pd.getName(); + if("dismissDate".equals(name)){ + continue; + } + Object srcValue = src.getPropertyValue(name); // 此处判断可根据需求修改 if (srcValue == null) { - emptyNames.add(pd.getName()); + emptyNames.add(name); } } String[] result = new String[emptyNames.size()]; From c6633005aa8ece2526dbefb7b94f6be5f44be3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 21 May 2025 11:37:25 +0800 Subject: [PATCH 276/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=B3=BB=E7=BB=9F=E7=AE=97=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalaryAcctRecordServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 94c14b032..5590cedc2 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -500,6 +500,12 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe */ @Override public void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List salaryAcctTaxAgents) { + // 如果个税申报功能是关闭的,则不需要检查 + TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); + if (taxDeclarationFunctionEnum == TaxDeclarationFunctionEnum.CLOSURE) { + return; + } + // 查询薪资账套 SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecord.getSalarySobId()); IncomeCategoryEnum incomeCategoryEnums = IncomeCategoryEnum.parseByValue(salarySobPO.getIncomeCategory()); From 9af61786362080965706601566f0ceffd327334b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 6 Jun 2025 10:27:16 +0800 Subject: [PATCH 277/298] =?UTF-8?q?=E5=AF=B9=E2=80=9C=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E9=9B=87=E5=91=98=E2=80=9D=E5=AD=97=E6=AE=B5=E4=B8=BA=E2=80=9C?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E2=80=9D=E6=97=B6=E7=9A=84=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=81=9A=E4=BA=86=E8=B0=83=E6=95=B4=E3=80=82=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=B8=AA=E5=AD=97=E6=AE=B5=20=E2=80=9D?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=83=85=E5=86=B5=E8=AF=B4=E6=98=8E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/employeedeclare/bo/EmployeeDeclareRequest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java index 5527df49e..d45c35b79 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -62,6 +62,11 @@ public class EmployeeDeclareRequest { // *任职受雇类型 EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); employeeInfoMap.put("sfgy", employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); + //其他情况说明“qtqksm”,有3个选择的值,可选择"扣缴申报利息股息红利所得”、“扣缴申报偶然所得”、”申报其他所得” + //一般劳务所得处理,可以统一用”申报其他所得”作为默认就好 + if (employmentTypeEnum == EmploymentTypeEnum.OTHER) { + employeeInfoMap.put("qtqksm", "申报其他所得"); + } // 入职年度就业情形 employeeInfoMap.put("rzndjyqk", employeeDeclare.getEmploymentFirstYear()); // *手机号码 From adbdb64b4ca5ca612269a2f279ee6daf8e46c8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 6 Jun 2025 11:07:33 +0800 Subject: [PATCH 278/298] =?UTF-8?q?=E8=A1=A5=E5=81=BF=E9=87=91=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=94=9F=E6=88=90=E5=85=8D=E7=A8=8E=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/taxdeclaration/bo/TaxDeclarationRequest.java | 5 ++--- .../engine/salary/formlua/func/date/DateTimeServiceImpl.java | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 8432faa61..495e4635b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -75,6 +75,7 @@ public class TaxDeclarationRequest { } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_DISMISS) { // 解除劳动合同一次性补偿金 List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); + employeeRequestParam.put("sfzdscmsfb","是"); employeeRequestParams.add(employeeRequestParam); } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE) { // 个人股权激励收入 @@ -125,6 +126,7 @@ public class TaxDeclarationRequest { } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR) { // 稿酬所得 List> employeeRequestParams = listRequestParam.computeIfAbsent("gcsdlb", k -> Lists.newArrayList()); + employeeRequestParam.put("sfzdscmsfb","是"); employeeRequestParams.add(employeeRequestParam); } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { // 特许权使用费所得 @@ -167,9 +169,6 @@ public class TaxDeclarationRequest { } } - String string = employeeRequestParam.getOrDefault("syjkbx", "0").toString(); - System.out.println(); - if (new BigDecimal(employeeRequestParam.getOrDefault("syjkbx", "0").toString()).compareTo(new BigDecimal("0")) > 0) { Map healthInsuranceMap = taxFreeMap.get(TaxFreeTypeEnum.HEALTH_INSURANCE); List pos = (List) healthInsuranceMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); diff --git a/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java b/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java index 5f2ffedd0..d081615e5 100644 --- a/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java +++ b/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java @@ -571,7 +571,6 @@ public class DateTimeServiceImpl implements DateTimeService { cale.set(cale.get(Calendar.YEAR), month, 1); String lastday = formatTemp.format(cale.getTime()); - System.out.println(lastday); return new DataType(DataType.STRING, lastday); } From d4ff9af8b76428a687e1b4959238f64a01f9315d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 17 Jun 2025 11:23:30 +0800 Subject: [PATCH 279/298] =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=89=80=E5=BE=97-?= =?UTF-8?q?=E4=B8=8A=E5=B8=82=E5=85=AC=E5=8F=B8=E8=82=A1=E6=81=AF=E7=BA=A2?= =?UTF-8?q?=E5=88=A9=E6=89=80=E5=BE=97(=E6=B2=AA=E5=B8=82=E3=80=81?= =?UTF-8?q?=E6=B7=B1=E5=B8=82=E3=80=81=E5=88=9B=E4=B8=9A=E6=9D=BF)=20?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=89=80=E5=BE=97-=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=88=A9=E6=81=AF=E8=82=A1=E6=81=AF=E7=BA=A2=E5=88=A9=E6=89=80?= =?UTF-8?q?=E5=BE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salaryacct/bo/SalaryCalcTax.java | 42 ++++ .../salaryacct/bo/SalaryCalcTaxRequest.java | 2 +- .../bo/TaxDeclarationRequest.java | 65 +++++- .../enums/salarysob/IncomeCategoryEnum.java | 91 ++++++++ ...ynIndividualIncomeTaxFeedbackResponse.java | 195 +++++++++++++++++- .../GetDeclareTaxResultFeedbackResponse.java | 194 ++++++++++++++++- .../impl/TaxDeclareRecordServiceImpl.java | 8 +- .../salary/wrapper/SalarySobWrapper.java | 3 +- 8 files changed, 578 insertions(+), 22 deletions(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java index 3dab288f0..8be3d2ed9 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java @@ -122,6 +122,9 @@ public class SalaryCalcTax { // 综合所得 requestParam.put("zhsd", buildZHSDRequestParam(salaryAcctTaxAgents, salaryAcctEmployees, salaryAcctResultValueMap, taxReportColumnMap, salarySobTaxReportRuleMap, employeeDeclares)); + // 综合所得 + requestParam.put("flsd", buildFLSDRequestParam(salaryAcctTaxAgents, salaryAcctEmployees, + salaryAcctResultValueMap, taxReportColumnMap, salarySobTaxReportRuleMap, employeeDeclares)); resultMap.put(taxAgent.getId(), requestParam); } @@ -196,4 +199,43 @@ public class SalaryCalcTax { } return requestParam; } + + private Map buildFLSDRequestParam(List salaryAcctTaxAgents, + List salaryAcctEmployees, + Map> salaryAcctResultValueMap, + Map> taxReportColumnMap, + Map salarySobTaxReportRuleMap, + List employeeDeclares) { + Map> incomeCategoryKeySalaryAcctEmployeeMap = SalaryEntityUtil + .group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); + + Map requestParam = new HashMap<>(); + + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum + .parseByValue(salaryAcctTaxAgent.getIncomeCategory()); + List taxReportColumns = taxReportColumnMap.get(incomeCategoryEnum.getValue().toString()); + List subSalaryAcctEmployees = incomeCategoryKeySalaryAcctEmployeeMap.get(incomeCategoryEnum.getValue().toString()); + Map salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(subSalaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId); + + SalaryCalcTaxRequest salaryCalcTaxRequest = new SalaryCalcTaxRequest(salaryAcctEmployeeMap, + salaryAcctResultValueMap, taxReportColumns, salarySobTaxReportRuleMap, employeeDeclares); + + switch (incomeCategoryEnum) { + case CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES: + List> ssgsgxhllb = salaryCalcTaxRequest.buildRequestParams(IncomeCategoryEnum.CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + requestParam.put("ssgsgxhllb", ssgsgxhllb); + break; + case CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES: + List> lxgxhllb = salaryCalcTaxRequest.buildRequestParams(IncomeCategoryEnum.CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + requestParam.put("lxgxhllb", lxgxhllb); + break; + default: + break; + } + } + return requestParam; + } } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java index 7e836152a..39eb225c0 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java @@ -200,7 +200,7 @@ public class SalaryCalcTaxRequest { employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); } - private List> buildRequestParams(IncomeCategoryEnum incomeCategoryEnum, + public List> buildRequestParams(IncomeCategoryEnum incomeCategoryEnum, List employeeDeclares, Map salaryAcctEmployeeMap, Map> salaryAcctResultValueMap) { diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 495e4635b..cd4140605 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.bo; +import cn.hutool.core.util.NumberUtil; import com.engine.salary.entity.datacollection.po.*; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; @@ -35,7 +36,7 @@ public class TaxDeclarationRequest { List taxDeclarations, List taxDeclarationValues, List employeeDeclares, - Map> taxFreeMap) { + Map> taxFreeMap) { Map> objRequestParam = Maps.newHashMap(); Map>> listRequestParam = Maps.newHashMap(); Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); @@ -75,7 +76,7 @@ public class TaxDeclarationRequest { } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_DISMISS) { // 解除劳动合同一次性补偿金 List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); - employeeRequestParam.put("sfzdscmsfb","是"); + employeeRequestParam.put("sfzdscmsfb", "是"); employeeRequestParams.add(employeeRequestParam); } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE) { // 个人股权激励收入 @@ -126,7 +127,7 @@ public class TaxDeclarationRequest { } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR) { // 稿酬所得 List> employeeRequestParams = listRequestParam.computeIfAbsent("gcsdlb", k -> Lists.newArrayList()); - employeeRequestParam.put("sfzdscmsfb","是"); + employeeRequestParam.put("sfzdscmsfb", "是"); employeeRequestParams.add(employeeRequestParam); } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { // 特许权使用费所得 @@ -145,7 +146,8 @@ public class TaxDeclarationRequest { } private static void buildOtherDeductionDetailParams(Map> taxFreeMap, Map>> listRequestParam, EmployeeDeclarePO employeeDeclare, IncomeCategoryEnum incomeCategoryEnum, Map employeeRequestParam) { - if (new BigDecimal(employeeRequestParam.getOrDefault("mssd", "0").toString()).compareTo(new BigDecimal("0")) > 0) { + String mssd = employeeRequestParam.getOrDefault("mssd", "0").toString(); + if (NumberUtil.isNumber(mssd) && new BigDecimal(mssd).compareTo(new BigDecimal("0")) > 0) { Map freeIncomeMap = taxFreeMap.get(TaxFreeTypeEnum.FREE_INCOME); List poList = (List) freeIncomeMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(poList)) { @@ -169,7 +171,8 @@ public class TaxDeclarationRequest { } } - if (new BigDecimal(employeeRequestParam.getOrDefault("syjkbx", "0").toString()).compareTo(new BigDecimal("0")) > 0) { + String syjkbx = employeeRequestParam.getOrDefault("syjkbx", "0").toString(); + if (NumberUtil.isNumber(syjkbx) && new BigDecimal(syjkbx).compareTo(new BigDecimal("0")) > 0) { Map healthInsuranceMap = taxFreeMap.get(TaxFreeTypeEnum.HEALTH_INSURANCE); List pos = (List) healthInsuranceMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { @@ -184,7 +187,7 @@ public class TaxDeclarationRequest { map.put("zzhm", employeeDeclare.getCardNum()); // 所得项目 map.put("sdxm", incomeCategoryEnum.getDefaultLabel()); - map.put("bdsxrq",SalaryDateUtil.getFormatLocalDate(healthInsurancePO.getEffectiveDate()) ); + map.put("bdsxrq", SalaryDateUtil.getFormatLocalDate(healthInsurancePO.getEffectiveDate())); map.put("sysbm", healthInsurancePO.getIdentificationNumber()); map.put("ndbf", healthInsurancePO.getYearPremium()); map.put("ydbf", healthInsurancePO.getMonthPremium()); @@ -194,7 +197,9 @@ public class TaxDeclarationRequest { listRequestParam.put("syjkbxfblb", paramMaps); } } - if (new BigDecimal(employeeRequestParam.getOrDefault("syylbx", "0").toString()).compareTo(new BigDecimal("0")) > 0) { + + String syylbx = employeeRequestParam.getOrDefault("syylbx", "0").toString(); + if (NumberUtil.isNumber(syylbx) && new BigDecimal(syylbx).compareTo(new BigDecimal("0")) > 0) { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.ENDOWMENT_INSURANCE); List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { @@ -220,7 +225,9 @@ public class TaxDeclarationRequest { listRequestParam.put("syjkbxfblb", paramMaps); } } - if (new BigDecimal(employeeRequestParam.getOrDefault("zykcjze", "0").toString()).compareTo(new BigDecimal("0")) > 0) { + + String zykcjze = employeeRequestParam.getOrDefault("zykcjze", "0").toString(); + if (NumberUtil.isNumber(zykcjze) && new BigDecimal(zykcjze).compareTo(new BigDecimal("0")) > 0) { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.GRANT_DONATION); List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { @@ -250,7 +257,8 @@ public class TaxDeclarationRequest { } } - if (new BigDecimal(employeeRequestParam.getOrDefault("jmse", "0").toString()).compareTo(new BigDecimal("0")) > 0) { + String jmse = employeeRequestParam.getOrDefault("jmse", "0").toString(); + if (NumberUtil.isNumber(jmse) && new BigDecimal(jmse).compareTo(new BigDecimal("0")) > 0) { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.DERATE_DEDUCTION); List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { @@ -274,9 +282,10 @@ public class TaxDeclarationRequest { } } - if (new BigDecimal(employeeRequestParam.getOrDefault("qt", "0").toString()).compareTo(new BigDecimal("0")) > 0) { + String qt = employeeRequestParam.getOrDefault("qt", "0").toString(); + if (NumberUtil.isNumber(qt) && new BigDecimal(qt).compareTo(new BigDecimal("0")) > 0) { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION); - List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); + List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { employeeRequestParam.put("bz", pos.get(0).getRemark()); } @@ -312,6 +321,40 @@ public class TaxDeclarationRequest { } + public static Map convert2flsdRequestParam(List taxReportColumns, + List taxDeclarations, + List taxDeclarationValues, + List employeeDeclares) { + Map> objRequestParam = Maps.newHashMap(); + Map>> listRequestParam = Maps.newHashMap(); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + for (TaxDeclarationPO taxDeclaration : taxDeclarations) { + List values = taxDeclarationValueMap.get(taxDeclaration.getId()); + for (TaxDeclarationValuePO taxDeclarationValue : values) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); + if (employeeDeclare == null || incomeCategoryEnum == null) { + continue; + } + List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); + Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); + if (incomeCategoryEnum == IncomeCategoryEnum.CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES) { + // 其他利息股息红利所得 + List> employeeRequestParams = listRequestParam.computeIfAbsent("lxgxhllb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + } + } + + Map requestParam = Maps.newHashMap(); + requestParam.putAll(objRequestParam); + requestParam.putAll(listRequestParam); + return requestParam; + } + + public static Map convert2fjmsdRequestParam(List taxReportColumns, List taxDeclarations, List taxDeclarationValues, diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 504e7d3d7..b2476e6b8 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,5 +1,6 @@ package com.engine.salary.enums.salarysob; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; @@ -673,6 +674,88 @@ public enum IncomeCategoryEnum implements BaseEnum { return resultMap; } + }, + CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES(810, "0810", "上市公司股息红利所得(沪市、深市、创业板)", DeclareReportTypeEnum.CLASSIFIED_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List flsd = declareTaxResultFeedbackResponse.getBody().getFlsd().getSsgsgxhllb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.flsd.flsdssjgdx.flsdscbw.class, flsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx ssgsgxhllb = declareTaxResultFeedbackResponse.getBody().getFlsd().getSsgsgxhllb(); + checkSSSBYYLBResponse(ssgsgxhllb.getSssbyylb()); + + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = ssgsgxhllb.getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + + }, + CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES(800, "0800", "其他利息股息红利所得", DeclareReportTypeEnum.CLASSIFIED_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List flsd = declareTaxResultFeedbackResponse.getBody().getFlsd().getLxgxhllb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.flsd.flsdssjgdx.flsdscbw.class, flsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx ssgsgxhllb = declareTaxResultFeedbackResponse.getBody().getFlsd().getLxgxhllb(); + checkSSSBYYLBResponse(ssgsgxhllb.getSssbyylb()); + + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = ssgsgxhllb.getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }; @@ -716,6 +799,14 @@ public enum IncomeCategoryEnum implements BaseEnum { } } + private static void checkSSSBYYLBResponse(List sssbyylb) { + if(CollUtil.isNotEmpty(sssbyylb)){ + String err = sssbyylb.stream().map(sssbyy -> sssbyy.getXm() + sssbyy.getCwxx()).collect(Collectors.joining(",")); + throw new OnlineCalculateTaxException(err); + } + } + + public Map>> parseGetCompanyIncomesResponse(Map>> result, GetCompanyIncomesResponse response) { List sfmx = Optional.ofNullable(response.getBody().getSfmx()) .orElse(new ArrayList<>()) diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java index ff4fb6484..ad6d5ed8a 100644 --- a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -46,10 +46,10 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { * 综合所得 必填:是 见综合所得计算结果 */ private zhsd zhsd; -// /** -// * 分类所得 必填:是 见分类所得计算结果 -// */ -// private flsd flsd; + /** + * 分类所得 必填:是 见分类所得计算结果 + */ + private flsd flsd; /** * 非居民所得 必填:是 见非居民所得计算结果 */ @@ -543,6 +543,193 @@ public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { } + /** + * 分类所得 + */ + @Data + public static class flsd { + + /** + * 利息股息红利所得列表 必填:null + */ + private flsdssjgdx lxgxhllb; + /** + * 股权转让所得列表 必填:null + */ + private flsdssjgdx ggzrlb; + /** + * 其他财产转让所得列表 必填:null + */ + private flsdssjgdx qtcczrlb; + /** + * 偶然所得列表 必填:null + */ + private flsdssjgdx orsdlb; + /** + * 其他财产租赁列表 必填:null + */ + private flsdssjgdx qtcczllb; + /** + * 上市公司股息红利 必填:null + */ + private flsdssjgdx ssgsgxhllb; + /** + * 个人房屋出租所得列表 必填:null + */ + private flsdssjgdx grfwczsdlb; + /** + * 随机赠送礼品列表 必填:null + */ + private flsdssjgdx sjzslplb; + /** + * 三板市场股息红利所得 必填:null + */ + private flsdssjgdx sbscgxhllb; + /** + * 证劵资金利息所得 必填:null + */ + private flsdssjgdx zjzjlxlb; + + + /** + * 分类所得算税结果对象 + */ + @Data + public static class flsdssjgdx { + /** + * 算税成功列表 参考输入报文非居民所得输出结果报文 + */ + private List sscglb; + /** + * 算税失败列表 参考输入报文非居民所得输出结果报文 + */ + private List sssblb; + /** + * 算税失败原因列表 参考算税失败原因对象 + */ + private List sssbyylb; + /** + * 算税总人数 + */ + private int sszrs; + /** + * 算税失败总人数 + */ + private int sssbrs; + + /** + * 所得输出结果报文 + */ + @Data + public static class result { + /** + * 是否明细申报 必填:否 是或者否 + */ + private String sfmxsb; + /** + * 姓名 必填:null 汇总申报返回空 + */ + private String xm; + /** + * 证件类型名称 必填:null 汇总申报返回空 + */ + private String zzlx; + /** + * 证件号码 必填:null 汇总申报返回空 + */ + private String zzhm; + /** + * 收入额 必填:是 + */ + private String sre; + /** + * 免税收入 必填:是 + */ + private String mssd; + /** + * 财产原值 必填:是 + */ + private String ccyz; + /** + * 允许扣除的税费 必填:是 + */ + private String yxkcsf; + /** + * 投资抵扣 必填:是 + */ + private String tzdk; + /** + * 其他 必填:是 + */ + private String qt; + /** + * 备注 必填:是 + */ + private String bz; + /** + * 减除费用 必填:是 + */ + private String jcfy; + /** + * 减计比例 必填:是 + */ + private String jjbl; + /** + * 准予扣除的捐赠额 必填:是 + */ + private String zykcjze; + /** + * 税前扣除项目合计 必填:是 + */ + private String sqkcxmhj; + /** + * 应纳税所得额 必填:是 + */ + private String ynssde; + /** + * 应纳税额 必填:是 + */ + private String ynse; + /** + * 减免税额 必填:是 + */ + private String jmse; + /** + * 已缴税额 必填:是 无需填写该值,按0处理 + */ + private String ykjse; + /** + * 应扣缴税额 必填:是 + */ + private String yingkjse; + /** + * 税率 必填:是 + */ + private String sl; + /** + * 速算扣除数 必填:是 + */ + private String sskcs; + /** + * 应补退税额 必填:是 + */ + private String ybtse; + /** + * 分类所得名字 必填:是 分类所得薪金类别-利息股息红利所得,股权转让所得,其他财产转让所得,偶然所得,其他所得" + */ + private String sdxm; + /** + * 所得期间起 必填:是 YYYY-MM + */ + private String sdqjq; + /** + * 所得期间止 必填:是 YYYY-MM + */ + private String sdqjz; + } + } + } + @Data public static class fjmsd { diff --git a/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java index 6691cdb96..aec9cc394 100644 --- a/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java @@ -47,10 +47,10 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { * 综合所得 必填:是 见综合所得计算结果 */ private zhsd zhsd; -// /** -// * 分类所得 必填:是 见分类所得计算结果 -// */ -// private 对象 flsd; + /** + * 分类所得 必填:是 见分类所得计算结果 + */ + private flsd flsd; /** * 非居民所得 必填:是 见非居民所得计算结果 */ @@ -657,6 +657,192 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { } + /** + * 分类所得 + */ + @Data + public static class flsd { + + /** + * 利息股息红利所得列表 必填:null + */ + private flsdssjgdx lxgxhllb; + /** + * 股权转让所得列表 必填:null + */ + private flsdssjgdx ggzrlb; + /** + * 其他财产转让所得列表 必填:null + */ + private flsdssjgdx qtcczrlb; + /** + * 偶然所得列表 必填:null + */ + private flsdssjgdx orsdlb; + /** + * 其他财产租赁列表 必填:null + */ + private flsdssjgdx qtcczllb; + /** + * 上市公司股息红利 必填:null + */ + private flsdssjgdx ssgsgxhllb; + /** + * 个人房屋出租所得列表 必填:null + */ + private flsdssjgdx grfwczsdlb; + /** + * 随机赠送礼品列表 必填:null + */ + private flsdssjgdx sjzslplb; + /** + * 三板市场股息红利所得 必填:null + */ + private flsdssjgdx sbscgxhllb; + /** + * 证劵资金利息所得 必填:null + */ + private flsdssjgdx zjzjlxlb; + + + /** + * 4.3.1.3.3.1分类所得算税结果对象 + */ + @Data + public static class flsdssjgdx { + /** + * 非算税成功列表 参考输入报文非居民所得输出结果报文 + */ + private List sscglb; + /** + * 算税失败列表 参考输入报文非居民所得输出结果报文 + */ + private List sssblb; + /** + * 失败原因列表 参考算税失败原因对象 + */ + private List sssbyylb; + /** + * 算税总人数 + */ + private int sszrs; + /** + * 失败总人数 + */ + private int sssbrs; + + /** + * 所得输出结果报文 + */ + @Data + public static class flsdscbw { + /** + * 是否明细申报 必填:否 是或者否 + */ + private String sfmxsb; + /** + * 姓名 必填:null 汇总申报返回空 + */ + private String xm; + /** + * 证件类型名称 必填:null 汇总申报返回空 + */ + private String zzlx; + /** + * 证件号码 必填:null 汇总申报返回空 + */ + private String zzhm; + /** + * 收入额 必填:是 + */ + private String sre; + /** + * 免税收入 必填:是 + */ + private String mssd; + /** + * 财产原值 必填:是 + */ + private String ccyz; + /** + * 允许扣除的税费 必填:是 + */ + private String yxkcsf; + /** + * 投资抵扣 必填:是 + */ + private String tzdk; + /** + * 其他 必填:是 + */ + private String qt; + /** + * 备注 必填:是 + */ + private String bz; + /** + * 减除费用 必填:是 + */ + private String jcfy; + /** + * 减计比例 必填:是 + */ + private String jjbl; + /** + * 准予扣除的捐赠额 必填:是 + */ + private String zykcjze; + /** + * 税前扣除项目合计 必填:是 + */ + private String sqkcxmhj; + /** + * 应纳税所得额 必填:是 + */ + private String ynssde; + /** + * 应纳税额 必填:是 + */ + private String ynse; + /** + * 减免税额 必填:是 + */ + private String jmse; + /** + * 已缴税额 必填:是 无需填写该值,按0处理 + */ + private String ykjse; + /** + * 应扣缴税额 必填:是 + */ + private String yingkjse; + /** + * 税率 必填:是 + */ + private String sl; + /** + * 速算扣除数 必填:是 + */ + private String sskcs; + /** + * 应补退税额 必填:是 + */ + private String ybtse; + /** + * 分类所得名字 必填:是 分类所得薪金类别-利息股息红利所得,股权转让所得,其他财产转让所得,偶然所得,其他所得" + */ + private String sdxm; + /** + * 所得期间起 必填:是 YYYY-MM + */ + private String sdqjq; + /** + * 所得期间止 必填:是 YYYY-MM + */ + private String sdqjz; + } + } + } @Data public static class fjmsd { diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 334ea2f51..28914157d 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -717,6 +717,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe requestParam.put("zhsd", taxDeclarationParam); } + if (declareReportType == DeclareReportTypeEnum.CLASSIFIED_INCOME) { + //分类所得 + Map flsdRequestParam = TaxDeclarationRequest.convert2flsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); + requestParam.put("flsd", flsdRequestParam); + } + if (declareReportType == DeclareReportTypeEnum.NONRESIDENT_INCOME) { //非居民所得代扣代缴 fjmsd Map fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); @@ -728,7 +734,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map params = new HashMap<>(1); Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - log.info("个税申报返回数据: {} , taxDeclareRecord: {}", res, taxDeclareRecord); + log.info("个税申报数据:params {} ,res {}, taxDeclareRecord: {}",params, res, taxDeclareRecord); DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); diff --git a/src/com/engine/salary/wrapper/SalarySobWrapper.java b/src/com/engine/salary/wrapper/SalarySobWrapper.java index 3eea30516..97e7c99d0 100644 --- a/src/com/engine/salary/wrapper/SalarySobWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobWrapper.java @@ -281,7 +281,8 @@ public class SalarySobWrapper extends Service { public List> incomeCategoryList() { List> list = new ArrayList<>(); Arrays.stream(IncomeCategoryEnum.values()) - .filter(incomeCategory -> incomeCategory.getReportType() == DeclareReportTypeEnum.COMPREHENSIVE_INCOME) + .filter(incomeCategory -> incomeCategory.getReportType() == DeclareReportTypeEnum.COMPREHENSIVE_INCOME + || incomeCategory.getReportType() == DeclareReportTypeEnum.CLASSIFIED_INCOME) .forEach(incomeCategory -> { Map map = new HashMap(); map.put("enum", incomeCategory); From c3d6ac8b66009db35f226954f6fc49d0b22884d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 17 Jun 2025 17:25:27 +0800 Subject: [PATCH 280/298] =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=89=80=E5=BE=97-?= =?UTF-8?q?=E4=B8=8A=E5=B8=82=E5=85=AC=E5=8F=B8=E8=82=A1=E6=81=AF=E7=BA=A2?= =?UTF-8?q?=E5=88=A9=E6=89=80=E5=BE=97(=E6=B2=AA=E5=B8=82=E3=80=81?= =?UTF-8?q?=E6=B7=B1=E5=B8=82=E3=80=81=E5=88=9B=E4=B8=9A=E6=9D=BF)=20?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=89=80=E5=BE=97-=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=88=A9=E6=81=AF=E8=82=A1=E6=81=AF=E7=BA=A2=E5=88=A9=E6=89=80?= =?UTF-8?q?=E5=BE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/TaxDeclarationRequest.java | 5 ++ .../GetDeclareTaxResultFeedbackResponse.java | 46 ++++++++++++++++++- .../impl/TaxDeclarationValueServiceImpl.java | 12 +++-- .../impl/TaxDeclareRecordServiceImpl.java | 2 +- 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index cd4140605..1dbb8de4b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -340,6 +340,11 @@ public class TaxDeclarationRequest { } List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); + if (incomeCategoryEnum == IncomeCategoryEnum.CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES) { + // 上市公司股息红利所得(沪市、深市、创业板) + List> employeeRequestParams = listRequestParam.computeIfAbsent("ssgsgxhllb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } if (incomeCategoryEnum == IncomeCategoryEnum.CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES) { // 其他利息股息红利所得 List> employeeRequestParams = listRequestParam.computeIfAbsent("lxgxhllb", k -> Lists.newArrayList()); diff --git a/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java index aec9cc394..137d849ae 100644 --- a/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java +++ b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java @@ -711,7 +711,7 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { @Data public static class flsdssjgdx { /** - * 非算税成功列表 参考输入报文非居民所得输出结果报文 + * 算税成功列表 参考输入报文非居民所得输出结果报文 */ private List sscglb; /** @@ -743,90 +743,134 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { /** * 姓名 必填:null 汇总申报返回空 */ + @SalaryTableColumn(text = "姓名", width = "10%", column = "xm") + @ExcelHead(title = "姓名", dataIndex = "xm") private String xm; /** * 证件类型名称 必填:null 汇总申报返回空 */ + @SalaryTableColumn(text = "证件类型", width = "10%", column = "zzlx") + @ExcelHead(title = "证件类型", dataIndex = "zzlx") private String zzlx; /** * 证件号码 必填:null 汇总申报返回空 */ + @SalaryTableColumn(text = "证件号码", width = "10%", column = "zzhm") + @ExcelHead(title = "证件号码", dataIndex = "zzhm") private String zzhm; /** * 收入额 必填:是 */ + @SalaryTableColumn(text = "本期收入", width = "10%", column = "sre") + @ExcelHead(title = "本期收入", dataIndex = "sre") private String sre; /** * 免税收入 必填:是 */ + @SalaryTableColumn(text = "本期免税收入", width = "10%", column = "mssd") + @ExcelHead(title = "本期免税收入", dataIndex = "mssd") private String mssd; /** * 财产原值 必填:是 */ + @SalaryTableColumn(text = "财产原值", width = "10%", column = "ccyz") + @ExcelHead(title = "财产原值", dataIndex = "ccyz") private String ccyz; /** * 允许扣除的税费 必填:是 */ + @SalaryTableColumn(text = "允许扣除的税费", width = "10%", column = "yxkcsf") + @ExcelHead(title = "允许扣除的税费", dataIndex = "yxkcsf") private String yxkcsf; /** * 投资抵扣 必填:是 */ + @SalaryTableColumn(text = "投资抵扣", width = "10%", column = "tzdk") + @ExcelHead(title = "投资抵扣", dataIndex = "tzdk") private String tzdk; /** * 其他 必填:是 */ + @SalaryTableColumn(text = "其他", width = "10%", column = "qt") + @ExcelHead(title = "其他", dataIndex = "qt") private String qt; /** * 备注 必填:是 */ + @SalaryTableColumn(text = "备注", width = "10%", column = "bz") + @ExcelHead(title = "备注", dataIndex = "bz") private String bz; /** * 减除费用 必填:是 */ + @SalaryTableColumn(text = "减除费用", width = "10%", column = "jcfy") + @ExcelHead(title = "减除费用", dataIndex = "jcfy") private String jcfy; /** * 减计比例 必填:是 */ + @SalaryTableColumn(text = "减计比例", width = "10%", column = "jjbl") + @ExcelHead(title = "减计比例", dataIndex = "jjbl") private String jjbl; /** * 准予扣除的捐赠额 必填:是 */ + @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "zykcjze") + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "zykcjze") private String zykcjze; /** * 税前扣除项目合计 必填:是 */ + @SalaryTableColumn(text = "税前扣除项目合计", width = "10%", column = "sqkcxmhj") + @ExcelHead(title = "税前扣除项目合计", dataIndex = "sqkcxmhj") private String sqkcxmhj; /** * 应纳税所得额 必填:是 */ + @SalaryTableColumn(text = "应纳税所得额", width = "10%", column = "ynssde") + @ExcelHead(title = "应纳税所得额", dataIndex = "ynssde") private String ynssde; /** * 应纳税额 必填:是 */ + @SalaryTableColumn(text = "应纳税额", width = "10%", column = "ynse") + @ExcelHead(title = "应纳税额", dataIndex = "ynse") private String ynse; /** * 减免税额 必填:是 */ + @SalaryTableColumn(text = "减免税额", width = "10%", column = "jmse") + @ExcelHead(title = "减免税额", dataIndex = "jmse") private String jmse; /** * 已缴税额 必填:是 无需填写该值,按0处理 */ + @SalaryTableColumn(text = "已缴税额", width = "10%", column = "ykjse") + @ExcelHead(title = "已缴税额", dataIndex = "ykjse") private String ykjse; /** * 应扣缴税额 必填:是 */ + @SalaryTableColumn(text = "应扣缴税额", width = "10%", column = "yingkjse") + @ExcelHead(title = "应扣缴税额", dataIndex = "yingkjse") private String yingkjse; /** * 税率 必填:是 */ + @SalaryTableColumn(text = "税率", width = "10%", column = "sl") + @ExcelHead(title = "税率", dataIndex = "sl") private String sl; /** * 速算扣除数 必填:是 */ + @SalaryTableColumn(text = "速算扣除数", width = "10%", column = "sskcs") + @ExcelHead(title = "速算扣除数", dataIndex = "sskcs") private String sskcs; /** * 应补退税额 必填:是 */ + @SalaryTableColumn(text = "应补退税额", width = "10%", column = "ybtse") + @ExcelHead(title = "应补退税额", dataIndex = "ybtse") private String ybtse; /** * 分类所得名字 必填:是 分类所得薪金类别-利息股息红利所得,股权转让所得,其他财产转让所得,偶然所得,其他所得" diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index f0f5f9a38..5d75c8efa 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -25,6 +25,7 @@ import com.engine.salary.entity.taxdeclaration.po.*; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +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.taxdeclaration.SourceEnum; @@ -365,7 +366,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar Map>> onlineDataMap = new HashMap<>(); List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); - list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); + list.stream() + .map(TaxDeclarationPO::getIncomeCategory) + .map(IncomeCategoryEnum::parseByValue) + .filter(Objects::nonNull) + .filter(e -> e.getReportType() == DeclareReportTypeEnum.parseByValue(reportType)) + .forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); Map resultList = new HashMap<>(); List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); @@ -446,7 +452,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar onlyShowColumns.add(col); hasDiff.set(true); } - } else if ((StrUtil.isBlank(localValue) && "0.00".equals(onlineValue)) || (StrUtil.isBlank(onlineValue) && "0.00".equals(localValue))) { + } else if ((StrUtil.isBlank(localValue) && ("0.00".equals(onlineValue) || "0".equals(onlineValue))) || (StrUtil.isBlank(onlineValue) && ("0.00".equals(localValue) || "0".equals(localValue)))) { //短路 } else { if (!Objects.equals(localValue, onlineValue)) { @@ -504,7 +510,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar // 获取线下对比结果 Map contrastMap = contrast(param); List header = ((List) contrastMap.get("columns")); - PageInfo> pageInfo = (PageInfo>)contrastMap.get("pageInfo"); + PageInfo> pageInfo = (PageInfo>) contrastMap.get("pageInfo"); List> list = pageInfo.getList(); List empInfoColumns = new ArrayList<>(); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 28914157d..57afeeb08 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -734,7 +734,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe Map params = new HashMap<>(1); Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); - log.info("个税申报数据:params {} ,res {}, taxDeclareRecord: {}",params, res, taxDeclareRecord); + log.info("个税申报数据:params {} ,res {}, taxDeclareRecord: {}",reqJson, res, taxDeclareRecord); DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); From f5b1768438901ba1cea5bc74154b1f64cbb88fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 19 Jun 2025 10:49:29 +0800 Subject: [PATCH 281/298] =?UTF-8?q?=E5=88=A9=E6=81=AF=E8=82=A1=E6=81=AF?= =?UTF-8?q?=E7=BA=A2=E5=88=A9=E6=89=80=E5=BE=97sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202506190103.sql | 24 +++++++++++++++++++ resource/sqlupgrade/GS/sql202506190103.sql | 24 +++++++++++++++++++ resource/sqlupgrade/JC/sql202506190103.sql | 24 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202506190103.sql | 10 ++++++++ .../sqlupgrade/Oracle/sql202506190103.sql | 18 ++++++++++++++ resource/sqlupgrade/PG/sql202506190103.sql | 10 ++++++++ .../sqlupgrade/SQLServer/sql202506190103.sql | 18 ++++++++++++++ resource/sqlupgrade/ST/sql202506190103.sql | 24 +++++++++++++++++++ 8 files changed, 152 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202506190103.sql create mode 100644 resource/sqlupgrade/GS/sql202506190103.sql create mode 100644 resource/sqlupgrade/JC/sql202506190103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202506190103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202506190103.sql create mode 100644 resource/sqlupgrade/PG/sql202506190103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202506190103.sql create mode 100644 resource/sqlupgrade/ST/sql202506190103.sql diff --git a/resource/sqlupgrade/DM/sql202506190103.sql b/resource/sqlupgrade/DM/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + diff --git a/resource/sqlupgrade/GS/sql202506190103.sql b/resource/sqlupgrade/GS/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + diff --git a/resource/sqlupgrade/JC/sql202506190103.sql b/resource/sqlupgrade/JC/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202506190103.sql b/resource/sqlupgrade/Mysql/sql202506190103.sql new file mode 100644 index 000000000..2ee229b09 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202506190103.sql @@ -0,0 +1,10 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202506190103.sql b/resource/sqlupgrade/Oracle/sql202506190103.sql new file mode 100644 index 000000000..4196b1982 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202506190103.sql @@ -0,0 +1,18 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0) +/ + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202506190103.sql b/resource/sqlupgrade/PG/sql202506190103.sql new file mode 100644 index 000000000..2ee229b09 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202506190103.sql @@ -0,0 +1,10 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202506190103.sql b/resource/sqlupgrade/SQLServer/sql202506190103.sql new file mode 100644 index 000000000..adfe5e358 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202506190103.sql @@ -0,0 +1,18 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0) +go + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0) +go \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202506190103.sql b/resource/sqlupgrade/ST/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '׼۳ľ', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '˰', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '׼۳ľ', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '˰', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + From cb02136ff6d61b832c5e6246571ba41bc22cd73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 1 Jul 2025 18:37:50 +0800 Subject: [PATCH 282/298] =?UTF-8?q?=E5=85=8D=E7=A8=8E=E6=94=B6=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202507010303.sql | 21 +++++++++++++++++++ resource/sqlupgrade/DM/sql202507010403.sql | 21 +++++++++++++++++++ resource/sqlupgrade/GS/sql202507010303.sql | 21 +++++++++++++++++++ resource/sqlupgrade/GS/sql202507010403.sql | 21 +++++++++++++++++++ resource/sqlupgrade/JC/sql202507010303.sql | 21 +++++++++++++++++++ resource/sqlupgrade/JC/sql202507010403.sql | 21 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202507010303.sql | 7 +++++++ resource/sqlupgrade/Mysql/sql202507010403.sql | 7 +++++++ .../sqlupgrade/Oracle/sql202507010303.sql | 20 ++++++++++++++++++ .../sqlupgrade/Oracle/sql202507010403.sql | 14 +++++++++++++ resource/sqlupgrade/PG/sql202507010303.sql | 20 ++++++++++++++++++ resource/sqlupgrade/PG/sql202507010403.sql | 20 ++++++++++++++++++ .../sqlupgrade/SQLServer/sql202507010303.sql | 20 ++++++++++++++++++ .../sqlupgrade/SQLServer/sql202507010403.sql | 14 +++++++++++++ resource/sqlupgrade/ST/sql202507010303.sql | 21 +++++++++++++++++++ resource/sqlupgrade/ST/sql202507010403.sql | 21 +++++++++++++++++++ .../dto/DerateDeductionListDTO.java | 11 +++++++--- .../dto/EndowmentInsuranceListDTO.java | 17 +++++++++------ .../datacollection/dto/FreeIncomeListDTO.java | 9 ++++++-- .../dto/GrantDonationListDTO.java | 19 ++++++++++------- .../dto/HealthInsuranceListDTO.java | 13 ++++++++---- .../dto/OtherDerateDeductionListDTO.java | 7 ++++++- .../dto/PersonalPensionListDTO.java | 11 +++++++--- .../param/DerateDeductionSaveParam.java | 7 +++++++ .../param/EndowmentInsuranceSaveParam.java | 7 +++++++ .../param/FreeIncomeSaveParam.java | 6 ++++++ .../param/GrantDonationSaveParam.java | 7 +++++++ .../param/HealthInsuranceSaveParam.java | 7 +++++++ .../param/OtherDerateDeductionSaveParam.java | 7 +++++++ .../param/PersonalPensionSaveParam.java | 7 +++++++ .../datacollection/po/DerateDeductionPO.java | 7 +++++++ .../po/EndowmentInsurancePO.java | 7 +++++++ .../datacollection/po/FreeIncomePO.java | 7 +++++++ .../datacollection/po/GrantDonationPO.java | 7 +++++++ .../datacollection/po/HealthInsurancePO.java | 7 +++++++ .../po/OtherDerateDeductionPO.java | 7 +++++++ .../datacollection/po/PersonalPensionPO.java | 7 +++++++ .../bo/TaxDeclarationRequest.java | 21 ++++++++++++++++--- .../datacollection/FreeIncomeMapper.xml | 15 +++++++++++++ .../impl/OtherDeductionServiceImpl.java | 16 ++++++++++++++ 40 files changed, 497 insertions(+), 29 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202507010303.sql create mode 100644 resource/sqlupgrade/DM/sql202507010403.sql create mode 100644 resource/sqlupgrade/GS/sql202507010303.sql create mode 100644 resource/sqlupgrade/GS/sql202507010403.sql create mode 100644 resource/sqlupgrade/JC/sql202507010303.sql create mode 100644 resource/sqlupgrade/JC/sql202507010403.sql create mode 100644 resource/sqlupgrade/Mysql/sql202507010303.sql create mode 100644 resource/sqlupgrade/Mysql/sql202507010403.sql create mode 100644 resource/sqlupgrade/Oracle/sql202507010303.sql create mode 100644 resource/sqlupgrade/Oracle/sql202507010403.sql create mode 100644 resource/sqlupgrade/PG/sql202507010303.sql create mode 100644 resource/sqlupgrade/PG/sql202507010403.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202507010303.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202507010403.sql create mode 100644 resource/sqlupgrade/ST/sql202507010303.sql create mode 100644 resource/sqlupgrade/ST/sql202507010403.sql diff --git a/resource/sqlupgrade/DM/sql202507010303.sql b/resource/sqlupgrade/DM/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/DM/sql202507010403.sql b/resource/sqlupgrade/DM/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/resource/sqlupgrade/GS/sql202507010303.sql b/resource/sqlupgrade/GS/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/GS/sql202507010403.sql b/resource/sqlupgrade/GS/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/resource/sqlupgrade/JC/sql202507010303.sql b/resource/sqlupgrade/JC/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/JC/sql202507010403.sql b/resource/sqlupgrade/JC/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202507010303.sql b/resource/sqlupgrade/Mysql/sql202507010303.sql new file mode 100644 index 000000000..8b3a971e8 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202507010303.sql @@ -0,0 +1,7 @@ +ALTER TABLE hrsa_free_income ADD COLUMN income_category int(0); +ALTER TABLE hrsa_derate_deduction ADD COLUMN income_category int(0); +ALTER TABLE hrsa_endowment_insurance ADD COLUMN income_category int(0); +ALTER TABLE hrsa_grant_donation ADD COLUMN income_category int(0); +ALTER TABLE hrsa_health_insurance ADD COLUMN income_category int(0); +ALTER TABLE hrsa_other_derate_deduction ADD COLUMN income_category int(0); +ALTER TABLE hrsa_personal_pension ADD COLUMN income_category int(0); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202507010403.sql b/resource/sqlupgrade/Mysql/sql202507010403.sql new file mode 100644 index 000000000..d6247eefc --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202507010403.sql @@ -0,0 +1,7 @@ +update hrsa_free_income set income_category = 1; +update hrsa_derate_deduction set income_category = 1; +update hrsa_endowment_insurance set income_category = 1; +update hrsa_grant_donation set income_category = 1; +update hrsa_health_insurance set income_category = 1; +update hrsa_other_derate_deduction set income_category = 1; +update hrsa_personal_pension set income_category = 1; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202507010303.sql b/resource/sqlupgrade/Oracle/sql202507010303.sql new file mode 100644 index 000000000..7cfc02c85 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202507010303.sql @@ -0,0 +1,20 @@ +ALTER TABLE hrsa_free_income ADD income_category int +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202507010403.sql b/resource/sqlupgrade/Oracle/sql202507010403.sql new file mode 100644 index 000000000..4eff5bab6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202507010403.sql @@ -0,0 +1,14 @@ +update hrsa_free_income set income_category = 1 +/ +update hrsa_derate_deduction set income_category = 1 +/ +update hrsa_endowment_insurance set income_category = 1 +/ +update hrsa_grant_donation set income_category = 1 +/ +update hrsa_health_insurance set income_category = 1 +/ +update hrsa_other_derate_deduction set income_category = 1 +/ +update hrsa_personal_pension set income_category = 1 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202507010303.sql b/resource/sqlupgrade/PG/sql202507010303.sql new file mode 100644 index 000000000..f54b534b9 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202507010303.sql @@ -0,0 +1,20 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202507010403.sql b/resource/sqlupgrade/PG/sql202507010403.sql new file mode 100644 index 000000000..f5ebbdb76 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202507010403.sql @@ -0,0 +1,20 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202507010303.sql b/resource/sqlupgrade/SQLServer/sql202507010303.sql new file mode 100644 index 000000000..9ca6c463d --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202507010303.sql @@ -0,0 +1,20 @@ +ALTER TABLE hrsa_free_income ADD income_category int +GO + +ALTER TABLE hrsa_derate_deduction ADD income_category int +GO + +ALTER TABLE hrsa_endowment_insurance ADD income_category int +GO + +ALTER TABLE hrsa_grant_donation ADD income_category int +GO + +ALTER TABLE hrsa_health_insurance ADD income_category int +GO + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int +GO + +ALTER TABLE hrsa_personal_pension ADD income_category int +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202507010403.sql b/resource/sqlupgrade/SQLServer/sql202507010403.sql new file mode 100644 index 000000000..99fc8e409 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202507010403.sql @@ -0,0 +1,14 @@ +update hrsa_free_income set income_category = 1 +GO +update hrsa_derate_deduction set income_category = 1 +GO +update hrsa_endowment_insurance set income_category = 1 +GO +update hrsa_grant_donation set income_category = 1 +GO +update hrsa_health_insurance set income_category = 1 +GO +update hrsa_other_derate_deduction set income_category = 1 +GO +update hrsa_personal_pension set income_category = 1 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202507010303.sql b/resource/sqlupgrade/ST/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/ST/sql202507010403.sql b/resource/sqlupgrade/ST/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java index c0751492b..dc2ec8f44 100644 --- a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java @@ -82,17 +82,22 @@ public class DerateDeductionListDTO { @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") private String idNo; - @ExcelProperty(index = 6) + @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + + @ExcelProperty(index = 7) @TableTitle(title = "减免事项", dataIndex = "derateItem", key = "derateItem") private String derateItem; - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @TableTitle(title = "减免性质", dataIndex = "derateProperty", key = "derateProperty") @ElogTransform(name = "减免性质") private String derateProperty; - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @TableTitle(title = "减免金额", dataIndex = "derateAmount", key = "derateAmount") @ElogTransform(name = "减免金额") private String derateAmount; diff --git a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java index 4b48e20bc..d56a961ae 100644 --- a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java @@ -81,28 +81,33 @@ public class EndowmentInsuranceListDTO { @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") private String idNo; - @ExcelProperty(index = 6) + @ExcelProperty(index = 7) + @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 8) @TableTitle(title = "申报扣除月份", dataIndex = "deductionMonth", key = "deductionMonth") @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date deductionMonth; - @ExcelProperty(index = 7) + @ExcelProperty(index = 9) @TableTitle(title = "税延养老账户编号", dataIndex = "accountNumber", key = "accountNumber") private String accountNumber; - @ExcelProperty(index = 8) + @ExcelProperty(index = 10) @TableTitle(title = "报税校验码", dataIndex = "checkCode", key = "checkCode") private String checkCode; - @ExcelProperty(index = 9) + @ExcelProperty(index = 11) @TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium") private String yearPremium; - @ExcelProperty(index = 10) + @ExcelProperty(index = 12) @TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium") private String monthPremium; - @ExcelProperty(index = 11) + @ExcelProperty(index = 13) @TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction") private String currentDeduction; diff --git a/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java index 698dcbde0..d6ae1ada7 100644 --- a/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java @@ -84,14 +84,19 @@ public class FreeIncomeListDTO { @ExcelProperty(index = 6) + @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 7) @TableTitle(title = "免税事项", dataIndex = "freeItem", key = "freeItem") private String freeItem; - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @TableTitle(title = "免税性质", dataIndex = "freeProperty", key = "freeProperty") private String freeProperty; - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @TableTitle(title = "免税金额", dataIndex = "freeAmount", key = "freeAmount") @Encrypt private String freeAmount; diff --git a/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java index f38aa7181..a6a26aaf1 100644 --- a/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java @@ -88,33 +88,38 @@ public class GrantDonationListDTO { @ExcelProperty(index = 5) private String idNo; - @ExcelProperty(index = 6) + @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + + @ExcelProperty(index = 7) @TableTitle(title = "受赠单位名称", dataIndex = "recipientName", key = "recipientName") private String recipientName; - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @TableTitle(title = "受赠单位纳税人识别号", dataIndex = "taxCode", key = "taxCode") private String taxCode; - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @TableTitle(title = "捐赠凭证号", dataIndex = "donationNumber", key = "donationNumber") private String donationNumber; - @ExcelProperty(index = 9) + @ExcelProperty(index = 10) @TableTitle(title = "捐赠日期", dataIndex = "donateDate", key = "donateDate") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date donateDate; - @ExcelProperty(index = 10) + @ExcelProperty(index = 11) @TableTitle(title = "捐赠金额", dataIndex = "donateAmount", key = "donateAmount") private String donateAmount; - @ExcelProperty(index = 11) + @ExcelProperty(index = 12) @TableTitle(title = "扣除比例", dataIndex = "deductionProportion", key = "deductionProportion") private String deductionProportion; - @ExcelProperty(index = 12) + @ExcelProperty(index = 13) @TableTitle(title = "实际扣除金额", dataIndex = "actualDeduction", key = "actualDeduction") private String actualDeduction; diff --git a/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java index 890682379..6f2393a9e 100644 --- a/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java @@ -85,23 +85,28 @@ public class HealthInsuranceListDTO { private String idNo; @ExcelProperty(index = 6) + @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 7) @TableTitle(title = "税优识别码", dataIndex = "identificationNumber", key = "identificationNumber") private String identificationNumber; - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @TableTitle(title = "保单生效日期", dataIndex = "effectiveDate", key = "effectiveDate") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date effectiveDate; - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium") private String yearPremium; - @ExcelProperty(index = 9) + @ExcelProperty(index = 10) @TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium") private String monthPremium; - @ExcelProperty(index = 10) + @ExcelProperty(index = 11) @TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction") private String currentDeduction; diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java index d4d292a14..216b5ab7a 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java @@ -85,10 +85,15 @@ public class OtherDerateDeductionListDTO { private String idNo; @ExcelProperty(index = 6) + @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 7) @TableTitle(title = "减免税额", dataIndex = "otherDeduction", key = "otherDeduction") private String otherDeduction; - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @TableTitle(title = "备注", dataIndex = "remark", key = "remark") private String remark; diff --git a/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java index d4f28e78b..eafeae03e 100644 --- a/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java @@ -83,6 +83,11 @@ public class PersonalPensionListDTO { @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") private String idNo; + @ExcelProperty(index = 6) + @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + //缴费月度 private Date payMonth; @@ -91,17 +96,17 @@ public class PersonalPensionListDTO { private Integer voucherType; //凭证类别名称 - @ExcelProperty(index = 6) + @ExcelProperty(index = 7) @TableTitle(title = "凭证类型", dataIndex = "voucherTypeName", key = "voucherTypeName") private String voucherTypeName; //凭证编码 - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @TableTitle(title = "凭证编码", dataIndex = "voucherNo", key = "voucherNo") private String voucherNo; //缴费金额 - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @TableTitle(title = "缴费金额", dataIndex = "payAmount", key = "payAmount") private String payAmount; diff --git a/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java index cd70723d3..196da93c3 100644 --- a/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.param; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -26,6 +27,12 @@ public class DerateDeductionSaveParam { //主表数据Id private Long mainId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + //减免事项 private String derateItem; diff --git a/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java b/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java index f86c8603b..044e92295 100644 --- a/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.param; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; @@ -30,6 +31,12 @@ public class EndowmentInsuranceSaveParam { //主表数据Id private Long mainId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + //申报扣除月份 @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") diff --git a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java index 216f2e3a5..213a3391d 100644 --- a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.param; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -26,6 +27,11 @@ public class FreeIncomeSaveParam { //主表数据Id private Long mainId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; //免税事项 private String freeItem; diff --git a/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java b/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java index ec98e212b..47ef897ca 100644 --- a/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.param; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -26,6 +27,12 @@ public class GrantDonationSaveParam { //主表数据Id private Long mainId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + //受赠单位名称 private String recipientName; diff --git a/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java b/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java index 13c8a9030..971fc5ccb 100644 --- a/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.param; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -28,6 +29,12 @@ public class HealthInsuranceSaveParam { //主表数据Id private Long mainId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + //税优识别码 private String identificationNumber; diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java index ab4114d6e..8aa1c17d9 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.param; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -26,6 +27,12 @@ public class OtherDerateDeductionSaveParam { //主表数据Id private Long mainId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + //减免税额 private String otherDeduction; diff --git a/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java index ecd0f92c5..ad7ceea3f 100644 --- a/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.param; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -31,6 +32,12 @@ public class PersonalPensionSaveParam { //主表数据Id private Long mainId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + //缴费月度 private Date payMonth; diff --git a/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java index 5d94d3627..226f05848 100644 --- a/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import io.swagger.annotations.ApiModel; import lombok.AllArgsConstructor; import lombok.Builder; @@ -42,6 +43,12 @@ public class DerateDeductionPO{ @ElogTransform(name = "个税扣缴义务人") private Long taxAgentId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + @ElogTransform(name = "减免事项") private String derateItem; diff --git a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java index 9bb444ebe..6718ee753 100644 --- a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java +++ b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -41,6 +42,12 @@ public class EndowmentInsurancePO { @ElogTransform(name = "个税扣缴义务人ID") private Long taxAgentId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + @ElogTransform(name = "申报扣除月份") private Date deductionMonth; diff --git a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java index 085b7f751..96c39dfc6 100644 --- a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java +++ b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -52,6 +53,12 @@ public class FreeIncomePO { @ElogTransform(name = "归档状态 0未归档 1已归档") private Integer fileStatus; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + /** * 人员类型 * diff --git a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java index f65f73caa..6cce0fb66 100644 --- a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java +++ b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -38,6 +39,12 @@ public class GrantDonationPO { @ElogTransform(name = "个税扣缴义务人") private Long taxAgentId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + @ElogTransform(name = "受赠单位名称") private String recipientName; diff --git a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java index 86152ffef..7ecad5ab7 100644 --- a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java +++ b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -40,6 +41,12 @@ public class HealthInsurancePO { @ElogTransform(name = "个税扣缴义务人") private Long taxAgentId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + @ElogTransform(name = "税优识别码") private String identificationNumber; diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java index 74f403bab..c0ff75f42 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -40,6 +41,12 @@ public class OtherDerateDeductionPO { @ElogTransform(name = "个税扣缴义务人") private Long taxAgentId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + @ElogTransform(name = "减免税额") private String otherDeduction; diff --git a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java index 766ad4783..b60bda6fd 100644 --- a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java @@ -3,6 +3,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -45,6 +46,12 @@ public class PersonalPensionPO{ @ElogTransform(name = "个税扣缴义务人") private Long taxAgentId; + /** + * 所得项目 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + @ElogTransform(name = "凭证类别") private Integer voucherType; diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 1dbb8de4b..b9f2a3544 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -322,9 +322,9 @@ public class TaxDeclarationRequest { public static Map convert2flsdRequestParam(List taxReportColumns, - List taxDeclarations, - List taxDeclarationValues, - List employeeDeclares) { + List taxDeclarations, + List taxDeclarationValues, + List employeeDeclares) { Map> objRequestParam = Maps.newHashMap(); Map>> listRequestParam = Maps.newHashMap(); Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); @@ -351,6 +351,21 @@ public class TaxDeclarationRequest { employeeRequestParams.add(employeeRequestParam); } } + List> paramMaps = new ArrayList<>(); + Map map = new HashMap<>(); + // 姓名 + map.put("xm", "测试孔霖"); + // 证件类型 + map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + // 证件号码 + map.put("zzhm", "828888194106301018"); + // 所得项目 + map.put("sdxm", "上市公司股息红利所得(沪市、深市、创业板)"); + map.put("jmsx", "上市公司股息红利差别化征税"); + map.put("jmxz", "其他"); + map.put("sjkcje", "1000"); + paramMaps.add(map); + listRequestParam.put("msfblb", paramMaps); } Map requestParam = Maps.newHashMap(); diff --git a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml index 87ed57c0c..6f1f5b3f6 100644 --- a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml @@ -17,6 +17,7 @@ + @@ -38,6 +39,7 @@ , t.tax_year_month , t.tenant_key , t.update_time + , t.income_category @@ -108,6 +110,9 @@ AND update_time = #{updateTime} + + AND income_category = #{incomeCategory} + AND id IN @@ -168,6 +173,9 @@ update_time, + + income_category, + @@ -215,6 +223,9 @@ #{updateTime}, + + #{incomeCategory}, + @@ -237,6 +248,7 @@ tax_year_month=#{taxYearMonth}, tenant_key=#{tenantKey}, update_time=#{updateTime}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -288,6 +300,9 @@ update_time=#{updateTime}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index b2d7cc2d0..ef78ab4c2 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -22,6 +22,7 @@ import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.datacollection.TaxFreeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.*; @@ -2446,6 +2447,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction dto.setMobile(employee.getMobile()); dto.setJobNum(employee.getWorkcode()); dto.setIdNo(employee.getIdNo()); + dto.setIncomeCategoryName(IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getDefaultLabel()); return dto; }).collect(Collectors.toList()); return listDTOS; @@ -2734,6 +2736,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) .freeItem(param.getFreeItem()) .freeProperty(param.getFreeProperty()) .freeAmount(param.getFreeAmount()) @@ -2753,6 +2756,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); po.setFreeItem(param.getFreeItem()); po.setFreeProperty(param.getFreeProperty()); po.setFreeAmount(param.getFreeAmount()); @@ -2781,6 +2785,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) .deductionMonth(param.getDeductionMonth()) .accountNumber(param.getAccountNumber()) .checkCode(param.getCheckCode()) @@ -2803,6 +2808,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); po.setDeductionMonth(param.getDeductionMonth()); po.setAccountNumber(param.getAccountNumber()); po.setCheckCode(param.getCheckCode()); @@ -2834,6 +2840,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) .recipientName(param.getRecipientName()) .taxCode(param.getTaxCode()) .donationNumber(param.getDonationNumber()) @@ -2857,6 +2864,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); po.setRecipientName(param.getRecipientName()); po.setTaxCode(param.getTaxCode()); po.setDonationNumber(param.getDonationNumber()); @@ -2889,6 +2897,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) .identificationNumber(param.getIdentificationNumber()) .effectiveDate(param.getEffectiveDate()) .yearPremium(param.getYearPremium()) @@ -2910,6 +2919,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); po.setIdentificationNumber(param.getIdentificationNumber()); po.setEffectiveDate(param.getEffectiveDate()); po.setYearPremium(param.getYearPremium()); @@ -2940,6 +2950,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) .otherDeduction(param.getOtherDeduction()) .remark(param.getRemark()) .fileStatus(1) @@ -2958,6 +2969,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); po.setOtherDeduction(param.getOtherDeduction()); po.setRemark(param.getRemark()); @@ -2985,6 +2997,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) .derateAmount(param.getDerateAmount()) .derateItem(param.getDerateItem()) .derateProperty(param.getDerateProperty()) @@ -3004,6 +3017,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); po.setDerateAmount(param.getDerateAmount()); po.setDerateItem(param.getDerateItem()); po.setDerateProperty(param.getDerateProperty()); @@ -3032,6 +3046,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .taxYearMonth(deductionPO.getDeclareMonth()) .employeeId(deductionPO.getEmployeeId()) .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) .voucherTypeName(param.getVoucherTypeName()) .voucherNo(param.getVoucherNo()) .payAmount(param.getPayAmount()) @@ -3051,6 +3066,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); po.setVoucherTypeName(param.getVoucherTypeName()); po.setVoucherNo(param.getVoucherNo()); po.setPayAmount(param.getPayAmount()); From de713c820d61d14230fea50d304bb705491b937a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 2 Jul 2025 11:37:16 +0800 Subject: [PATCH 283/298] =?UTF-8?q?=E9=99=84=E8=A1=A8=E5=A1=AB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/TaxDeclarationRequest.java | 44 +++++++++---------- .../impl/TaxDeclareRecordServiceImpl.java | 4 +- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index b9f2a3544..5bcad824f 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -21,6 +21,7 @@ import weaver.general.Util; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; +import java.util.stream.Collectors; /** * 个税申报 @@ -151,7 +152,8 @@ public class TaxDeclarationRequest { Map freeIncomeMap = taxFreeMap.get(TaxFreeTypeEnum.FREE_INCOME); List poList = (List) freeIncomeMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(poList)) { - List> paramMaps = new ArrayList<>(); + poList = poList.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("msfblb",new ArrayList<>()); for (FreeIncomePO po : poList) { Map map = new HashMap<>(); // 姓名 @@ -176,7 +178,8 @@ public class TaxDeclarationRequest { Map healthInsuranceMap = taxFreeMap.get(TaxFreeTypeEnum.HEALTH_INSURANCE); List pos = (List) healthInsuranceMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { - List> paramMaps = new ArrayList<>(); + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("syjkbxfblb",new ArrayList<>()); for (HealthInsurancePO healthInsurancePO : pos) { Map map = new HashMap<>(); // 姓名 @@ -203,7 +206,8 @@ public class TaxDeclarationRequest { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.ENDOWMENT_INSURANCE); List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { - List> paramMaps = new ArrayList<>(); + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("syylbxfblb",new ArrayList<>()); for (EndowmentInsurancePO po : pos) { Map map = new HashMap<>(); // 姓名 @@ -222,7 +226,7 @@ public class TaxDeclarationRequest { map.put("sjkcje", po.getCurrentDeduction()); paramMaps.add(map); } - listRequestParam.put("syjkbxfblb", paramMaps); + listRequestParam.put("syylbxfblb", paramMaps); } } @@ -231,7 +235,8 @@ public class TaxDeclarationRequest { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.GRANT_DONATION); List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { - List> paramMaps = new ArrayList<>(); + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("zykcjzefb",new ArrayList<>()); for (GrantDonationPO po : pos) { Map map = new HashMap<>(); // 姓名 @@ -262,7 +267,8 @@ public class TaxDeclarationRequest { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.DERATE_DEDUCTION); List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { - List> paramMaps = new ArrayList<>(); + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("jmfblb",new ArrayList<>()); for (DerateDeductionPO po : pos) { Map map = new HashMap<>(); // 姓名 @@ -287,6 +293,7 @@ public class TaxDeclarationRequest { Map posMap = taxFreeMap.get(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION); List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); if (CollectionUtils.isNotEmpty(pos)) { + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); employeeRequestParam.put("bz", pos.get(0).getRemark()); } } @@ -324,7 +331,8 @@ public class TaxDeclarationRequest { public static Map convert2flsdRequestParam(List taxReportColumns, List taxDeclarations, List taxDeclarationValues, - List employeeDeclares) { + List employeeDeclares, + Map> taxFreeMap) { Map> objRequestParam = Maps.newHashMap(); Map>> listRequestParam = Maps.newHashMap(); Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); @@ -332,9 +340,9 @@ public class TaxDeclarationRequest { Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); for (TaxDeclarationPO taxDeclaration : taxDeclarations) { List values = taxDeclarationValueMap.get(taxDeclaration.getId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); for (TaxDeclarationValuePO taxDeclarationValue : values) { EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); - IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); if (employeeDeclare == null || incomeCategoryEnum == null) { continue; } @@ -350,22 +358,9 @@ public class TaxDeclarationRequest { List> employeeRequestParams = listRequestParam.computeIfAbsent("lxgxhllb", k -> Lists.newArrayList()); employeeRequestParams.add(employeeRequestParam); } + // 其他免税扣除附表 + buildOtherDeductionDetailParams(taxFreeMap, listRequestParam, employeeDeclare, incomeCategoryEnum, employeeRequestParam); } - List> paramMaps = new ArrayList<>(); - Map map = new HashMap<>(); - // 姓名 - map.put("xm", "测试孔霖"); - // 证件类型 - map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); - // 证件号码 - map.put("zzhm", "828888194106301018"); - // 所得项目 - map.put("sdxm", "上市公司股息红利所得(沪市、深市、创业板)"); - map.put("jmsx", "上市公司股息红利差别化征税"); - map.put("jmxz", "其他"); - map.put("sjkcje", "1000"); - paramMaps.add(map); - listRequestParam.put("msfblb", paramMaps); } Map requestParam = Maps.newHashMap(); @@ -378,7 +373,8 @@ public class TaxDeclarationRequest { public static Map convert2fjmsdRequestParam(List taxReportColumns, List taxDeclarations, List taxDeclarationValues, - List employeeDeclares) { + List employeeDeclares, + Map> taxFreeMap) { Map> objRequestParam = Maps.newHashMap(); Map>> listRequestParam = Maps.newHashMap(); Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 57afeeb08..13ae9c1a8 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -719,13 +719,13 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe if (declareReportType == DeclareReportTypeEnum.CLASSIFIED_INCOME) { //分类所得 - Map flsdRequestParam = TaxDeclarationRequest.convert2flsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); + Map flsdRequestParam = TaxDeclarationRequest.convert2flsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap); requestParam.put("flsd", flsdRequestParam); } if (declareReportType == DeclareReportTypeEnum.NONRESIDENT_INCOME) { //非居民所得代扣代缴 fjmsd - Map fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); + Map fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap); requestParam.put("fjmsd", fjmsdRequestParam); } From cabaed627bd66679529a5696f2de8d8641766027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 2 Jul 2025 13:42:41 +0800 Subject: [PATCH 284/298] =?UTF-8?q?=E5=85=B6=E4=BB=96=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E5=A2=9E=E5=8A=A0=E7=94=B3=E6=8A=A5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacollection/DerateDeductionMapper.xml | 15 +++++++++++++++ .../datacollection/EndowmentInsuranceMapper.xml | 15 +++++++++++++++ .../mapper/datacollection/GrantDonationMapper.xml | 15 +++++++++++++++ .../datacollection/HealthInsuranceMapper.xml | 15 +++++++++++++++ .../datacollection/OtherDerateDeductionMapper.xml | 15 +++++++++++++++ .../datacollection/PersonalPensionMapper.xml | 15 +++++++++++++++ 6 files changed, 90 insertions(+) diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml index e3585c01f..824c2466e 100644 --- a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml @@ -17,6 +17,7 @@ + @@ -38,6 +39,7 @@ , t.tax_year_month , t.tenant_key , t.update_time + , t.income_category @@ -108,6 +110,9 @@ AND update_time = #{updateTime} + + AND income_category = #{incomeCategory} + AND id IN @@ -168,6 +173,9 @@ update_time, + + income_category, + @@ -215,6 +223,9 @@ #{updateTime}, + + #{incomeCategory}, + @@ -237,6 +248,7 @@ tax_year_month=#{taxYearMonth}, tenant_key=#{tenantKey}, update_time=#{updateTime}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -288,6 +300,9 @@ update_time=#{updateTime}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml index 8d673f35b..30f404db9 100644 --- a/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EndowmentInsuranceMapper.xml @@ -20,6 +20,7 @@ + @@ -44,6 +45,7 @@ , t.tenant_key , t.update_time , t.year_premium + , t.income_category @@ -123,6 +125,9 @@ AND year_premium = #{yearPremium} + + AND income_category = #{incomeCategory} + AND id IN @@ -192,6 +197,9 @@ year_premium, + + income_category, + @@ -248,6 +256,9 @@ #{yearPremium}, + + #{incomeCategory}, + @@ -273,6 +284,7 @@ tenant_key=#{tenantKey}, update_time=#{updateTime}, year_premium=#{yearPremium}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -333,6 +345,9 @@ year_premium=#{yearPremium}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml index 8fa17414e..96a5dab18 100644 --- a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml @@ -21,6 +21,7 @@ + @@ -46,6 +47,7 @@ , t.tax_year_month , t.tenant_key , t.update_time + , t.income_category @@ -128,6 +130,9 @@ AND update_time = #{updateTime} + + AND income_category = #{incomeCategory} + AND id IN @@ -200,6 +205,9 @@ update_time, + + income_category, + @@ -259,6 +267,9 @@ #{updateTime}, + + #{incomeCategory}, + @@ -285,6 +296,7 @@ tax_year_month=#{taxYearMonth}, tenant_key=#{tenantKey}, update_time=#{updateTime}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -348,6 +360,9 @@ update_time=#{updateTime}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml index 4ed0bd9a1..a071f7426 100644 --- a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml @@ -19,6 +19,7 @@ + @@ -42,6 +43,7 @@ , t.tenant_key , t.update_time , t.year_premium + , t.income_category @@ -118,6 +120,9 @@ AND year_premium = #{yearPremium} + + AND income_category = #{incomeCategory} + AND id IN @@ -184,6 +189,9 @@ year_premium, + + income_category, + @@ -237,6 +245,9 @@ #{yearPremium}, + + #{incomeCategory}, + @@ -261,6 +272,7 @@ tenant_key=#{tenantKey}, update_time=#{updateTime}, year_premium=#{yearPremium}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -318,6 +330,9 @@ year_premium=#{yearPremium}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml index 330fb74f8..397b091c0 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml @@ -16,6 +16,7 @@ + @@ -36,6 +37,7 @@ , t.tax_year_month , t.tenant_key , t.update_time + , t.income_category @@ -103,6 +105,9 @@ AND update_time = #{updateTime} + + AND income_category = #{incomeCategory} + AND id IN @@ -160,6 +165,9 @@ update_time, + + income_category, + @@ -204,6 +212,9 @@ #{updateTime}, + + #{incomeCategory}, + @@ -225,6 +236,7 @@ tax_year_month=#{taxYearMonth}, tenant_key=#{tenantKey}, update_time=#{updateTime}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -273,6 +285,9 @@ update_time=#{updateTime}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml index da3185d56..1db068c24 100644 --- a/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml @@ -22,6 +22,7 @@ + @@ -48,6 +49,7 @@ , t.voucher_no , t.voucher_type , t.voucher_type_name + , t.income_category @@ -133,6 +135,9 @@ AND voucher_type_name = #{voucherTypeName} + + AND income_category = #{incomeCategory} + AND id IN @@ -208,6 +213,9 @@ voucher_type_name, + + income_category, + @@ -270,6 +278,9 @@ #{voucherTypeName}, + + #{incomeCategory}, + @@ -297,6 +308,7 @@ voucher_no=#{voucherNo}, voucher_type=#{voucherType}, voucher_type_name=#{voucherTypeName}, + income_category=#{incomeCategory}, WHERE id = #{id} AND delete_type = 0 @@ -363,6 +375,9 @@ voucher_type_name=#{voucherTypeName}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 From b2507306e59029d68e40175fae146ad70f695674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 2 Jul 2025 15:46:32 +0800 Subject: [PATCH 285/298] =?UTF-8?q?=E9=99=84=E8=A1=A8=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/EndowmentInsuranceListDTO.java | 14 +-- .../enums/salarysob/IncomeCategoryEnum.java | 13 ++- .../impl/OtherDeductionServiceImpl.java | 106 +++++++++++++++--- 3 files changed, 110 insertions(+), 23 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java index d56a961ae..1a9919d01 100644 --- a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java @@ -81,33 +81,33 @@ public class EndowmentInsuranceListDTO { @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") private String idNo; - @ExcelProperty(index = 7) + @ExcelProperty(index = 6) @TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName") private String incomeCategoryName; private Integer incomeCategory; - @ExcelProperty(index = 8) + @ExcelProperty(index = 7) @TableTitle(title = "申报扣除月份", dataIndex = "deductionMonth", key = "deductionMonth") @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date deductionMonth; - @ExcelProperty(index = 9) + @ExcelProperty(index = 8) @TableTitle(title = "税延养老账户编号", dataIndex = "accountNumber", key = "accountNumber") private String accountNumber; - @ExcelProperty(index = 10) + @ExcelProperty(index = 9) @TableTitle(title = "报税校验码", dataIndex = "checkCode", key = "checkCode") private String checkCode; - @ExcelProperty(index = 11) + @ExcelProperty(index = 10) @TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium") private String yearPremium; - @ExcelProperty(index = 12) + @ExcelProperty(index = 11) @TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium") private String monthPremium; - @ExcelProperty(index = 13) + @ExcelProperty(index = 12) @TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction") private String currentDeduction; diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index b2476e6b8..0fec5bc83 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -800,8 +800,8 @@ public enum IncomeCategoryEnum implements BaseEnum { } private static void checkSSSBYYLBResponse(List sssbyylb) { - if(CollUtil.isNotEmpty(sssbyylb)){ - String err = sssbyylb.stream().map(sssbyy -> sssbyy.getXm() + sssbyy.getCwxx()).collect(Collectors.joining(",")); + if (CollUtil.isNotEmpty(sssbyylb)) { + String err = sssbyylb.stream().map(sssbyy -> sssbyy.getXm() + sssbyy.getCwxx()).collect(Collectors.joining(",")); throw new OnlineCalculateTaxException(err); } } @@ -852,6 +852,15 @@ public enum IncomeCategoryEnum implements BaseEnum { return null; } + public static IncomeCategoryEnum parseByDefaultLabel(String defaultLabel) { + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + if (incomeCategoryEnum.getDefaultLabel().equals(defaultLabel)) { + return incomeCategoryEnum; + } + } + return null; + } + public static List parseByValue(Collection values) { if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index ef78ab4c2..b44b1ad3b 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -460,7 +460,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List errorData = new ArrayList<>(); //免税收入 - List freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 9, "OtherDeductionTemplate.xlsx"); + List freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 10, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < freeIncomeList.size(); i++) { FreeIncomeListDTO dto = freeIncomeList.get(i); @@ -569,6 +569,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "所得项目不存在!"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + freeIncomePO.setIncomeCategory(incomeCategoryEnum.getValue()); + } + //免税收入 String freeIncome = dto.getFreeItem(); String freeProperty = dto.getFreeProperty(); @@ -614,7 +624,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List dtoList = ExcelParseHelper.parse2Map(fileInputStream, HealthInsuranceListDTO.class, 1, 1, 11, "OtherDeductionTemplate.xlsx"); + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, HealthInsuranceListDTO.class, 1, 1, 12, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < dtoList.size(); i++) { HealthInsuranceListDTO dto = dtoList.get(i); @@ -723,6 +733,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "所得项目不存在!"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + po.setIdentificationNumber(dto.getIdentificationNumber()); po.setEffectiveDate(dto.getEffectiveDate()); po.setYearPremium(dto.getYearPremium()); @@ -764,7 +784,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx"); + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 13, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < derateDeductionList.size(); i++) { EndowmentInsuranceListDTO dto = derateDeductionList.get(i); @@ -873,6 +893,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "所得项目不存在!"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + po.setAccountNumber(dto.getAccountNumber()); po.setCheckCode(dto.getCheckCode()); po.setYearPremium(dto.getYearPremium()); @@ -916,7 +946,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List dtoList = ExcelParseHelper.parse2Map(fileInputStream, GrantDonationListDTO.class, 3, 1, 13, "OtherDeductionTemplate.xlsx"); + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, GrantDonationListDTO.class, 3, 1, 14, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < dtoList.size(); i++) { GrantDonationListDTO dto = dtoList.get(i); @@ -1025,6 +1055,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "所得项目不存在!"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + po.setRecipientName(dto.getRecipientName()); po.setTaxCode(dto.getTaxCode()); po.setDonationNumber(dto.getDonationNumber()); @@ -1069,7 +1109,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, DerateDeductionListDTO.class, 4, 1, 9, "OtherDeductionTemplate.xlsx"); + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, DerateDeductionListDTO.class, 4, 1, 10, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < derateDeductionList.size(); i++) { DerateDeductionListDTO dto = derateDeductionList.get(i); @@ -1178,6 +1218,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "所得项目不存在!"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + po.setDerateAmount(dto.getDerateAmount()); po.setDerateItem(dto.getDerateItem()); po.setDerateProperty(dto.getDerateProperty()); @@ -1218,7 +1268,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List dtoList = ExcelParseHelper.parse2Map(fileInputStream, OtherDerateDeductionListDTO.class, 5, 1, 8, "OtherDeductionTemplate.xlsx"); + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, OtherDerateDeductionListDTO.class, 5, 1, 9, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < dtoList.size(); i++) { OtherDerateDeductionListDTO dto = dtoList.get(i); @@ -1327,6 +1377,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "所得项目不存在!"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + po.setOtherDeduction(dto.getOtherDeduction()); po.setRemark(dto.getRemark()); @@ -1367,7 +1427,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List dtoList = ExcelParseHelper.parse2Map(fileInputStream, PersonalPensionListDTO.class, 6, 1, 9, "OtherDeductionTemplate.xlsx"); + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, PersonalPensionListDTO.class, 6, 1, 10, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < dtoList.size(); i++) { PersonalPensionListDTO dto = dtoList.get(i); @@ -1476,6 +1536,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "所得项目不存在!"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + po.setVoucherTypeName(dto.getVoucherTypeName()); po.setVoucherNo(dto.getVoucherNo()); po.setPayAmount(dto.getPayAmount()); @@ -2277,7 +2347,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Map>> map = new LinkedHashMap<>(); List> freeIncomeRowList = new ArrayList<>(); - List freeIncomeTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "免税事项", "免税性质", "免税金额"); + List freeIncomeTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "免税事项", "免税性质", "免税金额"); freeIncomeRowList.add(freeIncomeTitle); freeIncomeList.forEach(dto -> { List row = new ArrayList<>(); @@ -2287,6 +2357,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction row.add(dto.getMobile()); row.add(dto.getJobNum()); row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); row.add(dto.getFreeItem()); row.add(dto.getFreeProperty()); row.add(dto.getFreeAmount()); @@ -2295,7 +2366,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction map.put("免税收入", freeIncomeRowList); List> healthInsuranceRowList = new ArrayList<>(); - List healthInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税优识别码", "保单生效日期", "年度保费", "月度保费", "本期扣除金额"); + List healthInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "税优识别码", "保单生效日期", "年度保费", "月度保费", "本期扣除金额"); healthInsuranceRowList.add(healthInsuranceTitle); healthInsuranceList.forEach(dto -> { List row = new ArrayList<>(); @@ -2305,6 +2376,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction row.add(dto.getMobile()); row.add(dto.getJobNum()); row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); row.add(dto.getIdentificationNumber()); row.add(dto.getEffectiveDate()); row.add(dto.getYearPremium()); @@ -2316,7 +2388,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List> endowmentInsuranceRowList = new ArrayList<>(); - List endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额"); + List endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目","申报扣除月份", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额"); endowmentInsuranceRowList.add(endowmentInsuranceTitle); endowmentInsuranceList.forEach(dto -> { List row = new ArrayList<>(); @@ -2326,6 +2398,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction row.add(dto.getMobile()); row.add(dto.getJobNum()); row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getDeductionMonth()); row.add(dto.getAccountNumber()); row.add(dto.getCheckCode()); row.add(dto.getYearPremium()); @@ -2336,7 +2410,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction map.put("税延养老保险", endowmentInsuranceRowList); List> grantDonationRowList = new ArrayList<>(); - List grantDonationTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "受赠单位名称", "受赠单位纳税人识别号", "凭证号", "捐赠日期", "捐赠金额", "扣除比例", "实际扣除金额"); + List grantDonationTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "受赠单位名称", "受赠单位纳税人识别号", "凭证号", "捐赠日期", "捐赠金额", "扣除比例", "实际扣除金额"); grantDonationRowList.add(grantDonationTitle); grantDonationList.forEach(dto -> { List row = new ArrayList<>(); @@ -2346,6 +2420,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction row.add(dto.getMobile()); row.add(dto.getJobNum()); row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); row.add(dto.getRecipientName()); row.add(dto.getTaxCode()); row.add(dto.getDonationNumber()); @@ -2358,7 +2433,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction map.put("准予扣除的捐赠额", grantDonationRowList); List> derateDeductionRowList = new ArrayList<>(); - List derateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "减免事项", "减免性质", "减免金额"); + List derateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "减免事项", "减免性质", "减免金额"); derateDeductionRowList.add(derateDeductionTitle); derateDeductionList.forEach(dto -> { List row = new ArrayList<>(); @@ -2368,6 +2443,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction row.add(dto.getMobile()); row.add(dto.getJobNum()); row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); row.add(dto.getDerateItem()); row.add(dto.getDerateProperty()); row.add(dto.getDerateAmount()); @@ -2376,7 +2452,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction map.put("减免税额", derateDeductionRowList); List> otherDerateDeductionRowList = new ArrayList<>(); - List otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "其他免税扣除金额", "备注"); + List otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "其他免税扣除金额", "备注"); otherDerateDeductionRowList.add(otherDerateDeductionTitle); otherDerateDeductionList.forEach(dto -> { List row = new ArrayList<>(); @@ -2386,6 +2462,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction row.add(dto.getMobile()); row.add(dto.getJobNum()); row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); row.add(dto.getOtherDeduction()); row.add(dto.getRemark()); otherDerateDeductionRowList.add(row); @@ -2393,7 +2470,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction map.put("其他", otherDerateDeductionRowList); List> personalPensionRowList = new ArrayList<>(); - List personalPensionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "凭证类型", "凭证编码", "缴费金额"); + List personalPensionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "凭证类型", "凭证编码", "缴费金额"); personalPensionRowList.add(personalPensionTitle); personalPensionList.forEach(dto -> { List row = new ArrayList<>(); @@ -2403,6 +2480,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction row.add(dto.getMobile()); row.add(dto.getJobNum()); row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); row.add(dto.getVoucherTypeName()); row.add(dto.getVoucherNo()); row.add(dto.getPayAmount()); From fe7481d753b1a08aee6370bce6da1601ead3cc44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 2 Jul 2025 20:02:05 +0800 Subject: [PATCH 286/298] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E7=B2=BE=E5=87=86?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacollection/po/OtherDeductionPO.java | 1 + .../datacollection/OtherDeductionMapper.java | 2 + .../datacollection/OtherDeductionMapper.xml | 90 +++++++++++++++++++ .../salary/service/OtherDeductionService.java | 10 +++ .../impl/OtherDeductionServiceImpl.java | 39 +++++++- .../impl/SalaryAcctCalculateServiceImpl.java | 6 +- 6 files changed, 145 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index bea18e842..02426212a 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -135,6 +135,7 @@ public class OtherDeductionPO { private List employeeIds; private Collection taxAgentIds; + private Integer incomeCategory; private List freeIncomeList; diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java index bfdcf2ecc..073363001 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java @@ -72,4 +72,6 @@ public interface OtherDeductionMapper { int delete(OtherDeductionPO otherDeduction); OtherDeductionPO getByTaxAgentIdAndEmployeeIdAndDeclareMonth(@Param("taxAgentId") Long taxAgentId, @Param("employeeId") Long employeeId, @Param("declareMonth") Date declareMonth); + + List listDetails(@Param("param") OtherDeductionPO param); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index 6d8496521..c3fd0e391 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -732,5 +732,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index c02d4a948..bbebf8c9b 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -98,6 +98,16 @@ public interface OtherDeductionService { */ List getOtherDeductionList(YearMonth declareMonth, List employeeIds, Long taxAgentId); + /** + * 按照申报表类型,获取其他免税扣除数据 + * @param declareMonth + * @param employeeIds + * @param taxAgentId + * @param incomeCategory + * @return + */ + List getOtherDeductionList(YearMonth declareMonth, List employeeIds, Long taxAgentId, Integer incomeCategory); + /** * 编辑数据 */ diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index b44b1ad3b..65495a2b5 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; import com.api.formmode.mybatis.util.SqlProxyHandle; @@ -1910,6 +1911,42 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return OtherDeductionBiz.listSome(OtherDeductionPO.builder().declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentId(taxAgentId).build()); } + @Override + public List getOtherDeductionList(YearMonth declareMonth, List employeeIds, Long taxAgentId, Integer incomeCategory) { + if (declareMonth == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:申报月份必传")); + } + if (taxAgentId == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:扣缴义务人必传")); + } + if (incomeCategory == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:所得项目必传")); + } + + List otherDeductionPOS = listDetails(OtherDeductionPO.builder().incomeCategory(incomeCategory).declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentId(taxAgentId).build()); + if (CollUtil.isEmpty(otherDeductionPOS)) { + return new ArrayList<>(); + } + otherDeductionPOS.forEach(OtherDeductionPO::handleList); + return otherDeductionPOS; + } + + private List listDetails(OtherDeductionPO param) { + if (CollectionUtils.isNotEmpty(param.getEmployeeIds())) { + List> partition = Lists.partition(param.getEmployeeIds(), 500); + List otherDeductionPOS = new ArrayList<>(); + partition.forEach(l -> { + param.setEmployeeIds(l); + otherDeductionPOS.addAll(getOtherDeductionMapper().listDetails(param)); + }); + return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class); + } else { + List otherDeductionPOS = getOtherDeductionMapper().listDetails(param); + return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class); + } + } + + @Override public void editData(OtherDeductionParam otherDeductionParam) { String declareMonthStr = otherDeductionParam.getDeclareMonth(); @@ -2388,7 +2425,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List> endowmentInsuranceRowList = new ArrayList<>(); - List endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目","申报扣除月份", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额"); + List endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "申报扣除月份", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额"); endowmentInsuranceRowList.add(endowmentInsuranceTitle); endowmentInsuranceList.forEach(dto -> { List row = new ArrayList<>(); diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index 16ab88f30..f3bd61e79 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -23,6 +23,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.formlua.entity.standard.ExcelResult; import com.engine.salary.service.*; @@ -125,7 +126,8 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc List employeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); SalarySobCycleDTO salarySobCycleDTO = salaryAcctCalculateBO.getSalarySobCycleDTO(); - Long taxAgentId = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentId(); + SalarySobPO salarySobPO = salaryAcctCalculateBO.getSalarySobPO(); + Long taxAgentId = salarySobPO.getTaxAgentId(); sw.stop(); // 2、查询薪资档案的数据 sw.start("查询薪资档案的数据"); @@ -147,7 +149,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc sw.stop(); // 5、查询其他免税扣除 sw.start("查询其他免税扣除"); - List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId); + List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId,salarySobPO.getIncomeCategory()); sw.stop(); //6、查询社保福利 sw.start("查询社保福利"); From d6061fa0596759d6cd1aa44a67879135ba96a177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 2 Jul 2025 20:43:53 +0800 Subject: [PATCH 287/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datacollection/OtherDeductionMapper.xml | 10 +++++++++- .../engine/salary/service/OtherDeductionService.java | 4 ++-- .../salary/service/impl/OtherDeductionServiceImpl.java | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index c3fd0e391..ef566fdd7 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -813,14 +813,22 @@ left join hrsa_other_derate_deduction f on t.id=f.main_id and f.delete_type=0 and f.income_category=#{param.incomeCategory} left join hrsa_personal_pension g on t.id=g.main_id and g.delete_type=0 and g.income_category=#{param.incomeCategory} where t.delete_type=0 - and t.tax_agent_id = #{param.taxAgentId} and t.declare_month = #{param.declareMonth} + + and t.tax_agent_id = #{param.taxAgentId} + AND t.employee_id IN #{employeeId} + + AND t.tax_agent_id IN + + #{taxAgentId} + + \ No newline at end of file diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index 874b93bc2..c2fd7f1e0 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -102,11 +102,11 @@ public interface OtherDeductionService { * 按照申报表类型,获取其他免税扣除数据 * @param declareMonth * @param employeeIds - * @param taxAgentId + * @param taxAgentIds * @param incomeCategory * @return */ - List getOtherDeductionList(YearMonth declareMonth, List employeeIds, Long taxAgentId, Integer incomeCategory); + List getOtherDeductionList(YearMonth declareMonth, List employeeIds, List taxAgentIds, Integer incomeCategory); /** * 编辑数据 diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index ea4ceeb3a..b192459e7 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -1894,18 +1894,18 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } @Override - public List getOtherDeductionList(YearMonth declareMonth, List employeeIds, Long taxAgentId, Integer incomeCategory) { + public List getOtherDeductionList(YearMonth declareMonth, List employeeIds, List taxAgentIds, Integer incomeCategory) { if (declareMonth == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:申报月份必传")); } - if (taxAgentId == null) { + if (CollUtil.isEmpty(taxAgentIds)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:扣缴义务人必传")); } if (incomeCategory == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:所得项目必传")); } - List otherDeductionPOS = listDetails(OtherDeductionPO.builder().incomeCategory(incomeCategory).declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentId(taxAgentId).build()); + List otherDeductionPOS = listDetails(OtherDeductionPO.builder().incomeCategory(incomeCategory).declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentIds(taxAgentIds).build()); if (CollUtil.isEmpty(otherDeductionPOS)) { return new ArrayList<>(); } From be3b4fc7e141bca05beff2164510c59f894fc4b5 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 4 Jul 2025 15:13:28 +0800 Subject: [PATCH 288/298] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=89=88=E6=9C=AC=20?= =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TaxDeclareRecordServiceImpl.java | 62 ++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 13ae9c1a8..2c78fa48e 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -48,6 +48,7 @@ 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.salaryacct.SalaryAcctRecordMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper; import com.engine.salary.remote.tax.client.DeclareClient; @@ -55,6 +56,8 @@ import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; 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.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.*; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; @@ -77,6 +80,7 @@ import java.util.*; import java.util.stream.Collectors; import static com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum.NOT_DECLARE; +import static com.engine.salary.sys.constant.SalarySysConstant.TAX_DECLARATION_DATE_TYPE; /** * 个税申报 @@ -182,9 +186,20 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); } + private SalaryAcctRecordMapper getSalaryAcctRecordMapper() { + return MapperProxyFactory.getProxy(SalaryAcctRecordMapper.class); + } + private TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + + //是否根据税款所属期进行申报 + private final boolean isTaxDeclarationByTaxCycle = "1".equals(getSalarySysConfService(user).getValueByCode(TAX_DECLARATION_DATE_TYPE)); + // private TaxPaymentRequestMapper taxPaymentRequestMapper; @@ -274,9 +289,44 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 根据个税扣缴义务人范围查询个税扣缴义务人 Collection taxAgents = queryByTaxAgentRange(saveParam); Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + + Date taxCycle; + List salaryAcctRecords = new ArrayList<>(); + //根据税款所属期申报 + if (isTaxDeclarationByTaxCycle) { + taxCycle = saveParam.getTaxCycle(); + if (Objects.isNull(taxCycle)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "税款所属期参数错误")); + } + + // 查询薪资所属月的薪资核算记录 + salaryAcctRecords = listByTaxCycle(SalaryAcctRecordPO.builder().taxCycle(taxCycle).build()); + // 无薪资核算记录,不允许生成个税申报表 + if (CollectionUtils.isEmpty(salaryAcctRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", SalaryDateUtil.getFormatYearMonth(taxCycle))); + } + } else { + //根据薪资所属月申报 + // 薪资所属月的日期范围 + LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(saveParam.getSalaryMonth()); + if (Objects.isNull(salaryMonthDateRange)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "薪资所属月参数错误")); + } + // 查询薪资所属月的薪资核算记录 + salaryAcctRecords = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build()); + // 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表 + taxCycle = salaryAcctRecords.get(0).getTaxCycle(); + boolean differentTaxCycle = salaryAcctRecords.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0); + if (differentTaxCycle) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}存在不同的税款所属期,无法正常生成个税申报表,请调整账套设置,重新核算后再生成个税申报表") + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + } + } // 查询薪资所属月下的薪资核算记录,并按照权限过滤 - LocalDateRange salaryMonthRange = new LocalDateRange().setFromDate(saveParam.getSalaryMonth()).setEndDate(saveParam.getSalaryMonth()); - List salaryAcctRecords = getSalaryAcctRecordService(user).listBySalaryMonth(salaryMonthRange); + // LocalDateRange salaryMonthRange = new LocalDateRange().setFromDate(saveParam.getSalaryMonth()).setEndDate(saveParam.getSalaryMonth()); + // List salaryAcctRecords = getSalaryAcctRecordService(user).listBySalaryMonth(salaryMonthRange); + + // 查询薪资核算记录关联的个税扣缴义务人 List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId)); // 按照saveParam中的个税扣缴义务人范围过滤 @@ -362,6 +412,14 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } + public List listBySalaryMonth(SalaryAcctRecordPO po) { + return getSalaryAcctRecordMapper().listSome(po); + } + + public List listByTaxCycle(SalaryAcctRecordPO po) { + return getSalaryAcctRecordMapper().listSome(po); + } + @Override public void refreshData(Long id) { // 查询个税申报记录 From b55ea81e4e18c61352bfc22167a08475a92fac3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 7 Jul 2025 10:20:24 +0800 Subject: [PATCH 289/298] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/WEB-INF/lib/hrmelog.jar | Bin 138117 -> 138098 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/resource/WEB-INF/lib/hrmelog.jar b/resource/WEB-INF/lib/hrmelog.jar index 7589cfeae2af120009328d9fce0d18905612e06a..ba4091f61da05482aa31da16145b2ef8ce271720 100644 GIT binary patch delta 4520 zcmZ`-c{r47AD;IyW5#GOW-QsWCWq`>M5{`&r0h%9QyNi}?K2&9lt>A^+9b+WgelXB zI0z|WREn}zT2Uz};TxX!?K{i$&HOR<`@8So`aI8dJ@5R^rF^QSh&b2^5UB(Lg+R!3 zc;%iZqD-9sHN<}1m&`wxAKr<~gY-#64T42L8-gSimCP_8oW37W=M9`xFpi0%rB&09 zi&D|rS%ku=BKAWwCtL6~Cg^6(`HFI~DEWW4pvDNGrx%GX;G|J)F}DF>MF3NdOKNcnF=t4BpHZsIy83^q20U?vxkv^G$%!;0!x}L2<@CO zy&hOSo+CZfNf6bg02=3*L5aeA6pppi6Sz|8{5ir(Mk#>F@%CDZRg&ft1Q8ZSfn(t( zh}G83GDO9w{54Aobi+Ed&QU>qsX&>d6;g~v=w>|?gf-uYFo$U;BE+x|b9(*&$mvRv z5}fr>k6{>&YWxi5t^V6NEOc|C0rZ|pBttSi%|{KjrU4>HKdG8TpWCg3zkD>(k+X8B zl?Z=sn#Ypj=@=1Y<1_BQ7n%%>R8_-!zX09#%)L&Tn3cVftWyvwG&p7ZU;i*hIJqu zEGYjl!@lPTlurn9-5(%9*iQV}$vi8&5QuS+ZX{daU(2I~@}3|{+>U36h|vEbQ9eoJ zGKLWe3asgG!MSduNF26%el{8}1DL492SkkBlu9F3NegB87BXxXg_mvj6E34S+4kfg zkiI>@>*P`1tFq(@LOSz3ZsxOYjwPQv+jApyiv0P|jKuwxH&(m{W0pq~5y8xiJy|b% zr$(o1#(MYlzgC?6cCQ~+}+wWbaNoGw+xEekr#; ziJjAvsP;?p*LOp^^Jq&48Y$l5HRrc}JhgbQ{|ZmFeo_WrW^!v-ez!w%Wy$?Zjx zaatk+!j5rtpCbd;7kf9ODw7+CyH@iAJsMr|CS__$hh(WMw`yKhI;q+HEuitVqWi|6 z4d1G_6)@jlk*+NAFi7;$vu#Xn&)%AIc1s!S8r%7bX$^ResNnM|p^-7iArj!}*NU!8YhNC9qVqNT`-C4E&VP(m_j48CKlvc5{ zJa?L%z2T_t);pz=5-Afwl3&zr4KMT29+umYA-6}-$tdrV)Obrv_ZpQ~7gN6_R;02d z$5Sqe)vq|et=K)HH6eUBrfu;(Q|iR`)|v1?@48hqy^dx&HFSUOz`DGo_|mu+M}p-o z_pv;e+VWhhuQ-uP+zfmko-4K!d6T#!3W*lYSj2YS=otJ6Xaywu2^J5M96NgN=;%_L zj+q>E8t+MI%KL2(=h5zN{WTYMExcwD$mocS?eWS#X1LLFoZ4EWy~{LM>yjVKx{lYU zy+fXNZ}{x!>t~7Dq+6bnvb8>=m!fYCNl$!9$n*^0>F#x!ynnjU%w*t3L~u%>OWV%a ze&-HDcC?-0;XmV+#Ss_oS7`{b>68s-T~xm2w9~O`b6n5kdmg@(!v>XJ6^~m6-32rX zNqJ7Z@ur@U;ZvKDaKMc$>w0tcWo5g=)z>HAeE!^W^hG{sTAN_ZHuNa&G4pR_(!##> zEH_d5VWg^8a6wUEN#DZ{+HoEYYMu@q<kq^<(KbSBrC^_3>f+h=%HT}niq8cV)R3%*72hUt+rt-`lQg}B{NFi zr!4#q-_>%yA$5kvrEvGIESk(qv>G&SANdke>Z|LT=-Fa?!f*CG*Vb&S?z{V3K$f`{ zQJ)vob#%5@zq;b-A2SU9>)pnE*O8BZ2<7hddj7>ricP%U$N3{BX4CN@H<^Qx>QOPb zVs}5#d+@#KMfuy1joV`CbhMKFFXiZqa<%M;`yj^MAN^o?5JOxDa*9taBA@K zuyTX<3%q*xkY(sso&+*!z1| z#$9->XR&El+Do4lx@4{W_o1XIiqW7#Jy)Y|h3!VW&;2&4DKk~SdaZ~U@!iN+rSC7B zXL2uAYPLbVe^Fs|)Asegvf=MFPU!4@r(T5&Tk5dsMh_~<8fnUBLW{%1x3`4cd9Hg< zLsz+6ba1^zV_bq=0sB>C{kZwdXiK}RjxCj%c|)JC9Wjtj-@ta(XEz1T>_WelDbw0fh)I`%;Y`_2jGoAcC*wNLY`-t!cPp9QOx57Is# zvix5E?#ip{X4894#5Y}mQ7n~aUTE02$-Ey77qq%bBV&Xc{>{-{1wo%U-MehVf zTUCd4w|}%;HTwL?At85-q)Ch9!GssRHa>P0c6yr%s@^LP=w$K3MDB)o44KT) zih4b9vt-I5k1Za1Vd~SwjUOte>xeF0AI8GJJ>KcEov}_w_oVfw{Hl|Ys?UY2PON_K z@a#YCb%R?}_1tFE{dL4!j7l@qcn{xRZuU5;U}0m)6h&*PvDJ}uZ$9Ufj;3OgfZvg!3BX`*(;)q?fj!z@%^8|Wx8o#=I z_=(hK5O}FZ17?sdP$}14y36VI!Z7cvhpsf`ESBMr10C$KI1%MkwG#bB#X#oH)d*~7(fSJ)0 zB3KP24~bwiL|P;~0H2jX^GE=`f1>?mLxWGg5?I}*Yx-6e$U+Jx{KETsY;=y8II+s3J21GKFW274i@62^533qS(2U0eVH zA>z*fyQVwS@K!I=@Vpce;0SeIBDih7{f8oW`#=X~_7AMiv4W+T2^>&vS`7$^bj1f4(?M{q=Mb>c66O3?QMqFVJtPgDnD>g#W!H zvXZylmL?GhuA&5j{@=X5LNAnmkQLFA8DzoAe`ewT)$*6mu4#l292gq7ds{?c06z~& SaE{!{|2E1K2q>Q=5dI69l4_m+ delta 4457 zcmZWtdpy(YANPH1Gn-*-!${>WQm#n{NfKQ|x!*~bBcYqiDeLM`PSQGkCB`AQ$ZZ|# zf|5{_s7_^y$*GQCF?2DN`OTiqtKaYV$9wP3`*VGsXRi+v_4pGUyyB*HvKWGl3|>a2 z)6>sCOHl_S{%s}s9k2+~A>wP(b|GQ|Q-J70un;VUAYE4%?M48Rc^DAHV)kk95fLM1 zlDZ!Aj1qy_0Pw#n0!8+HOb@iMS-86rO>d0YUx}TKFZq9JA7O_?&m+zUFy=_1SU;cb zqNpp;^N1FxBLGBpxzc7x)sZcs9QCh4V14W;)o_X4+(1GJC_hW6tWZdy)v|!hE~Z_O z^xK}Q%ZyT2hK(hudjQz9r>-uOPbb3@qmb~!2wk^PR|gQ&o(y*m4(XF04msbj1OZVWmhI~3YG)v>Z?4P_ zKZZ;sR|_?ry?Dl%?Fz66ks3XuD5}sh*H3cBvxli%Bqx3g6d61oFMbP5yRt>7p%Tzy zlUUMetSl&(%w?p|4OYaqD+7`^E6c6t=E%-1w~$<|Bz0Y8ZaJ~8LPt{YwSBV$9*t80 z*ncOTv&pf~Uoq19S68;o_$&Hof(oFq2_3&Ui!-9>BxE_vEy{*=sQ?AkP!&))1VzLY zUKZ3&1+jqQI2A-v=1(Eygyqk@DXd?LatK$Db#R;U;4;<^#GFS z2EDBT2%LFu5hDKo#-vOa9n#KGMEdnAJrFdS4k##f3{hr;M99_}uQ{x8-nO1n7xn~0 zj8kr_ePS^0Zzl!q#d#V>@`~eguex2ddiDJ326W#*?%z+__V+m!IDV?$v2o)}IxB_0 z(@JG&*`?eTQ+|H}fASE&>D!ta!J|;2Vwn1}B3m4rIvG(;@(pvDI_K-DtlNrrj}d5n zFv=OkpQrW&1nZ{gsKmn`(4pXc^^uQu=GQe@^N= zbGz<%fhvBWvAO2v4m(2f-pZl@Ati6{UX; znz~1QbS?Qy$EA?7g|&(P#e@LMZB+#~qb_QBk^UN!ozOONuE}N;c6B8A+@rNBY-v#{ zEU3r|4x?mv*c|s7=Vr7`AK7d9#_PU?%O9~CR~@5NyS;zu2rQAK8&oA?w+)=Pd?{b* zSEgX}&uDMqGjikBkY~YpeKq>ksC&fFWM|{mf)!Qap$`Mo^=YI?!{Y-D{?|TWbI*-t zkUw``SUh}@kW*5f#=w!YV_oMt;duA%akHMb`D>QruTXTn^Y++8+jenZ4H^hHldE8L1cd04KBqNZaDT|+uH9=8w#%xF zwA!+@F3-AcLk}ULdL&WyPN*|TO-)fK6P!ahTsB6N&)L8X0hoIn* zE#tDJ*r8uRS}y86u1j)kTVcv7$kplepxkv_6aTZIe8Ke!pYY80T{wB~q-G$uS%WoRhV^3Y# zC_F~8TQTUl^gVZGR4e7-NYG5N=lkowEsI@waP+XziWgh=GZL^)SL%10<*}%j5-;Jx z^N6gFn8KIw53V*jPE{srZq5$AddlSW*tw(#llo!$#K&RJQf_j>Uk&q3Xp5aoul=WP z?7~~Of&RVa4%P1#+6i*Z)}AZ2@N`hW9e3*eUcuF2{H4f}yv2bx>?2Lp>pkz$OG&=8 zo=smPeeGJb<#VkVSr=HBX{B#ztktY{=;$S9^Z3yFQ*l9$Zn#|B|FXlo>e-vx zWPIfLQQM6AL1&G;?@bPE9z12mv}f(5vi~&4*DMmeJZ>9Ncx+;MM=fS_=yOVwy-Ofd zeWa08yiB;=s?o4WVd6$!LV;}fnphXLRKc^5@wb^L$y4{|{m$@A`ufp-s4-&2LWj2T z1sfj+Zk2!s~epfuOXwNG{Y)|kxUD~RA*QOLxM#<-?m#wj_+mamX zcJ~?zQqI48^5R#wfYP+YoD*>yCq|2_4SEeUN?QUCkmI}G*{@y03>mKfRs*fKr+1mGld3v({PXEQnduuH6pD(X^apK0}tMe?M(zRlo zaO?;BS+U{$?{>V~euCo^%2>b{WPCE?Y8(o+)Bd(Pk@}6#TZvbDJ$P%7*V_Hf_MCsK z{j%pVuePgC`+s;d>9&~fnaRNXn#Oxg7rNRDseSrf%vnQ?bqkWv1ka9F+Gp=KCF>ok zZHedaq`H=TjrQZdA(&ZQb~9ZURAKU9>(u+ZX~LX+Lpv|uiB+nqTlt)^`jNpwdVY9i zfcJrK@Abatk54b@;gm!~U11dqzgK;H+Avzad{gPRvXX6;MV#6y^YrIYO%~TpnVs%= z^|IN9UVnrpoW|rXOao?=P!_BH55i2&}{hV13tP7l3XUIXRgUHA^&G|cidv)_<(foop_Psn8 zE^R0Gkvz3g?F@6Wbp~u&Cx)6oh#38D3cMgV3W6aRk^poy0(_x79|1uS&CGED00ctrIskqUQDs2@M0;g{Kdhl! z7C1vr4Ff_TmxKYUA!^2e%@C<$MZU9(J9+>swTkLr3poN#nr$aes%ysqA81`D2f`pa zAt&lb9HmcA#^n47^%>kE>X>Tb%5Iu~2D2p|+920_a42*4foVMYW8 zASxq@bhEo4N>l(xA<9w!QP5Y^IUS{t0Ni#_Cz7<)Y?3tjXA%Tobv5dB9* z>b71Ltb&{sMIc_smbbZ8J6;;}$EDdadTp$f> zf~cA%^(CrFBS)!8Be$smS2$R*y670i!#3|OYnnXP*fI9p9lo!lKj5+0fR~;)O Date: Tue, 8 Jul 2025 18:28:00 +0800 Subject: [PATCH 290/298] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E5=85=8D=E7=A8=8E?= =?UTF-8?q?=E6=94=B6=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxdeclaration/bo/TaxDeclarationRequest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java index 5bcad824f..284b5a010 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -9,6 +9,7 @@ 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.DeclareReportTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; @@ -43,6 +44,10 @@ public class TaxDeclarationRequest { Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + taxDeclarations = taxDeclarations.stream() + .filter(taxDeclaration -> IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()) != null + && IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType()== DeclareReportTypeEnum.COMPREHENSIVE_INCOME) + .collect(Collectors.toList()); for (TaxDeclarationPO taxDeclaration : taxDeclarations) { List values = taxDeclarationValueMap.get(taxDeclaration.getId()); for (TaxDeclarationValuePO taxDeclarationValue : values) { @@ -338,6 +343,10 @@ public class TaxDeclarationRequest { Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + taxDeclarations = taxDeclarations.stream() + .filter(taxDeclaration -> IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()) != null + && IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType()== DeclareReportTypeEnum.CLASSIFIED_INCOME) + .collect(Collectors.toList()); for (TaxDeclarationPO taxDeclaration : taxDeclarations) { List values = taxDeclarationValueMap.get(taxDeclaration.getId()); IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); @@ -380,6 +389,10 @@ public class TaxDeclarationRequest { Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + taxDeclarations = taxDeclarations.stream() + .filter(taxDeclaration -> IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()) != null + && IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType()== DeclareReportTypeEnum.NONRESIDENT_INCOME) + .collect(Collectors.toList()); for (TaxDeclarationPO taxDeclaration : taxDeclarations) { List values = taxDeclarationValueMap.get(taxDeclaration.getId()); for (TaxDeclarationValuePO taxDeclarationValue : values) { From ed5f6da8a6205a5550e4a4ea6b84446c3799381a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 11 Jul 2025 17:18:15 +0800 Subject: [PATCH 291/298] =?UTF-8?q?=E7=BC=B4=E6=AC=BE=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E5=88=86=E7=B1=BB=E5=88=86=E5=88=AB=E7=BC=B4?= =?UTF-8?q?=E7=BA=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202507110103.sql | 3 + resource/sqlupgrade/GS/sql202507110103.sql | 3 + resource/sqlupgrade/JC/sql202507110103.sql | 3 + resource/sqlupgrade/Mysql/sql202507110103.sql | 1 + .../sqlupgrade/Oracle/sql202507110103.sql | 2 + resource/sqlupgrade/PG/sql202507110103.sql | 1 + .../sqlupgrade/SQLServer/sql202507110103.sql | 2 + resource/sqlupgrade/ST/sql202507110103.sql | 3 + .../taxpayment/po/TaxPaymentRequestPO.java | 2 + .../taxpayment/TaxPaymentRequestMapper.java | 2 - .../taxpayment/TaxPaymentRequestMapper.xml | 48 +++++---- .../impl/AbstractTaxPaymentService.java | 37 +++---- .../TaxPaymentWithholdingServiceImpl.java | 98 ++++++++++--------- ...xPaymentWithholdingVoucherServiceImpl.java | 10 +- 14 files changed, 113 insertions(+), 102 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202507110103.sql create mode 100644 resource/sqlupgrade/GS/sql202507110103.sql create mode 100644 resource/sqlupgrade/JC/sql202507110103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202507110103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202507110103.sql create mode 100644 resource/sqlupgrade/PG/sql202507110103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202507110103.sql create mode 100644 resource/sqlupgrade/ST/sql202507110103.sql diff --git a/resource/sqlupgrade/DM/sql202507110103.sql b/resource/sqlupgrade/DM/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/resource/sqlupgrade/GS/sql202507110103.sql b/resource/sqlupgrade/GS/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/resource/sqlupgrade/JC/sql202507110103.sql b/resource/sqlupgrade/JC/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202507110103.sql b/resource/sqlupgrade/Mysql/sql202507110103.sql new file mode 100644 index 000000000..ab9b6cb2e --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202507110103.sql @@ -0,0 +1 @@ +ALTER TABLE hrsa_tax_payment_request ADD COLUMN report_type int NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202507110103.sql b/resource/sqlupgrade/Oracle/sql202507110103.sql new file mode 100644 index 000000000..40452d2a6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202507110103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add report_type number(11) null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202507110103.sql b/resource/sqlupgrade/PG/sql202507110103.sql new file mode 100644 index 000000000..b59e15941 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202507110103.sql @@ -0,0 +1 @@ +ALTER TABLE hrsa_tax_payment_request ADD COLUMN report_type int ; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202507110103.sql b/resource/sqlupgrade/SQLServer/sql202507110103.sql new file mode 100644 index 000000000..19d102aa7 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202507110103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add report_type int null +go \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202507110103.sql b/resource/sqlupgrade/ST/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 34141f5a2..55e0c69c5 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -73,6 +73,8 @@ public class TaxPaymentRequestPO implements Serializable { //是否已获取反馈") private Integer feedback; + private Integer reportType; + /** * 租户key */ diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java index 6ec65e30f..d33063ed7 100644 --- a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java @@ -79,8 +79,6 @@ public interface TaxPaymentRequestMapper { void updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO build); - void updateFeedbackByTaxDeclareRecordId(TaxPaymentRequestPO build); - TaxPaymentRequestPO getOne(TaxPaymentRequestPO build); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml index d1ca5dee2..6d84c59b8 100644 --- a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml @@ -14,6 +14,7 @@ + @@ -32,6 +33,7 @@ , t.tax_year_month , t.tenant_key , t.update_time + , t.report_type @@ -93,6 +95,9 @@ AND update_time = #{updateTime} + + AND report_type = #{reportType} + AND id IN @@ -142,7 +147,10 @@ tenant_key, - update_time + update_time, + + + report_type @@ -180,7 +188,10 @@ #{tenantKey}, - #{updateTime} + #{updateTime}, + + + #{reportType} @@ -201,7 +212,8 @@ tax_declare_record_id, tax_year_month, tenant_key, - update_time + update_time, + report_type ) VALUES ( @@ -217,7 +229,8 @@ #{item.taxDeclareRecordId}, #{item.taxYearMonth}, #{item.tenantKey}, - #{item.updateTime} + #{item.updateTime}, + #{item.reportType} ) @@ -236,7 +249,8 @@ tax_declare_record_id, tax_year_month, tenant_key, - update_time + update_time, + report_type ) @@ -252,7 +266,8 @@ #{item.taxDeclareRecordId,jdbcType=DOUBLE}, #{item.taxYearMonth,jdbcType=DATE}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.updateTime,jdbcType=DATE} + #{item.updateTime,jdbcType=DATE}, + #{item.reportType,jdbcType=INTEGER} from dual @@ -272,7 +287,8 @@ tax_declare_record_id, tax_year_month, tenant_key, - update_time + update_time, + report_type ) VALUES ( @@ -287,7 +303,8 @@ #{item.taxDeclareRecordId}, #{item.taxYearMonth}, #{item.tenantKey}, - #{item.updateTime} + #{item.updateTime}, + #{item.reportType} ) @@ -307,6 +324,7 @@ tax_year_month=#{taxYearMonth}, tenant_key=#{tenantKey}, update_time=#{updateTime}, + report_type=#{reportType}, WHERE id = #{id} AND delete_type = 0 @@ -349,6 +367,9 @@ update_time=#{updateTime}, + + report_type=#{reportType}, + WHERE id = #{id} AND delete_type = 0 @@ -385,17 +406,9 @@ AND request_type=#{requestType} AND tax_agent_id=#{taxAgentId} AND tax_year_month=#{taxYearMonth} + AND report_type=#{reportType} - - UPDATE hrsa_tax_payment_request - - feedback=#{feedback} - - WHERE delete_type = 0 - AND tax_declare_record_id=#{taxDeclareRecordId} - @@ -407,6 +420,7 @@ AND request_type = #{requestType} AND tax_agent_id = #{taxAgentId} AND tax_year_month = #{taxYearMonth} + AND report_type = #{reportType} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index 25078bcf0..0881fd6cf 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -11,6 +11,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; import com.engine.salary.entity.taxagent.response.SzyhResponseHead; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; @@ -34,7 +35,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; -import java.math.BigDecimal; import java.util.*; /** @@ -54,6 +54,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa protected TaxDeclareStatusService getTaxDeclareStatusService(User user) { return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); } + protected TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -172,6 +173,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .requestType(param.getType()) .taxAgentId(param.getTaxAgentId()) .taxYearMonth(param.getTaxYearMonth()) + .reportType(param.getReportType()) .build()); } } else { @@ -189,6 +191,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .requestId(requestId) .requestType(param.getType()) .feedback(SalaryOnOffEnum.OFF.getValue()) + .reportType(param.getReportType()) .build(); getTaxPaymentRequestMapper().insertIgnoreNull(paymentRequestPO); } @@ -200,6 +203,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .builder() .taxAgentId(param.getTaxAgentId()) .taxYearMonth(param.getTaxYearMonth()) + .reportType(param.getReportType()) .build()); if (Objects.isNull(param.getCheckFeedback()) || SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { TaxPaymentRequestPO notFeedback = paymentRequests.stream() @@ -226,6 +230,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .requestType(getServiceType()) .taxAgentId(param.getTaxAgentId()) .taxYearMonth(param.getTaxYearMonth()) + .reportType(param.getReportType()) .build()); SalaryAssert.notNull(paymentRequest, "请先点击[三方缴款]或[银行端凭证缴款]按钮发起缴款请求后,再点击[缴款反馈]按钮"); paymentRequest.setFeedback(SalaryOnOffEnum.ON.getValue()); @@ -256,10 +261,11 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); SalaryAssert.notNull(taxDeclareRecord, "个税申报记录不存在"); - if (!TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) { + TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(param.getTaxDeclareRecordId(), param.getReportType()); + if (!TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue().equals(taxDeclareStatus.getTaxDeclareStatus())) { throw new SalaryRunTimeException("当前申报状态不是[申报成功,未缴费],暂时无法获取"); } - if (taxDeclareRecord.getTaxPayAmount() == null || taxDeclareRecord.getPersonNum() == null) { + if (taxDeclareStatus.getTaxPayAmount() == null || taxDeclareStatus.getPersonNum() == null) { throw new SalaryRunTimeException("未获取到应缴信息,请先进行个税在线申报"); } TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); @@ -267,32 +273,11 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa return TaxAmountFormDTO.builder() .taxAgent(taxAgentPO.getName()) - .amount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPayAmount())) - .personNum(taxDeclareRecord.getPersonNum().toString()) + .amount(SalaryEntityUtil.thousandthConvert(taxDeclareStatus.getTaxPayAmount())) + .personNum(taxDeclareStatus.getPersonNum().toString()) .build(); } - protected TaxDeclareRecordPO updateTaxDeclareRecord(TaxPaymentQueryParam param, BigDecimal totalPaid) { - TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); - if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) { - throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态"); - } - BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); - BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); - if (SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()).equals(totalPaid) - && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) { - throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态"); - } - taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue()); - taxDeclareRecord.setTaxPaidAmount(totalPaid.toString()); - taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); - taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString()); - taxDeclareRecord.setUpdateTime(new Date()); - getTaxDeclareRecordService(user).updateById(taxDeclareRecord); - // 填充回去后续返回数据用 - taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString()); - return taxDeclareRecord; - } @Override public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 2d85f020c..019701a54 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -9,7 +9,6 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.entity.taxpayment.dto.TaxAgreementFeedbackResultDTO; -import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; import com.engine.salary.entity.taxpayment.response.BaseResponse; @@ -23,7 +22,6 @@ import com.engine.salary.util.*; import lombok.extern.slf4j.Slf4j; import java.math.BigDecimal; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -55,53 +53,57 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService throw new SalaryRunTimeException(msg); } - List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId()); - for (TaxDeclareStatusPO status : statuses) { - WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) - .map(WithholdingFeedbackResponse::getBody) - .map(body -> { - if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue())) { - return body.getZhsdjk(); - } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue())) { - return body.getFlsdjk(); - } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue())) { - return body.getFjmsdjk(); - } else { - return body.getXsgsdjk(); - } + TaxDeclareStatusPO status = getTaxDeclareStatusService(user).getTaxDeclareStatus(param.getTaxDeclareRecordId(),param.getReportType()); + WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) + .map(WithholdingFeedbackResponse::getBody) + .map(body -> { + if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue())) { + return body.getZhsdjk(); + } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue())) { + return body.getFlsdjk(); + } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue())) { + return body.getFjmsdjk(); + } else { + return body.getXsgsdjk(); + } - }) - .orElse(null); - if (feedback == null) { - log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); - } - // 判断缴款状态是否成功 - Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); - TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); - if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { - throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt())); - } - // 累计实缴金额 - BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); - - if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(status.getTaxDeclareStatus())) { - throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态"); - } - BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(status.getTaxPayAmount()); - BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(status.getTaxPurePaidAmount()); - if (SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).equals(totalPaid) - && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) { - throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态"); - } - status.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue()); - status.setTaxPaidAmount(totalPaid.toString()); - status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); - status.setTaxPayAmount(BigDecimal.ZERO.toString()); - getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false); + }) + .orElse(null); + if (feedback == null) { + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); } + // 判断缴款状态是否成功 + Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); + TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); + if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt())); + } + // 累计实缴金额 + BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); + + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(status.getTaxDeclareStatus())) { + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态"); + } + BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(status.getTaxPayAmount()); + BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(status.getTaxPurePaidAmount()); + if (SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).equals(totalPaid) && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) { + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态"); + } + status.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue()); + status.setTaxPaidAmount(totalPaid.toString()); + status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); + status.setTaxPayAmount(BigDecimal.ZERO.toString()); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false); - TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param); //更新主记录 getTaxDeclareStatusService(user).updateRecord(param.getTaxDeclareRecordId()); @@ -112,9 +114,9 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService BigDecimal otherAmount = SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).subtract(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPurePaidAmount())); return new TaxAgreementFeedbackResultDTO() - .setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).toString())) + .setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).toString())) .setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString())) - .setPersonNum(taxAmountFormDTO.getPersonNum()); + .setPersonNum(status.getPersonNum().toString()); } @Override diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index dda4b4f06..5acb92777 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -106,14 +106,6 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS @Override public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { - TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO - .builder() - .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) - .taxAgentId(taxDeclareRecord.getTaxAgentId()) - .taxYearMonth(taxDeclareRecord.getTaxCycle()) - .build()); -// if (paymentRequestPO != null) { - List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId()); statuses.forEach(status -> { @@ -128,9 +120,9 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .reportType(status.getReportType()) .build()); }); -// } } // @Override From 4c61714069d1d8b2cb13a2f7f258aaca96d21f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Sep 2025 11:12:34 +0800 Subject: [PATCH 292/298] =?UTF-8?q?1=E3=80=81=E6=89=B9=E9=87=8F=E7=94=B3?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxdeclaration/param/TaxDeclarationBatParam.java | 3 +-- src/com/engine/salary/web/TaxDeclarationController.java | 9 +-------- src/com/engine/salary/wrapper/TaxDeclarationWrapper.java | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java index 0168f9c89..0b309e9c4 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java @@ -6,7 +6,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; import java.util.Date; import java.util.List; @@ -32,7 +31,7 @@ public class TaxDeclarationBatParam { /** * 薪资所属月 */ - private YearMonth salaryMonth; + private Date salaryMonth; /** * 个税扣缴义务人 diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 88e686346..1baca155b 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -5,13 +5,6 @@ import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationBatParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; @@ -487,7 +480,7 @@ public class TaxDeclarationController { @Produces(MediaType.APPLICATION_JSON) public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBatParam param) { User user = HrmUserVarify.getUser(request, response); - param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr())); + param.setSalaryMonth(SalaryDateUtil.dateStrToLocalYearMonth(param.getSalaryMonthStr())); return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::batSave, param); } diff --git a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java index 9ae14cf75..c01b1ba04 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -139,7 +139,7 @@ public class TaxDeclarationWrapper extends Service { String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth()); // 查询个税扣缴义务人 TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId()); - return TaxDeclarationInfoDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); + return TaxDeclarationInfoDTO.builder().salaryMonth(SalaryDateUtil.stringToDate(transformDate+"-01")).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); } /** From 07cdf2063a97651132d04561fc30b1149e07d536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Sep 2025 11:41:33 +0800 Subject: [PATCH 293/298] =?UTF-8?q?1=E3=80=81=E6=89=B9=E9=87=8F=E7=94=B3?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/web/TaxDeclarationController.java | 30 +++++++++---------- .../wrapper/TaxDeclareRecordWrapper.java | 23 ++++++++++++++ 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index 45d5f0a8d..53fb8d0ec 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -5,13 +5,6 @@ import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.param.*; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationBatParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; @@ -140,6 +133,20 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::save, saveParam); } + /** + * 个税申报表批量生成 + * + * @param param 批量保存参数 + * @return + */ + @POST + @Path("/batSave") + @Produces(MediaType.APPLICATION_JSON) + public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::batSave, param); + } + /** * 刷新个税申报表的待刷新标识 @@ -482,14 +489,7 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::add, param); } - @POST - @Path("/batSave") - @Produces(MediaType.APPLICATION_JSON) - public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBatParam param) { - User user = HrmUserVarify.getUser(request, response); - param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr())); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::batSave, param); - } + /** diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index 8b127dddd..f175ece2c 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -416,6 +416,29 @@ public class TaxDeclareRecordWrapper extends Service { return taxDeclarationRate.getIndex(); } + public String batSave(TaxDeclarationSaveParam param) { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + try { + param.setTaxAgentId(taxAgentId); + getTaxDeclareRecordService(user).save(param); + success++; + } catch (SalaryRunTimeException e) { + msg.append(e.getMessage()).append(";"); + fail++; + } catch (Exception e) { + log.error("个税申报表生成报错:{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + } + /** * 更新个税申报表的待刷新数据的标识 * From c4f860f742a7ecc17deac46468cc245a5a785104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Sep 2025 11:42:20 +0800 Subject: [PATCH 294/298] =?UTF-8?q?1=E3=80=81=E6=89=B9=E9=87=8F=E7=94=B3?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/wrapper/TaxDeclarationWrapper.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java index 74419ecee..d98b8a419 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -2,19 +2,6 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.component.WeaFormOption; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationBatParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationService; @@ -23,8 +10,6 @@ import com.engine.salary.service.impl.TaxAgentServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; import weaver.hrm.User; -import java.util.List; - /** * 个税申报表 *

Copyright: Copyright (c) 2022

@@ -46,19 +31,5 @@ public class TaxDeclarationWrapper extends Service { private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } - public void batSave(TaxDeclarationBatParam param) { - List taxAgentIds = param.getTaxAgentIds(); - for (int i = 0; i < taxAgentIds.size(); i++) { - Long taxAgentId = taxAgentIds.get(i); - TaxDeclarationSaveParam saveParam = TaxDeclarationSaveParam.builder() - .salaryMonth(param.getSalaryMonth()) - .taxAgentId(taxAgentId) - .description(param.getDescription()) - .taxCycle(param.getTaxCycle()) - .salaryDate(param.getSalaryDate()) - .build(); - save(saveParam); - } - } } From b7ecb9a2397da23384fa3316459bd7dc2badab07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Sep 2025 11:51:08 +0800 Subject: [PATCH 295/298] =?UTF-8?q?1=E3=80=81=E6=89=B9=E9=87=8F=E7=94=B3?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/web/TaxDeclarationController.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index b6bb6d93c..8a953dc92 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -489,18 +489,6 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::add, param); } - @POST - @Path("/batSave") - @Produces(MediaType.APPLICATION_JSON) - public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBatParam param) { - User user = HrmUserVarify.getUser(request, response); - param.setSalaryMonth(SalaryDateUtil.dateStrToLocalYearMonth(param.getSalaryMonthStr())); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::batSave, param); - } - - - - /** * 编辑 From 17247f111f2b58bf475fa8c39968afb4def13b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Sep 2025 16:23:44 +0800 Subject: [PATCH 296/298] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=8A=A5=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/EmployeeDeclareParam.java | 7 ++ .../param/EmployeeDeclareRefreshParam.java | 11 +++- .../salary/web/EmployeeDeclareController.java | 23 +++++++ .../wrapper/EmployeeDeclareWrapper.java | 65 +++++++++++++++++++ 4 files changed, 104 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java index 8af42f76a..036a3ad7a 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java @@ -8,6 +8,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Date; +import java.util.List; /** * 人员报送 @@ -34,4 +35,10 @@ public class EmployeeDeclareParam extends BaseQueryParam { */ @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") private Date taxCycle; + + /** + * 批量报送,个税扣缴义务人id集合 + */ + private List taxAgentIds; + } diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java index b70cba7b5..073dd793a 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java @@ -7,6 +7,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Date; +import java.util.List; /** * 刷新报送人员 @@ -25,12 +26,18 @@ public class EmployeeDeclareRefreshParam { /** * 个税扣缴义务人id */ - @DataCheck(require = true,message = "参数错误,个税扣缴义务人id不能为空") + @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空") private Long taxAgentId; /** * 税款所属期 */ - @DataCheck(require = true,message = "参数错误,税款所属期参数格式错误") + @DataCheck(require = true, message = "参数错误,税款所属期参数格式错误") private Date taxCycle; + + + /** + * 批量操作,个税扣缴义务人id集合 + */ + private List taxAgentIds; } diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index af3295194..356801c50 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -200,6 +200,14 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::refresh, refreshParam); } + @POST + @Path("/batRefresh") + @Produces(MediaType.APPLICATION_JSON) + public String batRefresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::batRefresh, refreshParam); + } + /** * 人员报送-获取整体的报送情况 * @@ -228,6 +236,14 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam); } + @POST + @Path("/batDeclare") + @Produces(MediaType.APPLICATION_JSON) + public String batDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::batDeclare, employeeDeclareParam); + } + /** * 人员报送-获取报送结果反馈 * @@ -242,6 +258,13 @@ public class EmployeeDeclareController { return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); } + @POST + @Path("/batGetDeclareFeedback") + @Produces(MediaType.APPLICATION_JSON) + public String batGetDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::batGetDeclareFeedback, employeeDeclareParam); + } /** * 人员报送-后端业务逻辑是否已经完成 diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index fca9ed934..6c1e31ee8 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -460,6 +460,26 @@ public class EmployeeDeclareWrapper extends Service { return employeeDeclareRate.getIndex(); } + public String batRefresh(EmployeeDeclareRefreshParam param) { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + param.setTaxAgentId(taxAgentId); + try { + getEmployeeDeclareService(user).refresh(param, Long.valueOf(user.getUID())); + success++; + } catch (Exception e) { + log.error("刷新数据失败:{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + } + /** * 人员报送-获取人员报送的整体情况 * @@ -505,6 +525,26 @@ public class EmployeeDeclareWrapper extends Service { return employeeDeclareRate.getIndex(); } + public String batDeclare(EmployeeDeclareParam param) { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + param.setTaxAgentId(taxAgentId); + try { + getEmployeeDeclareService(user).declare(param); + success++; + } catch (Exception e) { + log.error("全部报送失败:{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + } + /** * 人员报送-获取报送结果反馈 * @@ -540,6 +580,31 @@ public class EmployeeDeclareWrapper extends Service { return employeeDeclareRate.getIndex(); } + public String batGetDeclareFeedback(EmployeeDeclareParam param) { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + param.setTaxAgentId(taxAgentId); + try { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + getEmployeeDeclareService(user).getDeclareFeedback(param,employeeDeclareRate); + success++; + } catch (Exception e) { + log.error("获取报送结果反馈失败:{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + } + /** * 获取人员报送相关后端接口是否已经完成 From d0e7f7ed8c7b121ca78da82ad953b6f958ea9e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 24 Sep 2025 16:59:50 +0800 Subject: [PATCH 297/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/EmployeeDeclareWrapper.java | 8 +-- .../wrapper/TaxDeclareRecordWrapper.java | 58 +++++++++++++------ 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 6c1e31ee8..b7956987e 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -477,7 +477,7 @@ public class EmployeeDeclareWrapper extends Service { } finally { } } - return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg); } /** @@ -542,7 +542,7 @@ public class EmployeeDeclareWrapper extends Service { } finally { } } - return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg); } /** @@ -593,7 +593,7 @@ public class EmployeeDeclareWrapper extends Service { .setStatus(true) .setFinish(false) .setMsg(""); - getEmployeeDeclareService(user).getDeclareFeedback(param,employeeDeclareRate); + getEmployeeDeclareService(user).getDeclareFeedback(param, employeeDeclareRate); success++; } catch (Exception e) { log.error("获取报送结果反馈失败:{}", e.getMessage(), e); @@ -602,7 +602,7 @@ public class EmployeeDeclareWrapper extends Service { } finally { } } - return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg); } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index f175ece2c..1662cab30 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -417,26 +417,46 @@ public class TaxDeclareRecordWrapper extends Service { } public String batSave(TaxDeclarationSaveParam param) { - List taxAgentIds = param.getTaxAgentIds(); - int success = 0; - int fail = 0; - StringBuilder msg = new StringBuilder(); - for (Long taxAgentId : taxAgentIds) { - try { - param.setTaxAgentId(taxAgentId); - getTaxDeclareRecordService(user).save(param); - success++; - } catch (SalaryRunTimeException e) { - msg.append(e.getMessage()).append(";"); - fail++; - } catch (Exception e) { - log.error("个税申报表生成报错:{}", e.getMessage(), e); - msg.append(e.getMessage()).append(";"); - fail++; - } finally { + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true) + .setIndex(Util.null2String(IdGenerator.generate())) + .setMsg(SalaryI18nUtil.getI18nLabel(95836, "生成申报表")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + try { + param.setTaxAgentId(taxAgentId); + getTaxDeclareRecordService(user).save(param); + success++; + } catch (SalaryRunTimeException e) { + msg.append(e.getMessage()).append(";"); + fail++; + } catch (Exception e) { + log.error("个税申报表生成报错:{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + taxDeclarationRate.setStatus(fail==0).setFinish(true).setMsg(msg.toString()); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("个税申报表生成报错:{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187276, "个税申报表生成报错:") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } } - } - return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg; + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "saveTaxDeclaration", localRunnable); + return taxDeclarationRate.getIndex(); } /** From ae43dbbe0414d0827c7d05eed827ea57f383c3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 25 Sep 2025 11:02:46 +0800 Subject: [PATCH 298/298] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index b7956987e..d251f51dc 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -477,7 +477,7 @@ public class EmployeeDeclareWrapper extends Service { } finally { } } - return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg); + return String.format("成功:" + success + "个,失败:" + fail + "个%s", fail == 0 ? "" : ",失败原因:" + msg); } /** @@ -542,7 +542,7 @@ public class EmployeeDeclareWrapper extends Service { } finally { } } - return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg); + return String.format("成功:" + success + "个,失败:" + fail + "个%s", fail == 0 ? "" : ",失败原因:" + msg); } /** @@ -602,7 +602,7 @@ public class EmployeeDeclareWrapper extends Service { } finally { } } - return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg); + return String.format("成功:" + success + "个,失败:" + fail + "个%s", fail == 0 ? "" : ",失败原因:" + msg); }