BUGFIX: workspace校验添加;
This commit is contained in:
@@ -504,6 +504,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
}else {
|
||||
throw new BusinessException("templateId or modelType can't be null");
|
||||
}
|
||||
if (StringUtils.isEmpty(designDTO.getModelSex())) {
|
||||
throw new BusinessException("modelSex can't be null");
|
||||
}
|
||||
elementVO.setModelSex(designDTO.getModelSex());
|
||||
return elementVO;
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
workspace.setIsLastIndex(null);
|
||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||
workspace.setUserName(userInfo.getUsername());
|
||||
checkWorkspaceName(workspace.getId(), workspace.getWorkSpaceName(), userInfo.getUsername());
|
||||
if (null == workspace.getId()) {
|
||||
workspace.setIsLastIndex(0);
|
||||
QueryWrapper<SysFile> systemFemaleQw = new QueryWrapper<>();
|
||||
@@ -121,6 +122,17 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
}
|
||||
}
|
||||
|
||||
private void checkWorkspaceName(Long id, String workSpaceName, String userName) {
|
||||
QueryWrapper<Workspace> qw = new QueryWrapper<>();
|
||||
qw.lambda().ne(null != id, Workspace::getId, id);
|
||||
qw.lambda().eq(Workspace::getWorkSpaceName, workSpaceName);
|
||||
qw.lambda().eq(Workspace::getUserName, userName);
|
||||
List<Workspace> workspaces = baseMapper.selectList(qw);
|
||||
if (!CollectionUtils.isEmpty(workspaces)) {
|
||||
throw new BusinessException("The workspace name already exists!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkspaceVO getPage(WorkspaceDTO query) {
|
||||
WorkspaceVO vo = new WorkspaceVO();
|
||||
|
||||
Reference in New Issue
Block a user