林颖晨 2 years ago
commit 645ddb4826
  1. 3
      psdc-business/src/main/java/com/psdc/mapper/PsdcDeviceMapper.java
  2. 3
      psdc-business/src/main/java/com/psdc/mapper/PsdcThermometerRtdataMapper.java
  3. 4
      psdc-business/src/main/java/com/psdc/service/IPsdcDeviceService.java
  4. 6
      psdc-business/src/main/java/com/psdc/service/IPsdcElectricHtdataService.java
  5. 2
      psdc-business/src/main/java/com/psdc/service/IPsdcElectricRtdataService.java
  6. 11
      psdc-business/src/main/java/com/psdc/service/IPsdcThermometerHtdataService.java
  7. 7
      psdc-business/src/main/java/com/psdc/service/impl/PsdcDeviceServiceImpl.java
  8. 12
      psdc-business/src/main/java/com/psdc/service/impl/PsdcElectricHtdataServiceImpl.java
  9. 6
      psdc-business/src/main/java/com/psdc/service/impl/PsdcElectricRtdataServiceImpl.java
  10. 83
      psdc-business/src/main/java/com/psdc/service/impl/PsdcThermometerHtdataServiceImpl.java
  11. 14
      psdc-business/src/main/resources/mapper/business/PsdcDeviceMapper.xml
  12. 2
      psdc-business/src/main/resources/mapper/business/PsdcElectricRtdataMapper.xml
  13. 9
      psdc-business/src/main/resources/mapper/business/PsdcThermometerRtdataMapper.xml
  14. 184
      psdc-ui/src/views/emonitor/drgl/index.vue
  15. 7
      psdc-web/src/main/java/com/psdc/controller/index/Index.java
  16. 48
      psdc-web/src/main/java/com/psdc/controller/monitor/AirSourcePumpController.java
  17. 17
      psdc-web/src/main/java/com/psdc/controller/monitor/ElectromagneticBoilerController.java
  18. 48
      psdc-web/src/main/java/com/psdc/controller/monitor/HeatingCableController.java
  19. 33
      psdc-web/src/main/java/com/psdc/controller/monitor/SandTableController.java
  20. 48
      psdc-web/src/main/java/com/psdc/controller/monitor/StorageBoilerController.java
  21. 34
      psdc-web/src/main/java/com/psdc/controller/monitor/TotalElectricMeterController.java
  22. 35
      psdc-web/src/main/java/com/psdc/controller/monitor/WenDuController.java

