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);