diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLineService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLineService.java index 8351199..88bc0ff 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLineService.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLineService.java @@ -40,19 +40,46 @@ public interface RouteLineService extends CommonService { */ List queryAll(RouteLineQueryParam query); + /** + * 根据id查询 + * @param id + * @return + */ RouteLine getById(String id); + /** + * 根据id查询 + * @param id + * @return + */ RouteLineDto findById(String id); /** * 插入一条新数据。 + * @param resources + * @return */ int insert(RouteLineDto resources); + /** + * 根据id修改 + * @param resources + * @return + */ int updateById(RouteLineDto resources); + /** + * 根据id删除 + * @param id + * @return + */ int removeById(String id); + /** + * 批量删除 + * @param ids + * @return + */ int removeByIds(Set ids); /** @@ -115,8 +142,8 @@ public interface RouteLineService extends CommonService { /** * 根据编码,查询下一级的路由,即此设备目标的路由 - * * @param code + * @param plan_uuid * @return */ JSONArray queryNextLine(String code, String plan_uuid); @@ -150,23 +177,23 @@ public interface RouteLineService extends CommonService { /** * 创建 - * - * @param data / + * @param data + * @throws SQLException */ void create(Map data) throws SQLException; /** * 编辑 - * - * @param dto / + * @param dto + * @throws SQLException */ void update(RouteLineDto dto) throws SQLException; /** * 多选删除 - * - * @param ids / + * @param ids + * @throws SQLException */ void deleteAll(String[] ids) throws SQLException; @@ -181,14 +208,16 @@ public interface RouteLineService extends CommonService { /** * 启用或停用 - * + * @param routeLineId * @param ia_active 1 启用,0 禁用 + * @throws SQLException */ void enabled(String routeLineId, String ia_active) throws SQLException; /** * 更新通路情况 * 任意两台设备之间的通路情况 + * @param route_plan_id */ void replaceAccess(String route_plan_id); @@ -201,12 +230,36 @@ public interface RouteLineService extends CommonService { */ boolean getReplaceAccess(String startDeviceCode, String endDeviceCode); + /** + * 重新加载通路 + * @throws SQLException + */ void reload() throws SQLException; + /** + * 检查是否存在通路 + * @param startDevice + * @param nextDevice + * @param routecode + * @return + * @throws Exception + */ boolean checkRouteLine(String startDevice, String nextDevice, String routecode) throws Exception; + /** + * 查询所有通路 + * @return + */ public Map getRouteLines(); + /** + * 根据起点设备编号查询所有目的地设备 + * + * @param device_code + * @param next_device_code + * @param plan_code + * @return + */ public List getShortPathLines(String device_code, String next_device_code, String plan_code); /** @@ -227,8 +280,23 @@ public interface RouteLineService extends CommonService { */ public List getPathLinesByCode(String device_code, String plan_code); + /** + * 根据设备编号查询所有目的地设备 + * + * @param device_code + * @param plan_code + * @return + */ public List getSuperiorShortPathLinesByCode(String device_code, String plan_code); + /** + * 根据设备编号终点设备路由查询所有目的地设备 + * + * @param device_code + * @param next_device_code + * @param plan_code + * @return + */ public JSONArray getActivePathLine(String device_code, String next_device_code, String plan_code); /** diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLocService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLocService.java index 93a96d2..23e835a 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLocService.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RouteLocService.java @@ -38,19 +38,49 @@ public interface RouteLocService extends CommonService { */ List queryAll(RouteLocQueryParam query); + /** + * 根据ID查询 + * + * @param id ID + * @return RouteLoc + */ RouteLoc getById(String id); + /** + * 根据ID查询 + * + * @param id ID + * @return RouteLocDto + */ RouteLocDto findById(String id); /** - * 插入一条新数据。 + * 新增数据 + * + * @param resources / + * @return RouteLocDto */ int insert(RouteLocDto resources); + /** + * 编辑数据 + * + * @param resources / + */ int updateById(RouteLocDto resources); + /** + * 删除数据 + * + * @param id ID + */ int removeById(String id); + /** + * 批量删除数据 + * + * @param ids ID集合 + */ int removeByIds(Set ids); /** diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RoutePlanService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RoutePlanService.java index 84ca751..46ac452 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RoutePlanService.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/RoutePlanService.java @@ -39,19 +39,49 @@ public interface RoutePlanService extends CommonService { */ List queryAll(RoutePlanQueryParam query); + /** + * 根据ID查询 + * + * @param id ID + * @return RoutePlan + */ RoutePlan getById(String id); + /** + * 根据ID查询 + * + * @param id ID + * @return RoutePlanDto + */ RoutePlanDto findById(String id); /** - * 插入一条新数据。 + * 新增数据 + * + * @param resources / + * @return RoutePlanDto */ int insert(RoutePlanDto resources); + /** + * 修改数据 + * + * @param resources / + */ int updateById(RoutePlanDto resources); + /** + * 删除数据 + * + * @param id ID + */ int removeById(String id); + /** + * 批量删除数据 + * + * @param ids ID集合 + */ int removeByIds(Set ids); /** diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java index e98d478..ef08872 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/route/service/impl/RouteLineServiceImpl.java @@ -70,9 +70,10 @@ public class RouteLineServiceImpl extends CommonServiceImpl routePlans = new HashMap(); Map routeIndex = new HashMap(); Map routeLines = new HashMap(); - - Map deviceCoordinate = null;//用来确定设备在 路由二维数组中的坐标 - Map[][] routeChart = null;//路由二维数组 + //用来确定设备在 路由二维数组中的坐标 + Map deviceCoordinate = null; + //路由二维数组 + Map[][] routeChart = null; List routePlansList = new ArrayList<>(); // private final RedisUtils redisUtils; private final RouteLineMapper routeLineMapper; @@ -161,13 +162,6 @@ public class RouteLineServiceImpl extends CommonServiceImpl") + 1); - if (graph[j][k] == null) {//最开始两点间不是直接通路,需要经过别的点 + //最开始两点间不是直接通路,需要经过别的点 + if (graph[j][k] == null) { String device_code = s1.substring(0, s1.indexOf("-")); HashMap map = new HashMap<>(); - map.put("device_code", device_code);//开始 - map.put("next_device_code", end);//终点 + //开始 + map.put("device_code", device_code); + //终点 + map.put("next_device_code", end); map.put("weights", v1 + v2 + ""); map.put("type", (String) graph[j][i].get("type")); map.put("route_plan_id", (String) graph[j][i].get("route_plan_id")); @@ -679,11 +670,11 @@ public class RouteLineServiceImpl extends CommonServiceImpl implements RouteLocService { - // private final RedisUtils redisUtils; private final RouteLocMapper routeLocMapper; @Override @@ -155,13 +154,7 @@ public class RouteLocServiceImpl extends CommonServiceImpl implements RoutePlanService { - // private final RedisUtils redisUtils; private final RoutePlanMapper routePlanMapper; @Override @@ -156,13 +155,7 @@ public class RoutePlanServiceImpl extends CommonServiceImpl { /** * 分页查询 + * @param page + * @param queryWrapper + * @param

+ * @return */ @Select(wrapperSql)

> P queryPage(P page, @Param("ew") Wrapper queryWrapper); + /** + * 查询所有 + * @param queryWrapper + * @return + */ @Select(wrapperRlSql) List selectRouteLineList(@Param("ew") Wrapper queryWrapper); }