@ -3,6 +3,7 @@ package com.psdc.mapper;
import java.util.List; import java.util.List;
import com.psdc.entity.PsdcDevice; import com.psdc.entity.PsdcDevice;
import com.psdc.entity.vo.DeviceStatusVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -24,6 +25,8 @@ public interface PsdcDeviceMapper{
*/ */
PsdcDevice queryById(Integer deviceId); PsdcDevice queryById(Integer deviceId);
DeviceStatusVo queryDeviceStatusById(@Param(value = "deviceId") Integer deviceId);
List<Integer> selMyWorkDevices(@Param(value = "devType") Integer devType, List<Integer> selMyWorkDevices(@Param(value = "devType") Integer devType,
@Param(value = "userId") Long userId); @Param(value = "userId") Long userId);

@ -23,7 +23,8 @@ public interface PsdcThermometerRtdataMapper{
* @param thermometerRtdataId 主键 * @param thermometerRtdataId 主键
* @return 实例对象 * @return 实例对象
*/ */
PsdcThermometerDataRes queryById(@Param("thermometerRtdataId") Integer thermometerRtdataId); PsdcThermometerDataRes queryById(@Param("thermometerRtdataId") Integer thermometerRtdataId,
@Param("today") String today);
List<PsdcThermometerDataRes> selWenDu(@Param("devType") Integer devType); List<PsdcThermometerDataRes> selWenDu(@Param("devType") Integer devType);

@ -28,6 +28,10 @@ public interface IPsdcDeviceService {
*/ */
List<DeviceStatusVo> queryDeviceStatus(); List<DeviceStatusVo> queryDeviceStatus();
DeviceStatusVo queryDeviceStatusById(Integer deviceId);
/** /**
* 新增数据 * 新增数据
* *

@ -15,10 +15,10 @@ public interface IPsdcElectricHtdataService {
Map selTotalElectricityInfo(); Map selTotalElectricityInfo();
List selThisHourUseElectric(); List selThisHourUseElectric(Integer deviceId);
List selDcglThisHourUseElectric(); List selDcglThisHourUseElectric(Integer deviceId);
List selDcglThisDayUseElectric(); List selDcglThisDayUseElectric(Integer deviceId);
} }

@ -12,6 +12,6 @@ import com.psdc.entity.res.PsdcDevicePowerRes;
*/ */
public interface IPsdcElectricRtdataService { public interface IPsdcElectricRtdataService {
PsdcDevicePowerRes queryById(); PsdcDevicePowerRes queryById(Integer deviceId);
} }

@ -1,9 +1,12 @@
package com.psdc.service; package com.psdc.service;
import com.psdc.core.domain.AjaxResult; import com.psdc.core.domain.AjaxResult;
import com.psdc.entity.PsdcDevicePowerHdata96; import com.psdc.entity.PsdcThermometerHtdata;
import com.psdc.entity.res.PsdcDevicePowerRes; import com.psdc.entity.res.PsdcDevicePowerRes;
import java.util.List;
import java.util.Map;
/** /**
* @Author戴仕崑 * @Author戴仕崑
@ -19,8 +22,10 @@ public interface IPsdcThermometerHtdataService {
AjaxResult sel8WnDu(); AjaxResult sel8WnDu();
PsdcDevicePowerRes selTotalElectricityInfo(); PsdcDevicePowerRes selTotalElectricityInfo(Integer deviceId);
Map selTodayThermometerById(Integer deviceId);
AjaxResult selDzglWenDu(); AjaxResult selDzglWenDu(Integer deviceId);
} }

@ -40,6 +40,8 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService{
return psdcDeviceMapper.queryById(deviceId); return psdcDeviceMapper.queryById(deviceId);
} }
/** /**
* 根据用户id查询设备列表 * 根据用户id查询设备列表
* @return * @return
@ -57,6 +59,11 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService{
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@Override
public DeviceStatusVo queryDeviceStatusById(Integer deviceId) {
return psdcDeviceMapper.queryDeviceStatusById(deviceId);
}
/** /**
* 新增数据 * 新增数据
* *

@ -47,8 +47,8 @@ public class PsdcElectricHtdataServiceImpl implements IPsdcElectricHtdataService
* @return * @return
*/ */
@Override @Override
public List selThisHourUseElectric() { public List selThisHourUseElectric(Integer deviceId) {
return electricHtdataMapper.selThisHourUseElectric(13, df.format(new Date())); return electricHtdataMapper.selThisHourUseElectric(deviceId, df.format(new Date()));
} }
/** /**
@ -56,16 +56,16 @@ public class PsdcElectricHtdataServiceImpl implements IPsdcElectricHtdataService
* @return * @return
*/ */
@Override @Override
public List selDcglThisHourUseElectric() { public List selDcglThisHourUseElectric(Integer deviceId) {
return electricHtdataMapper.selThisHourUseElectric(1, df.format(new Date())); return electricHtdataMapper.selThisHourUseElectric(deviceId, df.format(new Date()));
} }
/** /**
* 电磁锅炉查询月用电量 * 电磁锅炉查询月用电量
* @return * @return
*/ */
@Override @Override
public List selDcglThisDayUseElectric() { public List selDcglThisDayUseElectric(Integer deviceId) {
return electricHtdataMapper.selThisDayUseElectric(1, df.format(new Date()).substring(0,7)); return electricHtdataMapper.selThisDayUseElectric(deviceId, df.format(new Date()).substring(0,7));
} }

@ -36,11 +36,11 @@ public class PsdcElectricRtdataServiceImpl implements IPsdcElectricRtdataService
* @return * @return
*/ */
@Override @Override
public PsdcDevicePowerRes queryById() { public PsdcDevicePowerRes queryById(Integer deviceId) {
long userId = SecurityUtils.getUserId(); long userId = SecurityUtils.getUserId();
Date date = new Date(); Date date = new Date();
PsdcDevicePowerRes devicePowerRes = electricRtdataMapper.queryById(1, sdf.format(date)); PsdcDevicePowerRes devicePowerRes = electricRtdataMapper.queryById(deviceId, sdf.format(date));
PsdcDevicePowerHdata96 hdata96 = devicePowerHdata96Mapper.queryById(userId, 13, sdf2.format(date)); PsdcDevicePowerHdata96 hdata96 = devicePowerHdata96Mapper.queryById(userId, deviceId, sdf2.format(date));
devicePowerRes.setTodayUsePowers(hdata96); devicePowerRes.setTodayUsePowers(hdata96);
return devicePowerRes; return devicePowerRes;
} }

@ -48,12 +48,12 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS
Date date = new Date(); Date date = new Date();
List<PsdcThermometerDataRes> ary = new ArrayList(); List<PsdcThermometerDataRes> ary = new ArrayList();
String tb = sdf.format(date) + " 00:00:00"; // 今天开始检索时间
String te = sdf.format(date) + " 23:59:59"; // 今天结束检索时间
for (Integer d : devList) { for (Integer d : devList) {
// 查询今日实时温度数据 // 查询今日实时温度数据
PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(d); PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(d, sdf.format(date));
String tb = sdf.format(date) + " 00:00:00"; // 今天开始检索时间
String te = sdf.format(date) + " 23:59:59"; // 今天结束检索时间
List<Double> listIn = new ArrayList(); // 今天历史进水温度集合 List<Double> listIn = new ArrayList(); // 今天历史进水温度集合
List<Double> listOut = new ArrayList(); // 今天历史出水温度集合 List<Double> listOut = new ArrayList(); // 今天历史出水温度集合
@ -63,7 +63,9 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS
// 循环遍历今天历史数据对象集合 // 循环遍历今天历史数据对象集合
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(d, tb, te); List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(d, tb, te);
for (PsdcThermometerHtdata h : htdata){ for (PsdcThermometerHtdata h : htdata){
listTemp.add(h.getThermometerValue()); if (null != h.getThermometerValue()){
listTemp.add(h.getThermometerValue());
}
if (null != h.getThermometerValueIn()){ if (null != h.getThermometerValueIn()){
listIn.add(h.getThermometerValueIn()); listIn.add(h.getThermometerValueIn());
} }
@ -95,12 +97,63 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS
} }
@Override @Override
public PsdcDevicePowerRes selTotalElectricityInfo() { public PsdcDevicePowerRes selTotalElectricityInfo(Integer deviceId) {
long userId = SecurityUtils.getUserId(); long userId = SecurityUtils.getUserId();
PsdcDevicePowerHdata96 hdata96 = psdcDevicePowerHdata96Mapper.queryById(userId, 13, sdf2.format(new Date())); PsdcDevicePowerHdata96 hdata96 = psdcDevicePowerHdata96Mapper.queryById(userId, deviceId, sdf2.format(new Date()));
PsdcDevicePowerRes rtdata = psdcElectricRtdataMapper.queryById(13, sdf.format(new Date())); PsdcDevicePowerRes rtdata = psdcElectricRtdataMapper.queryById(deviceId, sdf.format(new Date()));
rtdata.setTodayUsePowers(hdata96);
return rtdata; if (null != hdata96 && null != rtdata){
rtdata.setTodayUsePowers(hdata96);
return rtdata;
} else {
return null;
}
}
@Override
public Map<String, Object> selTodayThermometerById(Integer deviceId) {
Date date = new Date();
String tb = sdf.format(date) + " 00:00:00"; // 今天开始检索时间
String te = sdf.format(date) + " 23:59:59"; // 今天结束检索时间
Map<String, Object> map = new HashMap();
// 查询该设备实时温度数据
PsdcThermometerDataRes dataRes = psdcThermometerRtdataMapper.queryById(deviceId, sdf.format(date));
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(deviceId, tb, te);
if (null == dataRes || null == htdata){
return null;
}
List<Double> listIn = new ArrayList(); // 今天历史进水温度集合
List<Double> listOut = new ArrayList(); // 今天历史出水温度集合
List<Double> listTemp = new ArrayList(); // 今天历史温度集合
List<String> times = new ArrayList(); // 时间轴
// 循环遍历今天历史数据对象集合
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);
}
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);
return map;
} }
/** /**
@ -108,15 +161,16 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS
* @return * @return
*/ */
@Override @Override
public AjaxResult selDzglWenDu() { public AjaxResult selDzglWenDu(Integer deviceId) {
Date date = new Date(); Date date = new Date();
String tb = sdf.format(date) + " 00:00:00"; // 今天开始检索时间 String tb = sdf.format(date) + " 00:00:00"; // 今天开始检索时间
String te = sdf.format(date) + " 23:59:59"; // 今天结束检索时间 String te = sdf.format(date) + " 23:59:59"; // 今天结束检索时间
List<Double> listIn = new ArrayList(); // 今天历史进水温度集合 List<Double> listIn = new ArrayList(); // 今天历史进水温度集合
List<Double> listOut = new ArrayList(); // 今天历史出水温度集合 List<Double> listOut = new ArrayList(); // 今天历史出水温度集合
List<Double> listTemps = new ArrayList(); // 今天历史温度集合
List<String> times = new ArrayList(); // 时间轴 List<String> times = new ArrayList(); // 时间轴
// 循环遍历今天历史数据对象集合 // 循环遍历今天历史数据对象集合
List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(1, tb, te); List<PsdcThermometerHtdata> htdata = psdcThermometerHtdataMapper.selTodayThermometer(deviceId, tb, te);
for (PsdcThermometerHtdata h : htdata){ for (PsdcThermometerHtdata h : htdata){
if (null != h.getThermometerValueIn()){ if (null != h.getThermometerValueIn()){
listIn.add(h.getThermometerValueIn()); listIn.add(h.getThermometerValueIn());
@ -124,10 +178,13 @@ public class PsdcThermometerHtdataServiceImpl implements IPsdcThermometerHtdataS
if (null != h.getThermometerValueOut()){ if (null != h.getThermometerValueOut()){
listOut.add(h.getThermometerValueOut()); listOut.add(h.getThermometerValueOut());
} }
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); times.add(t);
} }
AjaxResult ajax = AjaxResult.success().put("tempIn", listIn).put("tempOut", listOut).put("times", times); AjaxResult ajax = AjaxResult.success().put("tempIn", listIn).put("tempOut", listOut).put("temps", listTemps).put("times", times);
return ajax; return ajax;
} }

@ -21,6 +21,20 @@
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
</resultMap> </resultMap>
<resultMap id="PsdcDeviceMap2" type="com.psdc.entity.vo.DeviceStatusVo">
<result property="deviceId" column="device_id" />
<result property="deviceType" column="device_type" />
<result property="deviceSn" column="device_sn" />
<result property="deviceName" column="device_name" />
<result property="photoUrl" column="photo_url" />
<result property="deviceRunstatus" column="device_runstatus" />
</resultMap>
<select id="queryDeviceStatusById" resultMap="PsdcDeviceMap2">
Select device_id, device_type, device_sn, device_name, device_runstatus, photo_url From psdc_device
Where device_id = #{deviceId}
</select>
<!-- 通过ID查询单条数据 --> <!-- 通过ID查询单条数据 -->
<select id="queryById" resultMap="PsdcDeviceMap"> <select id="queryById" resultMap="PsdcDeviceMap">
select device_id, select device_id,

@ -66,7 +66,7 @@
And DATE_FORMAT(per.update_time,'%Y-%m-%d') = #{upDate} And DATE_FORMAT(per.update_time,'%Y-%m-%d') = #{upDate}
</if> </if>
<if test="upDate != null and upDate != ''"> <if test="upDate != null and upDate != ''">
And DATE_FORMAT(per.update_time,'%Y-%m-%d') = #{upDate} And DATE_FORMAT(ptr.update_time,'%Y-%m-%d') = #{upDate}
</if> </if>
</select> </select>

@ -24,7 +24,14 @@
Select pd.device_id, pd.device_name, pd.device_runstatus, ptr.thermometer_value, ptr.thermometer_value_in, ptr.thermometer_value_out Select pd.device_id, pd.device_name, pd.device_runstatus, ptr.thermometer_value, ptr.thermometer_value_in, ptr.thermometer_value_out
From psdc_device pd From psdc_device pd
Left Join psdc_thermometer_rtdata ptr On ptr.device_id = pd.device_id Left Join psdc_thermometer_rtdata ptr On ptr.device_id = pd.device_id
Where ptr.device_id = #{thermometerRtdataId} <where>
<if test="thermometerRtdataId != null and thermometerRtdataId != ''">
ptr.device_id = #{thermometerRtdataId}
</if>
<if test="today != null and today != ''">
And DATE_FORMAT(ptr.update_time,'%Y-%m-%d') = #{today}
</if>
</where>
</select> </select>
<select id="selWenDu" resultMap="PsdcThermometerRtdataMap2"> <select id="selWenDu" resultMap="PsdcThermometerRtdataMap2">

@ -42,33 +42,25 @@
<div class="bottom1-1"> <div class="bottom1-1">
日用电量 日用电量
</div> </div>
<div id="myEcharts" style="width: 100%; height: 86.7%"> <div id="myEcharts" style="width: 100%; height: 86.7%"></div>
pic
</div>
</div> </div>
<div class="bottom1"> <div class="bottom1">
<div class="bottom1-1"> <div class="bottom1-1">
月用电量 月用电量
</div> </div>
<div> <div id="myEcharts2" style="width: 100%; height: 86.7%"></div>
pic
</div>
</div> </div>
<div class="bottom1"> <div class="bottom1">
<div class="bottom1-1"> <div class="bottom1-1">
当前功率 当前功率
</div> </div>
<div> <div id="myEcharts3" style="width: 100%; height: 86.7%"></div>
pic
</div>
</div> </div>
<div class="bottom1"> <div class="bottom1">
<div class="bottom1-1"> <div class="bottom1-1">
当前温度 当前温度
</div> </div>
<div> <div id="myEcharts4" style="width: 100%; height: 86.7%"></div>
pic
</div>
</div> </div>
</div> </div>
</div> </div>
@ -82,33 +74,193 @@ export default {
setup() { setup() {
onMounted(() => {//element,onMountedHook onMounted(() => {//element,onMountedHook
let myChart = echarts.init(document.getElementById("myEcharts")); let myChart = echarts.init(document.getElementById("myEcharts"));
let myChart2 = echarts.init(document.getElementById("myEcharts2"));
let myChart3 = echarts.init(document.getElementById("myEcharts3"));
let myChart4 = echarts.init(document.getElementById("myEcharts4"));
// //
myChart.setOption({ myChart.setOption({
title: {}, title: {},
tooltip: {}, tooltip: {},
textStyle:{
color:'#BEC3DA'
},
xAxis: { xAxis: {
data: ["12-3", "12-4", "12-5", "12-6", "12-7", "12-8"], data: ["12-3", "12-4", "12-5", "12-6", "12-7", "12-8"],
axisLine:{
lineStyle:{
color:'#BEC3DA',
type:'dashed'
}
}
}, },
yAxis: { yAxis: {
nameTextStyle: { type: 'value',
color: 'white' splitLine:{
show:true,
lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
}, },
axisLine: {
show: true, show: true,
lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
},
},
series: [
{
name: "用户量",
type: "bar",
data: [5, 20, 36, 10, 10, 20],
itemStyle:{
color:'#2F8EE0'
},
},
],
});
window.onresize = function () {//
myChart.resize();
};
myChart2.setOption({
title: {},
tooltip: {},
textStyle:{
color:'#BEC3DA'
},
xAxis: {
data: ["12-3", "12-4", "12-5", "12-6", "12-7", "12-8"],
axisLine:{
lineStyle:{
color:'#BEC3DA',
type:'dashed'
}
}
},
yAxis: {
type: 'value', type: 'value',
splitLine:{
show:true,
lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
},
axisLine: { axisLine: {
show: true, show: true,
} lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
}, },
},
series: [ series: [
{ {
name: "用户量", name: "用户量",
type: "bar", type: "bar",
data: [5, 20, 36, 10, 10, 20], data: [5, 20, 36, 10, 10, 20],
itemStyle:{
color:'#2F8EE0'
},
}, },
], ],
}); });
window.onresize = function () {// window.onresize = function () {//
myChart.resize(); myChart2.resize();
};
myChart3.setOption({
title: {},
tooltip: {},
textStyle:{
color:'#BEC3DA'
},
xAxis: {
data: ["12-3", "12-4", "12-5", "12-6", "12-7", "12-8"],
axisLine:{
lineStyle:{
color:'#BEC3DA',
type:'dashed'
}
}
},
yAxis: {
type: 'value',
splitLine:{
show:true,
lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
},
axisLine: {
show: true,
lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
},
},
series: [
{
name: "用户量",
type: "line",
data: [5, 20, 36, 10, 10, 20],
itemStyle:{
color:'#2F8EE0'
},
},
],
});
window.onresize = function () {//
myChart3.resize();
};
myChart4.setOption({
title: {},
tooltip: {},
textStyle:{
color:'#BEC3DA'
},
xAxis: {
data: ["12-3", "12-4", "12-5", "12-6", "12-7", "12-8"],
axisLine:{
lineStyle:{
color:'#BEC3DA',
type:'dashed'
}
}
},
yAxis: {
type: 'value',
splitLine:{
show:true,
lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
},
axisLine: {
show: true,
lineStyle:{
type:'dashed',
color:'#BEC3DA'
}
},
},
series: [
{
name: "用户量",
type: "line",
data: [5, 20, 36, 10, 10, 20],
itemStyle:{
color:'#2F8EE0'
},
},
],
});
window.onresize = function () {//
myChart4.resize();
}; };
}); });
}, },

@ -27,8 +27,11 @@ public class Index {
@RequestMapping(value = "/zdb", method = RequestMethod.GET) @RequestMapping(value = "/zdb", method = RequestMethod.GET)
public AjaxResult selzdb() { public AjaxResult selzdb() {
AjaxResult ajax = AjaxResult.success(psdcThermometerHtdataService.selTotalElectricityInfo()); // 查询总电表日常用电信息
return ajax; if (null == psdcThermometerHtdataService.selTotalElectricityInfo(13)){
return AjaxResult.success("今日暂无数据!");
}
return AjaxResult.success(psdcThermometerHtdataService.selTotalElectricityInfo(13));
} }
} }

