From 27fb5ec5798a4dd30ba437a9a922a2d78544e301 Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Sun, 20 Feb 2022 22:56:20 +0800
Subject: [PATCH] 配置文件改造

---
 zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java
index 0146ff7..8d92ccc 100644
--- a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java
+++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java
@@ -7,7 +7,6 @@
 import com.matrix.core.pojo.PaginationVO;
 import com.matrix.core.tools.LogUtil;
 import com.matrix.core.tools.MD5Util;
-import com.matrix.core.tools.PropertiesUtil;
 import com.matrix.system.common.bean.SysUsers;
 import com.matrix.system.common.constance.AppConstance;
 import com.matrix.system.constance.Dictionary;
@@ -17,6 +16,7 @@
 import com.matrix.system.hive.service.SysShopInfoService;
 import com.matrix.system.shopXcx.api.WeChatApiTools;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -37,9 +37,18 @@
 @Controller
 @RequestMapping("hiveErp/shopInfo")
 public class ErpShopInfoController extends BaseController {
+
+
+    @Autowired
+    WxacodeUtil wxacodeUtil;
+
     @Resource
     private SysShopInfoService shopInfoService; // 店铺Service
+    @Value("${file_storage_path}")
+    private String fileStoragePath;
 
+    @Value("${static_resource_url}")
+    private String staticResourceUrl;
 
     @Autowired
     WeChatApiTools weChatApiTools;
@@ -86,6 +95,7 @@
         return "admin/hive-erp/shop/shopInfo-form";
     }
 
+
     /**
      * 生成门店二维码
      */
@@ -95,13 +105,13 @@
     AjaxResult creteSohopQrcode(@PathVariable("shopId") Long shopId) {
         SysShopInfo shopInfo = shopInfoService.findById(shopId);
         try {
-            String qrcodeSavePath = WxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "")
+            String qrcodeSavePath = wxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "")
                     ,weChatApiTools.getAppid(shopInfo.getCompanyId()),weChatApiTools.getSecret(shopInfo.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 qrcodeImgUrl = qrcodeSavePath.replace(baseSavePath, baseSaveUrl);
             shopInfo.setQrcode(qrcodeImgUrl);
             shopInfoService.modify(shopInfo);

--
Gitblit v1.9.1