浏览代码

楼宇中控接口修改

zhanghao 2 月之前
父节点
当前提交
8862dc8f21

+ 2 - 0
project-admin/src/main/resources/application-dev.yml

@@ -43,6 +43,8 @@ apiurl:
   controlImportantSum: /important/sum
   # 楼宇中控 楼宇中当前告警的设备
   controlEquipment: /equipment/state
+  # 楼宇中控 楼宇中异常点位查看
+  controlAlertDetails: /equipment/alertDetails
   # 楼宇中控 告警事件的历史统计
   controlAlarm: /alarm/count
   # 楼宇中控 水箱水位情况

+ 2 - 2
project-zcustom/src/main/java/com/project/zcustom/controller/build/PlatBuildControlController.java

@@ -32,7 +32,7 @@ public class PlatBuildControlController {
     /*专业所属电表明细*/
     @GetMapping("/thisAmmeterDetail")
     public AjaxResult getThisAmmeterDetail(@RequestParam String type) {
-        return AjaxResult.success("查询成功", platBuildingService.getThisAmmeterDetail());
+        return AjaxResult.success("查询成功", platBuildingService.getThisAmmeterDetail(type));
     }
 
     /*楼宇今日总用电量*/
@@ -62,7 +62,7 @@ public class PlatBuildControlController {
     /*异常点位查看*/
     @GetMapping("/abnormalPoint")
     public AjaxResult getAbnormalPoint(@RequestParam String type) {
-        return AjaxResult.success("查询成功", platBuildingService.getAbnormalPoint());
+        return AjaxResult.success("查询成功", platBuildingService.getAbnormalPoint(type));
     }
 
     /*告警事件的历史统计*/

+ 2 - 2
project-zcustom/src/main/java/com/project/zcustom/service/smart/IPlatBuildingService.java

@@ -37,7 +37,7 @@ public interface IPlatBuildingService{
 
     Map<String, Object> getThisWeekElectricity();
 
-    JSONArray getThisAmmeterDetail();
+    JSONArray getThisAmmeterDetail(String type);
 
     List<Map<String, Object>> getTodayElectricity();
 
@@ -47,7 +47,7 @@ public interface IPlatBuildingService{
 
     Map<String, Object> getWarnDevice();
 
-    JSONArray getAbnormalPoint();
+    JSONArray getAbnormalPoint(String type);
 
     JSONArray getWarnEvent();
 

+ 11 - 2
project-zcustom/src/main/java/com/project/zcustom/service/smart/impl/PlatBuildingServiceImpl.java

@@ -7,6 +7,8 @@ import com.project.zcustom.domain.addional.LargeBuildingControl;
 import com.project.zcustom.mapper.unit.PlatBuildingMapper;
 import com.project.zcustom.service.smart.IPlatBuildingService;
 import com.project.zcustom.service.smart.IPlatGreenFoodsService;
+import com.project.zcustom.tools.ApiUrlConfig;
+import com.project.zcustom.tools.BuildingService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -22,6 +24,9 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
     @Autowired
     private PlatBuildingMapper platBuildingMapper;
 
+    @Autowired
+    private BuildingService buildingService;
+
     public List<Map<String, Object>> getPowerAndWaterMonth(){
         List<Map<String, Object>> resultList = new ArrayList<>();
 
@@ -307,8 +312,9 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
         return map;
     }
 
-    public JSONArray getThisAmmeterDetail(){
+    public JSONArray getThisAmmeterDetail(String type){
         // TODO
+        /*return buildingService.repeat(ApiUrlConfig.getControlElectricityDetail(), "type=" + type);*/
         String str = "[\n" +
                 "        {\n" +
                 "            \"number\": \"1# 1-3\",\n" +
@@ -410,8 +416,11 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
         return map;
     }
 
-    public JSONArray getAbnormalPoint(){
+    public JSONArray getAbnormalPoint(String type){
         // TODO
+        /*
+        return buildingService.repeat(ApiUrlConfig.getControlAlertDetails(), "type=" + type);
+        */
         String str = "[\n" +
                 "        {\n" +
                 "            \"alertTime\": \"2025-01-01 15:12:11\",\n" +

+ 9 - 0
project-zcustom/src/main/java/com/project/zcustom/tools/ApiUrlConfig.java

@@ -96,6 +96,15 @@ public class ApiUrlConfig {
         ApiUrlConfig.controlEquipment = controlEquipment;
     }
 
+    // 楼宇中控 楼宇中异常点位查看
+    private static String controlAlertDetails;
+    public static String getControlAlertDetails() {
+        return controlAlertDetails;
+    }
+    public static void setControlAlertDetails(String controlAlertDetails) {
+        ApiUrlConfig.controlAlertDetails = controlAlertDetails;
+    }
+
     // 楼宇中控 告警事件的历史统计
     private static String controlAlarm;
     public static String getControlAlarm() {