调整订单模块
This commit is contained in:
parent
9a289e2f9e
commit
befeb07fac
@ -8,16 +8,20 @@ pay:
|
|||||||
vendorSn: "vendorSn"
|
vendorSn: "vendorSn"
|
||||||
vendorKey: "vendorKey"
|
vendorKey: "vendorKey"
|
||||||
alipay:
|
alipay:
|
||||||
enabled: false
|
enabled: true
|
||||||
appId: appId
|
# 应用id
|
||||||
appPrivateKey: appPrivateKey #classpath:pay/alipay/alipay_private_key.pem
|
appId: appid
|
||||||
alipayPublicKey: alipayPublicKey #classpath:pay/alipay/alipay_public_key.pem
|
# 应用私钥
|
||||||
notifyUrl: http://www.sdaizy.com/prod-api/alipay/notify
|
appPrivateKey: classpath:pay/alipay/alipay_private_key.pem
|
||||||
|
# 支付宝公钥
|
||||||
|
alipayPublicKey: classpath:pay/alipay/alipay_public_key.pem
|
||||||
|
notifyUrl: http://e2vca6.natappfree.cc/alipay/notify
|
||||||
wechat:
|
wechat:
|
||||||
enabled: false
|
enabled: false
|
||||||
merchantId: merchantId
|
appId: appid
|
||||||
privateKeyPath: privateKeyPath # classpath:pay/wx/apiclient_key.pem
|
|
||||||
merchantSerialNumber: merchantSerialNumber
|
|
||||||
apiV3Key: apiV3Key
|
apiV3Key: apiV3Key
|
||||||
appId: appId
|
privateKeyPath: classpath:pay/wx/apiclient_key.pem
|
||||||
notifyUrl: http://g5vdrz.natappfree.cc/wxPay/notify
|
merchantId: merchantId
|
||||||
|
merchantSerialNumber: merchantSerialNumber
|
||||||
|
# 回调地址,此处使用的内网穿透http://e2vca6.natappfree.cc
|
||||||
|
notifyUrl: http://e2vca6.natappfree.cc/pay/wechat/notify
|
||||||
|
@ -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.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
@ -12,7 +12,7 @@ import com.aliyun.teaopenapi.models.Config;
|
|||||||
import com.aliyun.teautil.Common;
|
import com.aliyun.teautil.Common;
|
||||||
import com.aliyun.teautil.models.RuntimeOptions;
|
import com.aliyun.teautil.models.RuntimeOptions;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
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;
|
import com.ruoyi.tfa.phone.enums.DySmsTemplate;
|
||||||
|
|
||||||
public class DySmsUtil {
|
public class DySmsUtil {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<result property="orderMessage" column="order_message" />
|
<result property="orderMessage" column="order_message" />
|
||||||
</resultMap>
|
</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>
|
order_content, order_remark, order_message from pay_order </sql>
|
||||||
|
|
||||||
<select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
|
<select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
|
||||||
|
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.pay.domain.PayOrder;
|
import com.ruoyi.pay.domain.PayOrder;
|
||||||
import com.ruoyi.pay.service.IPayOrderService;
|
import com.ruoyi.pay.service.IPayOrderService;
|
||||||
import com.ruoyi.pay.wx.config.WxPayConfig;
|
import com.ruoyi.pay.wx.config.WxPayConfig;
|
||||||
@ -60,14 +61,11 @@ public class WxPayController extends BaseController {
|
|||||||
@Parameter(name = "orderNumber", description = "订单号", required = true)
|
@Parameter(name = "orderNumber", description = "订单号", required = true)
|
||||||
})
|
})
|
||||||
@GetMapping("/url/{orderNumber}")
|
@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);
|
PayOrder aliPay = payOrderService.selectPayOrderByOrderNumber(orderNumber);
|
||||||
String amountStr = aliPay.getActualAmount();
|
|
||||||
double amountDouble = Double.parseDouble(amountStr);
|
|
||||||
int totalAmountInt = (int) (amountDouble * 100);
|
|
||||||
PrepayRequest request = new PrepayRequest();
|
PrepayRequest request = new PrepayRequest();
|
||||||
Amount amount = new Amount();
|
Amount amount = new Amount();
|
||||||
amount.setTotal(totalAmountInt);
|
amount.setTotal(Integer.parseInt(aliPay.getActualAmount()));
|
||||||
request.setAmount(amount);
|
request.setAmount(amount);
|
||||||
request.setAppid(wxPayAppConfig.getAppId());
|
request.setAppid(wxPayAppConfig.getAppId());
|
||||||
request.setMchid(wxPayAppConfig.getWxchantId());
|
request.setMchid(wxPayAppConfig.getWxchantId());
|
||||||
@ -75,7 +73,7 @@ public class WxPayController extends BaseController {
|
|||||||
request.setNotifyUrl(wxPayAppConfig.getNotifyUrl());
|
request.setNotifyUrl(wxPayAppConfig.getNotifyUrl());
|
||||||
request.setOutTradeNo(aliPay.getOrderNumber());
|
request.setOutTradeNo(aliPay.getOrderNumber());
|
||||||
PrepayResponse response = nativePayService.prepay(request);
|
PrepayResponse response = nativePayService.prepay(request);
|
||||||
return success(response.getCodeUrl());
|
return R.ok(response.getCodeUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Anonymous
|
@Anonymous
|
||||||
|
Loading…
Reference in New Issue
Block a user