Browse Source

append

dev_power_axis
YUJT 3 years ago
parent
commit
f68add317b
  1. 3
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java
  2. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  3. 1
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

3
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java

@ -69,7 +69,8 @@ public interface PowerAxisStructDao extends BaseDao<PowerAxisStructEntity> {
int countRepeatStructByName(@Param("customerId") String customerId,
@Param("name") String name,
@Param("agencyId") String agencyId,
@Param("pid") String pid);
@Param("pid") String pid,
@Param("id") String id);
/**
* 查询同组织下是否有同级的节点 主要用于一级节点判重

2
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java

@ -151,7 +151,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点");
}
}
if (baseDao.countRepeatStructByName(customerId, structDto.getName(), agencyId, structDto.getPid()) > NumConstant.ZERO) {
if (baseDao.countRepeatStructByName(customerId, structDto.getName(), agencyId, structDto.getPid(), structDto.getId()) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点");
}
}

1
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

@ -144,6 +144,7 @@
</if>
</otherwise>
</choose>
<if test="id != null and id != ''">AND s.ID != #{id}</if>
</select>
<select id="countRepeatStructByCategory" resultType="java.lang.Integer">
SELECT

Loading…
Cancel
Save