@ -0,0 +1,48 @@
package com.psdc.controller.monitor;
import com.psdc.core.domain.AjaxResult;
import com.psdc.service.IPsdcElectricHtdataService;
import com.psdc.service.IPsdcElectricRtdataService;
import com.psdc.service.IPsdcThermometerHtdataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author戴仕崑
* @Projectpsdc
* @FilenameAirSourcePumpController
* @Date2023/5/11 9:49
* @Version 1.0
*/
@RestController
@RequestMapping("/api/monitor/kqyrb/index")
public class AirSourcePumpController {
@Autowired
IPsdcElectricRtdataService psdcElectricRtdataService;
@Autowired
IPsdcThermometerHtdataService psdcThermometerHtdataService;
@Autowired
IPsdcElectricHtdataService psdcElectricHtdataService;
@PreAuthorize("@ss.hasPermi('emonitor:kqyrb')")
@RequestMapping(value = "/sel1/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl1(@PathVariable(value = "deviceId", required = false) Integer deviceId){
AjaxResult ajax = AjaxResult.success(psdcElectricRtdataService.queryById(deviceId));
return ajax;
}
@PreAuthorize("@ss.hasPermi('emonitor:kqyrb')")
@RequestMapping(value = "/sel2/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl2(@PathVariable(value = "deviceId", required = false) Integer deviceId) {
AjaxResult ajax = psdcThermometerHtdataService.selDzglWenDu(deviceId);
ajax.put("kqyrbqhour", psdcElectricHtdataService.selDcglThisHourUseElectric(deviceId));
ajax.put("kqyrbqday", psdcElectricHtdataService.selDcglThisDayUseElectric(deviceId));
return ajax;
}
}

