|
@@ -34,15 +34,12 @@ import shop.alien.util.common.constant.PaymentEnum;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.io.UncheckedIOException;
|
|
import java.io.UncheckedIOException;
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.security.PrivateKey;
|
|
import java.security.PrivateKey;
|
|
|
import java.security.PublicKey;
|
|
import java.security.PublicKey;
|
|
|
import java.security.Signature;
|
|
import java.security.Signature;
|
|
|
-import java.util.Base64;
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -158,7 +155,7 @@ public class WeChatPaymentMininProgramStrategyImpl implements PaymentStrategy {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public R createPrePayOrder(String price, String subject, String payer, String orderNo, Integer storeId, Integer couponId, Integer payerId) throws Exception {
|
|
|
|
|
|
|
+ public R createPrePayOrder(String price, String subject, String payer, String orderNo, Integer storeId, Integer couponId, Integer payerId,String tablewareFee,String discountAmount,String payAmount) throws Exception {
|
|
|
// 本系统调用:通过 storeId 从 MySQL 获取店铺支付配置
|
|
// 本系统调用:通过 storeId 从 MySQL 获取店铺支付配置
|
|
|
if (storeId == null) {
|
|
if (storeId == null) {
|
|
|
log.warn("createPrePayOrder 缺少 storeId,无法获取支付配置");
|
|
log.warn("createPrePayOrder 缺少 storeId,无法获取支付配置");
|
|
@@ -223,6 +220,9 @@ public class WeChatPaymentMininProgramStrategyImpl implements PaymentStrategy {
|
|
|
log.info("未支付场景已换新微信商户单号 orderNo={}, payTradeNo={}", orderNo, newPayTradeNo);
|
|
log.info("未支付场景已换新微信商户单号 orderNo={}, payTradeNo={}", orderNo, newPayTradeNo);
|
|
|
storeOrder.setCouponId(couponId);
|
|
storeOrder.setCouponId(couponId);
|
|
|
storeOrder.setPayUserId(payerId);
|
|
storeOrder.setPayUserId(payerId);
|
|
|
|
|
+ storeOrder.setTablewareFee(new BigDecimal(tablewareFee));
|
|
|
|
|
+ storeOrder.setDiscountAmount(new BigDecimal(discountAmount));
|
|
|
|
|
+ storeOrder.setPayAmount(new BigDecimal(payAmount));
|
|
|
if (!storeOrderService.updateById(storeOrder)) {
|
|
if (!storeOrderService.updateById(storeOrder)) {
|
|
|
log.error("更新订单失败 orderNo={}", orderNo);
|
|
log.error("更新订单失败 orderNo={}", orderNo);
|
|
|
return R.fail("更新订单失败");
|
|
return R.fail("更新订单失败");
|
|
@@ -346,6 +346,8 @@ public class WeChatPaymentMininProgramStrategyImpl implements PaymentStrategy {
|
|
|
if (storeOrder != null && storeOrder.getPayStatus() != 1) {
|
|
if (storeOrder != null && storeOrder.getPayStatus() != 1) {
|
|
|
storeOrder.setPayStatus(1);
|
|
storeOrder.setPayStatus(1);
|
|
|
storeOrder.setOrderStatus(1);
|
|
storeOrder.setOrderStatus(1);
|
|
|
|
|
+ storeOrder.setPayType(1);
|
|
|
|
|
+ storeOrder.setPayTime(new Date());
|
|
|
if (storeOrderService.updateById(storeOrder)) {
|
|
if (storeOrderService.updateById(storeOrder)) {
|
|
|
log.info("小程序更新订单成功,订单号outTradeNo:{}", outTradeNo);
|
|
log.info("小程序更新订单成功,订单号outTradeNo:{}", outTradeNo);
|
|
|
if (storeOrder.getCouponId() != null && storeOrder.getPayUserId() != null) {
|
|
if (storeOrder.getCouponId() != null && storeOrder.getPayUserId() != null) {
|