From f37389d9380b3966821984ee9ec014b8784cb209 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 10 Mar 2023 10:12:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=9D=E8=B4=B9=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HighDiscountAgentRelServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java index 6d9fd416..bfbd7ab7 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java @@ -6,6 +6,7 @@ import com.hai.common.QRCodeGenerator; import com.hai.common.security.AESEncodeUtil; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; +import com.hai.config.CommonSysConst; import com.hai.config.WeChatQrcodeUtils; import com.hai.dao.HighDiscountAgentRelMapper; import com.hai.entity.*; @@ -57,17 +58,22 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ } HighDiscountAgentCode code; - + Map map = new HashMap<>(); + map.put("type" , "DISCOUNT"); for (int i = 0;i < stockCount;i++) { code = new HighDiscountAgentCode(); code.setDiscountAgentId(highDiscountAgentRel.getId()); code.setStatus(1); code.setCreateTime(new Date()); highDiscountAgentCodeService.insertCode(code); + // 二维码参数 + map.put("id", code.getId()); - // 生成二维码地址 - code.setExt1(weChatQrcodeUtils.qrCodeImgUrl(WxQrCodeTypeEnum.type5.getType(), code.getId().toString() , "DISCOUNT")); + // 生成二维码 + String qrCodeUrl = CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000011&key=&code=" + Base64Util.encode(AESEncodeUtil.aesEncrypt(JSON.toJSONString(map))); + code.setExt1(qrCodeUrl); code.setExt2("2"); + // 生成二维码地址 highDiscountAgentCodeService.updateCode(code); } }