@ -6,6 +6,7 @@ import com.psdc.service.IPsdcElectricRtdataService;
import com.psdc.service.IPsdcThermometerHtdataService; import com.psdc.service.IPsdcThermometerHtdataService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -29,18 +30,18 @@ public class ElectromagneticBoilerController {
IPsdcElectricHtdataService psdcElectricHtdataService; IPsdcElectricHtdataService psdcElectricHtdataService;
@PreAuthorize("@ss.hasPermi('emonitor:drgl')") @PreAuthorize("@ss.hasPermi('emonitor:drgl')")
@RequestMapping(value = "/sel1", method = RequestMethod.GET) @RequestMapping(value = "/sel1/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl1() { public AjaxResult seldrgl1(@PathVariable(value = "deviceId", required = false) Integer deviceId){
AjaxResult ajax = AjaxResult.success(psdcElectricRtdataService.queryById()); AjaxResult ajax = AjaxResult.success(psdcElectricRtdataService.queryById(deviceId));
return ajax; return ajax;
} }
@PreAuthorize("@ss.hasPermi('emonitor:drgl')") @PreAuthorize("@ss.hasPermi('emonitor:drgl')")
@RequestMapping(value = "/sel2", method = RequestMethod.GET) @RequestMapping(value = "/sel2/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl2() { public AjaxResult seldrgl2(@PathVariable(value = "deviceId", required = false) Integer deviceId) {
AjaxResult ajax = psdcThermometerHtdataService.selDzglWenDu(); AjaxResult ajax = psdcThermometerHtdataService.selDzglWenDu(deviceId);
ajax.put("dcglqhour", psdcElectricHtdataService.selDcglThisHourUseElectric()); ajax.put("dcglqhour", psdcElectricHtdataService.selDcglThisHourUseElectric(deviceId));
ajax.put("dcglqday", psdcElectricHtdataService.selDcglThisDayUseElectric()); ajax.put("dcglqday", psdcElectricHtdataService.selDcglThisDayUseElectric(deviceId));
return ajax; return ajax;
} }
} }

