From a681a298f4aa7408e67b04f58e906286353811a7 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Thu, 2 Oct 2025 12:09:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BF=AE=E6=94=B9=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BC=9A=E5=A4=9A=E4=B8=80=E4=B8=AA=E6=A8=A1=E7=89=B9?= =?UTF-8?q?fix=E5=88=A4=E6=96=AD=E6=A8=A1=E7=89=B9=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/service/impl/WorkspaceServiceImpl.java | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java index 0a86181e..d31a1aad 100644 --- a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java @@ -154,14 +154,14 @@ public class WorkspaceServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); qw.lambda().eq(WorkspaceRelStyle::getWorkspaceId, workspace.getId()); List workspaceRelStyles = workspaceRelStyleMapper.selectList(qw); @@ -344,7 +344,7 @@ public class WorkspaceServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper().eq(CollectionElement::getProjectId, projectId) - .eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.MODEL.getRealName()) - .eq(CollectionElement::getLevel3Type, workspaceNew.getSex()); - if (collectionElementMapper.selectCount(queryWrapper) == 0){ - SysFile sysFile = sysFileService.getOneBySex(projectDTO.getStyleId(), projectDTO.getWorkspace().getSex(), projectDTO.getWorkspace().getAgeGroup()); + SysFile sysFile = sysFileService.getOneBySex(projectDTO.getStyleId(), projectDTO.getWorkspace().getSex(), projectDTO.getWorkspace().getAgeGroup()); + if (!checkIfModelExistsInProject(sysFile.getMd5(), projectId)) { CollectionElement collectionElement = new CollectionElement(); collectionElement.setAccountId(userInfo.getId()); collectionElement.setProjectId(projectId); @@ -763,14 +759,14 @@ public class WorkspaceServiceImpl extends ServiceImpl wRSQW = new QueryWrapper<>(); wRSQW.lambda().eq(WorkspaceRelStyle::getWorkspaceId, projectDTO.getWorkspace().getId()); List workspaceRelStyles = workspaceRelStyleMapper.selectList(wRSQW); @@ -784,7 +780,7 @@ public class WorkspaceServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); + qw.lambda().eq(CollectionElement::getProjectId, projectId) + .eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.MODEL.getRealName()) + .eq(CollectionElement::getMd5, md5); + + List collectionElements = collectionElementMapper.selectList(qw); + return collectionElements != null && !collectionElements.isEmpty(); + } + public static List getPNGFiles(String directoryPath) { List pngFiles = new ArrayList<>(); File directory = new File(directoryPath);