修改已知问题。
This commit is contained in:
parent
5b2817d66e
commit
5390bd1e40
|
|
@ -194,7 +194,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
|
||||
List<String> accessibleIds;
|
||||
|
||||
if (querySource == PrjQuerySource.SYS_DB.value) {
|
||||
if (querySource == PrjQuerySource.SYS_DB.value || querySource == PrjQuerySource.REPO_DB.value) {
|
||||
accessibleIds = permissionService.getAccessibleTree();
|
||||
if (CollUtil.isEmpty(accessibleIds)) {
|
||||
return ElectromagneticResultUtil.success(new ArrayList<>());
|
||||
|
|
|
|||
|
|
@ -66,11 +66,15 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
|||
}
|
||||
|
||||
// 首先检查工程是否存在
|
||||
Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class)
|
||||
LambdaQueryWrapper<EdFileInfo> queryWrapper = Wrappers.lambdaQuery(EdFileInfo.class)
|
||||
.eq(EdFileInfo::getParentId, PRJ_PARENT_ID)
|
||||
.eq(EdFileInfo::getDataOwn, dataOwnCode)
|
||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code)
|
||||
.eq(EdFileInfo::getFileName, prjName));
|
||||
.eq(EdFileInfo::getFileName, prjName);
|
||||
if (DataOwnEnum.isUserCode(dataOwnCode)) {
|
||||
queryWrapper.eq(EdFileInfo::getCreatedBy, UserThreadLocal.getUserId());
|
||||
}
|
||||
Long count = this.baseMapper.selectCount(queryWrapper);
|
||||
|
||||
if (count > 0) {
|
||||
String info = StrFormatter.format("{} 项目已经存在", prjName);
|
||||
|
|
@ -81,7 +85,20 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
|||
try {
|
||||
// 保存信息到MySQL
|
||||
String maxPrjId = this.baseMapper.maxPrjId();
|
||||
int prjCount = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class).eq(EdFileInfo::getParentId, PRJ_PARENT_ID)).intValue();
|
||||
int prjCount;
|
||||
if (DataOwnEnum.isUserCode(dataOwnCode)) {
|
||||
prjCount = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class).eq(EdFileInfo::getParentId, PRJ_PARENT_ID)
|
||||
.eq(EdFileInfo::getDataOwn, DataOwnEnum.USER_PRJ.code).eq(EdFileInfo::getCreatedBy, UserThreadLocal.getUserId()))
|
||||
.intValue();
|
||||
} else if (DataOwnEnum.isSysCode(dataOwnCode)) {
|
||||
prjCount = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class).eq(EdFileInfo::getParentId, PRJ_PARENT_ID)
|
||||
.eq(EdFileInfo::getDataOwn, DataOwnEnum.SYS_PRJ.code))
|
||||
.intValue();
|
||||
} else {
|
||||
prjCount = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class).eq(EdFileInfo::getParentId, PRJ_PARENT_ID)
|
||||
.eq(EdFileInfo::getDataOwn, DataOwnEnum.REPO_PRJ.code))
|
||||
.intValue();
|
||||
}
|
||||
int id = Integer.parseInt(StrUtil.isEmpty(maxPrjId) ? "100000" : maxPrjId);
|
||||
String newPrjId = String.valueOf(id + 1);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue