|
|
@ -196,7 +196,7 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
if (childOrder.getGoodsType() == 1) { |
|
|
|
if (childOrder.getGoodsType() == 1) { |
|
|
|
// 查询卡券
|
|
|
|
// 查询卡券
|
|
|
|
HighCoupon couponDetail = highCouponService.getCouponDetail(childOrder.getGoodsId()); |
|
|
|
HighCoupon couponDetail = highCouponService.getCouponDetail(childOrder.getGoodsId()); |
|
|
|
if (couponDetail.getCouponSource() != 4) { |
|
|
|
if (couponDetail.getCouponSource() != 4 && couponDetail.getCouponSource() != 5) { |
|
|
|
// 查询待销售
|
|
|
|
// 查询待销售
|
|
|
|
List<HighCouponCode> list = highCouponCodeService.getNoSaleCode(childOrder.getGoodsId()); |
|
|
|
List<HighCouponCode> list = highCouponCodeService.getNoSaleCode(childOrder.getGoodsId()); |
|
|
|
if (list == null || list.size() == 0) { |
|
|
|
if (list == null || list.size() == 0) { |
|
|
@ -459,6 +459,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(orderId); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setUserId(highOrder.getMemId()); |
|
|
|
highUserCoupon.setUserId(highOrder.getMemId()); |
|
|
@ -475,16 +477,32 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 给用户发码
|
|
|
|
// 给用户发码
|
|
|
|
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), highOrder.getOrderNo(), highChildOrder.getSaleCount(), highOrder.getMemPhone()); |
|
|
|
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), highOrder.getOrderNo(), highChildOrder.getSaleCount(), highOrder.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 推送记录
|
|
|
|
|
|
|
|
JSONObject request = new JSONObject(); |
|
|
|
|
|
|
|
request.put("requestCode", coupon.getCouponKey()); |
|
|
|
|
|
|
|
request.put("tradeId", highOrder.getOrderNo()); |
|
|
|
|
|
|
|
request.put("ticketSum", highChildOrder.getSaleCount()); |
|
|
|
|
|
|
|
request.put("phone", highOrder.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
|
|
|
|
highGasOrderPush.setType(OrderPushType.type10.getType()); |
|
|
|
|
|
|
|
highGasOrderPush.setOrderNo(highOrder.getOrderNo()); |
|
|
|
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highGasOrderPush.setRequestContent(request.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPush.setReturnContent(response.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
|
|
JSONObject couponDetail = response.getJSONObject("ticketDetail"); |
|
|
|
JSONObject couponDetail = response.getJSONObject("ticketDetail"); |
|
|
|
JSONArray codeList = response.getJSONArray("codeList"); |
|
|
|
JSONArray codeList = response.getJSONArray("codeList"); |
|
|
|
|
|
|
|
|
|
|
|
for (Object data : codeList) { |
|
|
|
for (Object data : codeList) { |
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
couponCodeOther.setType(1); |
|
|
|
couponCodeOther.setType(2); |
|
|
|
couponCodeOther.setOrderId(highOrder.getId()); |
|
|
|
couponCodeOther.setOrderId(highOrder.getId()); |
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode")); |
|
|
|
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode")); |
|
|
|
couponCodeOther.setCouNo(String.valueOf(data)); |
|
|
|
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data))); |
|
|
|
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd")); |
|
|
|
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd")); |
|
|
@ -496,6 +514,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(orderId); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setUserId(highOrder.getMemId()); |
|
|
|
highUserCoupon.setUserId(highOrder.getMemId()); |
|
|
|
highUserCoupon.setCreateTime(new Date()); |
|
|
|
highUserCoupon.setCreateTime(new Date()); |
|
|
|
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo()); |
|
|
|
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo()); |
|
|
@ -503,6 +523,7 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} 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.预支付
|
|
|
@ -511,6 +532,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(orderId); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setUserId(highOrder.getMemId()); |
|
|
|
highUserCoupon.setUserId(highOrder.getMemId()); |
|
|
@ -764,6 +787,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
@ -785,6 +810,55 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (coupon.getCouponSource() == 5) { |
|
|
|
|
|
|
|
// 给用户发码
|
|
|
|
|
|
|
|
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 推送记录
|
|
|
|
|
|
|
|
JSONObject request = new JSONObject(); |
|
|
|
|
|
|
|
request.put("requestCode", coupon.getCouponKey()); |
|
|
|
|
|
|
|
request.put("tradeId", order.getOrderNo()); |
|
|
|
|
|
|
|
request.put("ticketSum", highChildOrder.getSaleCount()); |
|
|
|
|
|
|
|
request.put("phone", order.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
|
|
|
|
highGasOrderPush.setType(OrderPushType.type10.getType()); |
|
|
|
|
|
|
|
highGasOrderPush.setOrderNo(order.getOrderNo()); |
|
|
|
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highGasOrderPush.setRequestContent(request.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPush.setReturnContent(response.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject couponDetail = response.getJSONObject("ticketDetail"); |
|
|
|
|
|
|
|
JSONArray codeList = response.getJSONArray("codeList"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Object data : codeList) { |
|
|
|
|
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
|
|
|
|
couponCodeOther.setType(2); |
|
|
|
|
|
|
|
couponCodeOther.setOrderId(order.getId()); |
|
|
|
|
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
|
|
|
|
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode")); |
|
|
|
|
|
|
|
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data))); |
|
|
|
|
|
|
|
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
|
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
|
|
|
|
highUserCoupon.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo()); |
|
|
|
|
|
|
|
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate()); |
|
|
|
|
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
|
|
|
|
} |
|
|
|
} 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.预支付
|
|
|
@ -793,6 +867,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
@ -1076,6 +1152,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
@ -1097,6 +1175,55 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (coupon.getCouponSource() == 5) { |
|
|
|
|
|
|
|
// 给用户发码
|
|
|
|
|
|
|
|
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 推送记录
|
|
|
|
|
|
|
|
JSONObject request = new JSONObject(); |
|
|
|
|
|
|
|
request.put("requestCode", coupon.getCouponKey()); |
|
|
|
|
|
|
|
request.put("tradeId", order.getOrderNo()); |
|
|
|
|
|
|
|
request.put("ticketSum", highChildOrder.getSaleCount()); |
|
|
|
|
|
|
|
request.put("phone", order.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
|
|
|
|
highGasOrderPush.setType(OrderPushType.type10.getType()); |
|
|
|
|
|
|
|
highGasOrderPush.setOrderNo(order.getOrderNo()); |
|
|
|
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highGasOrderPush.setRequestContent(request.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPush.setReturnContent(response.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject couponDetail = response.getJSONObject("ticketDetail"); |
|
|
|
|
|
|
|
JSONArray codeList = response.getJSONArray("codeList"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Object data : codeList) { |
|
|
|
|
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
|
|
|
|
couponCodeOther.setType(2); |
|
|
|
|
|
|
|
couponCodeOther.setOrderId(order.getId()); |
|
|
|
|
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
|
|
|
|
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode")); |
|
|
|
|
|
|
|
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data))); |
|
|
|
|
|
|
|
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
|
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
|
|
|
|
highUserCoupon.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo()); |
|
|
|
|
|
|
|
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate()); |
|
|
|
|
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
|
|
|
|
} |
|
|
|
} 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.预支付
|
|
|
@ -1105,6 +1232,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
@ -1339,6 +1468,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
@ -1360,6 +1491,55 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPush.setReturnContent(returnParam.toJSONString()); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (coupon.getCouponSource() == 5) { |
|
|
|
|
|
|
|
// 给用户发码
|
|
|
|
|
|
|
|
JSONObject response = ChongQingCNPCService.sendCNPCTicket(coupon.getCouponKey(), order.getOrderNo(), highChildOrder.getSaleCount(), order.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 推送记录
|
|
|
|
|
|
|
|
JSONObject request = new JSONObject(); |
|
|
|
|
|
|
|
request.put("requestCode", coupon.getCouponKey()); |
|
|
|
|
|
|
|
request.put("tradeId", order.getOrderNo()); |
|
|
|
|
|
|
|
request.put("ticketSum", highChildOrder.getSaleCount()); |
|
|
|
|
|
|
|
request.put("phone", order.getMemPhone()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
|
|
|
|
highGasOrderPush.setType(OrderPushType.type10.getType()); |
|
|
|
|
|
|
|
highGasOrderPush.setOrderNo(order.getOrderNo()); |
|
|
|
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highGasOrderPush.setRequestContent(request.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPush.setReturnContent(response.toJSONString()); |
|
|
|
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject couponDetail = response.getJSONObject("ticketDetail"); |
|
|
|
|
|
|
|
JSONArray codeList = response.getJSONArray("codeList"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Object data : codeList) { |
|
|
|
|
|
|
|
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); |
|
|
|
|
|
|
|
couponCodeOther.setType(2); |
|
|
|
|
|
|
|
couponCodeOther.setOrderId(order.getId()); |
|
|
|
|
|
|
|
couponCodeOther.setChildOrderId(highChildOrder.getId()); |
|
|
|
|
|
|
|
couponCodeOther.setCouTypeCode(couponDetail.getString("requestCode")); |
|
|
|
|
|
|
|
couponCodeOther.setCouNo(ChongQingCNPCService.decryptCouponCode(String.valueOf(data))); |
|
|
|
|
|
|
|
couponCodeOther.setActiveTime(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setValidStartDate(DateUtil.format(couponDetail.getString("effectiveTime"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setValidEndDate(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd")); |
|
|
|
|
|
|
|
couponCodeOther.setStatus(20); |
|
|
|
|
|
|
|
couponCodeOther.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highCouponCodeOtherMapper.insert(couponCodeOther); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setMerchantId(coupon.getMerchantId()); |
|
|
|
|
|
|
|
highUserCoupon.setCouponId(coupon.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
|
|
|
|
highUserCoupon.setCreateTime(new Date()); |
|
|
|
|
|
|
|
highUserCoupon.setQrCodeImg(couponCodeOther.getCouNo()); |
|
|
|
|
|
|
|
highUserCoupon.setUseEndTime(couponCodeOther.getValidEndDate()); |
|
|
|
|
|
|
|
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
|
|
|
highUserCouponMapper.insert(highUserCoupon); |
|
|
|
|
|
|
|
} |
|
|
|
} 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.预支付
|
|
|
@ -1368,6 +1548,8 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 卡卷关联用户
|
|
|
|
// 卡卷关联用户
|
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = new HighUserCoupon(); |
|
|
|
|
|
|
|
highUserCoupon.setOrderId(order.getId()); |
|
|
|
|
|
|
|
highUserCoupon.setChildOrderId(highChildOrder.getId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setMerchantId(code.getMerchantId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setCouponId(code.getCouponId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
|
highUserCoupon.setUserId(order.getMemId()); |
|
|
@ -3157,4 +3339,33 @@ public class HighOrderServiceImpl implements HighOrderService { |
|
|
|
|
|
|
|
|
|
|
|
return list; |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<OrderCouponModel> getOrderCouponList(Map<String, Object> param) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MapUtils.getLong(param, "createTimeS") != null) { |
|
|
|
|
|
|
|
param.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeS")), DateUtil.Y_M_D_HMS)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MapUtils.getLong(param, "createTimeE") != null) { |
|
|
|
|
|
|
|
param.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeE")), DateUtil.Y_M_D_HMS)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MapUtils.getLong(param, "payTimeS") != null) { |
|
|
|
|
|
|
|
param.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeS")), DateUtil.Y_M_D_HMS)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MapUtils.getLong(param, "payTimeE") != null) { |
|
|
|
|
|
|
|
param.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeE")), DateUtil.Y_M_D_HMS)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MapUtils.getLong(param, "finishTimeS") != null) { |
|
|
|
|
|
|
|
param.put("finishTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeS")), DateUtil.Y_M_D_HMS)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MapUtils.getLong(param, "finishTimeE") != null) { |
|
|
|
|
|
|
|
param.put("finishTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeE")), DateUtil.Y_M_D_HMS)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return highOrderMapper.queryOrderCoupon(param); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|