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);