diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java index e893ae72..347babc1 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -5,6 +5,7 @@ import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.utils.DateUtil; +import com.hai.common.utils.IDGenerator; import com.hai.dao.HighCouponCodeMapper; import com.hai.dao.HighCouponCodeMapperExt; import com.hai.entity.HighChildOrder; @@ -52,7 +53,7 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { public void insertList(List list) throws Exception { for (HighCouponCode highCouponCode: list) { // 生成二维码 - String qrCodeImg = DateUtil.date2String(new Date(),"yyyyMMddHHmmss")+".png"; + String qrCodeImg = DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(10) +".png"; String qrCodeUrl = "/home/project/hsg/filesystem/couponCode/" + qrCodeImg; QRCodeGenerator.generateQRCodeImage(list.get(0).getSalesCode(), 350, 350, qrCodeUrl); highCouponCode.setExt1(qrCodeImg); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index b0ed9539..845a3611 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -265,9 +265,11 @@ public class HighOrderServiceImpl implements HighOrderService { if (highChildOrder.getGoodsType() == 1) { // 查询卡卷详情 HighCouponCode couponCode = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); - couponCode.setChildOrderId(null); - couponCode.setStatus(1); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 - highCouponCodeService.updateCouponCode(couponCode); + if (couponCode != null) { + couponCode.setChildOrderId(null); + couponCode.setStatus(1); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 + highCouponCodeService.updateCouponCode(couponCode); + } } highChildOrder.setChildOrdeStatus(5); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 }