测试发现的问题

This commit is contained in:
chenxudong 2025-03-21 14:23:34 +08:00
parent e26819824a
commit d5a6459734
5 changed files with 33 additions and 28 deletions

View File

@ -177,28 +177,28 @@ public class RepoEdFileInfoController {
return ElectromagneticResultUtil.success(edFileInfoService.addFavorite(userId, id)); return ElectromagneticResultUtil.success(edFileInfoService.addFavorite(userId, id));
} }
/** // /**
* 从收藏夹移除 // * 从收藏夹移除
* // *
* @param id 文件id // * @param id 文件id
* @return // * @return
*/ // */
@GetMapping("/removeCollection") // @GetMapping("/removeCollection")
@UserOperation(value = "从收藏夹移除了文件", modelName = UserOperationModuleEnum.REPO_PRJ_DATABASE) // @UserOperation(value = "从收藏夹移除了文件", modelName = UserOperationModuleEnum.REPO_PRJ_DATABASE)
public ElectromagneticResult<?> removeFavorite(@RequestParam String id) { // public ElectromagneticResult<?> removeFavorite(@RequestParam String id) {
String userId = UserThreadLocal.getUserId(); // String userId = UserThreadLocal.getUserId();
return ElectromagneticResultUtil.success(edFileInfoService.removeFavorite(userId, id)); // return ElectromagneticResultUtil.success(edFileInfoService.removeFavorite(userId, id));
} // }
//
/** // /**
* 展示当前用户收藏夹文件 // * 展示当前用户收藏夹文件
* // *
* @return // * @return
*/ // */
@PostMapping("/listCollection") // @PostMapping("/listCollection")
@UserOperation(value = "查看了收藏夹", modelName = UserOperationModuleEnum.REPO_PRJ_DATABASE) // @UserOperation(value = "查看了收藏夹", modelName = UserOperationModuleEnum.REPO_PRJ_DATABASE)
public ElectromagneticResult<?> listFavorite(@RequestBody FileInfoQueryDTO fileInfoQueryDTO) { // public ElectromagneticResult<?> listFavorite(@RequestBody FileInfoQueryDTO fileInfoQueryDTO) {
String userId = UserThreadLocal.getUserId(); // String userId = UserThreadLocal.getUserId();
return ElectromagneticResultUtil.success(edFileInfoService.findFavorite(userId, fileInfoQueryDTO)); // return ElectromagneticResultUtil.success(edFileInfoService.findFavorite(userId, fileInfoQueryDTO));
} // }
} }

View File

@ -37,4 +37,6 @@ public class RolePermissionDTO {
* 子目录 * 子目录
*/ */
private List<RolePermissionDTO> children; private List<RolePermissionDTO> children;
private int dataOwnCode;
} }

View File

@ -337,7 +337,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
.set(EdFileInfo::getFileNote, updateFileInfoDTO.getFileNote())); .set(EdFileInfo::getFileNote, updateFileInfoDTO.getFileNote()));
String newName = updateFileInfoDTO.getFileName() + "." + fileInfo.getFileType() + "." + fileInfo.getFileCode(); String newName = updateFileInfoDTO.getFileName() + "." + fileInfo.getFileType() + "." + fileInfo.getFileCode();
fileSystemService.renameFile(srcFilePath, newName); fileSystemService.renameFile(srcFilePath, newName);
UserThreadLocal.setSuccessInfo(commonService.getLastPrjLeafId(fileInfo.getFilePath()), updateFileInfoDTO.getId(), "更新文件信息成功,新文件名为 {}.{}", newFileName, fileInfo.getFileType()); UserThreadLocal.setSuccessInfo(commonService.getLastPrjLeafId(fileInfo.getFilePath()), updateFileInfoDTO.getId(), "更新文件信息成功,新文件名为 {}.{},新备注为 {}", newFileName, fileInfo.getFileType(), updateFileInfoDTO.getFileNote());
return ElectromagneticResultUtil.success(true); return ElectromagneticResultUtil.success(true);
} catch (Exception e) { } catch (Exception e) {
String info = StrFormatter.format("更新文件信息失败,新文件名 {} 原因 {}", newFileName, e.getMessage()); String info = StrFormatter.format("更新文件信息失败,新文件名 {} 原因 {}", newFileName, e.getMessage());

View File

@ -178,7 +178,7 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
if (count > 0) { if (count > 0) {
String info = StrFormatter.format("禁止废除非空项目,废除失败。"); String info = StrFormatter.format("禁止废除非空项目,废除失败。");
log.info(info); log.info(info);
ElectromagneticResultUtil.fail("-1", info); return ElectromagneticResultUtil.fail("-1", info);
} }
LambdaQueryWrapper<EdFileInfo> queryWrapper = Wrappers.lambdaQuery(EdFileInfo.class) LambdaQueryWrapper<EdFileInfo> queryWrapper = Wrappers.lambdaQuery(EdFileInfo.class)

View File

@ -272,14 +272,17 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
public RoleDTO getRoleTemplate() { public RoleDTO getRoleTemplate() {
RoleDTO roleDTO = new RoleDTO(); RoleDTO roleDTO = new RoleDTO();
List<EdFileInfo> infos = getFiles(DataOwnEnum.SYS_PRJ.code); List<EdFileInfo> sysInfos = getFiles(DataOwnEnum.SYS_PRJ.code);
List<EdFileInfo> repoInfos = getFiles(DataOwnEnum.REPO_PRJ.code);
List<EdFileInfo> infos = new ArrayList<>(sysInfos);
infos.addAll(repoInfos);
List<RolePermissionDTO> nodes = new ArrayList<>(); List<RolePermissionDTO> nodes = new ArrayList<>();
for (EdFileInfo info : infos) { for (EdFileInfo info : infos) {
RolePermissionDTO rolePermissionDTO = new RolePermissionDTO(); RolePermissionDTO rolePermissionDTO = new RolePermissionDTO();
rolePermissionDTO.setId(info.getId()); rolePermissionDTO.setId(info.getId());
rolePermissionDTO.setParentId(info.getParentId()); rolePermissionDTO.setParentId(info.getParentId());
rolePermissionDTO.setFileName(info.getFileName()); rolePermissionDTO.setFileName(info.getFileName());
rolePermissionDTO.setDataOwnCode(info.getDataOwn());
List<String> permissionCodes = new ArrayList<>(); List<String> permissionCodes = new ArrayList<>();
Map<String, Boolean> dataAuth = new HashMap<>(); Map<String, Boolean> dataAuth = new HashMap<>();
dataAuth.put("data", false); dataAuth.put("data", false);