|
|
|
@ -52,38 +52,41 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
String te = sdf.format(date) + " 23:59:59"; // 今天结束检索时间
|
|
|
|
|
|
|
|
|
|
for (Integer d : devList) { |
|
|
|
|
// 查询今日实时温度数据
|
|
|
|
|
PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(d, sdf.format(date)); |
|
|
|
|
|
|
|
|
|
List<Double> listIn = new ArrayList(); // 今天历史进水温度集合
|
|
|
|
|
List<Double> listOut = new ArrayList(); // 今天历史出水温度集合
|
|
|
|
|
List<Double> listTemp = new ArrayList(); // 今天历史温度集合
|
|
|
|
|
List<String> times = new ArrayList(); // 时间轴
|
|
|
|
|
|
|
|
|
|
// 循环遍历今天历史数据对象集合
|
|
|
|
|
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(d, tb, te); |
|
|
|
|
for (PsdcThermometerHtdata h : htdata){ |
|
|
|
|
if (null != h.getThermometerValue()){ |
|
|
|
|
listTemp.add(h.getThermometerValue()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueIn()){ |
|
|
|
|
listIn.add(h.getThermometerValueIn()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueOut()){ |
|
|
|
|
listOut.add(h.getThermometerValueOut()); |
|
|
|
|
// 今日如果无数据,空判断处理
|
|
|
|
|
if (null != psdcThermometerRtdataMapper.queryById(d, sdf.format(date))){ |
|
|
|
|
// 查询今日实时温度数据
|
|
|
|
|
PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(d, sdf.format(date)); |
|
|
|
|
|
|
|
|
|
List<Double> listIn = new ArrayList(); // 今天历史进水温度集合
|
|
|
|
|
List<Double> listOut = new ArrayList(); // 今天历史出水温度集合
|
|
|
|
|
List<Double> listTemp = new ArrayList(); // 今天历史温度集合
|
|
|
|
|
List<String> times = new ArrayList(); // 时间轴
|
|
|
|
|
|
|
|
|
|
// 循环遍历今天历史数据对象集合
|
|
|
|
|
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(d, tb, te); |
|
|
|
|
for (PsdcThermometerHtdata h : htdata){ |
|
|
|
|
if (null != h.getThermometerValue()){ |
|
|
|
|
listTemp.add(h.getThermometerValue()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueIn()){ |
|
|
|
|
listIn.add(h.getThermometerValueIn()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueOut()){ |
|
|
|
|
listOut.add(h.getThermometerValueOut()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0,5); |
|
|
|
|
times.add(t); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0,5); |
|
|
|
|
times.add(t); |
|
|
|
|
Double useEnergy = psdcElectricHtdataMapper.selTodayUseEnergy(d, tb, te); |
|
|
|
|
dataRes.setTimeList(times); |
|
|
|
|
dataRes.setTempTodayList(listTemp); |
|
|
|
|
dataRes.setTempInTodayList(listIn); |
|
|
|
|
dataRes.setTempOutTodayList(listOut); |
|
|
|
|
dataRes.setTodayUseEnergy(useEnergy); |
|
|
|
|
ary.add(dataRes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Double useEnergy = psdcElectricHtdataMapper.selTodayUseEnergy(d, tb, te); |
|
|
|
|
dataRes.setTimeList(times); |
|
|
|
|
dataRes.setTempTodayList(listTemp); |
|
|
|
|
dataRes.setTempInTodayList(listIn); |
|
|
|
|
dataRes.setTempOutTodayList(listOut); |
|
|
|
|
dataRes.setTodayUseEnergy(useEnergy); |
|
|
|
|
ary.add(dataRes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AjaxResult r = new AjaxResult(200, "查询成功", ary); |
|
|
|
|