Commit 1639a4e7 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent dbbae009
......@@ -493,50 +493,52 @@ public class LiResourceController extends AbstractController {
List<Map<String, Object>> nodes = new ArrayList<>();
for (LiStationMap liStationMap : mapList) {
Map<String, Object> mapStationMap = JSONObject.parseObject(JSONObject.toJSONString(liStationMap), Map.class);
mapStationMap.put("key", UUID.randomUUID());
mapStationMap.put("level", 4);
List<Map<String, Object>> childrenStationMap = new ArrayList<>();
for (SysDictionary dic : dicList) {
Map<String, Object> mapDic = JSONObject.parseObject(JSONObject.toJSONString(dic), Map.class);
// 两个id拼接保证id的唯一性
mapDic.put("id", liStationMap.getId() + dic.getId());
mapDic.put("code", dic.getValue());
mapDic.put("stationId", liStationMap.getStationId());
mapDic.put("tierId", liStationMap.getId());
mapDic.put("key", UUID.randomUUID());
mapDic.put("level", 5);
if(liStationMap.getStationId().equals(liStation.getId())){
Map<String, Object> mapStationMap = JSONObject.parseObject(JSONObject.toJSONString(liStationMap), Map.class);
mapStationMap.put("key", UUID.randomUUID());
mapStationMap.put("level", 4);
List<Map<String, Object>> childrenStationMap = new ArrayList<>();
for (SysDictionary dic : dicList) {
Map<String, Object> mapDic = JSONObject.parseObject(JSONObject.toJSONString(dic), Map.class);
// 两个id拼接保证id的唯一性
mapDic.put("id", liStationMap.getId() + dic.getId());
mapDic.put("code", dic.getValue());
mapDic.put("stationId", liStationMap.getStationId());
mapDic.put("tierId", liStationMap.getId());
mapDic.put("key", UUID.randomUUID());
mapDic.put("level", 5);
List<Map<String, Object>> childrenDic = new ArrayList<>();
Iterator<LiResource> iterator = resourceList.iterator();
while (iterator.hasNext()) {
LiResource resource = iterator.next();
if (dic.getId().equals(resource.getType()) && liStationMap.getId().equals(resource.getTierId())) {
Map<String, Object> mapResource = JSONObject.parseObject(JSONObject.toJSONString(resource), Map.class);
mapResource.put("cameraIds", resource.getCameraIds());
mapResource.put("cameraNames", resource.getCameraNames());
mapResource.put("level", 6);
mapResource.put("active", false);
mapResource.put("cameraChange", false);
// 拖拽的唯一标识
mapResource.put("key", resource.getId());
List<Map<String, Object>> childrenDic = new ArrayList<>();
Iterator<LiResource> iterator = resourceList.iterator();
while (iterator.hasNext()) {
LiResource resource = iterator.next();
if (dic.getId().equals(resource.getType()) && liStationMap.getId().equals(resource.getTierId())) {
Map<String, Object> mapResource = JSONObject.parseObject(JSONObject.toJSONString(resource), Map.class);
mapResource.put("cameraIds", resource.getCameraIds());
mapResource.put("cameraNames", resource.getCameraNames());
mapResource.put("level", 6);
mapResource.put("active", false);
mapResource.put("cameraChange", false);
// 拖拽的唯一标识
mapResource.put("key", resource.getId());
childrenDic.add(mapResource);
iterator.remove();
childrenDic.add(mapResource);
iterator.remove();
}
}
mapDic.put("children", childrenDic);
/** 如果该子系统下无资源点,不展示*/
if (childrenDic != null && childrenDic.size() > 0) {
childrenStationMap.add(mapDic);
}
}
mapDic.put("children", childrenDic);
/** 如果该子系统下无资源点,不展示*/
if (childrenDic != null && childrenDic.size() > 0) {
childrenStationMap.add(mapDic);
}
}
mapStationMap.put("children", childrenStationMap);
if (liStationMap.getStationId().equals(liStation.getId())) {
nodes.add(mapStationMap);
mapStationMap.put("children", childrenStationMap);
if (liStationMap.getStationId().equals(liStation.getId())) {
nodes.add(mapStationMap);
}
}
}
mapStation.put("children", nodes);
......
......@@ -40,7 +40,7 @@ public interface LiStationMapDao extends MyBaseMapper<LiStationMap> {
* @param stationId
* @return
*/
List<LiStationMap> getListByStationId(String stationId);
List<LiStationMap> getListByStationId(@Param("stationId")String stationId);
List<Map<String, Object>> queryListByParam(LiStationMapModel model);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment