diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/QzOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/QzOrderController.java index 5c4055b6..b7cca1e8 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/QzOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/QzOrderController.java @@ -39,7 +39,7 @@ public class QzOrderController { @RequestMapping(value = "/orderNotify", method = RequestMethod.POST) @ApiOperation(value = "千猪订单回调") - public void orderPaymentNotify(@RequestBody String reqBodyStr,HttpServletRequest request, HttpServletResponse response) { + public void orderNotify(@RequestBody String reqBodyStr,HttpServletRequest request, HttpServletResponse response) { try { log.info(reqBodyStr); JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class); diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index f0ce001c..0df74b90 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -18,6 +18,7 @@ public class CommonSysConfig { private String qinzhuUrl; private String qinzhuPlatformId; private String qinzhuSecret; + private String qianzhuOrderNotify; private String wx_cert; @@ -26,6 +27,14 @@ public class CommonSysConfig { private String telMemberId; private String telUrl; + public String getQianzhuOrderNotify() { + return qianzhuOrderNotify; + } + + public void setQianzhuOrderNotify(String qianzhuOrderNotify) { + this.qianzhuOrderNotify = qianzhuOrderNotify; + } + public String getTuanYouUrl() { return tuanYouUrl; } diff --git a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java index 588303d0..95f2f91e 100644 --- a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java +++ b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java @@ -69,7 +69,7 @@ public class QianZhuConfig { Map map = new HashMap<>(); map.put("platformId", CommonSysConst.getSysConfig().getQinzhuPlatformId()); map.put("timestamp", new Date().getTime()); - map.put("notifyUrl", ""); + map.put("notifyUrl", CommonSysConst.getSysConfig().getQianzhuOrderNotify()); map.put("orderNo", orderNo); map.put("sign", MD5Util.encode(generateSignature(map,CommonSysConst.getSysConfig().getQinzhuSecret()).getBytes()).toLowerCase()); return HttpsUtils.doPost(CommonSysConst.getSysConfig().getQinzhuUrl()+"/openApi/v1/orders/payKfcOrder", JSONObject.toJSONString(map)); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/CinemaOrderService.java b/hai-service/src/main/java/com/hai/service/pay/impl/CinemaOrderService.java index e6e7ba9d..82b85983 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/CinemaOrderService.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/CinemaOrderService.java @@ -26,7 +26,7 @@ public class CinemaOrderService implements PayService { } if (payType.equals("WechatPay")) { HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no")); - if (order != null && order.getOrderStatus() != 1) { + if (order != null && order.getOrderStatus() == 1) { order.setPaySerialNo(map.get("transaction_id")); // 支付流水号 order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额 order.setPayTime(new Date()); // 支付时间 diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/KfcOrderService.java b/hai-service/src/main/java/com/hai/service/pay/impl/KfcOrderService.java index a57dda5e..9ece365c 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/KfcOrderService.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/KfcOrderService.java @@ -27,7 +27,7 @@ public class KfcOrderService implements PayService { } if (payType.equals("WechatPay")) { HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no")); - if (order != null && order.getOrderStatus() != 1) { + if (order != null && order.getOrderStatus() == 1) { order.setPaySerialNo(map.get("transaction_id")); // 支付流水号 order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额 order.setPayTime(new Date()); // 支付时间 diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index acc3c40f..e874c3ea 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -7,6 +7,7 @@ tuanYouGasolineAccount=9b115e5g4400 qinzhuUrl=https://live-test.qianzhu8.com qinzhuPlatformId=10376 qinzhuSecret=ktxb49sh2jfhgn8g +qianzhuOrderNotify=https://hsgcs.dctpay.com/crest/qianzhu/orderNotify wx_cert=/home/project/wx_cert/ diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index 9369b963..63ab75ad 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -7,6 +7,7 @@ tuanYouGasolineAccount=9b115e5g4400 qinzhuUrl=https://live-test.qianzhu8.com/ qinzhuPlatformId=10376 qinzhuSecret=ktxb49sh2jfhgn8g +qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify wx_cert=/home/project/wx_cert/