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 01/44] =?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 02/44] 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 03/44] =?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 04/44] 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 05/44] 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 06/44] =?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 07/44] =?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 08/44] =?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 09/44] =?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 10/44] =?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 11/44] =?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 12/44] =?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 13/44] =?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 14/44] 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 15/44] =?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 16/44] =?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 17/44] =?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 18/44] =?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 19/44] =?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 20/44] =?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 21/44] =?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 22/44] =?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 23/44] =?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 24/44] =?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 25/44] =?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 26/44] =?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 27/44] =?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 28/44] =?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 29/44] =?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 30/44] =?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 31/44] =?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 32/44] =?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 33/44] =?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 34/44] =?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 35/44] =?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 36/44] =?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 37/44] =?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 38/44] =?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 39/44] =?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 40/44] =?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 41/44] =?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 42/44] =?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 43/44] =?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 44/44] =?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); + } + } + + }