From cb8d24c9272735cfa690e437dc498e3808de09fa Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 18 Aug 2022 13:51:00 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=9D=E8=B4=B9?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hai/service/impl/HighOrderServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 18972eb0..5df36e92 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -2289,8 +2289,7 @@ public class HighOrderServiceImpl implements HighOrderService { } // 下单 -// jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile")); - jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), "50562", List.toString().replace(" ", ""), object.getString("customerMobile")); + jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile")); // 判断下单是否成功 if (!Objects.equals(jsonObject.getString("code"), "200")) { From 21b578307c378830b3676a3779b62a209244d6d0 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 18 Aug 2022 13:51:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=9D=E8=B4=B9?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hai/service/impl/HighOrderServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 18972eb0..5df36e92 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -2289,8 +2289,7 @@ public class HighOrderServiceImpl implements HighOrderService { } // 下单 -// jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile")); - jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), "50562", List.toString().replace(" ", ""), object.getString("customerMobile")); + jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile")); // 判断下单是否成功 if (!Objects.equals(jsonObject.getString("code"), "200")) { From caa49e84736ce10de3c864fcd9d8754da75095e9 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 19 Aug 2022 13:53:29 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cweb/controller/HighOrderController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index b4c561fc..b9c1518a 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -461,8 +461,13 @@ public class HighOrderController { if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) { SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId"))); - BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); - highOrder.setCompanyId(bsCompany.getId()); + if (region != null) { + BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); + if (bsCompany != null) { + highOrder.setCompanyId(bsCompany.getId()); + } + } + } highOrder.setMerchId(request.getHeader("mchId")); From 4d343225d4f1cc0ba7a5ca659cd15d242931bd59 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 19 Aug 2022 14:09:08 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/cweb/controller/HighOrderController.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index b9c1518a..b8ea8365 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -457,8 +457,6 @@ public class HighOrderController { } } - - if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) { SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId"))); if (region != null) { @@ -467,7 +465,6 @@ public class HighOrderController { highOrder.setCompanyId(bsCompany.getId()); } } - } highOrder.setMerchId(request.getHeader("mchId")); From ed3b99794831e7ea03fb8072a86d2a3e10f87ccd Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 22 Aug 2022 09:29:13 +0800 Subject: [PATCH 5/5] =?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 --- .../hai/config/HuiLianTongUnionCardConfig.java | 6 ++++++ .../impl/HighCouponAgentServiceImpl.java | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java index 6809bf10..6d25dce9 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java @@ -296,6 +296,12 @@ public class HuiLianTongUnionCardConfig { return request("fuelCoupons/syncPayOrder", map); } + public static void main(String[] args) { + String data = "Gbkl57c3fEBg+E3HfPuQ55SDLVyAf2Ys3VN1cifAfXIoT1gnbFR0NaiH/z1OIZZiuqlFwDLLu6mt\\nuTcVJuO1hhr5QW09U1uIfz1mQwCBwvx4/PKxXQ7rR7/rnbvnsMxRupCMjc1vBdq902CiXq8RZVEq\\n8LrnkFZ9R+9IokVEc5nGG7XvKCmikEH80xtkvw0EwuPl1mEGp92uUbpxTahhwy5M9SAnIBZIjN5D\\nxi3F4tZ0kOhiuNNTO/CECE9sWZfO".replace("\\n", ""); + String decodeData = DesUtil.decode("F8E91A3C", data, Charset.forName("UTF-8")); + JSONObject.parseObject(decodeData); + + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java index 88749f0b..37e49106 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java @@ -606,15 +606,31 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { couponAgent.setSalesCount(couponAgent.getSalesCount() + 1); highCouponAgentRelMapper.updateByPrimaryKey(couponAgent); - // 下单请求 + // 第一次,下单请求 JSONObject rechargeObject = HuiLianTongConfig.recharge(convertCode.getConvertCode(), 1, coupon.getCouponKey(), phone); + + System.out.println("第一次下单" + rechargeObject.toJSONString()); if (!rechargeObject.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); } JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data")); + if (response == null || response.getJSONObject("data") == null) { + // 第二次,下单请求 + // 重新生成兑换码 + convertCode.setConvertCode(generateConvertCode(couponAgent.getId())); + rechargeObject = HuiLianTongConfig.recharge(convertCode.getConvertCode(), + 1, + coupon.getCouponKey(), + phone); + System.out.println("第二次下单" + rechargeObject.toJSONString()); + response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data")); + if (response == null || response.getJSONObject("data") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); + } + } convertCode.setExt1(response.getJSONObject("data").getString("rechargeOrderId")); highCouponAgentCodeMapper.updateByPrimaryKey(convertCode);