|
|
|
@ -210,19 +210,23 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* if (couponDetail.getCouponSource().equals(4)) { |
|
|
|
|
if (couponDetail.getCouponSource().equals(4)) { |
|
|
|
|
// 下单请求
|
|
|
|
|
JSONObject jsonObject = HuiLianTongConfig.recharge(highOrder.getOrderNo(), |
|
|
|
|
childOrder.getSaleCount(), |
|
|
|
|
couponDetail.getCouponKey(), |
|
|
|
|
highOrder.getMemPhone()); |
|
|
|
|
System.out.println(jsonObject); |
|
|
|
|
if (!jsonObject.getString("respCode").equals("0000")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); |
|
|
|
|
} |
|
|
|
|
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); |
|
|
|
|
if (!response.getString("respCode").equals("0000")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("msg")); |
|
|
|
|
} |
|
|
|
|
childOrder.setExt2(response.getJSONObject("data").getString("rechargeOrderId")); |
|
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!childOrder.getGiveawayType()) { |
|
|
|
|
// 查看是否需要赠送卡卷
|
|
|
|
@ -300,6 +304,10 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
System.out.println(HuiLianTongUnionCardConfig.resolveResponse("Gbkl57c3fEBg+E3HfPuQ52xYXxRnbPnT1CFoWj0AaUCBA2W/qzLuaUXplapIu/Avzt0AmzA/oCA=\\n")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void updateChildOrder(HighChildOrder highChildOrder) { |
|
|
|
|
highChildOrderMapper.updateByPrimaryKey(highChildOrder); |
|
|
|
@ -358,49 +366,7 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
} |
|
|
|
|
// 贵州高速
|
|
|
|
|
if (coupon.getCouponSource() == 4) { |
|
|
|
|
// 获取token
|
|
|
|
|
String token = huiLianTongConfig.getToken(); |
|
|
|
|
|
|
|
|
|
Map<String, Object> push = new HashMap<>(); |
|
|
|
|
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, highOrder.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(highOrder.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(highOrder.getMemId()); |
|
|
|
|
highUserCoupon.setCreateTime(new Date()); |
|
|
|
|
highUserCoupon.setQrCodeImg(dataObject.getString("couNo")); |
|
|
|
|
highUserCoupon.setUseEndTime(dataObject.getDate("validEndDate")); |
|
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Map<String,Object> push = new HashMap<>(); |
|
|
|
|
Map<String,Object> push = new HashMap<>(); |
|
|
|
|
push.put("couTypeCode", coupon.getCouponKey()); |
|
|
|
|
push.put("distCouCount", highChildOrder.getSaleCount()); |
|
|
|
|
push.put("userPhone", highUser.getPhone()); |
|
|
|
@ -408,6 +374,17 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
// 推送给高速
|
|
|
|
|
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2()); |
|
|
|
|
System.out.println(returnParam); |
|
|
|
|
// 推送记录
|
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
|
highGasOrderPush.setType(OrderPushType.type6.getType()); |
|
|
|
|
highGasOrderPush.setOrderNo(highOrder.getOrderNo()); |
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
|
highGasOrderPush.setCode(returnParam.getString("respCode")); |
|
|
|
|
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); |
|
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
if (returnParam != null && returnParam.getString("respCode").equals("0000")) { |
|
|
|
|
// 解密
|
|
|
|
|
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); |
|
|
|
@ -438,17 +415,7 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
// 推送记录
|
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
|
highGasOrderPush.setType(OrderPushType.type6.getType()); |
|
|
|
|
highGasOrderPush.setOrderNo(highOrder.getOrderNo()); |
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
|
highGasOrderPush.setCode(returnParam.getString("respCode")); |
|
|
|
|
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); |
|
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); |
|
|
|
|
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
|
|
|
|
@ -685,20 +652,18 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
// 贵州中石化
|
|
|
|
|
if (coupon.getCouponSource() == 4) { |
|
|
|
|
// 获取token
|
|
|
|
|
String token = huiLianTongConfig.getToken(); |
|
|
|
|
|
|
|
|
|
Map<String, Object> push = new HashMap<>(); |
|
|
|
|
push.put("token", token); |
|
|
|
|
Map<String,Object> push = new HashMap<>(); |
|
|
|
|
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"); |
|
|
|
|
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2()); |
|
|
|
|
if (returnParam != null && returnParam.getString("respCode").equals("0000")) { |
|
|
|
|
// 解密
|
|
|
|
|
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); |
|
|
|
|
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class); |
|
|
|
|
for (Object data : dataArray) { |
|
|
|
|
JSONObject dataObject = (JSONObject) data; |
|
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
@ -707,11 +672,11 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
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")); |
|
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
@ -994,20 +959,18 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
// 贵州中石化
|
|
|
|
|
if (coupon.getCouponSource() == 4) { |
|
|
|
|
// 获取token
|
|
|
|
|
String token = huiLianTongConfig.getToken(); |
|
|
|
|
|
|
|
|
|
Map<String, Object> push = new HashMap<>(); |
|
|
|
|
push.put("token", token); |
|
|
|
|
Map<String,Object> push = new HashMap<>(); |
|
|
|
|
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"); |
|
|
|
|
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2()); |
|
|
|
|
if (returnParam != null && returnParam.getString("respCode").equals("0000")) { |
|
|
|
|
// 解密
|
|
|
|
|
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); |
|
|
|
|
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class); |
|
|
|
|
for (Object data : dataArray) { |
|
|
|
|
JSONObject dataObject = (JSONObject) data; |
|
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
@ -1016,11 +979,11 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
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")); |
|
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
|