|
@@ -1,5 +1,23 @@
|
|
|
package com.ruoyi.ems.controller;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
@@ -15,23 +33,8 @@ import com.ruoyi.ems.domain.vo.QueryDevice;
|
|
|
import com.ruoyi.ems.service.IAreaBuildingService;
|
|
|
import com.ruoyi.ems.service.IAreaBuildingZoningService;
|
|
|
import com.ruoyi.ems.service.IEmsDeviceService;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
|
|
/**
|
|
|
* 能源设备Controller
|
|
@@ -162,4 +165,26 @@ public class DeviceController extends BaseController {
|
|
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(deviceService.deleteEmsDeviceByIds(ids));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备-设备状态统计
|
|
|
+ *
|
|
|
+ * @param areaCode
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/status/cnt")
|
|
|
+ public AjaxResult getDeviceStatusCnt(@RequestParam("areaCode") String areaCode) {
|
|
|
+ return success(deviceService.cntDeviceStatus(areaCode));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备-类型在线率
|
|
|
+ *
|
|
|
+ * @param areaCode
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/type/online")
|
|
|
+ public AjaxResult getDeviceOnlineSummary(@RequestParam("areaCode") String areaCode) {
|
|
|
+ return success(deviceService.calcDeviceOnlineSummary(areaCode));
|
|
|
+ }
|
|
|
}
|