From 79222cab935a34eacb531a51e4e6d4192cb6bed3 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 7 Feb 2023 16:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/OrderPayController.java | 27 ++++++++++++++++--- .../java/com/hai/config/WxOrderConfig.java | 2 +- .../service/impl/OrderRefundServiceImpl.java | 4 +-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/hai-order/src/main/java/com/web/controller/OrderPayController.java b/hai-order/src/main/java/com/web/controller/OrderPayController.java index e3a4ed45..97c315b7 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayController.java @@ -144,10 +144,24 @@ public class OrderPayController { orderTitle = productType.getName(); } - if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE5.getNumber())) { + if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE1.getNumber())) { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); + + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE2.getNumber())) { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); + + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE3.getNumber())) { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); + + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE4.getNumber())) { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); + + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE5.getNumber())) { HighCoupon coupon = couponService.getCouponById(order.getHighChildOrderList().get(0).getGoodsId()); if (coupon.getCouponSource() != null && coupon.getCouponSource().equals(4)) { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1634835264); + } else { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); } } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE6.getNumber())) { @@ -226,8 +240,15 @@ public class OrderPayController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!"); } + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE7.getNumber())) { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE8.getNumber())) { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1619676214); + + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE9.getNumber())) { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); + } else { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1609882817); } @@ -469,10 +490,10 @@ public class OrderPayController { // 支付前业务校验 orderPayBeforeService.payOrderCheck(order); - order.setAccountMerchantNum(UnionPayConfig.MER_ID3); + order.setAccountMerchantNum(UnionPayConfig.MER_ID2); order.setProfitSharingStatus(false); orderService.updateOrderData(order); - return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPayPrice(), "购买商品", SysConst.getSysConfig().getUnionPayNotifyUrl(), request)); + return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPayPrice(), "购买商品", SysConst.getSysConfig().getUnionPayNotifyUrl(), request)); } catch (Exception e) { log.error("orderToPay error!", e); diff --git a/hai-service/src/main/java/com/hai/config/WxOrderConfig.java b/hai-service/src/main/java/com/hai/config/WxOrderConfig.java index 86c6e371..bd73797e 100644 --- a/hai-service/src/main/java/com/hai/config/WxOrderConfig.java +++ b/hai-service/src/main/java/com/hai/config/WxOrderConfig.java @@ -52,7 +52,7 @@ public class WxOrderConfig { /** * 微信支付商户号 - * 重庆惠兑电子商务有限公司 + * 惠兑礼品 (重庆) 有限公司 */ public static final String MCH_ID_1614670195 = "1614670195"; diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java index 4527bfa1..f6fd8dcd 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java @@ -186,7 +186,7 @@ public class OrderRefundServiceImpl implements OrderRefundService { // 订单是否处于当日的订单 if (!DateUtil.isEffectiveDate(order.getPayTime(), startTime.getTime(), endTime.getTime())) { // 订单撤销 - JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPaySerialNo()); + JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo()); System.out.println(refund.toJSONString()); if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg")); @@ -194,7 +194,7 @@ public class OrderRefundServiceImpl implements OrderRefundService { refundPriceModel.setRefundSuccess(true); } else { // 订单退款 - JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue()); + JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue()); System.out.println(refund.toJSONString()); if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg"));