个税对接v6
This commit is contained in:
parent
bb2d2d64e6
commit
fdc1df3dba
|
|
@ -0,0 +1,9 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/bs/hrmsalary/taxPayment")
|
||||
public class TaxPaymentController extends com.engine.salary.web.TaxPaymentController{
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxpayment.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
@ -23,6 +24,7 @@ public class TaxPaymentQueryParam {
|
|||
private Long taxAgentId;
|
||||
|
||||
//税款所属期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date taxYearMonth;
|
||||
|
||||
//个税申报记录id")
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -99,4 +100,7 @@ public class TaxPaymentRequestPO implements Serializable {
|
|||
*/
|
||||
//更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
//查询条件
|
||||
Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@
|
|||
employee_name,
|
||||
card_num,
|
||||
error_msg,
|
||||
income_category,
|
||||
income_category
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
|
|
@ -204,7 +204,7 @@
|
|||
#{item.employeeName},
|
||||
#{item.cardNum},
|
||||
#{item.errorMsg},
|
||||
#{item.incomeCategory},
|
||||
#{item.incomeCategory}
|
||||
</foreach>
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -222,7 +222,7 @@
|
|||
employee_name,
|
||||
card_num,
|
||||
error_msg,
|
||||
income_category,
|
||||
income_category
|
||||
)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
|
|
@ -237,7 +237,7 @@
|
|||
#{item.employeeName,jdbcType=VARCHAR},
|
||||
#{item.cardNum,jdbcType=VARCHAR},
|
||||
#{item.errorMsg,jdbcType=VARCHAR},
|
||||
#{item.incomeCategory,jdbcType=VARCHAR},
|
||||
#{item.incomeCategory,jdbcType=VARCHAR}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -256,7 +256,7 @@
|
|||
employee_name,
|
||||
card_num,
|
||||
error_msg,
|
||||
income_category,
|
||||
income_category
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
|
|
@ -270,7 +270,7 @@
|
|||
#{item.employeeName},
|
||||
#{item.cardNum},
|
||||
#{item.errorMsg},
|
||||
#{item.incomeCategory},
|
||||
#{item.incomeCategory}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@
|
|||
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getOne" resultMap="BaseResultMap" parameterType="Long">
|
||||
<select id="getOne" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_payment_request t
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFail
|
|||
@Override
|
||||
public void saveBatch(List<TaxDeclareFailPO> taxDeclareFails) {
|
||||
if (CollectionUtils.isNotEmpty(taxDeclareFails)) {
|
||||
|
||||
getTaxDeclareFailMapper().batchInsert(taxDeclareFails);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxPaymentServiceFactory taxPaymentServiceFactory;
|
||||
private TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user);
|
||||
;
|
||||
|
||||
// private TaxPaymentRequestMapper taxPaymentRequestMapper;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,194 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.wrapper.TaxPaymentWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* 个税辅助缴款
|
||||
*
|
||||
* @author chengliming
|
||||
* @date: 2022-08-31 11:49:38
|
||||
*/
|
||||
@Slf4j
|
||||
public class TaxPaymentController {
|
||||
|
||||
private TaxPaymentWrapper getTaxPaymentWrapper(User user) {
|
||||
return ServiceUtil.getService(TaxPaymentWrapper.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业的三方信息
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/getAgreement")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getAgreement(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
param.setType(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue());
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, String>(user).run(getTaxPaymentWrapper(user)::getRequestId, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业的三方信息查询反馈
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/getAgreementFeedback")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getAgreementFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, TaxFeedbackResultDTO>(user).run(getTaxPaymentWrapper(user)::getAgreementFeedback, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 三方协议缴款
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/agreement/pay")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String payAgreement(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue());
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, String>(user).run(getTaxPaymentWrapper(user)::getRequestId, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 三方协议缴款反馈
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/agreement/pay/feedback")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String payAgreementFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, TaxFeedbackResultDTO>(user).run(getTaxPaymentWrapper(user)::payAgreementFeedback, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 缴款凭证打印
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/voucher/print")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String printVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue());
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, String>(user).run(getTaxPaymentWrapper(user)::getRequestId, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 缴款凭证打印反馈
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/voucher/print/feedback")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String printVoucherFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue());
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, TaxFeedbackResultDTO>(user).run(getTaxPaymentWrapper(user)::printVoucherFeedback, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废缴款凭证
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/voucher/cancel")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String cancelVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, TaxFeedbackResultDTO>(user).run(getTaxPaymentWrapper(user)::cancelVoucher, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开具企业缴税完税证明
|
||||
*
|
||||
* @param param 参数
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/withheldVoucher/get")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getWithheldVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, TaxWithheldVoucherResultDTO>(user).run(getTaxPaymentWrapper(user)::getWithheldVoucher, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步缴款状态
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/voucher/status/sync")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSyncWithholdingFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, TaxWithheldVoucherResultDTO>(user).run(getTaxPaymentWrapper(user)::getSyncWithholdingFeedback, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 应缴税额查询
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/tax/amount")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String queryTaxAmount(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxPaymentQueryParam, TaxAmountFormDTO>(user).run(getTaxPaymentWrapper(user)::queryTaxAmount, param);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 缴款类型
|
||||
// *
|
||||
// * @return WeaResult 返回结果
|
||||
// */
|
||||
// @GET
|
||||
// @Path("/pay/type")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String payType(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<TaxPaymentQueryParam, TaxAmountFormDTO>(user).run(getTaxPaymentWrapper(user)::payType, param);
|
||||
// return WeaResult.success(taxPaymentWrapper.payType());
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO;
|
||||
|
|
@ -15,8 +16,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||
* @date: 2022-08-31 13:29:14
|
||||
*/
|
||||
@Slf4j
|
||||
public class TaxPaymentWrapper {
|
||||
private TaxPaymentServiceFactory taxPaymentServiceFactory;
|
||||
public class TaxPaymentWrapper extends Service {
|
||||
private final TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user);
|
||||
|
||||
public TaxFeedbackResultDTO getAgreementFeedback(TaxPaymentQueryParam param) {
|
||||
return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).getFeedback(param);
|
||||
|
|
@ -35,8 +36,7 @@ public class TaxPaymentWrapper {
|
|||
}
|
||||
|
||||
public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) {
|
||||
TaxAmountFormDTO formDTO = taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param);
|
||||
return formDTO;
|
||||
return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param);
|
||||
}
|
||||
|
||||
public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue