Commit 8f45791a authored by 耿迪迪's avatar 耿迪迪

手动消警 监控 gengdidi

parent 50884716
......@@ -2,19 +2,14 @@ package com.zehong.web.controller.dataMonitoring;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.zehong.system.domain.form.DeviceAlarmForm;
import com.zehong.system.domain.vo.DeviceAlarmVo;
import com.zehong.system.service.WebSocketServer;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
......@@ -36,6 +31,9 @@ public class TDeviceAlarmController extends BaseController
@Autowired
private ITDeviceAlarmService tDeviceAlarmService;
@Autowired
private WebSocketServer webSocketServer;
/**
* 查询报警信息列表
......@@ -113,4 +111,28 @@ public class TDeviceAlarmController extends BaseController
public List<TDeviceAlarm> selectAlarmDevice (){
return tDeviceAlarmService.selectAlarmDevice();
}
/**
* 手动消警
* @param alarmId 报警信息id
* @return
*/
@GetMapping("/handEliminationAlarm")
public AjaxResult handEliminationAlarm(@RequestParam(value = "alarmId") int alarmId){
try {
TDeviceAlarm alarmVo = new TDeviceAlarm();
alarmVo.setAlarmId(alarmId);
alarmVo.setDealStatus("4");
int status = tDeviceAlarmService.updateTDeviceAlarm(alarmVo);
if(1 != status){
throw new Exception("手动消警更新失败!");
}
DeviceAlarmVo alarm = tDeviceAlarmService.selectTDeviceAlarmById(alarmId);
webSocketServer.batchSendMessage(JSONObject.toJSONString(alarm));
return AjaxResult.success(alarm);
} catch (Exception e) {
logger.error("手动消警系统报错:"+e);
}
return AjaxResult.error();
}
}
......@@ -58,7 +58,7 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
host: 36.148.23.59
# 端口,默认为6379
port: 6379
# 数据库索引
......
......@@ -26,7 +26,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: test
active: prd
# 文件上传
servlet:
multipart:
......
......@@ -8,7 +8,7 @@ VUE_APP_BASE_API = '/dev-api'
VUE_APP_MAP_CENTER = '石家庄'
#代理地址
VUE_APP_TARGET = 'http://192.168.2.28:8903/gassafety'
VUE_APP_TARGET = 'http://36.148.23.59:8901/gassafety'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......@@ -157,6 +157,7 @@
<span v-if="scope.row.dealStatus == 1">不需处理</span>
<span v-if="scope.row.dealStatus == 2">已处理完成</span>
<span v-if="scope.row.dealStatus == 3">未处理完成</span>
<span v-if="scope.row.dealStatus == 4">手动消警</span>
</template>
</el-table-column>
<el-table-column
......
......@@ -120,7 +120,7 @@
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备监控id" align="center" prop="monitorId" />
<!--<el-table-column label="设备监控id" align="center" prop="monitorId" />-->
<el-table-column label="设备" align="center" prop="deviceName" />
<el-table-column label="设备阈值" align="center" prop="deviceThreshold" />
<el-table-column label="关联管道" align="center" prop="relationPipeName" />
......@@ -156,9 +156,9 @@
/>
<!-- 添加或修改设备监控对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="650px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="deviceId">
<el-form-item label="设备" prop="deviceId">
<!--<el-input v-model="form.deviceId" placeholder="请输入设备id" />-->
<el-select v-model="form.deviceId" placeholder="请选择设备" filterable>
<el-option
......@@ -172,7 +172,7 @@
<el-form-item label="设备阈值" prop="deviceThreshold">
<el-input v-model="form.deviceThreshold" placeholder="请输入设备阈值" />
</el-form-item>
<el-form-item label="关联管道id" prop="relationPipeId">
<el-form-item label="关联管道" prop="relationPipeId">
<!--<el-input v-model="form.relationPipeId" placeholder="请输入关联管道id" />-->
<el-select v-model="form.relationPipeId" placeholder="请选择关联管道" filterable>
<el-option
......@@ -186,7 +186,7 @@
<el-form-item label="关联管道阈值" prop="relationPipeThreshold">
<el-input v-model="form.relationPipeThreshold" placeholder="请输入关联管道阈值" />
</el-form-item>
<el-form-item label="关联设备id" prop="relationDeviceId">
<el-form-item label="关联设备" prop="relationDeviceId">
<!-- <el-input v-model="form.relationDeviceId" placeholder="请输入关联设备id" />-->
<el-select v-model="form.relationDeviceId" placeholder="请选择关联设备" filterable>
<el-option
......@@ -316,6 +316,24 @@ export default {
form: {},
// 表单校验
rules: {
deviceId: [
{ required: true, message: "请选择设备", trigger: "blur" },
],
deviceThreshold: [
{ required: true, message: "请输入设备阈值", trigger: "blur" },
],
relationPipeId: [
{ required: true, message: "请选择关联管道", trigger: "blur" },
],
relationPipeThreshold: [
{ required: true, message: "请设置关联属管道阈值", trigger: "blur" },
],
relationDeviceId: [
{ required: true, message: "请选择关联设备", trigger: "blur" },
],
relationDeviceThreshold: [
{ required: true, message: "请设置关联设备阈值", trigger: "blur" },
],
},
devices: [],
pipes: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment