修改内部评审提出问题

This commit is contained in:
zhanghan11 2024-04-15 11:10:57 +08:00
parent 24c9a72084
commit 833f458057
7 changed files with 201 additions and 32 deletions

View File

@ -30,5 +30,14 @@ public class IpcDataShowController extends BaseController {
return AjaxResult.success(iIpcDataShowService.getShowData(parts)); return AjaxResult.success(iIpcDataShowService.getShowData(parts));
} }
/**
* 获取报警数据
*/
@PreAuthorize("@ss.hasPermi('ipc:dataShow:query')")
@GetMapping(value = "/alarmData")
public AjaxResult getAlarmData()
{
return AjaxResult.success(iIpcDataShowService.getAlarmData());
}
} }

View File

@ -109,6 +109,8 @@ public class IpcAlarmRecord extends BaseEntity {
private String[] ids; private String[] ids;
private int pageSize;
public String[] getIds() { public String[] getIds() {
return ids; return ids;
} }
@ -117,6 +119,14 @@ public class IpcAlarmRecord extends BaseEntity {
this.ids = ids; this.ids = ids;
} }
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }

View File

@ -15,4 +15,8 @@ public interface IIpcDataShowService {
*/ */
public Map<String,Object> getShowData(String [] parts); public Map<String,Object> getShowData(String [] parts);
/**
* 报警数据获取
*/
public Map<String,Object> getAlarmData();
} }

View File

