From 1eedb8a57c2eb5c9953dcf058184ebdc6987fbf5 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 24 May 2022 15:14:21 +0800
Subject: [PATCH] Merge branch 'feature/订单服务单代码改造' into alpha
---
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 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 5232255..9f0c799 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
@@ -45,6 +45,15 @@
public class WxShareProductAction {
@Autowired
+ WxacodeUtil wxacodeUtil;
+
+ @Value("${file_storage_path}")
+ private String fileStoragePath;
+
+ @Value("${static_resource_url}")
+ private String staticResourceUrl;
+
+ @Autowired
WeChatApiTools weChatApiTools;
@Autowired
private ShopProductDao shopProductDao;
@@ -155,6 +164,7 @@
}
+
/**
* 秒杀分享图片参数
* @param loginUser
@@ -167,14 +177,14 @@
ShopProduct shopProduct = shopProductDao.selectById(seckillInfo.getGoodsId().intValue());
- String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()
+ String qrcodeSavePath = wxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()
,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId()));
LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath);
// 图片保存目录路径
- String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH);
+ String baseSavePath = fileStoragePath;
// 图片访问URL
- String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL);
+ String baseSaveUrl = staticResourceUrl;
String productImg = shopProduct.getImgMobile();
productImg = productImg.replace(baseSaveUrl, baseSavePath);
String targetImg = UUIDUtil.getRandomID() + ".png";
@@ -206,14 +216,14 @@
ShopProduct shopProduct = shopProductDao.selectById(groupBuyVO.getGoodsId().intValue());
- String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()
+ String qrcodeSavePath =wxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()
,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId()));
LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath);
// 图片保存目录路径
- String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH);
+ String baseSavePath =fileStoragePath;
// 图片访问URL
- String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL);
+ String baseSaveUrl =staticResourceUrl;
String productImg = shopProduct.getImgMobile();
productImg = productImg.replace(baseSaveUrl, baseSavePath);
String targetImg = UUIDUtil.getRandomID() + ".png";
@@ -238,14 +248,14 @@
- String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()
+ String qrcodeSavePath = wxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()
,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId()));
LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath);
// 图片保存目录路径
- String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH);
+ String baseSavePath =fileStoragePath;
// 图片访问URL
- String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL);
+ String baseSaveUrl =staticResourceUrl;
String productImg = shopProduct.getImgMobile();
String productPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "poster.png";
ImageUtil.downloadPicture(productImg, productPath);
--
Gitblit v1.9.1