TASK:workspace、design模块代码;
This commit is contained in:
@@ -9,8 +9,8 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
*/
|
||||
public enum Position implements IEnumDisplay {
|
||||
|
||||
OVERALL("整体"),
|
||||
SINGLE("部位")
|
||||
OVERALL("overall"),
|
||||
SINGLE("single")
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
@@ -9,9 +9,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
*/
|
||||
public enum Sex implements IEnumDisplay {
|
||||
|
||||
MALE("男装"),
|
||||
FEMALE("女装"),
|
||||
CHILD("童装")
|
||||
MALE("male"),
|
||||
FEMALE("female"),
|
||||
CHILD("child")
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
@@ -218,7 +218,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
//保存collection
|
||||
Long collectionId = (null == collectionIdParam) ?
|
||||
collectionService.saveCollection(userInfo.getId(),designDTO.getTimeZone(),designDTO.getMoodTemplateId()) : collectionIdParam;
|
||||
List<Long> elementIds =getElementId(elementVO);
|
||||
List<Long> elementIds = getElementId(elementVO);
|
||||
//批量关联element 到 collection
|
||||
collectionElementService.relationCollection(elementIds,collectionId);
|
||||
//library转化为collection(生成)
|
||||
|
||||
@@ -53,9 +53,17 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
workspace.setUserName(userInfo.getUsername());
|
||||
workspace.setIsLastIndex(0);
|
||||
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 {
|
||||
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.setUserName(userName);
|
||||
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);
|
||||
vo.setPage(PageBaseResponse.success(page));
|
||||
vo.setId(workspace.getId());
|
||||
|
||||
Reference in New Issue
Block a user