Commit a24ce4a3 authored by tangwei's avatar tangwei

修改物联趋势图

parent 89593a50
......@@ -908,16 +908,29 @@ public class TopographyController extends AbstractBaseController {
String json = JSON.toJSONString(entity.getResult());
List<Map<String, String>> listObject = (List<Map<String, String>>) JSONArray.parse(json);
List<IotDataVO> vos = new ArrayList<>();
for (Map<String, String> mapList : listObject) {
List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCodeAndTrend(iotCode);
List<Map<String, String>> listObjp=new ArrayList<>();
for (Map<String, String> mapList : listObject) {
for (Map.Entry entry : mapList.entrySet()) {
if (!"name".equals(entry.getKey()) && !"deviceName".equals(entry.getKey())) {
IotDataVO vo = new IotDataVO();
vo.setKey(String.valueOf(entry.getKey()));
vo.setValue(String.valueOf(entry.getValue()));
vos.add(vo);
for (EquipmentSpecificIndex x : indexes) {
if (x.getNameKey().equals(entry.getKey())&&entry.getValue()!=null&&!"".equals(String.valueOf(entry.getValue()))&&!"null".equals(String.valueOf(entry.getValue()))) {
listObjp.add(mapList);
}
}
}
}
for (Map<String, String> mapList : listObjp) {
for (Map.Entry entry : mapList.entrySet()) {
if (!"name".equals(entry.getKey()) && !"deviceName".equals(entry.getKey())) {
IotDataVO vo = new IotDataVO();
vo.setKey(String.valueOf(entry.getKey()));
vo.setValue(String.valueOf(entry.getValue()));
vos.add(vo);
}
}
}
List<IotDataVO> timeList = vos.stream().filter(x -> x.getKey().equals("time")).collect(Collectors.toList());
List<Date> dates = new ArrayList<>();
......@@ -935,7 +948,7 @@ public class TopographyController extends AbstractBaseController {
dates.add(sdf1.parse(time));
logger.info("返回时间===================================(" + sdf1.parse(time) + ") =======================================");
}
List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCodeAndTrend(iotCode);
if (0 < indexes.size()) {
List<TopographyIotIndexTrendVo> list = new ArrayList<>();
vos.forEach(iotDataVO -> {
......
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