|
|
@ -207,19 +207,23 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* if (couponDetail.getCouponSource().equals(4)) { |
|
|
|
if (couponDetail.getCouponSource().equals(4)) { |
|
|
|
// 下单请求
|
|
|
|
// 下单请求
|
|
|
|
JSONObject jsonObject = HuiLianTongConfig.recharge(highOrder.getOrderNo(), |
|
|
|
JSONObject jsonObject = HuiLianTongConfig.recharge(highOrder.getOrderNo(), |
|
|
|
childOrder.getSaleCount(), |
|
|
|
childOrder.getSaleCount(), |
|
|
|
couponDetail.getCouponKey(), |
|
|
|
couponDetail.getCouponKey(), |
|
|
|
highOrder.getMemPhone()); |
|
|
|
highOrder.getMemPhone()); |
|
|
|
|
|
|
|
System.out.println(jsonObject); |
|
|
|
if (!jsonObject.getString("respCode").equals("0000")) { |
|
|
|
if (!jsonObject.getString("respCode").equals("0000")) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); |
|
|
|
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")); |
|
|
|
childOrder.setExt2(response.getJSONObject("data").getString("rechargeOrderId")); |
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
highChildOrderMapper.updateByPrimaryKey(childOrder); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!childOrder.getGiveawayType()) { |
|
|
|
if (!childOrder.getGiveawayType()) { |
|
|
|
// 查看是否需要赠送卡卷
|
|
|
|
// 查看是否需要赠送卡卷
|
|
|
@ -269,6 +273,10 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
System.out.println(HuiLianTongUnionCardConfig.resolveResponse("Gbkl57c3fEBg+E3HfPuQ52xYXxRnbPnT1CFoWj0AaUCBA2W/qzLuaUXplapIu/Avzt0AmzA/oCA=\\n")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateChildOrder(HighChildOrder highChildOrder) { |
|
|
|
public void updateChildOrder(HighChildOrder highChildOrder) { |
|
|
|
highChildOrderMapper.updateByPrimaryKey(highChildOrder); |
|
|
|
highChildOrderMapper.updateByPrimaryKey(highChildOrder); |
|
|
@ -327,49 +335,7 @@ 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("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<>(); |
|
|
|
|
|
|
|
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()); |
|
|
@ -377,6 +343,17 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 推送给高速
|
|
|
|
// 推送给高速
|
|
|
|
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2()); |
|
|
|
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")) { |
|
|
|
if (returnParam != null && returnParam.getString("respCode").equals("0000")) { |
|
|
|
// 解密
|
|
|
|
// 解密
|
|
|
|
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); |
|
|
|
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); |
|
|
@ -407,17 +384,7 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
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 { |
|
|
|
} else { |
|
|
|
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); |
|
|
|
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); |
|
|
|
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
|
|
|
|
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
|
|
|
@ -644,20 +611,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, order.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(); |
|
|
@ -666,11 +631,11 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); |
|
|
|
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); |
|
|
|
couponCodeOther.setCouNo(dataObject.getString("couNo")); |
|
|
|
couponCodeOther.setCouNo(dataObject.getString("couNo")); |
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
|
|
|
|
couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); |
|
|
|
couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); |
|
|
|
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); |
|
|
|
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); |
|
|
|
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); |
|
|
|
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); |
|
|
|
|
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
@ -953,20 +918,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, order.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(); |
|
|
@ -975,11 +938,11 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); |
|
|
|
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); |
|
|
|
couponCodeOther.setCouNo(dataObject.getString("couNo")); |
|
|
|
couponCodeOther.setCouNo(dataObject.getString("couNo")); |
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
|
|
|
|
couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); |
|
|
|
couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); |
|
|
|
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); |
|
|
|
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); |
|
|
|
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); |
|
|
|
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); |
|
|
|
|
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|