提交代码

dev-discount
胡锐 3 years ago
parent be6beb508d
commit c1c56a6297
  1. 72
      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<String,Object> 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 {

Loading…
Cancel
Save