reformat code

This commit is contained in:
chenxudong 2025-04-15 17:44:00 +08:00
parent 56a49fb271
commit 98d8b621b3
5 changed files with 19 additions and 25 deletions

View File

@ -1,7 +1,6 @@
package com.electromagnetic.industry.software.manage.pojo.models; package com.electromagnetic.industry.software.manage.pojo.models;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.github.mymonstercat.Model;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;

View File

@ -528,9 +528,12 @@ public class CommonService {
DataOwnEnum obj = DataOwnEnum.getEnumByCode(dataOwnCode); DataOwnEnum obj = DataOwnEnum.getEnumByCode(dataOwnCode);
switch (Objects.requireNonNull(obj)) { switch (Objects.requireNonNull(obj)) {
case USER_FILE, USER_PRJ -> prjInfo = queryUserPrjTree(PrjQuerySource.USER_DB.value, new FileProjectVO()).getOrDefault(PrjQuerySource.USER_DB.value, new ArrayList<>()); case USER_FILE, USER_PRJ ->
case SYS_FILE, SYS_PRJ -> prjInfo = querySysPrjTree(PrjQuerySource.SYS_DB.value, accessibleIds, new FileProjectVO()).getOrDefault(PrjQuerySource.SYS_DB.value, new ArrayList<>()); prjInfo = queryUserPrjTree(PrjQuerySource.USER_DB.value, new FileProjectVO()).getOrDefault(PrjQuerySource.USER_DB.value, new ArrayList<>());
case REPO_PRJ, REPO_FILE -> prjInfo = queryRepoPrjTree(PrjQuerySource.REPO_DB.value, accessibleIds, new FileProjectVO()).getOrDefault(PrjQuerySource.REPO_DB.value, new ArrayList<>()); case SYS_FILE, SYS_PRJ ->
prjInfo = querySysPrjTree(PrjQuerySource.SYS_DB.value, accessibleIds, new FileProjectVO()).getOrDefault(PrjQuerySource.SYS_DB.value, new ArrayList<>());
case REPO_PRJ, REPO_FILE ->
prjInfo = queryRepoPrjTree(PrjQuerySource.REPO_DB.value, accessibleIds, new FileProjectVO()).getOrDefault(PrjQuerySource.REPO_DB.value, new ArrayList<>());
default -> ElectromagneticResultUtil.fail("-1", "参数错误"); default -> ElectromagneticResultUtil.fail("-1", "参数错误");
} }

View File

@ -64,26 +64,20 @@ import static com.electromagnetic.industry.software.common.enums.FileRepeatEnum.
@Service @Service
public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo> implements EdFileInfoService { public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo> implements EdFileInfoService {
private static final Map<String, List<String>> FILE_DB_ID_NAME = new ConcurrentHashMap<>();
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class); private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
@Resource @Resource
private CommonService commonService; private CommonService commonService;
@Resource @Resource
private FileSystemService fileSystemService; private FileSystemService fileSystemService;
@Resource @Resource
private PermissionService permissionService; private PermissionService permissionService;
@Resource @Resource
private UserMapper userMapper; private UserMapper userMapper;
@Resource @Resource
private ElePropertyConfig elePropertyConfig; private ElePropertyConfig elePropertyConfig;
@Resource @Resource
private EdFileFavoriteService fileFavoriteService; private EdFileFavoriteService fileFavoriteService;
@Resource @Resource
private FileTagRelationService fileTagRelationService; private FileTagRelationService fileTagRelationService;
@Resource @Resource
@ -93,8 +87,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
@Resource @Resource
private EdFileFavoriteMapper edFileFavoriteMapper; private EdFileFavoriteMapper edFileFavoriteMapper;
private static final Map<String, List<String>> FILE_DB_ID_NAME = new ConcurrentHashMap<>();
/** /**
* 查询文件列表 * 查询文件列表
* *

View File

@ -153,11 +153,11 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
.eq(EdFileInfo::getId, prjId)); .eq(EdFileInfo::getId, prjId));
String oldPrjName = fileInfo.getFileName(); String oldPrjName = fileInfo.getFileName();
try { try {
Assert.isTrue(EleCommonUtil.isFileNameValid(newPrjName), StrFormatter.format("{} {}{} 修改失败。", newPrjName, NAME_VALID_MSG, oldPrjName));
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::getEffectFlag, EffectFlagEnum.EFFECT.code)
.eq(EdFileInfo::getFileName, newPrjName)); .eq(EdFileInfo::getFileName, newPrjName));
Assert.isTrue(EleCommonUtil.isFileNameValid(newPrjName), StrFormatter.format("{} {}{} 修改失败。", newPrjName, NAME_VALID_MSG, oldPrjName));
if (count > 0) { if (count > 0) {
String info = StrFormatter.format("{} 项目已经存在,{} 修改失败。", newPrjName, oldPrjName); String info = StrFormatter.format("{} 项目已经存在,{} 修改失败。", newPrjName, oldPrjName);
log.info(info); log.info(info);