From c1c56a629779637ea592abac5468f423472cc329 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 4 Aug 2022 09:11:41 +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 --- .../pay/impl/GoodsOrderServiceImpl.java | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index 879f3c52..fc7e060f 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -186,55 +186,55 @@ public class GoodsOrderServiceImpl implements PayService { // 贵州中石化 if (coupon.getCouponSource() == 4) { // 获取token -// String token = huiLianTongConfig.getToken(); + String token = huiLianTongConfig.getToken(); Map push = new HashMap<>(); -// push.put("token", token); + push.put("token", token); push.put("couTypeCode", coupon.getCouponKey()); push.put("distCouCount", highChildOrder.getSaleCount()); push.put("userPhone", highUser.getPhone()); push.put("thirdUserId", highUser.getUnionId()); -// // 推送给高速 -// JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(),coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); -// if (returnParam != null && returnParam.getString("result").equals("success")) { -// JSONArray dataArray = returnParam.getJSONArray("data"); -// for (Object data : dataArray) { -// JSONObject dataObject = (JSONObject) data; -// HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); -// couponCodeOther.setType(1); -// couponCodeOther.setOrderId(order.getId()); -// couponCodeOther.setChildOrderId(highChildOrder.getId()); -// couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); -// couponCodeOther.setCouNo(dataObject.getString("couNo")); -// couponCodeOther.setStatus(20); -// couponCodeOther.setCreateTime(new Date()); -// couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); -// couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); -// couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); -// highCouponCodeOtherMapper.insert(couponCodeOther); -// -// // 卡卷关联用户 -// HighUserCoupon highUserCoupon = new HighUserCoupon(); -// highUserCoupon.setMerchantId(coupon.getMerchantId()); -// highUserCoupon.setCouponId(coupon.getId()); -// highUserCoupon.setUserId(order.getMemId()); -// highUserCoupon.setCreateTime(new Date()); -// highUserCoupon.setQrCodeImg(dataObject.getString("couNo")); -// highUserCoupon.setUseEndTime(dataObject.getDate("validEndDate")); -// highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 -// highUserCouponMapper.insert(highUserCoupon); -// } -// } + // 推送给高速 + JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(),coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); + if (returnParam != null && returnParam.getString("result").equals("success")) { + JSONArray dataArray = returnParam.getJSONArray("data"); + for (Object data : dataArray) { + JSONObject dataObject = (JSONObject) data; + HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); + couponCodeOther.setType(1); + couponCodeOther.setOrderId(order.getId()); + couponCodeOther.setChildOrderId(highChildOrder.getId()); + couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); + couponCodeOther.setCouNo(dataObject.getString("couNo")); + couponCodeOther.setStatus(20); + couponCodeOther.setCreateTime(new Date()); + couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); + couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); + couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); + highCouponCodeOtherMapper.insert(couponCodeOther); + + // 卡卷关联用户 + HighUserCoupon highUserCoupon = new HighUserCoupon(); + highUserCoupon.setMerchantId(coupon.getMerchantId()); + highUserCoupon.setCouponId(coupon.getId()); + highUserCoupon.setUserId(order.getMemId()); + highUserCoupon.setCreateTime(new Date()); + highUserCoupon.setQrCodeImg(dataObject.getString("couNo")); + highUserCoupon.setUseEndTime(dataObject.getDate("validEndDate")); + highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 + highUserCouponMapper.insert(highUserCoupon); + } + } // 推送记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); highGasOrderPush.setType(OrderPushType.type6.getType()); highGasOrderPush.setOrderNo(order.getOrderNo()); highGasOrderPush.setCreateTime(new Date()); -// highGasOrderPush.setCode(returnParam.getString("result")); -// highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); -// highGasOrderPush.setReturnContent(returnParam.toJSONString()); + highGasOrderPush.setCode(returnParam.getString("result")); + highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); + highGasOrderPush.setReturnContent(returnParam.toJSONString()); highGasOrderPushMapper.insert(highGasOrderPush); } else {