调整订单模块

This commit is contained in:
Dftre 2024-06-11 01:08:58 +08:00
parent 9a289e2f9e
commit befeb07fac
5 changed files with 21 additions and 19 deletions

View File

@ -8,16 +8,20 @@ pay:
vendorSn: "vendorSn"
vendorKey: "vendorKey"
alipay:
enabled: false
appId: appId
appPrivateKey: appPrivateKey #classpath:pay/alipay/alipay_private_key.pem
alipayPublicKey: alipayPublicKey #classpath:pay/alipay/alipay_public_key.pem
notifyUrl: http://www.sdaizy.com/prod-api/alipay/notify
enabled: true
# 应用id
appId: appid
# 应用私钥
appPrivateKey: classpath:pay/alipay/alipay_private_key.pem
# 支付宝公钥
alipayPublicKey: classpath:pay/alipay/alipay_public_key.pem
notifyUrl: http://e2vca6.natappfree.cc/alipay/notify
wechat:
enabled: false
merchantId: merchantId
privateKeyPath: privateKeyPath # classpath:pay/wx/apiclient_key.pem
merchantSerialNumber: merchantSerialNumber
appId: appid
apiV3Key: apiV3Key
appId: appId
notifyUrl: http://g5vdrz.natappfree.cc/wxPay/notify
privateKeyPath: classpath:pay/wx/apiclient_key.pem
merchantId: merchantId
merchantSerialNumber: merchantSerialNumber
# 回调地址此处使用的内网穿透http://e2vca6.natappfree.cc
notifyUrl: http://e2vca6.natappfree.cc/pay/wechat/notify

View File

@ -1,4 +1,4 @@
package com.ruoyi.tfa.phone.constant;
package com.ruoyi.tfa.phone.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

View File

@ -12,7 +12,7 @@ import com.aliyun.teaopenapi.models.Config;
import com.aliyun.teautil.Common;
import com.aliyun.teautil.models.RuntimeOptions;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.tfa.phone.constant.DySmsConfig;
import com.ruoyi.tfa.phone.config.DySmsConfig;
import com.ruoyi.tfa.phone.enums.DySmsTemplate;
public class DySmsUtil {

View File

@ -14,7 +14,7 @@
<result property="orderMessage" column="order_message" />
</resultMap>
<sql id="selectPayOrderVo"> select order_id, user_id, order_number, order_status, total_amount,
<sql id="selectPayOrderVo"> select order_id, user_id, order_number, order_status, total_amount,actual_amount,
order_content, order_remark, order_message from pay_order </sql>
<select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">

View File

@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.pay.domain.PayOrder;
import com.ruoyi.pay.service.IPayOrderService;
import com.ruoyi.pay.wx.config.WxPayConfig;
@ -60,14 +61,11 @@ public class WxPayController extends BaseController {
@Parameter(name = "orderNumber", description = "订单号", required = true)
})
@GetMapping("/url/{orderNumber}")
public AjaxResult url(@PathVariable(name = "orderNumber") String orderNumber) throws Exception {
public R<String> url(@PathVariable(name = "orderNumber") String orderNumber) throws Exception {
PayOrder aliPay = payOrderService.selectPayOrderByOrderNumber(orderNumber);
String amountStr = aliPay.getActualAmount();
double amountDouble = Double.parseDouble(amountStr);
int totalAmountInt = (int) (amountDouble * 100);
PrepayRequest request = new PrepayRequest();
Amount amount = new Amount();
amount.setTotal(totalAmountInt);
amount.setTotal(Integer.parseInt(aliPay.getActualAmount()));
request.setAmount(amount);
request.setAppid(wxPayAppConfig.getAppId());
request.setMchid(wxPayAppConfig.getWxchantId());
@ -75,7 +73,7 @@ public class WxPayController extends BaseController {
request.setNotifyUrl(wxPayAppConfig.getNotifyUrl());
request.setOutTradeNo(aliPay.getOrderNumber());
PrepayResponse response = nativePayService.prepay(request);
return success(response.getCodeUrl());
return R.ok(response.getCodeUrl());
}
@Anonymous