Browse Source

message:

修改添加功能,同一父节点下不能有重名子节点
dev_power_axis
HAHA 3 years ago
parent
commit
54f754ed43
  1. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  2. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java
  3. 1
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

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

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

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

@ -64,7 +64,7 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl<PowerService
QueryWrapper<PowerServiceStationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id)
.eq(StringUtils.isNotBlank(name), "NAME", name)
.eq(StringUtils.isNotBlank(axisStructId), "STRUCT_REFERENCE_ID", name);
.eq(StringUtils.isNotBlank(axisStructId), "STRUCT_REFERENCE_ID", axisStructId);
return wrapper;
}

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

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

Loading…
Cancel
Save