fix: 问题修复,添加打印,托盘显示等功能
This commit is contained in:
@@ -373,10 +373,8 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) throws SQLException {
|
||||
for (String line_uuid : ids) {
|
||||
this.removeById(line_uuid);
|
||||
}
|
||||
reload();
|
||||
routeLineMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
//reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -427,14 +425,14 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
List<RouteLine> routeLineList= new LambdaQueryChainWrapper<>(routeLineMapper)
|
||||
.eq(RouteLine::getRoute_plan_id,route_plan_id)
|
||||
.list();
|
||||
JSONArray route = JSONArray.parseArray(JSON.toJSONString(routeLineList));
|
||||
Map n[][] = new HashMap[size][size];
|
||||
//建二维数组
|
||||
for (int i = 0; i < route.size(); i++) {
|
||||
JSONObject jo = (JSONObject) route.get(i);
|
||||
String start = jo.getString("device_code");
|
||||
String end = jo.getString("next_device_code");
|
||||
if (ObjectUtil.isEmpty(map.get(start)) || ObjectUtil.isEmpty(map.get(end))) {//如果路由中的设备号在设备列表中找不到就跳过
|
||||
for (int i = 0; i < routeLineList.size(); i++) {
|
||||
RouteLine routeLine = routeLineList.get(i);
|
||||
String start = routeLine.getDevice_code();
|
||||
String end = routeLine.getNext_device_code();
|
||||
if (ObjectUtil.isEmpty(map.get(start)) || ObjectUtil.isEmpty(map.get(end))) {
|
||||
//如果路由中的设备号在设备列表中找不到就跳过
|
||||
continue;
|
||||
}
|
||||
Integer s = Integer.valueOf(map.get(start));
|
||||
@@ -442,10 +440,10 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
HashMap<String, String> smap = new HashMap<>();
|
||||
smap.put("device_code", start);
|
||||
smap.put("next_device_code", end);
|
||||
smap.put("type", jo.getString("type"));
|
||||
smap.put("type", routeLine.getType());
|
||||
smap.put("path", start + "->" + end);
|
||||
smap.put("weights", jo.getString("weights"));
|
||||
smap.put("route_plan_id", jo.getString("route_plan_id"));
|
||||
smap.put("weights", routeLine.getWeights());
|
||||
smap.put("route_plan_id", routeLine.getRoute_plan_id());
|
||||
n[s][e] = smap;
|
||||
}
|
||||
//对数组使用Floyd(弗洛伊德)算法,求出任意两个设备之间的最短距离,不通则为null
|
||||
|
||||
Reference in New Issue
Block a user