提交代码

dev-discount
胡锐 2 years ago
parent a2fb1d474c
commit 79222cab93
  1. 27
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  2. 2
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java
  3. 4
      hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.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);

@ -52,7 +52,7 @@ public class WxOrderConfig {
/**
* 微信支付商户号
* 重庆惠兑电子商务有限公司
* 惠兑礼品 (重庆) 有限公司
*/
public static final String MCH_ID_1614670195 = "1614670195";

@ -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"));

Loading…
Cancel
Save