From 0fcd8e54443a8c0de30570c830c713e7cd46c9fd Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 29 Jul 2025 15:00:13 +0800 Subject: [PATCH] =?UTF-8?q?BUGFIX:=201=E3=80=81=E4=BF=AE=E6=94=B9=E7=94=BB?= =?UTF-8?q?=E5=B8=83=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=86=8D=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=B0=E6=96=87=E4=BB=B6=EF=BC=8C=E6=94=B9=E4=B8=BA=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E5=8E=9F=E6=96=87=E4=BB=B6=202=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4toProduct=20relight=E7=BB=93=E6=9E=9C=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E5=88=A0=E5=B9=B2=E5=87=80=E5=AF=BC=E8=87=B4=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=BA=90=E6=96=87=E4=BB=B6=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/UserLikeGroupServiceImpl.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index 0314b49f..4fac10d8 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -361,20 +361,32 @@ public class UserLikeGroupServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); List exportFiles = null; if (Objects.nonNull(projectId)){ qw.lambda().eq(ExportFile::getProjectId, projectId); qw.lambda().eq(ExportFile::getModule, module); exportFiles = exportFileMapper.selectList(qw); + } else if (Objects.nonNull(designItemDetailId)){ + DesignItemDetailCanvas designItemDetailCanvas = designItemDetailService.getDIDCByDesignItemDetailId(designItemDetailId); + if (Objects.nonNull(designItemDetailCanvas) && Objects.nonNull(designItemDetailCanvas.getExportFileId())){ + qw.lambda().eq(ExportFile::getId, designItemDetailCanvas.getExportFileId()); + qw.lambda().eq(ExportFile::getModule, module); + exportFiles = exportFileMapper.selectList(qw); + } } +// String upload = minioUtil.upload("aida-users", userHolder.getId() + "/exportFile", file); if (CollectionUtil.isNotEmpty(exportFiles)) { ExportFile exportFile = exportFiles.get(0); - exportFile.setUrl(upload); - exportFileMapper.updateById(exportFile); + // 更新画布信息时,只重新上传图片,不用修改数据库url + String url = exportFile.getUrl(); + String path = url.substring(url.indexOf("/") + 1); + minioUtil.upload("aida-users", path, file, null); +// exportFile.setUrl(upload); +// exportFileMapper.updateById(exportFile); }else { + String upload = minioUtil.upload("aida-users", userHolder.getId() + "/exportFile", file); ExportFile exportFile = new ExportFile(); exportFile.setProjectId(projectId); exportFile.setModule(module); @@ -1326,9 +1338,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl wrapper = new UpdateWrapper<>(); - wrapper.eq("id", id) - .eq("project_id", projectId) - .set("is_deleted", 1); + wrapper.lambda().eq(ToProductImageResult::getProjectId, projectId) + .eq(ToProductImageResult::getId, id).or().eq(ToProductImageResult::getElementId, id) + .set(ToProductImageResult::getIsDeleted, 1); + int update = toProductImageResultMapper.update(null, wrapper); log.info("删除 {} 结果, id={}, 影响行数={}", type, id, update);