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 1/2] =?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 2/2] 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()); + } +}