修复国标级联时添加目录不同平台无法使用同一个目录的问题

This commit is contained in:
648540858
2023-07-19 15:33:21 +08:00
parent 19533c8f4d
commit 9cd63f0105
10 changed files with 33 additions and 47 deletions

View File

@@ -428,7 +428,7 @@ public class PlatformController {
if (logger.isDebugEnabled()) {
logger.debug("添加目录,{}", JSON.toJSONString(platformCatalog));
}
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getId());
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getPlatformId(), platformCatalog.getId());
if (platformCatalogInStore != null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), platformCatalog.getId() + " already exists");
@@ -453,7 +453,7 @@ public class PlatformController {
if (logger.isDebugEnabled()) {
logger.debug("编辑目录,{}", JSON.toJSONString(platformCatalog));
}
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getId());
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getPlatformId(), platformCatalog.getId());
if (platformCatalogInStore == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), platformCatalog.getId() + " not exists");
@@ -486,7 +486,7 @@ public class PlatformController {
throw new ControllerException(ErrorCode.ERROR400);
}
int delResult = storager.delCatalog(id);
int delResult = storager.delCatalog(platformId, id);
// 如果删除的是默认目录则根目录设置为默认目录
PlatformCatalog parentPlatform = storager.queryDefaultCatalogInPlatform(platformId);