From 3ff440c105c897152a105c31c4016ddafa529f37 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Thu, 23 Oct 2025 11:35:56 +0800 Subject: [PATCH] 1 --- .../jeecg/modules/api/service/impl/YaoDuShopServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) {