diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/WisdomScenarioContorller.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/WisdomScenarioContorller.java new file mode 100644 index 0000000..74e1793 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/WisdomScenarioContorller.java @@ -0,0 +1,104 @@ +package com.ruoyi.web.controller.iot; + +import com.alibaba.fastjson.JSONArray; +import com.ruoyi.system.domain.BaseMonitorunitInfo; +import com.ruoyi.system.domain.BaseSensorInfo; +import com.ruoyi.system.domain.dto.BaseMonitorunitInfoDto; +import com.ruoyi.system.domain.dto.BaseSensorInfoDto; +import com.ruoyi.system.service.IBaseMonitorunitInfoService; +import com.ruoyi.system.service.IBaseSensorInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 智慧场景Controller + * + * @author WenJY + * @date 2022年03月14日 11:18 + */ +@Controller +@RequestMapping("/iot/wisdomScenario") +public class WisdomScenarioContorller { + + @Autowired private IBaseMonitorunitInfoService baseMonitorunitInfoService; + + @Autowired private IBaseSensorInfoService baseSensorInfoService; + + /** + * 数量统计:传感器数量、监控单元数量 + * + * @author WenJY + * @date 2022/3/14 16:45 + * @param monitorUnitType + * @return java.lang.String + */ + @GetMapping("/quantityStatistics") + @ResponseBody + public String quantityStatistics(String monitorUnitType) { + + List baseMonitorunitInfos = + baseMonitorunitInfoService.selectBaseMonitorunitInfoList(new BaseMonitorunitInfo()); + List collect = + baseMonitorunitInfos.stream() + .filter( + x -> + !x.getParentId().isEmpty() + && x.getEnableFlag() == 0L + && x.getMonitorunitType().equals(monitorUnitType)) + .collect(Collectors.toList()); + int sensorAmount = 0; + for (BaseMonitorunitInfo x : collect) { + List baseSensorInfoDtos = + baseSensorInfoService.selectBaseSensorInfoList( + new BaseSensorInfo(null, null, null, x.getMonitorunitId())); + sensorAmount = sensorAmount + baseSensorInfoDtos.size(); + } + + int finalSensorAmount = sensorAmount; + List result = + new ArrayList() { + { + this.add(finalSensorAmount); + this.add(collect.size()); + } + }; + return JSONArray.toJSONString(result); + } + + /** + * 获取监控单元模块 + * + * @author WenJY + * @date 2022/3/14 16:46 + * @param monitorUnitType + * @return java.lang.String + */ + @GetMapping("/getMonitorUnitModule") + @ResponseBody + public String getMonitorUnitModule(String monitorUnitType) { + List baseMonitorunitInfoDtos = + baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(new BaseMonitorunitInfo()); + List collect = + baseMonitorunitInfoDtos.stream() + .filter( + x -> + !x.getParentId().isEmpty() + && x.getEnableFlag() == 0L + && x.getMonitorunitType().equals(monitorUnitType)) + .collect(Collectors.toList()); + collect.forEach(x->{ + x.setUnitUrl("/sections/transformer-detail?id="+x.getMonitorunitId()); + }); + + return JSONArray.toJSONString(collect); + } +} diff --git a/ruoyi-admin/src/main/resources/static/styleCss/bootstrap.min.css b/ruoyi-admin/src/main/resources/static/styleCss/bootstrap.min.css index a68f941..99c50d7 100644 --- a/ruoyi-admin/src/main/resources/static/styleCss/bootstrap.min.css +++ b/ruoyi-admin/src/main/resources/static/styleCss/bootstrap.min.css @@ -268,9 +268,9 @@ td, th { } @font-face { - /*font-family: 'Glyphicons Halflings'; + font-family: 'Glyphicons Halflings'; src: url(../fonts/glyphicons-halflings-regular.eot); - src: url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'), url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'), url(../fonts/glyphicons-halflings-regular.woff) format('woff'), url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'), url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')*/ + src: url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'), url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'), url(../fonts/glyphicons-halflings-regular.woff) format('woff'), url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'), url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg') } .glyphicon { diff --git a/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html b/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html index 9687a4c..15c1933 100644 --- a/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html +++ b/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html @@ -2,10 +2,12 @@ +
+
@@ -63,9 +65,35 @@
+ +

上传模型

+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html b/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html index 235b9f3..c9df879 100644 --- a/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html +++ b/ruoyi-admin/src/main/resources/templates/base/sensorInfo/sensorInfo.html @@ -265,6 +265,7 @@ $("#monitorunitId").val(treeNode.id); $.table.search(); initTable(treeNode.id); + var num = new Object; num.cp_keynum = "key_num"; num.cp_num_value = treeNode.id + "/" + treeNode.name; diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index f8a4d5a..2b1fd24 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -33,9 +33,9 @@
- +
智慧物联监控平台
+ + /*function myClick(hre) { + let num = new Object; + num.cp_keynum = "wisdmoScenario_Key"; + num.cp_num_value = hre; + var str = JSON.stringify(num); // 将对象转换为字符串 + localStorage.setItem(num.cp_keynum, str); + } + + function buttonClick(href) { + let num = new Object; + num.cp_keynum = "wisdmoScenario_Key"; + num.cp_num_value = href.innerText; + var str = JSON.stringify(num); // 将对象转换为字符串 + localStorage.setItem(num.cp_keynum, str); + }*/ + function userInfoOnclick() { location.href = '/indexInfo/index'; } diff --git a/ruoyi-admin/src/main/resources/templates/section/substation.html b/ruoyi-admin/src/main/resources/templates/section/substation.html index 2f4764e..775205d 100644 --- a/ruoyi-admin/src/main/resources/templates/section/substation.html +++ b/ruoyi-admin/src/main/resources/templates/section/substation.html @@ -4,7 +4,7 @@ - 监控主页 + 智慧场景 @@ -213,7 +213,8 @@ -
78
变压器
+
78
监控单元
78
传感器
设备高温
3
@@ -223,26 +224,8 @@
室内渗水
3
安消视觉
3
- -
- -
    @@ -252,6 +235,35 @@ - - + + - + -
    - - -
    - -
    - - -
    -
    - -
    监控单元
    -
    - 监控单元 -
    - -
    -

    设备编号:10kv 主变压器001

    -

    设备型号:SC(B)10型干式电力变压器

    -

    启用时间:2020年1月20日

    -

    所属变电站:新疆某某变电站

    -

    测试参数-1:xxxxx

    -

    测试参数-2:xxxxx

    -
    - - - -
    -
    +
    + + +
    + +
    + + +
    +
    + +
    监控单元
    +
    + 监控单元 +
    + +
    +

    设备编号:10kv 主变压器001

    +

    设备型号:SC(B)10型干式电力变压器

    +

    启用时间:2020年1月20日

    +

    所属变电站:新疆某某变电站

    +

    测试参数-1:xxxxx

    +

    测试参数-2:xxxxx

    +
    + + + +
    +
    - + $(() => { + sensorCollection.push( + new SensorCardsViewModel("sensor-card-1", document.getElementById("sensor-card-group")), + new SensorCardsViewModel("sensor-card-2", document.getElementById("sensor-card-group")), + new SensorCardsViewModel("sensor-card-3", document.getElementById("sensor-card-group")), + new SensorCardsViewModel("sensor-card-4", document.getElementById("sensor-card-group")), + new SensorCardsViewModel("sensor-card-5", document.getElementById("sensor-card-group")), + ) + + for (let i = 0; i < 5; i++) { + const vm = sensorCollection.get(i) + vm.set("title", "10kV I、II段母联110开关柜_上触头B相_温度传感器_XP00028C08") + vm.set("temperature", "47.5°C") + vm.set("battery-icon", ``) + vm.set("status", "启用") + vm.set("conn-status", "在线") + vm.set("datetime", "10:00:00") + } + + sensorCollection.refresh() + }) +