优化功能,修复已知问题。
This commit is contained in:
parent
16a256ced8
commit
3fe8c1498f
|
|
@ -251,9 +251,8 @@ public class CommonService {
|
|||
.eq(EdFileInfo::getId, parentId);
|
||||
EdFileInfo edFileInfo = edFileInfoMapper.selectOne(queryWrapper);
|
||||
String currentPath = edFileInfo.getFilePath();
|
||||
List<String> paths = CollUtil.newArrayList(edFileInfo.getFilePath().split(MYSQL_FILE_PATH_SPLIT));
|
||||
if (maxLengthCheck) {
|
||||
if (paths.size() >= elePropertyConfig.getPrjFolderMaxLength()) {
|
||||
if (StrUtil.count(currentPath, MYSQL_FILE_PATH_SPLIT) >= elePropertyConfig.getPrjFolderMaxLength() - 1) {
|
||||
String info = StrFormatter.format("当前子集已达到最大层级,禁止创建子集,{} 创建失败。", folderName);
|
||||
log.error(info);
|
||||
return ElectromagneticResultUtil.fail("-1", info);
|
||||
|
|
@ -297,19 +296,12 @@ public class CommonService {
|
|||
}
|
||||
|
||||
/**
|
||||
* 1.询管理员从层级定义处查。2.用户从数据库管理界面查询。
|
||||
*
|
||||
* @param querySource 0:询管理员从层级定义处查。 2.用户从数据库管理界面查询。
|
||||
* @param querySource 管理员从层级定义处查询,用户从数据库管理界面查询。
|
||||
* @param accessibleIds
|
||||
* @param returnType
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer, List<String>> querySysPrjTree(int querySource, List<String> accessibleIds, Object returnType) {
|
||||
|
||||
/**
|
||||
* querySource=SYS_PRJ(从层级定义处查询) querySource=SYS_DB(从数据库界面处查询)
|
||||
*/
|
||||
|
||||
Map<Integer, List<String>> map = new HashMap<>();
|
||||
try {
|
||||
// 首先查出所有的工程id
|
||||
|
|
|
|||
|
|
@ -346,8 +346,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
.eq(EdFileInfo::getId, updateFileInfoDTO.getId())
|
||||
.set(EdFileInfo::getFileName, updateFileInfoDTO.getFileName())
|
||||
.set(EdFileInfo::getFileNote, updateFileInfoDTO.getFileNote()));
|
||||
String newName = updateFileInfoDTO.getFileName() + "." + fileInfo.getFileType() + "." + fileInfo.getFileCode();
|
||||
fileSystemService.renameFile(srcFilePath, newName);
|
||||
UserThreadLocal.setSuccessInfo(commonService.getLastPrjLeafId(fileInfo.getFilePath()), updateFileInfoDTO.getId(), "更新文件信息成功,新文件名为 {}.{},新备注为 {},路径为 {}", newFileName, fileInfo.getFileType(), updateFileInfoDTO.getFileNote(), dbPath);
|
||||
return ElectromagneticResultUtil.success(true);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -157,17 +157,6 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
|||
this.baseMapper.update(new EdFileInfo(), Wrappers.lambdaUpdate(EdFileInfo.class)
|
||||
.eq(EdFileInfo::getId, prjId)
|
||||
.set(EdFileInfo::getFileName, newPrjName));
|
||||
|
||||
String prjPath;
|
||||
DataOwnEnum enumByCode = DataOwnEnum.getEnumByCode(dataOwnCode);
|
||||
switch (Objects.requireNonNull(enumByCode)) {
|
||||
case USER_PRJ, USER_FILE ->
|
||||
prjPath = commonService.getPrjRootPath1(dataOwnCode) + File.separator + UserThreadLocal.getUserId() + File.separator;
|
||||
case REPO_PRJ, REPO_FILE, SYS_PRJ, SYS_FILE ->
|
||||
prjPath = commonService.getPrjRootPath1(dataOwnCode) + File.separator;
|
||||
default -> throw new BizException("参数错误");
|
||||
}
|
||||
fileSystemService.renameFile(prjPath, oldPrjName, newPrjName);
|
||||
UserThreadLocal.setSuccessInfo("", prjId, "修改工层名 {} 为 {} 成功。", oldPrjName, newPrjName);
|
||||
} catch (Exception e) {
|
||||
String info = StrFormatter.format("修改工程名异常--->{},{}", newPrjName, e.getMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue