935090232@qq.com
2022-02-20 27fb5ec5798a4dd30ba437a9a922a2d78544e301
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);