From a20db6ec6208d35cfd85ec7c01628005060c1194 Mon Sep 17 00:00:00 2001 From: YUJT Date: Fri, 22 Apr 2022 15:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BC=82=E5=B8=B8=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PowerAxisStructServiceImpl.java | 12 +++++++----- .../axis/service/impl/PowerAxisTagServiceImpl.java | 4 ++-- 2 files changed, 9 insertions(+), 7 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 96e371b..061e7a3 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 @@ -9,6 +9,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; @@ -131,11 +132,11 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ZERO) { - throw new EpmetException("同一组织下只允许存在一个顶级节点"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); } } if (baseDao.queryName(form) > NumConstant.ZERO) { - throw new EpmetException("同一组织下不允许存在重名的节点"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); } this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId()); @@ -166,23 +167,24 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl agencyInfoResult = govOrgOpenFeignClient.getAgencyById(agencyId); if (!agencyInfoResult.success()) { - throw new EpmetException(agencyInfoResult.getMsg()); + throw new EpmetException(agencyInfoResult.getCode(), agencyInfoResult.getMsg()); } CustomerAgencyDTO agencyInfo = agencyInfoResult.getData(); struct.setAgencyId(agencyInfo.getId()); struct.setAgencyName(agencyInfo.getOrganizationName()); struct.setAgencyType(agencyInfo.getLevel()); + struct.setPids(StringUtils.EMPTY); } else { // 新增一级节点或二级节点 PowerAxisStructEntity parentStruct = baseDao.selectById(pid); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java index 06ec363..697415d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java @@ -99,7 +99,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl listSimple(String tagCategory) { if (StringUtils.isBlank(tagCategory)) { - throw new EpmetException("缺少参数"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "缺少参数"); } QueryWrapper wrapper = new QueryWrapper<>(); @@ -126,7 +126,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl list = baseDao.selectList(lqw); if (list.size() != NumConstant.ONE) { - throw new EpmetException("动力主轴标签配置出错"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "动力主轴标签配置出错"); } return list.get(NumConstant.ZERO).getStructLevel(); }