This commit is contained in:
s2042968 2025-02-19 10:52:48 +08:00
commit de63dfe9d6
2 changed files with 9 additions and 3 deletions

View File

@ -297,7 +297,7 @@ public class CommonService {
} else { } else {
// 先设置dataStatus状态为删除状态 // 先设置dataStatus状态为删除状态
edFileInfoMapper.update(null, Wrappers.<EdFileInfo>lambdaUpdate() edFileInfoMapper.update(null, Wrappers.<EdFileInfo>lambdaUpdate()
.eq(EdFileInfo::getId, id) .like(EdFileInfo::getFilePath, id)
.set(EdFileInfo::getSort, -1) .set(EdFileInfo::getSort, -1)
.set(EdFileInfo::getUpdatedBy, currentUserId) .set(EdFileInfo::getUpdatedBy, currentUserId)
.set(EdFileInfo::getUpdatedTime, now) .set(EdFileInfo::getUpdatedTime, now)
@ -308,7 +308,6 @@ public class CommonService {
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code) .eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code)
.ne(EdFileInfo::getDataStatus, EleDataStatusEnum.DELETED.code) .ne(EdFileInfo::getDataStatus, EleDataStatusEnum.DELETED.code)
.eq(EdFileInfo::getParentId, parentId) .eq(EdFileInfo::getParentId, parentId)
.orderByAsc(EdFileInfo::getSort)); .orderByAsc(EdFileInfo::getSort));
for (int i = 0; i < edFileInfos1.size(); i++) { for (int i = 0; i < edFileInfos1.size(); i++) {

View File

@ -63,6 +63,7 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
// 首先检查工程是否存在 // 首先检查工程是否存在
Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class) Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class)
.eq(EdFileInfo::getParentId, PRJ_PARENT_ID) .eq(EdFileInfo::getParentId, PRJ_PARENT_ID)
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code)
.eq(EdFileInfo::getFileName, prjName)); .eq(EdFileInfo::getFileName, prjName));
if (count > 0) { if (count > 0) {
@ -351,6 +352,7 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
EdFileInfo sourceFile = sourceFileNameMap.get(sourceFileName); EdFileInfo sourceFile = sourceFileNameMap.get(sourceFileName);
EdFileInfo targetFile = new EdFileInfo(); EdFileInfo targetFile = new EdFileInfo();
int maxFolderId = Integer.parseInt(this.baseMapper.maxPrjId()); int maxFolderId = Integer.parseInt(this.baseMapper.maxPrjId());
String newFolderId = String.valueOf(maxFolderId + 1); String newFolderId = String.valueOf(maxFolderId + 1);
String nowTimeStr = EleCommonUtil.getNowTimeStr(); String nowTimeStr = EleCommonUtil.getNowTimeStr();
String fileCode = commonService.createFileCode(targetParentFile.getId(), EleDataTypeEnum.FOLDER.desc, FILE_START_VERSION, nowTimeStr); String fileCode = commonService.createFileCode(targetParentFile.getId(), EleDataTypeEnum.FOLDER.desc, FILE_START_VERSION, nowTimeStr);
@ -389,7 +391,12 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
} }
return ElectromagneticResultUtil.success(true); return ElectromagneticResultUtil.success(true);
} catch (Exception e) { } catch (Exception e) {
String info = StrFormatter.format("层级沿用失败"); String info;
if (e instanceof BizException) {
info = StrFormatter.format("层级沿用失败,{}", e.getMessage());
} else {
info = "层级沿用失败";
}
log.error(info, e); log.error(info, e);
throw new BizException(info); throw new BizException(info);
} }