From 75a0054185acb56b542d17627f8e4306bdef918e Mon Sep 17 00:00:00 2001 From: YUJT Date: Fri, 22 Apr 2022 15:42:07 +0800 Subject: [PATCH] append --- .../impl/PowerAxisStructServiceImpl.java | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index ce016b5..d726a30 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -129,19 +129,38 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + if (baseDao.queryCategory(struct) > NumConstant.ZERO) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); } } - if (baseDao.queryName(form) > NumConstant.ZERO) { + if (baseDao.queryName(struct) > NumConstant.ZERO) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); } - - this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId()); - - baseDao.insert(form); } /** @@ -198,28 +217,6 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ZERO) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); - } - } - if (baseDao.queryName(form) > NumConstant.ZERO) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); - } - - this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId()); - - baseDao.updateById(form); - } - -// private void - @Override public void delete(String id) { baseDao.delete(id);