|
|
@ -4,11 +4,16 @@ import com.CWebApplication; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
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.HttpsUtils; |
|
|
|
|
|
|
|
import com.hai.common.utils.IDGenerator; |
|
|
|
|
|
|
|
import com.hai.entity.HighCouponCode; |
|
|
|
import com.hai.entity.HighMerchantStore; |
|
|
|
import com.hai.entity.HighMerchantStore; |
|
|
|
import com.hai.entity.SecRegion; |
|
|
|
import com.hai.entity.SecRegion; |
|
|
|
import com.hai.service.CommonService; |
|
|
|
import com.hai.service.CommonService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.hai.service.HighCouponCodeService; |
|
|
|
import com.hai.service.HighMerchantStoreService; |
|
|
|
import com.hai.service.HighMerchantStoreService; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.runner.RunWith; |
|
|
|
import org.junit.runner.RunWith; |
|
|
@ -38,6 +43,9 @@ public class RegionTest { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private CommonService commonService; |
|
|
|
private CommonService commonService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighCouponCodeService highCouponCodeService; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighMerchantStoreService highMerchantStoreService; |
|
|
|
private HighMerchantStoreService highMerchantStoreService; |
|
|
|
|
|
|
|
|
|
|
@ -79,6 +87,64 @@ public class RegionTest { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void gQrCode(){ |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> 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 |
|
|
|
@Test |
|
|
|
public void test(){ |
|
|
|
public void test(){ |
|
|
|
try { |
|
|
|
try { |
|
|
|