diff --git a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java index b8398d9..b59ef3d 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -125,7 +125,7 @@ public class OrderCreateService { orderCoupon.setStatus(OrderChildStatusEnum.status1.getCode()); orderCouponService.editData(orderCoupon); - for (int i = 0; i <= orderCoupon.getGoodsCount(); i++) { + for (int i = 0; i < orderCoupon.getGoodsCount(); i++) { // 卡券订单卡密 BsOrderCouponNo orderCouponNo = new BsOrderCouponNo(); orderCouponNo.setCouponOrderId(orderCoupon.getId()); @@ -239,5 +239,4 @@ public class OrderCreateService { return orderChild; } - } diff --git a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java index 0dee65e..b551cd5 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -117,10 +117,10 @@ public class OrderPaySuccessService { } else if (vpd.getSource() == GoodsVpdSourceEnum.type5.getCode()) { // 预发码 - JSONObject preSendCoupon = ChongQingCNPCCouponService.preSendCoupon(orderCoupon.getGoodsVpdKey(), orderCoupon.getOrderNo(), 1, orderCoupon.getUserPhone()); + JSONObject preSendCoupon = ChongQingCNPCCouponService.preSendCoupon(orderCoupon.getGoodsVpdKey(), couponNo.getOrderNo(), 1, orderCoupon.getUserPhone()); if (preSendCoupon.getInteger("status").equals(1)) { // 给用户发码 - JSONObject response = ChongQingCNPCCouponService.sendCNPCTicket(orderCoupon.getGoodsVpdKey(), orderCoupon.getOrderNo(), 1, orderCoupon.getUserPhone()); + JSONObject response = ChongQingCNPCCouponService.sendCNPCTicket(orderCoupon.getGoodsVpdKey(), couponNo.getOrderNo(), 1, orderCoupon.getUserPhone()); JSONObject couponDetail = response.getJSONObject("ticketDetail"); JSONArray codeList = response.getJSONArray("codeList"); for (Object data : codeList) { @@ -146,7 +146,7 @@ public class OrderPaySuccessService { } else if (vpd.getSource() == GoodsVpdSourceEnum.type10.getCode()) { // 发放卡券 - JSONObject jsonObject = PcytCNPCCouponConfig.getCoupon(orderCoupon.getOrderNo() , orderCoupon.getUserPhone() , orderCoupon.getGoodsVpdKey()); + JSONObject jsonObject = PcytCNPCCouponConfig.getCoupon(couponNo.getOrderNo() , orderCoupon.getUserPhone() , orderCoupon.getGoodsVpdKey()); if (!jsonObject.getString("code").equals("200")) { throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , jsonObject.getString("errMsg")); }