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