From 2562e13a8db342cc1e23e17b8a26d84ce314f9eb Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 13 Aug 2021 12:04:57 +0800
Subject: [PATCH] 20210813
---
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java
index db91c07..96f4f01 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java
@@ -1,17 +1,15 @@
package com.matrix.system.shopXcx.api.action;
-import com.matrix.system.hive.bean.SysVipInfo;
-import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.component.redis.RedisUserLoginUtils;
+import com.matrix.component.tools.ImageUtil;
import com.matrix.component.tools.WxacodeUtil;
import com.matrix.core.pojo.AjaxResult;
-import com.matrix.core.tools.DateUtil;
-import com.matrix.core.tools.LogUtil;
-import com.matrix.core.tools.PropertiesUtil;
-import com.matrix.core.tools.UUIDUtil;
+import com.matrix.core.tools.*;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
+import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysShopInfoDao;
+import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.shopXcx.api.WeChatApiTools;
import com.matrix.system.shopXcx.api.pojo.QrcodeImgParam;
@@ -251,7 +249,9 @@
// 图片访问URL
String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL);
String productImg = shopProduct.getImgMobile();
- productImg = productImg.replace(baseSaveUrl, baseSavePath);
+ String productPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "poster.png";
+ ImageUtil.downloadPicture(productImg, productPath);
+// productImg = productImg.replace(baseSaveUrl, baseSavePath);
String targetImg = UUIDUtil.getRandomID() + ".png";
QrcodeImgParam qrcodeImgParam = new QrcodeImgParam();
@@ -259,7 +259,7 @@
qrcodeImgParam.qrcodeSavePath = qrcodeSavePath;
qrcodeImgParam.qrcodeBackgroundImgPath = qrcodeBackgroundImgPath;
qrcodeImgParam.qrcodeFrontImgPath = qrcodeFrontImgPath;
- qrcodeImgParam.productImgPath = productImg;
+ qrcodeImgParam.productImgPath = productPath;
qrcodeImgParam.urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg;
qrcodeImgParam.targetImg = baseSavePath + "/" + "wxacode" + "/" + targetImg;
qrcodeImgParam.title = shopProduct.getTitle();
@@ -337,10 +337,11 @@
public static void main(String[] args) throws Exception {
QrcodeImgParam qrcodeImgParam = new QrcodeImgParam();
- qrcodeImgParam.qrcodeSavePath = "C:\\Users\\Administrator\\Desktop\\dd\\ewm.png";
+ qrcodeImgParam.qrcodeSavePath = "C:\\Users\\Administrator\\Desktop\\ewm.png";
qrcodeImgParam.qrcodeBackgroundImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\bj1.png";
qrcodeImgParam.qrcodeFrontImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\qj2.png";
- qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\banner.jpg";
+// qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\banner.jpg";
+ qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\6cbfee5df0474fe0b864be142bc474ab.jpg";
qrcodeImgParam.targetImg = "C:\\Users\\Administrator\\Desktop\\dd\\banner111.jpg";
qrcodeImgParam.title = "盐酸米多君片";
qrcodeImgParam.price = "¥30";
--
Gitblit v1.9.1