|
|
@ -207,6 +207,20 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (couponDetail.getCouponSource().equals(4)) { |
|
|
|
|
|
|
|
// 下单请求
|
|
|
|
|
|
|
|
JSONObject jsonObject = HuiLianTongConfig.recharge(highOrder.getOrderNo(), |
|
|
|
|
|
|
|
childOrder.getSaleCount(), |
|
|
|
|
|
|
|
couponDetail.getCouponKey(), |
|
|
|
|
|
|
|
highOrder.getMemPhone()); |
|
|
|
|
|
|
|
if (!jsonObject.getString("respCode").equals("0000")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); |
|
|
|
|
|
|
|
childOrder.setExt2(response.getJSONObject("data").getString("rechargeOrderId")); |
|
|
|
|
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!childOrder.getGiveawayType()) { |
|
|
|
if (!childOrder.getGiveawayType()) { |
|
|
|
// 查看是否需要赠送卡卷
|
|
|
|
// 查看是否需要赠送卡卷
|
|
|
|
List<HighCouponHandselModel> handselListByCoupon = highCouponHandselService.getHandselListByCoupon(childOrder.getGoodsId()); |
|
|
|
List<HighCouponHandselModel> handselListByCoupon = highCouponHandselService.getHandselListByCoupon(childOrder.getGoodsId()); |
|
|
@ -313,20 +327,18 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
// 贵州高速
|
|
|
|
// 贵州高速
|
|
|
|
if (coupon.getCouponSource() == 4) { |
|
|
|
if (coupon.getCouponSource() == 4) { |
|
|
|
// 获取token
|
|
|
|
Map<String,Object> push = new HashMap<>(); |
|
|
|
String token = huiLianTongConfig.getToken(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> push = new HashMap<>(); |
|
|
|
|
|
|
|
push.put("token", token); |
|
|
|
|
|
|
|
push.put("couTypeCode", coupon.getCouponKey()); |
|
|
|
push.put("couTypeCode", coupon.getCouponKey()); |
|
|
|
push.put("distCouCount", highChildOrder.getSaleCount()); |
|
|
|
push.put("distCouCount", highChildOrder.getSaleCount()); |
|
|
|
push.put("userPhone", highUser.getPhone()); |
|
|
|
push.put("userPhone", highUser.getPhone()); |
|
|
|
push.put("thirdUserId", highUser.getUnionId()); |
|
|
|
push.put("thirdUserId", highUser.getUnionId()); |
|
|
|
|
|
|
|
|
|
|
|
// 推送给高速
|
|
|
|
// 推送给高速
|
|
|
|
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, highOrder.getOrderNo(), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); |
|
|
|
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2()); |
|
|
|
if (returnParam != null && returnParam.getString("result").equals("success")) { |
|
|
|
if (returnParam != null && returnParam.getString("respCode").equals("0000")) { |
|
|
|
JSONArray dataArray = returnParam.getJSONArray("data"); |
|
|
|
// 解密
|
|
|
|
|
|
|
|
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); |
|
|
|
|
|
|
|
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class); |
|
|
|
for (Object data : dataArray) { |
|
|
|
for (Object data : dataArray) { |
|
|
|
JSONObject dataObject = (JSONObject) data; |
|
|
|
JSONObject dataObject = (JSONObject) data; |
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
@ -354,12 +366,13 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 推送记录
|
|
|
|
// 推送记录
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
highGasOrderPush.setType(OrderPushType.type6.getType()); |
|
|
|
highGasOrderPush.setType(OrderPushType.type6.getType()); |
|
|
|
highGasOrderPush.setOrderNo(highOrder.getOrderNo()); |
|
|
|
highGasOrderPush.setOrderNo(highOrder.getOrderNo()); |
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
highGasOrderPush.setCode(returnParam.getString("result")); |
|
|
|
highGasOrderPush.setCode(returnParam.getString("respCode")); |
|
|
|
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); |
|
|
|
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|