@ -1,9 +1,12 @@
package com.inspur.ipc.service.impl; package com.inspur.ipc.service.impl;
import com.inspur.common.constant.CacheConstants;
import com.inspur.ipc.domain.IpcAlarmRecord; import com.inspur.ipc.domain.IpcAlarmRecord;
import com.inspur.ipc.domain.IpcMonitorField;
import com.inspur.ipc.domain.IpcQueryParams; import com.inspur.ipc.domain.IpcQueryParams;
import com.inspur.ipc.service.IIpcAlarmRecordService; import com.inspur.ipc.service.IIpcAlarmRecordService;
import com.inspur.ipc.service.IIpcDataShowService; import com.inspur.ipc.service.IIpcDataShowService;
import com.inspur.ipc.service.IIpcMonitorFieldService;
import com.inspur.ipc.utils.IpcConstant; import com.inspur.ipc.utils.IpcConstant;
import com.inspur.system.service.influx.InfluxDBService; import com.inspur.system.service.influx.InfluxDBService;
import org.influxdb.dto.QueryResult; import org.influxdb.dto.QueryResult;
@ -31,6 +34,8 @@ public class IpcDataShowServiceImpl implements IIpcDataShowService {
private InfluxDBService influxDBService; private InfluxDBService influxDBService;
@Autowired @Autowired
private IIpcAlarmRecordService ipcAlarmRecordService; private IIpcAlarmRecordService ipcAlarmRecordService;
@Autowired
private IIpcMonitorFieldService iIpcMonitorFieldService;
/** /**
* 展示数据获取 * 展示数据获取
@ -116,15 +121,6 @@ public class IpcDataShowServiceImpl implements IIpcDataShowService {
map.put("oip", oip.get(plcIndex)); map.put("oip", oip.get(plcIndex));
map.put("od", od.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)) { if (part.endsWith(IpcConstant.OPERATION_PROFILE)) {
// 操作侧 // 操作侧
@ -234,4 +230,29 @@ public class IpcDataShowServiceImpl implements IIpcDataShowService {
return dateTime; 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;
}
} }

View File

@ -7,3 +7,11 @@ export function getShowData(parts) {
method: "get", method: "get",
}); });
} }
// 根据部位查询报警数据
export function getAlarmData() {
return request({
url: "/ipc/dataShow/alarmData",
method: "get",
});
}

View File

@ -24,19 +24,63 @@
<div @click="() => { <div @click="() => {
curImageIndex = 1 curImageIndex = 1
handleTypeChange(['rtd', 'rto']) 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="() => { <div @click="() => {
curImageIndex = 2 curImageIndex = 2
handleTypeChange(['ftd', 'fto']) 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="() => { <div @click="() => {
curImageIndex = 3 curImageIndex = 3
handleTypeChange(['rbd', 'rbo']) 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="() => { <div @click="() => {
curImageIndex = 4 curImageIndex = 4
handleTypeChange(['fbd', 'fbo']) 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> </div>
<div class="grid-item-wrapper"> <div class="grid-item-wrapper">
@ -162,13 +206,13 @@
> >
<div <div
class="extra-bar-item" class="extra-bar-item"
:style="`height: ${parseInt(l2 * 100)}%;background-color:#19ca88;`" :style="`height: ${parseInt(l2)}%;background-color:#19ca88;`"
></div> ></div>
<div <div
class="extra-bar-text" 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> </div>
<div <div
@ -205,13 +249,13 @@
> >
<div <div
class="extra-bar-item" class="extra-bar-item"
:style="`height: ${parseInt(r1 * 100)}%;background-color:#19ca88;`" :style="`height: ${parseInt(r1)}%;background-color:#19ca88;`"
></div> ></div>
<div <div
class="extra-bar-text" 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> </div>
<div <div
@ -370,6 +414,7 @@ import * as echarts from "echarts";
import { isArray, merge } from "lodash"; import { isArray, merge } from "lodash";
import request from "@/utils/request"; import request from "@/utils/request";
import { getTendencyData } from "@/api/ipc/dataLog"; import { getTendencyData } from "@/api/ipc/dataLog";
import { getAlarmData, getShowData } from "@/api/ipc/dataShow";
export default { export default {
name: "BigScreen", name: "BigScreen",
@ -390,6 +435,7 @@ export default {
rbAlarmStr: "", rbAlarmStr: "",
timer: null, timer: null,
alarmTimer: null,
queryParams: ["rtd", "rto"], queryParams: ["rtd", "rto"],
total: 0, total: 0,
titleMap: { titleMap: {
@ -402,7 +448,13 @@ export default {
fbd: "F下辊传动侧", fbd: "F下辊传动侧",
fbo: "F下辊操作侧", fbo: "F下辊操作侧",
}, },
//
isAlarm: {
rt: false,
rb: false,
ft: false,
fb: false,
},
xSensorData: [], xSensorData: [],
// //
// //
@ -474,10 +526,15 @@ export default {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.initData(this.queryParams); this.initData(this.queryParams);
}, 1000); }, 1000);
this.initAlarmData();
this.alarmTimer = setInterval(() => {
this.initAlarmData();
}, 1000 * 30);
this.handleTypeChange(this.queryParams); this.handleTypeChange(this.queryParams);
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer); clearInterval(this.timer);
clearInterval(this.alarmTimer);
}, },
methods: { methods: {
//** */ //** */
@ -639,8 +696,39 @@ export default {
this.title1 = this.titleMap[params[0]]; this.title1 = this.titleMap[params[0]];
this.title2 = this.titleMap[params[1]]; 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 = []) { initData(params = []) {
this.getDataResponse(params).then(({ data }) => { getShowData(params).then(({ data }) => {
const { drive, operation } = data; const { drive, operation } = data;
// //
if (operation) { if (operation) {
@ -659,9 +747,6 @@ export default {
this.r1 = ssat; this.r1 = ssat;
this.r2 = rot; this.r2 = rot;
this.rtAlarmStr = pzAlarmStr;
this.rbAlarmStr = otherAlarmStr;
} }
// //
if (drive) { if (drive) {
@ -678,8 +763,6 @@ export default {
this.l1 = rot; this.l1 = rot;
this.l2 = ssat; 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) { jumpSensorDataLog(param) {
this.$router.push({ this.$router.push({
@ -1329,6 +1406,7 @@ export default {
text-align: center; text-align: center;
padding-top: 0.4rem; padding-top: 0.4rem;
font-size: 1.3rem; font-size: 1.3rem;
color: red;
background-size: 100% 100%; background-size: 100% 100%;
text-shadow: 2px 2px 2px #fff; text-shadow: 2px 2px 2px #fff;
@include background_bg(bigGridTitleBackgroundImage); @include background_bg(bigGridTitleBackgroundImage);
@ -1443,4 +1521,23 @@ export default {
transform: translateX(-100%); 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> </style>