diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuShopServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuShopServiceImpl.java index ad9c116..c245a5e 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuShopServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuShopServiceImpl.java @@ -69,9 +69,13 @@ public class YaoDuShopServiceImpl implements YaoDuShopService { int y = byId.getQrCodeY() != null ? byId.getQrCodeY() : 0; double whl = 2.5; + Integer qrCodeBgHashCode = byId.getQrCodeBg() != null ? byId.getQrCodeBg().hashCode() : 0; + + String finalPath = String.format("gourmet/gourmetDetail/final/%s_%s_%s_%s_%s.jpg", + id, qrCodeBgHashCode, x, y); + if (StringUtil.isNotEmpty(byId.getQrCodeBg())){ - String finalPath = String.format("gourmet/gourmetDetail/final/%s_%s_%s_%s_%s.jpg", - id, byId.getQrCodeBg().hashCode(), x, y); + try { InputStream ossFile = OssBootUtil.getOssFile(finalPath, null); if (ossFile != null) { @@ -109,8 +113,7 @@ public class YaoDuShopServiceImpl implements YaoDuShopService { byte[] finalImage = this.generateAndCombineImagesFromUrl2(qrCodeBytes, byId.getQrCodeBg(), x, y, whl); // 异步上传到OSS(移除Redis缓存) - uploadToOssAsync(finalImage, String.format("gourmet/gourmetDetail/final/%s_%s_%s_%s_%s.jpg", - id, byId.getQrCodeBg().hashCode(), x, y, whl)); + uploadToOssAsync(finalImage, finalPath); return finalImage; } catch (Exception e) {