From f3d6d7b00006b395fb46b1181830464e294e0041 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Fri, 14 Nov 2025 13:32:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BF=9B=E8=A1=8Cdesign=E5=90=8Elibrary?= =?UTF-8?q?=E4=B8=AD=E5=8F=AF=E8=83=BD=E4=BC=9A=E7=94=9F=E6=88=90=E5=90=8C?= =?UTF-8?q?=E6=A0=B7=E7=9A=84=E5=9B=BE=E7=89=87=20fix:ageGroup=E5=9C=A8des?= =?UTF-8?q?ignSingle=E6=97=B6=E4=B8=8D=E4=BC=9A=E8=A2=AB=E5=AD=98=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AF=BC=E8=87=B4=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8D=E8=83=BD=E6=98=BE=E7=A4=BA=E5=AE=8C?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/DesignService.java | 2 ++ .../da/service/impl/CollectionElementServiceImpl.java | 10 ++++++++++ .../com/ai/da/service/impl/DesignItemServiceImpl.java | 2 ++ .../java/com/ai/da/service/impl/DesignServiceImpl.java | 2 +- .../com/ai/da/service/impl/LibraryServiceImpl.java | 7 ++++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/service/DesignService.java b/src/main/java/com/ai/da/service/DesignService.java index 3b55f1a4..0964685d 100644 --- a/src/main/java/com/ai/da/service/DesignService.java +++ b/src/main/java/com/ai/da/service/DesignService.java @@ -124,4 +124,6 @@ public interface DesignService extends IService { Boolean cloudTaskNameUpdate(CloudTaskDTO cloudTaskDTO); Boolean cloudTaskDelete(CloudTaskDTO cloudTaskDTO); + + String getAgeGroupByProjectOrCollectionId(Long projectId, Long collectionId); } diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index a6f9b0f0..bd02a75a 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -358,6 +358,16 @@ public class CollectionElementServiceImpl extends ServiceImpl e, + (e1, e2) -> e1 // 冲突时保留第一个 + ), + map -> new ArrayList<>(map.values()) + )); //获取已存在相同的library List md5List = elements.stream().map(CollectionElement::getMd5).collect(Collectors.toList()); List existsLibrarys = libraryService.getByMD5List(md5List); diff --git a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java index f1b87d72..733e98a4 100644 --- a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java @@ -1032,6 +1032,8 @@ public class DesignItemServiceImpl extends ServiceImpl impleme return requestId; } - private String getAgeGroupByProjectOrCollectionId(Long projectId, Long collectionId){ + public String getAgeGroupByProjectOrCollectionId(Long projectId, Long collectionId){ if (Objects.nonNull(projectId)){ Workspace workspace = workspaceService.getWSByProjectId(projectId); if (workspace != null && !StringUtil.isNullOrEmpty(workspace.getAgeGroup())){ diff --git a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java index 8fc315c4..8a9b55e5 100644 --- a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java @@ -789,7 +789,12 @@ public class LibraryServiceImpl extends ServiceImpl impl } else { library.setLevel3Type(uploadDTO.getModelSex()); } - library.setAgeGroup(uploadDTO.getAgeGroup()); + if (uploadDTO.getLevel1Type().equals(LibraryLevel1TypeEnum.SKETCH_BOARD.getRealName())&&StringUtils.isEmpty(uploadDTO.getAgeGroup())) { + log.error("前端未传ageGroup"); + library.setAgeGroup("Adult"); + } else { + library.setAgeGroup(uploadDTO.getAgeGroup()); + } libraryMapper.insert(library); return library; } else if (uploadDTO.getModelType().equals(ModelType.SYSTEM.getValue())) {