Commit d65f4088 authored by tangwei's avatar tangwei

修改物联数据丢失

parent 38a6eaec
...@@ -773,18 +773,21 @@ public class TopographyController extends AbstractBaseController { ...@@ -773,18 +773,21 @@ public class TopographyController extends AbstractBaseController {
} }
List<IotDataVO> timeList = iotDatalist.stream().filter(x -> "time".equals(x.getKey())).collect(Collectors.toList()); List<IotDataVO> timeList = iotDatalist.stream().filter(x -> "time".equals(x.getKey())).collect(Collectors.toList());
List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCode(iotCode); List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCode(iotCode);
if (0 <indexes.size()) { if (0 <indexes.size()) {
int j = 0; int j = 0;
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
for (int i=0; i<iotDatalist.size(); i++) {
for (int i=0; i<timeList.size(); i++) {
TopographyIotVo iotVo = new TopographyIotVo(); TopographyIotVo iotVo = new TopographyIotVo();
List<TopographyIotDataVO> lists = new ArrayList<>(); List<TopographyIotDataVO> lists = new ArrayList<>();
if (i == 0) { // if (i == 0) {
map.put(iotDatalist.get(i).getKey(), iotDatalist.get(i).getValue()); // map.put(iotDatalist.get(i).getKey(), iotDatalist.get(i).getValue());
} // }
if (map.containsKey(iotDatalist.get(i).getKey())) { // if (map.containsKey(iotDatalist.get(i).getKey())) {
j++; // j++;
} // }
for (EquipmentSpecificIndex x : indexes) { for (EquipmentSpecificIndex x : indexes) {
if (x.getNameKey().equals(iotDatalist.get(i).getKey())) { if (x.getNameKey().equals(iotDatalist.get(i).getKey())) {
TopographyIotDataVO dataVO = new TopographyIotDataVO(); TopographyIotDataVO dataVO = new TopographyIotDataVO();
...@@ -797,7 +800,7 @@ public class TopographyController extends AbstractBaseController { ...@@ -797,7 +800,7 @@ public class TopographyController extends AbstractBaseController {
try { try {
//Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN); //Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN);
String value = String.valueOf(timeList.get(j-1).getValue()); String value = String.valueOf(timeList.get(i).getValue());
String strDate = value.substring(0, 19); String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC); SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
......
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