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 ae40a5c8..ddd76c8c 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayController.java @@ -451,6 +451,9 @@ public class OrderPayController { // 支付前业务校验 orderPayBeforeService.payOrderCheck(order); + order.setAccountMerchantNum(UnionPayConfig.MER_ID3); + 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)); } catch (Exception e) { 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 d5a06170..eaa3cc07 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 @@ -184,11 +184,11 @@ public class OrderRefundServiceImpl implements OrderRefundService { startTime.set(Calendar.SECOND, 59); // 订单是否处于当日的订单 - if (DateUtil.isEffectiveDate(order.getPayTime(), startTime.getTime(), endTime.getTime())) { + if (!DateUtil.isEffectiveDate(order.getPayTime(), startTime.getTime(), endTime.getTime())) { // 订单撤销 JSONObject refund = UnionPayConfig.cancel(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, order.getOrderNo(), order.getPaySerialNo()); System.out.println(refund.toJSONString()); - if (!refund.getString("resultcode").equals("00") || !refund.getString("resultcode").equals("W6")) { + if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg")); } refundPriceModel.setRefundSuccess(true); @@ -196,11 +196,8 @@ public class OrderRefundServiceImpl implements OrderRefundService { // 订单退款 JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, 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")) { - JSONObject refund2 = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID1, UnionPayConfig.TERM_ID1, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue()); - if (!refund2.getString("resultcode").equals("00") || !refund.getString("resultcode").equals("W6")) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund2.getString("returnmsg")); - } + if (!refund.getString("resultcode").equals("00") && !refund.getString("resultcode").equals("W6")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refund.getString("returnmsg")); } refundPriceModel.setRefundSuccess(true); } diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index a923cedb..f4d0140c 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -62,7 +62,6 @@ unionPayChannelid=D01X00000801226 unionPayMerid=83169055983W000 unionPayTermid=XS000103 unionPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0 -unionPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notify unionPayTelNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notifyTel unionStagingPayUrl=https://mtest.eycard.cn/