fix: 修改相关提成单位
parent
0e26bdbf4b
commit
9bef9b0cc3
|
@ -4,9 +4,12 @@ import cn.hutool.json.JSONUtil;
|
||||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||||
import cn.iocoder.yudao.framework.pay.config.WxPayOneAutoConfiguration;
|
import cn.iocoder.yudao.framework.pay.config.WxPayOneAutoConfiguration;
|
||||||
import cn.iocoder.yudao.framework.pay.properties.WxPayProperties;
|
import cn.iocoder.yudao.framework.pay.properties.WxPayProperties;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse;
|
import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse;
|
||||||
import cn.iocoder.yudao.module.shop.utils.OrderUtil;
|
import cn.iocoder.yudao.module.shop.utils.OrderUtil;
|
||||||
|
import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
|
||||||
import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request;
|
import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request;
|
||||||
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request;
|
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request;
|
||||||
import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result;
|
import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result;
|
||||||
|
@ -36,16 +39,20 @@ public class WxPayStrategy implements IPayStrategy{
|
||||||
private WxPayOneAutoConfiguration wxPayOneAutoConfiguration;
|
private WxPayOneAutoConfiguration wxPayOneAutoConfiguration;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WxPayProperties payProperties;
|
private WxPayProperties payProperties;
|
||||||
|
@Autowired
|
||||||
|
private TenantApi tenantApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest,String openid) {
|
public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest,String openid) {
|
||||||
|
Long requiredTenantId = TenantContextHolder.getRequiredTenantId();
|
||||||
|
TenantDTO tenant = tenantApi.getTenant(requiredTenantId);
|
||||||
InitOrderResponse response = new InitOrderResponse();
|
InitOrderResponse response = new InitOrderResponse();
|
||||||
WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService();
|
WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService();
|
||||||
Assert.notNull(wxPayService, "获取微信支付配置失败!");
|
Assert.notNull(wxPayService, "获取微信支付配置失败!");
|
||||||
WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request();
|
WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request();
|
||||||
int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue();
|
int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue();
|
||||||
wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum));
|
wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum));
|
||||||
wxPayRequest.setDescription("会员充值");
|
wxPayRequest.setDescription(tenant.getName());
|
||||||
wxPayRequest.setOutTradeNo(orderDO.getOrderId());
|
wxPayRequest.setOutTradeNo(orderDO.getOrderId());
|
||||||
wxPayRequest.setNotifyUrl(payProperties.getNotifyUrl());
|
wxPayRequest.setNotifyUrl(payProperties.getNotifyUrl());
|
||||||
wxPayRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openid));
|
wxPayRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openid));
|
||||||
|
|
Loading…
Reference in New Issue