From ae21412425a41c3b72f2de0c2310da5d0899df90 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Sun, 28 Mar 2021 21:37:07 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hai/service/impl/HighCouponCodeServiceImpl.java | 3 ++- .../java/com/hai/service/impl/HighOrderServiceImpl.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) 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.已取消 }