@ -0,0 +1,48 @@
package com.psdc.controller.monitor;
import com.psdc.core.domain.AjaxResult;
import com.psdc.service.IPsdcElectricHtdataService;
import com.psdc.service.IPsdcElectricRtdataService;
import com.psdc.service.IPsdcThermometerHtdataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author戴仕崑
* @Projectpsdc
* @FilenameHeatingCableController
* @Date2023/5/11 9:48
* @Version 1.0
*/
@RestController
@RequestMapping("/api/monitor/frdl/index")
public class HeatingCableController {
@Autowired
IPsdcElectricRtdataService psdcElectricRtdataService;
@Autowired
IPsdcThermometerHtdataService psdcThermometerHtdataService;
@Autowired
IPsdcElectricHtdataService psdcElectricHtdataService;
@PreAuthorize("@ss.hasPermi('emonitor:frdl')")
@RequestMapping(value = "/sel1/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl1(@PathVariable(value = "deviceId", required = false) Integer deviceId){
AjaxResult ajax = AjaxResult.success(psdcElectricRtdataService.queryById(deviceId));
return ajax;
}
@PreAuthorize("@ss.hasPermi('emonitor:frdl')")
@RequestMapping(value = "/sel2/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl2(@PathVariable(value = "deviceId", required = false) Integer deviceId) {
AjaxResult ajax = psdcThermometerHtdataService.selDzglWenDu(deviceId);
ajax.put("frdlqhour", psdcElectricHtdataService.selDcglThisHourUseElectric(deviceId));
ajax.put("frdlqday", psdcElectricHtdataService.selDcglThisDayUseElectric(deviceId));
return ajax;
}
}

@ -0,0 +1,33 @@
package com.psdc.controller.monitor;
import com.psdc.core.domain.AjaxResult;
import com.psdc.service.IPsdcDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author戴仕崑
* @Projectpsdc
* @FilenameSandTableController
* @Date2023/5/11 13:40
* @Version 1.0
*/
@RestController
@RequestMapping("/api/monitor/sp/index")
public class SandTableController {
@Autowired
IPsdcDeviceService psdcDeviceService;
@PreAuthorize("@ss.hasPermi('emonitor:sp')")
@RequestMapping(value = "/sel1/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl1(@PathVariable(value = "deviceId", required = false) Integer deviceId){
AjaxResult ajax = AjaxResult.success(psdcDeviceService.queryDeviceStatusById(deviceId));
return ajax;
}
}

@ -0,0 +1,48 @@
package com.psdc.controller.monitor;
import com.psdc.core.domain.AjaxResult;
import com.psdc.service.IPsdcElectricHtdataService;
import com.psdc.service.IPsdcElectricRtdataService;
import com.psdc.service.IPsdcThermometerHtdataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author戴仕崑
* @Projectpsdc
* @FilenameStrorageBoilerController
* @Date2023/5/11 9:49
* @Version 1.0
*/
@RestController
@RequestMapping("/api/monitor/xrgl/index")
public class StorageBoilerController {
@Autowired
IPsdcElectricRtdataService psdcElectricRtdataService;
@Autowired
IPsdcThermometerHtdataService psdcThermometerHtdataService;
@Autowired
IPsdcElectricHtdataService psdcElectricHtdataService;
@PreAuthorize("@ss.hasPermi('emonitor:xrgl')")
@RequestMapping(value = "/sel1/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl1(@PathVariable(value = "deviceId", required = false) Integer deviceId){
AjaxResult ajax = AjaxResult.success(psdcElectricRtdataService.queryById(deviceId));
return ajax;
}
@PreAuthorize("@ss.hasPermi('emonitor:xrgl')")
@RequestMapping(value = "/sel2/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl2(@PathVariable(value = "deviceId", required = false) Integer deviceId) {
AjaxResult ajax = psdcThermometerHtdataService.selDzglWenDu(deviceId);
ajax.put("xrglqhour", psdcElectricHtdataService.selDcglThisHourUseElectric(deviceId));
ajax.put("xrglqday", psdcElectricHtdataService.selDcglThisDayUseElectric(deviceId));
return ajax;
}
}

@ -1,15 +1,20 @@
package com.psdc.controller.monitor; package com.psdc.controller.monitor;
import com.psdc.core.domain.AjaxResult; import com.psdc.core.domain.AjaxResult;
import com.psdc.entity.PsdcDevice;
import com.psdc.entity.res.PsdcDevicePowerRes; import com.psdc.entity.res.PsdcDevicePowerRes;
import com.psdc.service.IPsdcDeviceService;
import com.psdc.service.IPsdcElectricHtdataService; import com.psdc.service.IPsdcElectricHtdataService;
import com.psdc.service.IPsdcThermometerHtdataService; import com.psdc.service.IPsdcThermometerHtdataService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -30,10 +35,27 @@ public class TotalElectricMeterController {
@Autowired @Autowired
IPsdcElectricHtdataService psdcElectricHtdataService; IPsdcElectricHtdataService psdcElectricHtdataService;
@Autowired
IPsdcDeviceService psdcDeviceService;
@PreAuthorize("@ss.hasPermi('emonitor:db')")
@RequestMapping(value = "/selMydevices", method = RequestMethod.GET)
public AjaxResult selMydevices() {
List<Map> maps = new ArrayList<>();
List<PsdcDevice> list = psdcDeviceService.queryByUserId();
for (PsdcDevice dd : list){
Map<String, Object> map = new HashMap<>();
map.put("label", dd.getDeviceName());
map.put("value", dd.getDeviceId());
maps.add(map);
}
return AjaxResult.success("用户所属设备列表", maps);
}
@PreAuthorize("@ss.hasPermi('emonitor:db')") @PreAuthorize("@ss.hasPermi('emonitor:db')")
@RequestMapping(value = "/sel1", method = RequestMethod.GET) @RequestMapping(value = "/sel1/{deviceId}", method = RequestMethod.GET)
public AjaxResult selzdb1() { public AjaxResult selzdb1(@PathVariable(value = "deviceId", required = false) Integer deviceId) {
PsdcDevicePowerRes devicePowerRes = psdcThermometerHtdataService.selTotalElectricityInfo(); PsdcDevicePowerRes devicePowerRes = psdcThermometerHtdataService.selTotalElectricityInfo(deviceId);
Map map = psdcElectricHtdataService.selTotalElectricityInfo(); Map map = psdcElectricHtdataService.selTotalElectricityInfo();
devicePowerRes.setEDay((Double) map.get("eday")); devicePowerRes.setEDay((Double) map.get("eday"));
devicePowerRes.setEMonth((Double) map.get("emonth")); devicePowerRes.setEMonth((Double) map.get("emonth"));
@ -42,9 +64,9 @@ public class TotalElectricMeterController {
} }
@PreAuthorize("@ss.hasPermi('emonitor:db')") @PreAuthorize("@ss.hasPermi('emonitor:db')")
@RequestMapping(value = "/sel2", method = RequestMethod.GET) @RequestMapping(value = "/sel2/{deviceId}", method = RequestMethod.GET)
public AjaxResult selzdb2() { public AjaxResult selzdb2(@PathVariable(value = "deviceId", required = false) Integer deviceId) {
List list = psdcElectricHtdataService.selThisHourUseElectric(); List list = psdcElectricHtdataService.selThisHourUseElectric(deviceId);
AjaxResult ajax = AjaxResult.success(list); AjaxResult ajax = AjaxResult.success(list);
return ajax; return ajax;
} }

@ -0,0 +1,35 @@
package com.psdc.controller.monitor;
import com.psdc.core.domain.AjaxResult;
import com.psdc.service.IPsdcThermometerHtdataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author戴仕崑
* @Projectpsdc
* @FilenameWenDuController
* @Date2023/5/11 14:21
* @Version 1.0
*/
@RestController
@RequestMapping("/api/monitor/wdcgq/index")
public class WenDuController {
@Autowired
IPsdcThermometerHtdataService psdcThermometerHtdataService;
@PreAuthorize("@ss.hasPermi('emonitor:wdcgq')")
@RequestMapping(value = "/sel1/{deviceId}", method = RequestMethod.GET)
public AjaxResult seldrgl1(@PathVariable(value = "deviceId", required = false) Integer deviceId){
if (null == psdcThermometerHtdataService.selTodayThermometerById(deviceId)){
return AjaxResult.success("今日该设备暂无温度数据!");
}
return AjaxResult.success(psdcThermometerHtdataService.selTodayThermometerById(deviceId));
}
}
Loading…
Cancel
Save