From 2c4c678e64d8679d50e8466f033ccddfcd54c85e Mon Sep 17 00:00:00 2001 From: 199901012 Date: Sun, 28 Mar 2021 20:05:19 +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 --- .../java/com/bweb/controller/HighOrderController.java | 1 - .../com/bweb/excelListener/ImportCouponListener.java | 6 +++++- hai-cweb/src/main/resources/dev/config.properties | 2 +- .../java/com/hai/service/HighCouponCodeService.java | 2 +- .../hai/service/impl/HighCouponCodeServiceImpl.java | 11 ++++++++++- .../com/hai/service/impl/HighOrderServiceImpl.java | 6 +----- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 0525c322..5516e659 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -51,7 +51,6 @@ public class HighOrderController { private HighCouponCodeService highCouponCodeService; - @RequestMapping(value = "/getOrderById", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据id查询订单详情") diff --git a/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java b/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java index d926e569..c80b39fc 100644 --- a/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java +++ b/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java @@ -92,7 +92,11 @@ public class ImportCouponListener extends AnalysisEventListener 0) { - highCouponCodeService.insertList(successData); + try { + highCouponCodeService.insertList(successData); + } catch (Exception e) { + e.printStackTrace(); + } } this.successData.clear(); this.allCouponCode.clear(); diff --git a/hai-cweb/src/main/resources/dev/config.properties b/hai-cweb/src/main/resources/dev/config.properties index d416d0c5..0cff26a6 100644 --- a/hai-cweb/src/main/resources/dev/config.properties +++ b/hai-cweb/src/main/resources/dev/config.properties @@ -10,7 +10,7 @@ wxSubAppId=wx8d49e2f83025229d wxSubMchId=1603942866 wxUnifiedOrderUrl=https://api.mch.weixin.qq.com/pay/unifiedorder -notifyUrl=https://hsgcs.dctpay.com//crest/wechatpay/notify +notifyUrl=https://hsgcs.dctpay.com/crest/wechatpay/notify fileUrl=/home/project/hsg/filesystem cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java index c1214810..ef9aa1e3 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java @@ -27,7 +27,7 @@ public interface HighCouponCodeService { * @Description 批量增加 * @Date 2021/3/18 21:30 **/ - void insertList(List list); + void insertList(List list) throws Exception; /** * @Author 胡锐 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 f51d3a1e..e893ae72 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 @@ -1,8 +1,10 @@ package com.hai.service.impl; +import com.hai.common.QRCodeGenerator; 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.dao.HighCouponCodeMapper; import com.hai.dao.HighCouponCodeMapperExt; import com.hai.entity.HighChildOrder; @@ -47,7 +49,14 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { } @Override - public void insertList(List list) { + public void insertList(List list) throws Exception { + for (HighCouponCode highCouponCode: list) { + // 生成二维码 + String qrCodeImg = DateUtil.date2String(new Date(),"yyyyMMddHHmmss")+".png"; + String qrCodeUrl = "/home/project/hsg/filesystem/couponCode/" + qrCodeImg; + QRCodeGenerator.generateQRCodeImage(list.get(0).getSalesCode(), 350, 350, qrCodeUrl); + highCouponCode.setExt1(qrCodeImg); + } highCouponCodeMapperExt.insertList(list); } 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 5ff8c608..b0ed9539 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 @@ -77,11 +77,7 @@ public class HighOrderServiceImpl implements HighOrderService { list.get(0).setStatus(99); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 highCouponCodeService.updateCouponCode(list.get(0)); - // 生成二维码 - //String qrCodeUrl = "/home/project/hsg/filesystem/couponCode/"+DateUtil.date2String(new Date(),"yyyyMMddHHmmss")+".png"; - String qrCodeUrl = "F:\\"+DateUtil.date2String(new Date(),"yyyyMMddHHmmss")+".png"; - QRCodeGenerator.generateQRCodeImage(list.get(0).getSalesCode(), 350, 350, qrCodeUrl); - childOrder.setExt1(qrCodeUrl); + childOrder.setExt1(list.get(0).getExt1()); highChildOrderMapper.updateByPrimaryKey(childOrder); if(childOrder.getGiveawayType() == false) {