195 lines
7.6 KiB
Java
195 lines
7.6 KiB
Java
|
|
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());
|
||
|
|
// }
|
||
|
|
}
|