TASK:workspace、design模块代码;

This commit is contained in:
shahaibo
2023-09-13 10:19:23 +08:00
parent 03f8f9a6cf
commit 7a6d70c2cf
4 changed files with 20 additions and 9 deletions

View File

@@ -9,8 +9,8 @@ import com.fasterxml.jackson.annotation.JsonValue;
*/ */
public enum Position implements IEnumDisplay { public enum Position implements IEnumDisplay {
OVERALL("整体"), OVERALL("overall"),
SINGLE("部位") SINGLE("single")
; ;
private String value; private String value;

View File

@@ -9,9 +9,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
*/ */
public enum Sex implements IEnumDisplay { public enum Sex implements IEnumDisplay {
MALE("男装"), MALE("male"),
FEMALE("女装"), FEMALE("female"),
CHILD("童装") CHILD("child")
; ;
private String value; private String value;

View File

@@ -218,7 +218,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
//保存collection //保存collection
Long collectionId = (null == collectionIdParam) ? Long collectionId = (null == collectionIdParam) ?
collectionService.saveCollection(userInfo.getId(),designDTO.getTimeZone(),designDTO.getMoodTemplateId()) : collectionIdParam; collectionService.saveCollection(userInfo.getId(),designDTO.getTimeZone(),designDTO.getMoodTemplateId()) : collectionIdParam;
List<Long> elementIds =getElementId(elementVO); List<Long> elementIds = getElementId(elementVO);
//批量关联element 到 collection //批量关联element 到 collection
collectionElementService.relationCollection(elementIds,collectionId); collectionElementService.relationCollection(elementIds,collectionId);
//library转化为collection(生成) //library转化为collection(生成)

View File

@@ -53,9 +53,17 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
workspace.setUserName(userInfo.getUsername()); workspace.setUserName(userInfo.getUsername());
workspace.setIsLastIndex(0); workspace.setIsLastIndex(0);
if (null == workspace.getId()) { if (null == workspace.getId()) {
return workspaceMapper.insert(workspace) == 1; int insert = workspaceMapper.insert(workspace);
if (insert <= 0) {
throw new BusinessException("insert workspace failed");
}
return true;
}else { }else {
return workspaceMapper.updateById(workspace) == 1; int update = workspaceMapper.updateById(workspace);
if (update <= 0) {
throw new BusinessException("update workspace failed");
}
return true;
} }
} }
@@ -78,7 +86,10 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
workspace.setPosition(Position.OVERALL.getValue()); workspace.setPosition(Position.OVERALL.getValue());
workspace.setUserName(userName); workspace.setUserName(userName);
workspace.setIsLastIndex(1); workspace.setIsLastIndex(1);
workspaceMapper.insert(workspace); int insert = workspaceMapper.insert(workspace);
if (insert <= 0) {
throw new BusinessException("save workspace failed");
}
page = workspaceMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw); page = workspaceMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw);
vo.setPage(PageBaseResponse.success(page)); vo.setPage(PageBaseResponse.success(page));
vo.setId(workspace.getId()); vo.setId(workspace.getId());