Commit 630f4e07 authored by zhoushiguang's avatar zhoushiguang

指标趋势数据排序

parent 3929a164
...@@ -435,20 +435,25 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -435,20 +435,25 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
Map<String, Object> mapList = new HashMap<>(); Map<String, Object> mapList = new HashMap<>();
if (Objects.equals(4, objectType)) { if (Objects.equals(4, objectType)) {
//路口级
TBaseCrossInfo tBaseCrossInfo = baseCrossInfoMapper.selectByPrimaryKey(sps[0]); TBaseCrossInfo tBaseCrossInfo = baseCrossInfoMapper.selectByPrimaryKey(sps[0]);
dirTurnDesc = tBaseCrossInfo.getName(); dirTurnDesc = tBaseCrossInfo.getName();
dirType = 0;
} else if (Objects.equals(3, objectType)) { } else if (Objects.equals(3, objectType)) {
//车道级
mapList.put("laneNo", laneNo); mapList.put("laneNo", laneNo);
dirType = Integer.parseInt(sps[2]); dirType = Integer.parseInt(sps[2]);
dirName = BaseEnum.SignalDirectionEnum.getNameByCode(dirType); dirName = BaseEnum.SignalDirectionEnum.getNameByCode(dirType);
turnDesc = TurnConvertEnum.getDescByKey(Integer.valueOf(sps[3])); turnDesc = TurnConvertEnum.getDescByKey(Integer.valueOf(sps[3]));
dirTurnDesc = dirName + "进口" + turnDesc + laneNo + "车道"; dirTurnDesc = dirName + "进口" + turnDesc + laneNo + "车道";
} else if (Objects.equals(2, objectType)) { } else if (Objects.equals(2, objectType)) {
//转向级
dirType = Integer.parseInt(sps[2]); dirType = Integer.parseInt(sps[2]);
dirName = BaseEnum.SignalDirectionEnum.getNameByCode(dirType); dirName = BaseEnum.SignalDirectionEnum.getNameByCode(dirType);
turnDesc = TurnConvertEnum.getDescByKey(Integer.valueOf(sps[3])); turnDesc = TurnConvertEnum.getDescByKey(Integer.valueOf(sps[3]));
dirTurnDesc = dirName + "进口" + turnDesc; dirTurnDesc = dirName + "进口" + turnDesc;
} else if (Objects.equals(1, objectType)) { } else if (Objects.equals(1, objectType)) {
//方向级
dirType = Integer.parseInt(sps[2]); dirType = Integer.parseInt(sps[2]);
dirName = BaseEnum.SignalDirectionEnum.getNameByCode(dirType); dirName = BaseEnum.SignalDirectionEnum.getNameByCode(dirType);
dirTurnDesc = dirName + "进口"; dirTurnDesc = dirName + "进口";
...@@ -461,6 +466,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -461,6 +466,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
mapList.put("scopeCode", key); mapList.put("scopeCode", key);
mapList.put("dirType",dirType);
mapList.put("scopeName", dirTurnDesc); mapList.put("scopeName", dirTurnDesc);
mapList.put("list", value); mapList.put("list", value);
allList.add(mapList); allList.add(mapList);
...@@ -478,6 +484,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -478,6 +484,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
Map<String, Object> mapList = new HashMap<>(); Map<String, Object> mapList = new HashMap<>();
mapList.put("scopeCode", ""); mapList.put("scopeCode", "");
mapList.put("scopeName", scopeName1); mapList.put("scopeName", scopeName1);
mapList.put("dirType", BaseEnum.SignalDirectionEnum.getCodeByName(scopeName1.substring(0,scopeName1.indexOf("进口"))));
List<CrossLaneDataHistPoExtend> tmpList = new ArrayList<>(); List<CrossLaneDataHistPoExtend> tmpList = new ArrayList<>();
//补充所有时段字段对象 //补充所有时段字段对象
for (String time : sortedSet) { for (String time : sortedSet) {
...@@ -503,6 +510,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -503,6 +510,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
} }
} }
} }
allList = allList.stream().sorted(Comparator.comparing(o->Integer.valueOf(o.get("dirType").toString()))).collect(Collectors.toList());
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("timeList", sortedSet); jsonObject.put("timeList", sortedSet);
...@@ -598,6 +606,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -598,6 +606,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
tmp.setDirTypeName(dirTurnDesc); tmp.setDirTypeName(dirTurnDesc);
tmp.setTurnTypeName(scopeName1.substring(dirTurnDesc.length())); tmp.setTurnTypeName(scopeName1.substring(dirTurnDesc.length()));
tmp.setTurnType(TurnConvertEnum.getKeyByDesc(tmp.getTurnTypeName())); tmp.setTurnType(TurnConvertEnum.getKeyByDesc(tmp.getTurnTypeName()));
hasDataScopeList.add(tmp.getDirTypeName()+tmp.getTurnTypeName());
//利用正则表达式取车道号 //利用正则表达式取车道号
if (Objects.equals(3, objectType)) { if (Objects.equals(3, objectType)) {
Pattern pattern = Pattern.compile("\\d+"); Pattern pattern = Pattern.compile("\\d+");
......
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