From 8fc79f6699bafc1069c0e0000c3e9495f9dadba9 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 23 May 2025 15:13:46 +0800 Subject: [PATCH] =?UTF-8?q?TASK:mannequin=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/CollectionLevel1TypeEnum.java | 4 +- .../da/mapper/primary/entity/Workspace.java | 2 +- .../com/ai/da/model/dto/ModuleSaveDTO.java | 3 + .../java/com/ai/da/model/vo/WorkspaceVO.java | 3 + .../impl/UserLikeGroupServiceImpl.java | 61 +++++++++++++++++++ .../da/service/impl/WorkspaceServiceImpl.java | 7 +++ 6 files changed, 78 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/common/enums/CollectionLevel1TypeEnum.java b/src/main/java/com/ai/da/common/enums/CollectionLevel1TypeEnum.java index c16b5b51..d8e025fe 100644 --- a/src/main/java/com/ai/da/common/enums/CollectionLevel1TypeEnum.java +++ b/src/main/java/com/ai/da/common/enums/CollectionLevel1TypeEnum.java @@ -27,7 +27,9 @@ public enum CollectionLevel1TypeEnum { /** * 市场 */ - MARKETING_SKETCH("MarketingSketch"); + MARKETING_SKETCH("MarketingSketch"), + + MANNEQUIN("Mannequin"); private String realName; diff --git a/src/main/java/com/ai/da/mapper/primary/entity/Workspace.java b/src/main/java/com/ai/da/mapper/primary/entity/Workspace.java index e4277c63..c3714550 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/Workspace.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/Workspace.java @@ -101,7 +101,7 @@ public class Workspace implements Serializable { private Long projectId; - private Integer userBrandDna; + private Long userBrandDna; private Integer brandPercentage; diff --git a/src/main/java/com/ai/da/model/dto/ModuleSaveDTO.java b/src/main/java/com/ai/da/model/dto/ModuleSaveDTO.java index 950647c8..6b160b11 100644 --- a/src/main/java/com/ai/da/model/dto/ModuleSaveDTO.java +++ b/src/main/java/com/ai/da/model/dto/ModuleSaveDTO.java @@ -1,5 +1,6 @@ package com.ai.da.model.dto; +import com.ai.da.mapper.primary.entity.Library; import com.ai.da.model.vo.CollectionColorVO; import com.ai.da.model.vo.CollectionElementVO; import com.ai.da.model.vo.MoodBoardModuleChooseVO; @@ -29,6 +30,8 @@ public class ModuleSaveDTO { private PatternMaking3DDTO patternMaking3D; + private List mannequin; + // private MoodBoardModuleChooseVO moodBoard; // private List printBoard; // private List colorBoard; diff --git a/src/main/java/com/ai/da/model/vo/WorkspaceVO.java b/src/main/java/com/ai/da/model/vo/WorkspaceVO.java index 9fd8d049..5a117ac5 100644 --- a/src/main/java/com/ai/da/model/vo/WorkspaceVO.java +++ b/src/main/java/com/ai/da/model/vo/WorkspaceVO.java @@ -40,6 +40,9 @@ public class WorkspaceVO extends Workspace { private String style; + private String userBrandDnaImg; + private String userBrandDnaName; + private Map> allKeywordsByStyle; } 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 da3fa74e..aee53ee0 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -1902,6 +1902,67 @@ public class UserLikeGroupServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); + qw.lambda().eq(CollectionElement::getProjectId, projectId); + qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.MANNEQUIN.getRealName()); + List collectionElements = collectionElementMapper.selectList(qw); + Set old = collectionElements.stream().map(CollectionElement::getId).collect(Collectors.toSet()); +// Set oldUrl = collectionElements.stream().map(CollectionElement::getUrl).collect(Collectors.toSet()); + List mannequin = moduleSaveDTO.getMannequin(); + for (MannequinDTO dto : mannequin) { + + if (dto.getType().equals("System")) { + SysFile sysFile = sysFileMapper.selectById(dto.getId()); + + CollectionElement collectionElement = new CollectionElement(); + collectionElement.setAccountId(accountId); + collectionElement.setProjectId(projectId); + collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MANNEQUIN.getRealName()); +// collectionElement.setLevel2Type(board.getLevel2Type()); + collectionElement.setName(sysFile.getName()); + collectionElement.setUrl(sysFile.getUrl()); +// collectionElement.setHasPin(board.getIsPin()); + collectionElement.setMd5(sysFile.getMd5()); + collectionElement.setCreateDate(new Date()); + collectionElementMapper.insert(collectionElement); + }else if (dto.getType().equals("Library")) { + Library library = libraryMapper.selectById(dto.getId()); + + CollectionElement collectionElement = new CollectionElement(); + collectionElement.setAccountId(accountId); + collectionElement.setProjectId(projectId); + collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MANNEQUIN.getRealName()); +// collectionElement.setLevel2Type(board.getLevel2Type()); + collectionElement.setName(library.getName()); + collectionElement.setUrl(library.getUrl()); +// collectionElement.setHasPin(board.getIsPin()); + collectionElement.setMd5(library.getMd5()); + collectionElement.setCreateDate(new Date()); + collectionElementMapper.insert(collectionElement); + }else { + if (old.contains(dto.getId())) { + CollectionElement collectionElement = collectionElementMapper.selectById(dto.getId()); +// collectionElement.setLevel2Type(board.getLevel2Type()); +// collectionElement.setHasPin(board.getIsPin()); + collectionElement.setUpdateDate(new Date()); + collectionElementMapper.updateById(collectionElement); + old.remove(dto.getId()); + }else { + CollectionElement collectionElement = collectionElementMapper.selectById(dto.getId()); + collectionElement.setProjectId(projectId); +// collectionElement.setLevel2Type(board.getLevel2Type()); +// collectionElement.setHasPin(board.getIsPin()); + collectionElement.setUpdateDate(new Date()); + collectionElementMapper.updateById(collectionElement); + } + } + } + if (!CollectionUtils.isEmpty(old)) { + collectionElementMapper.deleteBatchIds(old); + } + + } if (boundingBox) { QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()); 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 0200b329..eda5d7aa 100644 --- a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java @@ -61,6 +61,8 @@ public class WorkspaceServiceImpl extends ServiceImpl