修改内部评审提出问题
This commit is contained in:
parent
24c9a72084
commit
833f458057
@ -30,5 +30,14 @@ public class IpcDataShowController extends BaseController {
|
||||
return AjaxResult.success(iIpcDataShowService.getShowData(parts));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报警数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ipc:dataShow:query')")
|
||||
@GetMapping(value = "/alarmData")
|
||||
public AjaxResult getAlarmData()
|
||||
{
|
||||
return AjaxResult.success(iIpcDataShowService.getAlarmData());
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -109,6 +109,8 @@ public class IpcAlarmRecord extends BaseEntity {
|
||||
|
||||
private String[] ids;
|
||||
|
||||
private int pageSize;
|
||||
|
||||
public String[] getIds() {
|
||||
return ids;
|
||||
}
|
||||
@ -117,6 +119,14 @@ public class IpcAlarmRecord extends BaseEntity {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
@ -15,4 +15,8 @@ public interface IIpcDataShowService {
|
||||
*/
|
||||
public Map<String,Object> getShowData(String [] parts);
|
||||
|
||||
/**
|
||||
* 报警数据获取
|
||||
*/
|
||||
public Map<String,Object> getAlarmData();
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.inspur.ipc.service.impl;
|
||||
|
||||
import com.inspur.common.constant.CacheConstants;
|
||||
import com.inspur.ipc.domain.IpcAlarmRecord;
|
||||
import com.inspur.ipc.domain.IpcMonitorField;
|
||||
import com.inspur.ipc.domain.IpcQueryParams;
|
||||
import com.inspur.ipc.service.IIpcAlarmRecordService;
|
||||
import com.inspur.ipc.service.IIpcDataShowService;
|
||||
import com.inspur.ipc.service.IIpcMonitorFieldService;
|
||||
import com.inspur.ipc.utils.IpcConstant;
|
||||
import com.inspur.system.service.influx.InfluxDBService;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
@ -31,6 +34,8 @@ public class IpcDataShowServiceImpl implements IIpcDataShowService {
|
||||
private InfluxDBService influxDBService;
|
||||
@Autowired
|
||||
private IIpcAlarmRecordService ipcAlarmRecordService;
|
||||
@Autowired
|
||||
private IIpcMonitorFieldService iIpcMonitorFieldService;
|
||||
|
||||
/**
|
||||
* 展示数据获取
|
||||
@ -116,15 +121,6 @@ public class IpcDataShowServiceImpl implements IIpcDataShowService {
|
||||
map.put("oip", oip.get(plcIndex));
|
||||
map.put("od", od.get(plcIndex));
|
||||
}
|
||||
// 查询报警数据
|
||||
IpcAlarmRecord ipcAlarmRecord = new IpcAlarmRecord();
|
||||
ipcAlarmRecord.setPartKey(part);
|
||||
ipcAlarmRecord.setAlarmStatus("0");
|
||||
List<IpcAlarmRecord> list = ipcAlarmRecordService.selectIpcAlarmRecordList(ipcAlarmRecord);
|
||||
// 颗粒度报警
|
||||
map.put("pzAlarmStr", String.join(IpcConstant.DATA_SEPARATOR, list.stream().filter(ipcAlarmRecord1 -> ipcAlarmRecord1.getNameKey().startsWith("pz")).limit(IpcConstant.BIGSCREEN_ALARM_RECORD_NUM_5).map(IpcAlarmRecord::getAlarmDetail).collect(Collectors.toList())));
|
||||
// 其他报警
|
||||
map.put("otherAlarmStr", String.join(IpcConstant.DATA_SEPARATOR, list.stream().filter(ipcAlarmRecord1 -> !ipcAlarmRecord1.getNameKey().startsWith("pz")).limit(IpcConstant.BIGSCREEN_ALARM_RECORD_NUM_10).map(IpcAlarmRecord::getAlarmDetail).collect(Collectors.toList())));
|
||||
// 根据位置处理
|
||||
if (part.endsWith(IpcConstant.OPERATION_PROFILE)) {
|
||||
// 操作侧
|
||||
@ -234,4 +230,29 @@ public class IpcDataShowServiceImpl implements IIpcDataShowService {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报警数据获取
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> getAlarmData(){
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
// 查询报警数据
|
||||
IpcAlarmRecord ipcAlarmRecord = new IpcAlarmRecord();
|
||||
ipcAlarmRecord.setAlarmStatus("0");
|
||||
List<IpcAlarmRecord> list = ipcAlarmRecordService.selectIpcAlarmRecordList(ipcAlarmRecord);
|
||||
// 颗粒度报警
|
||||
dataMap.put("pzOperationAlarmStr", String.join(IpcConstant.DATA_SEPARATOR, list.stream().filter(ipcAlarmRecord1 -> ipcAlarmRecord1.getPartKey().endsWith("o") && ipcAlarmRecord1.getNameKey().startsWith("pz")).limit(IpcConstant.BIGSCREEN_ALARM_RECORD_NUM_5).map(IpcAlarmRecord::getAlarmDetail).collect(Collectors.toList())));
|
||||
dataMap.put("pzDriveAlarmStr", String.join(IpcConstant.DATA_SEPARATOR, list.stream().filter(ipcAlarmRecord1 -> ipcAlarmRecord1.getPartKey().endsWith("d") && ipcAlarmRecord1.getNameKey().startsWith("pz")).limit(IpcConstant.BIGSCREEN_ALARM_RECORD_NUM_5).map(IpcAlarmRecord::getAlarmDetail).collect(Collectors.toList())));
|
||||
// 其他报警
|
||||
dataMap.put("otherOperationAlarmStr", String.join(IpcConstant.DATA_SEPARATOR, list.stream().filter(ipcAlarmRecord1 -> ipcAlarmRecord1.getPartKey().endsWith("o") && !ipcAlarmRecord1.getNameKey().startsWith("pz")).limit(IpcConstant.BIGSCREEN_ALARM_RECORD_NUM_5).map(IpcAlarmRecord::getAlarmDetail).collect(Collectors.toList())));
|
||||
dataMap.put("otherDriveAlarmStr", String.join(IpcConstant.DATA_SEPARATOR, list.stream().filter(ipcAlarmRecord1 -> ipcAlarmRecord1.getPartKey().endsWith("d") && !ipcAlarmRecord1.getNameKey().startsWith("pz")).limit(IpcConstant.BIGSCREEN_ALARM_RECORD_NUM_10).map(IpcAlarmRecord::getAlarmDetail).collect(Collectors.toList())));
|
||||
// 根据部位区分报警数量
|
||||
List<IpcMonitorField> fieldList = iIpcMonitorFieldService.selectFieldDataByType(CacheConstants.MONITOR_PART_KEY);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (IpcMonitorField field : fieldList) {
|
||||
map.put(field.getFieldValue(), list.stream().anyMatch(ipcAlarmRecord1 -> ipcAlarmRecord1.getPartKey().equals(field.getFieldValue())));
|
||||
}
|
||||
dataMap.put("alarmCount", map);
|
||||
return dataMap;
|
||||
}
|
||||
}
|
||||
|
@ -7,3 +7,11 @@ export function getShowData(parts) {
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 根据部位查询报警数据
|
||||
export function getAlarmData() {
|
||||
return request({
|
||||
url: "/ipc/dataShow/alarmData",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
@ -24,19 +24,63 @@
|
||||
<div @click="() => {
|
||||
curImageIndex = 1
|
||||
handleTypeChange(['rtd', 'rto'])
|
||||
}"></div>
|
||||
}">
|
||||
<div class="part-title">
|
||||
<div class="part-alarm">
|
||||
<i class="width-10 hidden-part">R</i>
|
||||
<i class="width-10">R</i>
|
||||
<i
|
||||
class="el-icon-warning width-10"
|
||||
:class="{'hidden-part' : !isAlarm.rt}"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div @click="() => {
|
||||
curImageIndex = 2
|
||||
handleTypeChange(['ftd', 'fto'])
|
||||
}"></div>
|
||||
}">
|
||||
<div class="part-title">
|
||||
<div class="part-alarm">
|
||||
<i class="width-10 hidden-part">F</i>
|
||||
<i class="width-10">F</i>
|
||||
<i
|
||||
class="el-icon-warning width-10"
|
||||
:class="{'hidden-part' : !isAlarm.ft}"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div @click="() => {
|
||||
curImageIndex = 3
|
||||
handleTypeChange(['rbd', 'rbo'])
|
||||
}"></div>
|
||||
}">
|
||||
<div class="part-title">
|
||||
<div class="part-alarm">
|
||||
<i class="width-10 hidden-part">R</i>
|
||||
<i class="width-10">R</i>
|
||||
<i
|
||||
class="el-icon-warning width-10"
|
||||
:class="{'hidden-part' : !isAlarm.rb}"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div @click="() => {
|
||||
curImageIndex = 4
|
||||
handleTypeChange(['fbd', 'fbo'])
|
||||
}"></div>
|
||||
}">
|
||||
<div class="part-title">
|
||||
<div class="part-alarm">
|
||||
<i class="width-10 hidden-part">F</i>
|
||||
<i class="width-10">F</i>
|
||||
<i
|
||||
class="el-icon-warning width-10"
|
||||
:class="{'hidden-part' : !isAlarm.fb}"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-item-wrapper">
|
||||
@ -162,13 +206,13 @@
|
||||
>
|
||||
<div
|
||||
class="extra-bar-item"
|
||||
:style="`height: ${parseInt(l2 * 100)}%;background-color:#19ca88;`"
|
||||
:style="`height: ${parseInt(l2)}%;background-color:#19ca88;`"
|
||||
></div>
|
||||
<div
|
||||
class="extra-bar-text"
|
||||
:style="`height: calc(100% - ${parseInt(l2 * 100)}%);`"
|
||||
:style="`height: calc(100% - ${parseInt(l2)}%);`"
|
||||
>
|
||||
{{ parseInt(l2 * 100) }}
|
||||
{{ parseFloat(l2) }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@ -205,13 +249,13 @@
|
||||
>
|
||||
<div
|
||||
class="extra-bar-item"
|
||||
:style="`height: ${parseInt(r1 * 100)}%;background-color:#19ca88;`"
|
||||
:style="`height: ${parseInt(r1)}%;background-color:#19ca88;`"
|
||||
></div>
|
||||
<div
|
||||
class="extra-bar-text"
|
||||
:style="`height: calc(100% - ${parseInt(r1 * 100)}%);`"
|
||||
:style="`height: calc(100% - ${parseInt(r1)}%);`"
|
||||
>
|
||||
{{ parseInt(r1 * 100) }}
|
||||
{{ parseFloat(r1) }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@ -370,6 +414,7 @@ import * as echarts from "echarts";
|
||||
import { isArray, merge } from "lodash";
|
||||
import request from "@/utils/request";
|
||||
import { getTendencyData } from "@/api/ipc/dataLog";
|
||||
import { getAlarmData, getShowData } from "@/api/ipc/dataShow";
|
||||
|
||||
export default {
|
||||
name: "BigScreen",
|
||||
@ -390,6 +435,7 @@ export default {
|
||||
rbAlarmStr: "",
|
||||
|
||||
timer: null,
|
||||
alarmTimer: null,
|
||||
queryParams: ["rtd", "rto"],
|
||||
total: 0,
|
||||
titleMap: {
|
||||
@ -402,7 +448,13 @@ export default {
|
||||
fbd: "F下辊传动侧",
|
||||
fbo: "F下辊操作侧",
|
||||
},
|
||||
|
||||
// 是否报警
|
||||
isAlarm: {
|
||||
rt: false,
|
||||
rb: false,
|
||||
ft: false,
|
||||
fb: false,
|
||||
},
|
||||
xSensorData: [],
|
||||
// 是否显示弹出层
|
||||
// 遮罩层
|
||||
@ -474,10 +526,15 @@ export default {
|
||||
this.timer = setInterval(() => {
|
||||
this.initData(this.queryParams);
|
||||
}, 1000);
|
||||
this.initAlarmData();
|
||||
this.alarmTimer = setInterval(() => {
|
||||
this.initAlarmData();
|
||||
}, 1000 * 30);
|
||||
this.handleTypeChange(this.queryParams);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
clearInterval(this.alarmTimer);
|
||||
},
|
||||
methods: {
|
||||
//** 振动图谱横轴默认数据 */
|
||||
@ -639,8 +696,39 @@ export default {
|
||||
this.title1 = this.titleMap[params[0]];
|
||||
this.title2 = this.titleMap[params[1]];
|
||||
},
|
||||
initAlarmData() {
|
||||
getAlarmData().then(({ data }) => {
|
||||
const {
|
||||
pzOperationAlarmStr,
|
||||
pzDriveAlarmStr,
|
||||
otherOperationAlarmStr,
|
||||
otherDriveAlarmStr,
|
||||
alarmCount,
|
||||
} = data;
|
||||
// 处理报警数据
|
||||
if (alarmCount) {
|
||||
const { rtd, rto, rbd, rbo, ftd, fto, fbd, fbo } = alarmCount;
|
||||
if (rtd || rto) {
|
||||
this.isAlarm.rt = true;
|
||||
}
|
||||
if (rbd || rbo) {
|
||||
this.isAlarm.rb = true;
|
||||
}
|
||||
if (ftd || fto) {
|
||||
this.isAlarm.ft = true;
|
||||
}
|
||||
if (fbd || fbo) {
|
||||
this.isAlarm.fb = true;
|
||||
}
|
||||
}
|
||||
this.rtAlarmStr = pzDriveAlarmStr;
|
||||
this.rbAlarmStr = otherDriveAlarmStr;
|
||||
this.ltAlarmStr = pzOperationAlarmStr;
|
||||
this.lbAlarmStr = otherOperationAlarmStr;
|
||||
});
|
||||
},
|
||||
initData(params = []) {
|
||||
this.getDataResponse(params).then(({ data }) => {
|
||||
getShowData(params).then(({ data }) => {
|
||||
const { drive, operation } = data;
|
||||
// 处理操作侧数据
|
||||
if (operation) {
|
||||
@ -659,9 +747,6 @@ export default {
|
||||
|
||||
this.r1 = ssat;
|
||||
this.r2 = rot;
|
||||
|
||||
this.rtAlarmStr = pzAlarmStr;
|
||||
this.rbAlarmStr = otherAlarmStr;
|
||||
}
|
||||
// 处理传动测数据
|
||||
if (drive) {
|
||||
@ -678,8 +763,6 @@ export default {
|
||||
|
||||
this.l1 = rot;
|
||||
this.l2 = ssat;
|
||||
this.ltAlarmStr = pzAlarmStr;
|
||||
this.lbAlarmStr = otherAlarmStr;
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -1265,12 +1348,6 @@ export default {
|
||||
}
|
||||
);
|
||||
},
|
||||
getDataResponse(params = []) {
|
||||
return request({
|
||||
url: "/ipc/dataShow/byPart/" + params.join(","),
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
// 跳转温振数据记录页面
|
||||
jumpSensorDataLog(param) {
|
||||
this.$router.push({
|
||||
@ -1329,6 +1406,7 @@ export default {
|
||||
text-align: center;
|
||||
padding-top: 0.4rem;
|
||||
font-size: 1.3rem;
|
||||
color: red;
|
||||
background-size: 100% 100%;
|
||||
text-shadow: 2px 2px 2px #fff;
|
||||
@include background_bg(bigGridTitleBackgroundImage);
|
||||
@ -1443,4 +1521,23 @@ export default {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
}
|
||||
.part-title {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.part-alarm {
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中 */
|
||||
justify-content: center; /* 水平居中,如果需要的话 */
|
||||
width: 100%;
|
||||
color: red;
|
||||
font-size: 5rem;
|
||||
}
|
||||
.width-10 {
|
||||
width: 10%;
|
||||
}
|
||||
.hidden-part {
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user