From 54a21c949796a2345b3e617bd8cbd8cd77a85c54 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 23 Jun 2021 14:49:55 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hai-cweb/src/test/common/RegionTest.java | 66 ++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/hai-cweb/src/test/common/RegionTest.java b/hai-cweb/src/test/common/RegionTest.java index b586481a..b5ce6eb6 100644 --- a/hai-cweb/src/test/common/RegionTest.java +++ b/hai-cweb/src/test/common/RegionTest.java @@ -4,11 +4,16 @@ import com.CWebApplication; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageInfo; +import com.hai.common.QRCodeGenerator; +import com.hai.common.utils.DateUtil; import com.hai.common.utils.HttpsUtils; +import com.hai.common.utils.IDGenerator; +import com.hai.entity.HighCouponCode; import com.hai.entity.HighMerchantStore; import com.hai.entity.SecRegion; import com.hai.service.CommonService; +import com.hai.service.HighCouponCodeService; import com.hai.service.HighMerchantStoreService; import org.junit.Test; import org.junit.runner.RunWith; @@ -38,6 +43,9 @@ public class RegionTest { @Resource private CommonService commonService; + @Resource + private HighCouponCodeService highCouponCodeService; + @Resource private HighMerchantStoreService highMerchantStoreService; @@ -79,6 +87,64 @@ public class RegionTest { } } + + + @Test + public void gQrCode(){ + try { + + List list = new ArrayList<>(); + list.add("01ZCplFfrpgRKydlzGKNNW"); + list.add("0191TLwAwBB956jzWM3YIC"); + list.add("01n04fzTdsTpeKmayBZyAk"); + list.add("01c6xoP1tJyBRC2zaTUhuI"); + list.add("01lmjIWIENUfiD43bf4qN1"); + list.add("01D5rNSEoNnSBGjgXqKzLb"); + list.add("01FeU4TAvGE6GuIYj8CWSG"); + list.add("01WX7Wepav3IY9c1dM1480"); + list.add("01b2wl9RRbFr74KurfNs9D"); + list.add("01b0KC0vpZxUxyWybIldpA"); + list.add("013x24Ou0EZTGDUFUUoVJH"); + list.add("01NYmIdcTxXk8uTP2wlzxN"); + list.add("01DsyPN9QUvwL8YEEjhHK2"); + list.add("01Tf9T9zK3tiW157oxTluZ"); + list.add("01C5XMRbxA13KmQZdigYrQ"); + list.add("01IkkXn3fbBGmeBQGlie6N"); + list.add("01fiH3t7P1DahSTgnltE5C"); + list.add("015I6hBEIUB6UtJB1AJpTY"); + list.add("017Rsu81CAy2lgya5qCVYK"); + list.add("01bOsNk2KViUjrKr1sifdM"); + list.add("01UUd4bpXAPvhGSNPiVdgv"); + list.add("01YDIj4DWaRCvWcd0UPTl4"); + list.add("01CBiCaEPp1PXms8wAoXtL"); + list.add("01aSV8p1RtV11aQRv5HyEg"); + list.add("01XYud7OMwKAzzZJssHAxX"); + list.add("01AgLE01SiraWzvZmaAMQz"); + list.add("01M1vYhLl6gfrknCTmQjVo"); + list.add("01GWKsIOTQKIJk9xk9zlq3"); + list.add("01S3GkZAtcvgHGZzkK9je1"); + list.add("01l0yZxhNDjUTgBfNFpZ0N"); + list.add("01Tm7PE3wvu6S4PRQD0sez"); + list.add("01b0NrXyZ8FDSyPQtxOwKM"); + list.add("01V6FFylLgJX95uNNHxt5K"); + + for(String code : list) { + HighCouponCode salesCode = highCouponCodeService.getCouponCodeBySalesCode(code); + if (salesCode != null){ + // 生成二维码 + String qrCodeImg = DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(10) +".png"; + String qrCodeUrl = "G:/couponCode/" + qrCodeImg; + QRCodeGenerator.generateQRCodeImage(code, 350, 350, qrCodeUrl); + salesCode.setExt1(qrCodeImg); + highCouponCodeService.updateCouponCode(salesCode); + } + } + + }catch (Exception e){ + e.printStackTrace(); + } + } + @Test public void test(){ try {