|
|
|
@ -122,28 +122,30 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
List<PsdcThermometerDataRes> dataResList = psdcThermometerRtdataMapper.selWenDu(SecurityUtils.getUserId(), 16); |
|
|
|
|
for (PsdcThermometerDataRes dec : dataResList ){ |
|
|
|
|
PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(dec.getDeviceId(), sdf.format(date)); |
|
|
|
|
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(dec.getDeviceId(), tb, te); |
|
|
|
|
if (null != dataRes){ |
|
|
|
|
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(dec.getDeviceId(), tb, te); |
|
|
|
|
|
|
|
|
|
List<Double> listTemp = new ArrayList(); // 今天历史温度集合
|
|
|
|
|
List<String> times = new ArrayList(); // 时间轴
|
|
|
|
|
List<Double> listTemp = new ArrayList(); // 今天历史温度集合
|
|
|
|
|
List<String> times = new ArrayList(); // 时间轴
|
|
|
|
|
|
|
|
|
|
// 循环遍历今天历史数据对象集合
|
|
|
|
|
for (PsdcThermometerHtdata h : htdata) { |
|
|
|
|
if (null != h.getThermometerValue()) { |
|
|
|
|
listTemp.add(h.getThermometerValue()); |
|
|
|
|
} |
|
|
|
|
// 循环遍历今天历史数据对象集合
|
|
|
|
|
for (PsdcThermometerHtdata h : htdata) { |
|
|
|
|
if (null != h.getThermometerValue()) { |
|
|
|
|
listTemp.add(h.getThermometerValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0, 5); |
|
|
|
|
times.add(t); |
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0, 5); |
|
|
|
|
times.add(t); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> map3 = new HashMap(); |
|
|
|
|
|
|
|
|
|
map3.put("deviceId", dataRes.getDeviceId()); |
|
|
|
|
map3.put("deviceName", dataRes.getDeviceName()); |
|
|
|
|
map3.put("deviceTemp", dec.getThermometerValue()); |
|
|
|
|
map3.put("temps", listTemp); |
|
|
|
|
map3.put("times", times); |
|
|
|
|
ary.add(map3); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> map3 = new HashMap(); |
|
|
|
|
|
|
|
|
|
map3.put("deviceId", dataRes.getDeviceId()); |
|
|
|
|
map3.put("deviceName", dataRes.getDeviceName()); |
|
|
|
|
map3.put("deviceTemp", dec.getThermometerValue()); |
|
|
|
|
map3.put("temps", listTemp); |
|
|
|
|
map3.put("times", times); |
|
|
|
|
ary.add(map3); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|