|
|
|
@ -53,7 +53,7 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
|
|
|
|
|
for (Integer d : devList) { |
|
|
|
|
// 今日如果无数据,空判断处理
|
|
|
|
|
if (null != psdcThermometerRtdataMapper.queryById(d, sdf.format(date))){ |
|
|
|
|
if (null != psdcThermometerRtdataMapper.queryById(d, sdf.format(date))) { |
|
|
|
|
// 查询今日实时温度数据
|
|
|
|
|
PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(d, sdf.format(date)); |
|
|
|
|
|
|
|
|
@ -64,18 +64,18 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
|
|
|
|
|
// 循环遍历今天历史数据对象集合
|
|
|
|
|
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(d, tb, te); |
|
|
|
|
for (PsdcThermometerHtdata h : htdata){ |
|
|
|
|
if (null != h.getThermometerValue()){ |
|
|
|
|
for (PsdcThermometerHtdata h : htdata) { |
|
|
|
|
if (null != h.getThermometerValue()) { |
|
|
|
|
listTemp.add(h.getThermometerValue()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueIn()){ |
|
|
|
|
if (null != h.getThermometerValueIn()) { |
|
|
|
|
listIn.add(h.getThermometerValueIn()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueOut()){ |
|
|
|
|
if (null != h.getThermometerValueOut()) { |
|
|
|
|
listOut.add(h.getThermometerValueOut()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0,5); |
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0, 5); |
|
|
|
|
times.add(t); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -95,7 +95,7 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public AjaxResult sel8WnDu() { |
|
|
|
|
List<PsdcThermometerDataRes> dataResList = psdcThermometerRtdataMapper.selWenDu(1); |
|
|
|
|
List<PsdcThermometerDataRes> dataResList = psdcThermometerRtdataMapper.selWenDu(SecurityUtils.getUserId(), 16); |
|
|
|
|
return AjaxResult.success(dataResList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -105,7 +105,7 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
PsdcDevicePowerHdata96 hdata96 = psdcDevicePowerHdata96Mapper.queryById(userId, deviceId, sdf2.format(new Date())); |
|
|
|
|
PsdcDevicePowerRes rtdata = psdcElectricRtdataMapper.queryById(deviceId, sdf.format(new Date())); |
|
|
|
|
|
|
|
|
|
if (null != hdata96 && null != rtdata){ |
|
|
|
|
if (null != hdata96 && null != rtdata) { |
|
|
|
|
rtdata.setTodayUsePowers(hdata96); |
|
|
|
|
return rtdata; |
|
|
|
|
} else { |
|
|
|
@ -123,7 +123,7 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(deviceId, sdf.format(date)); |
|
|
|
|
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(deviceId, tb, te); |
|
|
|
|
|
|
|
|
|
if (null == dataRes || null == htdata){ |
|
|
|
|
if (null == dataRes || null == htdata) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -134,33 +134,46 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
|
|
|
|
|
// 循环遍历今天历史数据对象集合
|
|
|
|
|
|
|
|
|
|
for (PsdcThermometerHtdata h : htdata){ |
|
|
|
|
if (null != h.getThermometerValue()){ |
|
|
|
|
for (PsdcThermometerHtdata h : htdata) { |
|
|
|
|
if (null != h.getThermometerValue()) { |
|
|
|
|
listTemp.add(h.getThermometerValue()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueIn()){ |
|
|
|
|
if (null != h.getThermometerValueIn()) { |
|
|
|
|
listIn.add(h.getThermometerValueIn()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueOut()){ |
|
|
|
|
if (null != h.getThermometerValueOut()) { |
|
|
|
|
listOut.add(h.getThermometerValueOut()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0,5); |
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0, 5); |
|
|
|
|
times.add(t); |
|
|
|
|
} |
|
|
|
|
map.put("deviceId", dataRes.getDeviceId()); |
|
|
|
|
map.put("deviceName", dataRes.getDeviceName()); |
|
|
|
|
map.put("deviceTemp", dataRes.getThermometerValue()); |
|
|
|
|
map.put("tempIn", listIn); |
|
|
|
|
map.put("tempOut", listOut); |
|
|
|
|
map.put("temps", listTemp); |
|
|
|
|
map.put("times", times); |
|
|
|
|
Map<String, Object> map2 = new HashMap(); |
|
|
|
|
List<PsdcThermometerDataRes> dataRes1 = psdcThermometerRtdataMapper.selWenDu(SecurityUtils.getUserId(), 16); |
|
|
|
|
ArrayList<Map> ary = new ArrayList<>(); |
|
|
|
|
// 循环遍历温度实时对象集合并
|
|
|
|
|
for (PsdcThermometerDataRes temp : dataRes1) { |
|
|
|
|
Map<String, Object> map3 = new HashMap(); |
|
|
|
|
map3.put("deviceId", temp.getDeviceId()); |
|
|
|
|
map3.put("deviceName", temp.getDeviceName()); |
|
|
|
|
map3.put("deviceTemp", temp.getThermometerValue()); |
|
|
|
|
ary.add(map3); |
|
|
|
|
} |
|
|
|
|
map2.put("realTemp", ary); |
|
|
|
|
map2.put("tempList", map); |
|
|
|
|
|
|
|
|
|
return map; |
|
|
|
|
return map2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询电磁锅炉进水、出水温度 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
@ -174,17 +187,17 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS |
|
|
|
|
List<String> times = new ArrayList(); // 时间轴
|
|
|
|
|
// 循环遍历今天历史数据对象集合
|
|
|
|
|
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(deviceId, tb, te); |
|
|
|
|
for (PsdcThermometerHtdata h : htdata){ |
|
|
|
|
if (null != h.getThermometerValueIn()){ |
|
|
|
|
for (PsdcThermometerHtdata h : htdata) { |
|
|
|
|
if (null != h.getThermometerValueIn()) { |
|
|
|
|
listIn.add(h.getThermometerValueIn()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValueOut()){ |
|
|
|
|
if (null != h.getThermometerValueOut()) { |
|
|
|
|
listOut.add(h.getThermometerValueOut()); |
|
|
|
|
} |
|
|
|
|
if (null != h.getThermometerValue()){ |
|
|
|
|
if (null != h.getThermometerValue()) { |
|
|
|
|
listTemps.add(h.getThermometerValue()); |
|
|
|
|
} |
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0,5); |
|
|
|
|
String t = h.getUpdateTime().split(" ")[1].substring(0, 5); |
|
|
|
|
times.add(t); |
|
|
|
|
} |
|
|
|
|
AjaxResult ajax = AjaxResult.success().put("tempIn", listIn).put("tempOut", listOut).put("temps", listTemps).put("times", times); |
|
|
|
|