diff --git a/pom.xml b/pom.xml
index 9c09ed19..f9fc25bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -162,7 +162,7 @@
com.tencentcloudapi
- tencentcloud-sdk-java
+ tencentcloud-sdk-java-ses
3.1.572
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 774cb23b..cbf9c605 100644
--- a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java
+++ b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java
@@ -703,11 +703,37 @@ public class WorkspaceServiceImpl extends ServiceImpl qw = new QueryWrapper<>();
qw.lambda().eq(Workspace::getProjectId, projectDTO.getId());
List workspaces = workspaceMapper.selectList(qw);
+
if (CollectionUtils.isEmpty(workspaces)) {
throw new BusinessException("Lack of associated workspace.");
}else {
Workspace workspace = workspaces.get(0);
Workspace workspaceNew = CopyUtil.copyObject(projectDTO.getWorkspace(), Workspace.class);
+ if (projectDTO.getProcess().equals(DesignProcess.SERIES_DESIGN.name()) || projectDTO.getProcess().equals(DesignProcess.SKETCH_COLLAGE_PROCESS.name())) {
+ if (!workspaceNew.getAgeGroup().equals(workspace.getAgeGroup()) || !workspaceNew.getSex().equals(workspace.getSex())) {
+ // 性别变更 清理sketch及模特
+ deleteMannequinByProjectId(projectId);
+ if (!workspaceNew.getSex().equals(workspace.getSex())) {
+ deleteSketchByProjectId(projectId);
+ }
+ }
+ SysFile sysFile = sysFileService.getOneBySex(projectDTO.getStyleId(), projectDTO.getWorkspace().getSex(), projectDTO.getWorkspace().getAgeGroup());
+ CollectionElement collectionElement = new CollectionElement();
+ collectionElement.setAccountId(userInfo.getId());
+ collectionElement.setProjectId(projectId);
+ collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MODEL.getRealName());
+ collectionElement.setName(sysFile.getName());
+ collectionElement.setUrl(sysFile.getUrl());
+ collectionElement.setMd5(sysFile.getMd5());
+ collectionElement.setCreateDate(new Date());
+ collectionElement.setHasPin((byte) 0);
+ collectionElementMapper.insert(collectionElement);
+ CollectionElementRelModel collectionElementRelModel = new CollectionElementRelModel();
+ collectionElementRelModel.setCollectionElementId(collectionElement.getId());
+ collectionElementRelModel.setRelationId(sysFile.getId());
+ collectionElementRelModel.setRelationType("System");
+ collectionElementRelModelMapper.insert(collectionElementRelModel);
+ }
workspaceNew.setId(workspace.getId());
workspace.setUpdateTime(LocalDateTime.now());
workspaceMapper.updateById(workspaceNew);
@@ -801,6 +827,20 @@ public class WorkspaceServiceImpl extends ServiceImpl qw = new QueryWrapper<>();
+ qw.lambda().eq(CollectionElement::getProjectId, projectId);
+ qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName());
+ collectionElementMapper.delete(qw);
+ }
+
+ private void deleteMannequinByProjectId(Long projectId) {
+ QueryWrapper qw = new QueryWrapper<>();
+ qw.lambda().eq(CollectionElement::getProjectId, projectId);
+ qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.MODEL.getRealName());
+ collectionElementMapper.delete(qw);
+ }
+
@Override
public Long getByProjectId(Long projectId) {
QueryWrapper qw = new QueryWrapper<>();