فهرست منبع

数据大屏bug的修正

zhengjie 1 سال پیش
والد
کامیت
16e80f7369

+ 35 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TDataDisplayController.java

@@ -64,7 +64,7 @@ public class TDataDisplayController extends BaseController
             alarmListDto.setCreatetime(dto.getCreatetime());
             alarmListDtoList.add(alarmListDto);
         }
-        return getDataTable(alarmListDtoList);
+        return getDataTable1(alarmListDtoList,tShouhuanAlarmListService.selectTShouhuanAlarmListCount());
     }
 
     /**
@@ -115,6 +115,39 @@ public class TDataDisplayController extends BaseController
         return success(dto);
     }
 
+    /**
+     * 总数
+     */
+    @GetMapping("/deviceView")
+    public AjaxResult deviceView()
+    {
+        DeviceViewDto dto = new DeviceViewDto();
+        return success();
+    }
+    /**
+     * 查询SOS预警处理列表
+     */
+    @GetMapping("/alarmList")
+    public AjaxResult alarmList(DataAlarmListDto dataAlarmListDto)
+    {
+        List<DataAlarmListDto> list = tShouhuanAlarmListService.selectTShouhuanAlarmList(dataAlarmListDto);
+        List<MessageAlarmListDto> messageAlarmListDtoList = new ArrayList<>();
+        for (DataAlarmListDto dto : list){
+            MessageAlarmListDto alarmListDto = new MessageAlarmListDto();
+            alarmListDto.setName(dto.getName());
+            alarmListDto.setTelno(dto.getTel_one());
+            alarmListDto.setGps_long(dto.getGps_long());
+            alarmListDto.setGps_lat(dto.getGps_lat());
+            alarmListDto.setAddress(getCounterLocation(dto.getGps_long() + "," + dto.getGps_lat()));
+            alarmListDto.setAlarm_type(dto.getAlarm_type());
+            alarmListDto.setCreatetime(dto.getCreatetime());
+            messageAlarmListDtoList.add(alarmListDto);
+        }
+        return success(messageAlarmListDtoList);
+    }
+
+
+
     /**
      * 逆地理编码
      * @param location
@@ -138,6 +171,6 @@ public class TDataDisplayController extends BaseController
         NumberFormat numberFormat = NumberFormat.getInstance();
         numberFormat.setMaximumFractionDigits(2);
         String result = numberFormat.format((float)num1/(float)num2*100);
-        return result + "%";
+        return result;
     }
 }

+ 4 - 0
ruoyi-admin/src/main/resources/application-druid.yml

@@ -9,6 +9,10 @@ spring:
                 url: jdbc:mysql://42.193.106.113:3306/yyky?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: zhonghui0123
+#            master:
+#                url: jdbc:mysql://localhost:3306/yyky?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#                username: root
+#                password: yiyikangyang
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 1 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -78,6 +78,7 @@ spring:
     database: 0
     # 密码
     password:
+#    password: yyky@2023
     # 连接超时时间
     timeout: 10s
     lettuce:

+ 14 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@@ -90,6 +90,20 @@ public class BaseController
         return rspData;
     }
 
+    /**
+     * 响应请求分页数据
+     */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    protected TableDataInfo getDataTable1(List<?> list,Integer total)
+    {
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.SUCCESS);
+        rspData.setMsg("查询成功");
+        rspData.setRows(list);
+        rspData.setTotal(total);
+        return rspData;
+    }
+
     /**
      * 返回成功
      */

+ 59 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DeviceViewDto.java

@@ -0,0 +1,59 @@
+package com.ruoyi.system.domain.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+public class DeviceViewDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 总数 */
+    @Excel(name = "总数")
+    private Integer deviceCount;
+
+    /** 在线 */
+    @Excel(name = "在线")
+    private Integer deviceOnline;
+
+    /** 离线 */
+    @Excel(name = "离线")
+    private Integer un_deviceOnline;
+
+    /** 告警数 */
+    @Excel(name = "告警数")
+    private Integer alarmCount;
+
+    public Integer getDeviceCount() {
+        return deviceCount;
+    }
+
+    public void setDeviceCount(Integer deviceCount) {
+        this.deviceCount = deviceCount;
+    }
+
+    public Integer getDeviceOnline() {
+        return deviceOnline;
+    }
+
+    public void setDeviceOnline(Integer deviceOnline) {
+        this.deviceOnline = deviceOnline;
+    }
+
+    public Integer getUn_deviceOnline() {
+        return un_deviceOnline;
+    }
+
+    public void setUn_deviceOnline(Integer un_deviceOnline) {
+        this.un_deviceOnline = un_deviceOnline;
+    }
+
+    public Integer getAlarmCount() {
+        return alarmCount;
+    }
+
+    public void setAlarmCount(Integer alarmCount) {
+        this.alarmCount = alarmCount;
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MessageAlarmListDto.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.domain.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+public class MessageAlarmListDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 告警内容 */
+    @Excel(name = "告警内容")
+    private Integer alarm_type;
+
+    /** 姓名 */
+    @Excel(name = "姓名")
+    private String name;
+
+    /** 电话 */
+    @Excel(name = "电话")
+    private String telno;
+
+    /** 详细地址 */
+    @Excel(name = "详细地址")
+    private String address;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    private float gps_long;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    private float gps_lat;
+
+    /** 时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "时间")
+    private Date createtime;
+
+    public Integer getAlarm_type() {
+        return alarm_type;
+    }
+
+    public void setAlarm_type(Integer alarm_type) {
+        this.alarm_type = alarm_type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getTelno() {
+        return telno;
+    }
+
+    public void setTelno(String telno) {
+        this.telno = telno;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public float getGps_long() {
+        return gps_long;
+    }
+
+    public void setGps_long(float gps_long) {
+        this.gps_long = gps_long;
+    }
+
+    public float getGps_lat() {
+        return gps_lat;
+    }
+
+    public void setGps_lat(float gps_lat) {
+        this.gps_lat = gps_lat;
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+}

+ 3 - 2
ruoyi-ui/vue.config.js

@@ -35,8 +35,9 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:8088`,
-        // target: `http://152.136.61.163:8088`,
+        // target: `http://localhost:8088`,
+        target: `http://118.195.207.241:8088`,
+        // target: `http://152.136.61.163`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''