|
@ -9,7 +9,6 @@ import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
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.page.PageData; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
@ -151,14 +150,14 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 验证表单字段
|
|
|
// 验证表单字段
|
|
|
private void verifyStructField(PowerAxisStructEntity struct){ |
|
|
private void verifyStructField(PowerAxisStructEntity struct) { |
|
|
int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), struct.getCategoryCode()); |
|
|
int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), struct.getCategoryCode()); |
|
|
if (PowerTagLevelEnum.ROOT.level() == structLevel) { |
|
|
if (PowerTagLevelEnum.ROOT.level() == structLevel) { |
|
|
if (baseDao.queryCategory(struct) > NumConstant.ZERO) { |
|
|
if (baseDao.queryCategory(struct) > NumConstant.ZERO) { |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (baseDao.queryName(struct) > NumConstant.ZERO) { |
|
|
if (baseDao.countByRepeatStruct(struct) > NumConstant.ZERO) { |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|