前端-胡立永 5 days ago
parent
commit
3ff440c105
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuShopServiceImpl.java

+ 7
- 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuShopServiceImpl.java View File

@ -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) {


Loading…
Cancel
Save