颗粒度根据工控机状态更新和前端样式修改更新

This commit is contained in:
zhangjunwen 2024-06-05 10:34:01 +08:00
parent 03461081fb
commit 07b2d6d59a
3 changed files with 240 additions and 48 deletions

View File

@ -266,7 +266,9 @@ public class IpcDataProcess implements Runnable {
// for(int m=0; m<=103; m++){
// logger.info("#######################"+m+":"+results.getValue(m));
// }
// logger.info("#######################"+300+":"+results.getValue(100));
// logger.info("#######################"+301+":"+results.getValue(301));
// logger.info("#######################"+302+":"+results.getValue(302));
// logger.info("#######################0:"+results.getValue(0));
// logger.info("#######################1:"+results.getValue(1));
@ -367,11 +369,18 @@ public class IpcDataProcess implements Runnable {
// 系统温度
fields.put("sys_temp", results.getValue(25));
// 油液颗粒度
fields.put("gran4", results.getValue(6));
fields.put("gran6", results.getValue(7));
fields.put("gran14", results.getValue(8));
fields.put("gran21", results.getValue(9));
// 油水检测
int ipcStatus = (int)results.getValue(101);
if(ipcStatus == 30 || ipcStatus == 40 || ipcStatus == 60) {
fields.put("gran4", results.getValue(6));
fields.put("gran6", results.getValue(7));
fields.put("gran14", results.getValue(8));
fields.put("gran21", results.getValue(9));
}else{
fields.put("gran4", 0.0);
fields.put("gran6", 0.0);
fields.put("gran14", 0.0);
fields.put("gran21", 0.0);
} // 油水检测
fields.put("oil_water", results.getValue(10));
// 油品粘度
fields.put("visc", results.getValue(11));
@ -420,7 +429,7 @@ public class IpcDataProcess implements Runnable {
fields.put("driven_bottom_dis", results.getValue(27));
//工控机参数
fields.put("ipc_status", results.getValue(300));
fields.put("ipc_status", results.getValue(101));
//报警处理
List<IpcAlarmRules> rulesList = alarmRulesService.selectIpcAlarmRulesConfigListByCache(equipId);
alarmRecordList.addAll(ipcUtil.dealRealTimeData(fields, tags, Constant.RUNNING, rulesList));//TODO 根据运行状态确定规则
@ -462,11 +471,20 @@ public class IpcDataProcess implements Runnable {
// 系统温度
fields.put("sys_temp", results.getValue(41));
// 油液颗粒度
fields.put("gran4", results.getValue(28));
fields.put("gran6", results.getValue(29));
fields.put("gran14", results.getValue(30));
fields.put("gran21", results.getValue(31));
int ipcStatus = (int)results.getValue(102);
if(ipcStatus == 30 || ipcStatus == 40 || ipcStatus == 60) {
// 油液颗粒度
fields.put("gran4", results.getValue(28));
fields.put("gran6", results.getValue(29));
fields.put("gran14", results.getValue(30));
fields.put("gran21", results.getValue(31));
}else{
fields.put("gran4", 0.0);
fields.put("gran6", 0.0);
fields.put("gran14", 0.0);
fields.put("gran21", 0.0);
}
//产线车速
fields.put("line_speed", results.getValue(39));
// 油水检测
@ -522,7 +540,7 @@ public class IpcDataProcess implements Runnable {
fields.put("flw11", results.getValue(53));
//工控机参数
fields.put("ipc_status", results.getValue(301));
fields.put("ipc_status", results.getValue(102));
//报警处理
List<IpcAlarmRules> rulesList = alarmRulesService.selectIpcAlarmRulesConfigListByCache(equipId);
alarmRecordList.addAll(ipcUtil.dealRealTimeData(fields, tags, Constant.RUNNING, rulesList));//TODO 根据运行状态确定规则
@ -563,11 +581,20 @@ public class IpcDataProcess implements Runnable {
// 系统温度
fields.put("sys_temp", results.getValue(77));
// 油液颗粒度
fields.put("gran4", results.getValue(65));
fields.put("gran6", results.getValue(66));
fields.put("gran14", results.getValue(67));
fields.put("gran21", results.getValue(68));
int ipcStatus = (int)results.getValue(102);
if(ipcStatus == 30 || ipcStatus == 40 || ipcStatus == 60){
// 油液颗粒度
fields.put("gran4", results.getValue(65));
fields.put("gran6", results.getValue(66));
fields.put("gran14", results.getValue(67));
fields.put("gran21", results.getValue(68));
}else {
fields.put("gran4", 0.0);
fields.put("gran6", 0.0);
fields.put("gran14", 0.0);
fields.put("gran21", 0.0);
}
//产线车速
fields.put("line_speed", results.getValue(39));
// 油水检测
@ -622,7 +649,7 @@ public class IpcDataProcess implements Runnable {
// 十一压区流量
fields.put("flw11", results.getValue(89));
//工控机参数
fields.put("ipc_status", results.getValue(302));
fields.put("ipc_status", results.getValue(103));
//报警处理
List<IpcAlarmRules> rulesList = alarmRulesService.selectIpcAlarmRulesConfigListByCache(equipId);
alarmRecordList.addAll(ipcUtil.dealRealTimeData(fields, tags, Constant.RUNNING, rulesList));//TODO 根据运行状态确定规则

View File

@ -39,6 +39,7 @@ public class DataQueryService implements IDataQueryService {
@Override
public Map<String, Object> queryBottomCylScreenData(){
List<Map<String, Object>> list = selectAllDataByEquId("zfipc_industrial_monitor_data1", "e2ae4710b516419c84d1d4a819429348", null, null, 60, 1);
List<Map<String, Object>> flwList = selectFlwDataByEquId("zfipc_industrial_monitor_data1", "e2ae4710b516419c84d1d4a819429348", 18000, 1);//5小时
if (list.size() == 0){
return null;
}
@ -111,16 +112,16 @@ public class DataQueryService implements IDataQueryService {
List<Object> drivenbottomdis = new ArrayList<>();//传动侧底缸位移
List<String> timelist = new ArrayList<>();
List<String> flwTimeList = new ArrayList<>();
for (int i = list.size() - 1; i >= 0; i--) {
Map<String, Object> data = list.get(i);
syscur.add(data.get("sys_cur") == null ? 0.0 : data.get("sys_cur"));
oprsoftflw.add(data.get("opr_soft_flw") == null ? 0.0 : data.get("opr_soft_flw"));
oprhotflw.add(data.get("opr_hot_flw") == null ? 0.0 : data.get("opr_hot_flw"));
drivensoftflw.add(data.get("driven_soft_flw") == null ? 0.0 : data.get("driven_soft_flw"));
drivenhotflw.add(data.get("driven_hot_flw") == null ? 0.0 : data.get("driven_hot_flw"));
// oprsoftflw.add(data.get("opr_soft_flw") == null ? 0.0 : data.get("opr_soft_flw"));
// oprhotflw.add(data.get("opr_hot_flw") == null ? 0.0 : data.get("opr_hot_flw"));
// drivensoftflw.add(data.get("driven_soft_flw") == null ? 0.0 : data.get("driven_soft_flw"));
// drivenhotflw.add(data.get("driven_hot_flw") == null ? 0.0 : data.get("driven_hot_flw"));
oprbottompress.add(data.get("opr_bottom_press") == null ? 0.0 : data.get("opr_bottom_press"));
drivenbottompress.add(data.get("driven_bottom_press") == null ? 0.0 : data.get("driven_bottom_press"));
@ -148,6 +149,17 @@ public class DataQueryService implements IDataQueryService {
timelist.add( time.getMinute() < 10 ? "0" + time.getMinute() : time.getMinute() + ":" + (time.getSecond() < 10 ? "0" + time.getSecond() : time.getSecond()));
}
for (int j = flwList.size() - 1; j >= 0; j--) {
Map<String, Object> data = flwList.get(j);
oprsoftflw.add(data.get("opr_soft_flw") == null ? 0.0 : data.get("opr_soft_flw"));
oprhotflw.add(data.get("opr_hot_flw") == null ? 0.0 : data.get("opr_hot_flw"));
drivensoftflw.add(data.get("driven_soft_flw") == null ? 0.0 : data.get("driven_soft_flw"));
drivenhotflw.add(data.get("driven_hot_flw") == null ? 0.0 : data.get("driven_hot_flw"));
LocalDateTime time = InfluxdbTimeUtil.utcToCst(data.get("time").toString());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
flwTimeList.add( time.format(formatter));
}
resMap.put("syscur",syscur);
resMap.put("oprsoftflw",oprsoftflw);
@ -178,7 +190,7 @@ public class DataQueryService implements IDataQueryService {
resMap.put("drivenbottomdis",drivenbottomdis);
resMap.put("timelist",timelist);
resMap.put("flwTimeList",flwTimeList);
return resMap;
}
@ -235,13 +247,15 @@ public class DataQueryService implements IDataQueryService {
List<Object> columnList = new ArrayList<>();
List<String> timelist = new ArrayList<>();
List<Integer> statusList = new ArrayList<>();
List<Double> statusList = new ArrayList<>();
if(intervalHours > 6){
columnName = "mean";
}
for (Map<String, Object> data : list) {
//取两位小数
columnList.add(data.get(columnName) == null ? 0.0 : Math.round(Double.parseDouble(data.get(columnName).toString()) * 100) / 100.0);
columnList.add(data.get(columnName));
statusList.add((Integer) data.get("ipc_status"));
statusList.add((Double)data.get("ipc_status"));
LocalDateTime time = InfluxdbTimeUtil.utcToCst(data.get("time").toString());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
timelist.add(time.format(formatter));
@ -385,6 +399,15 @@ public class DataQueryService implements IDataQueryService {
return influxDBUtils.queryResultProcess(influxDBUtils.query(sql));
}
/**
* 查询流量数据
*/
private List<Map<String, Object>> selectFlwDataByEquId(String tableName, String equipId, int pageSize, int pageNum){
String sql = "select opr_soft_flw,opr_hot_flw,driven_soft_flw,driven_hot_flw from " + tableName + " where equ_id = '" + equipId + "'";
sql += " order by time desc limit " + pageSize + " offset " +(pageNum - 1)*pageSize;
return influxDBUtils.queryResultProcess(influxDBUtils.query(sql));
}
/**
* 根据字段名称和起止时间查询数据
* @param tableName 表名

View File

@ -534,7 +534,20 @@
<span class="numCol">{{ cylyykld21 }}</span>
</el-col>
</el-row>
<el-row>
<div
v-if="this.cylipcstatus == 30"
style="text-align:center;margin-left:50px;margin-top:10px"
>吸油油品监测</div>
<div
v-if="this.cylipcstatus == 40"
style="text-align:center;margin-left:50px;margin-top:10px"
>回油油品监测</div>
<div
v-if="this.cylipcstatus == 60"
style="text-align:center;margin-left:50px;margin-top:10px"
>底层油品监测</div>
</el-row>
<el-row style="height: 50%">
<el-col
:span="24"
@ -1384,7 +1397,20 @@
<span class="numCol">{{ yykld21 }}</span>
</el-col>
</el-row>
<el-row>
<div
v-if="this.ipcstatus == 30"
style="text-align:center;margin-left:50px;margin-top:10px"
>吸油油品监测</div>
<div
v-if="this.ipcstatus == 40"
style="text-align:center;margin-left:50px;margin-top:10px"
>回油油品监测</div>
<div
v-if="this.ipcstatus == 60"
style="text-align:center;margin-left:50px;margin-top:10px"
>底层油品监测</div>
</el-row>
<el-row style="height: 50%">
<el-col
:span="24"
@ -2236,7 +2262,20 @@
<span class="numCol">{{ bsyykld21 }}</span>
</el-col>
</el-row>
<el-row>
<div
v-if="this.bsipcstatus == 30"
style="text-align:center;margin-left:50px;margin-top:10px"
>吸油油品监测</div>
<div
v-if="this.bsipcstatus == 40"
style="text-align:center;margin-left:50px;margin-top:10px"
>回油油品监测</div>
<div
v-if="this.bsipcstatus == 60"
style="text-align:center;margin-left:50px;margin-top:10px"
>底层油品监测</div>
</el-row>
<el-row style="height: 50%">
<el-col
:span="24"
@ -2626,6 +2665,7 @@ export default {
yykld6: 0,
yykld14: 0,
yykld21: 0,
ipcstatus: null,
// 湿
dlndCharts: null,
xdsdCharts: null,
@ -2654,6 +2694,8 @@ export default {
cyldlndCharts: null,
cyldlndtempCharts: null,
cylxdsdCharts: null,
//
cylipcstatus: null,
//
intervalTask: null,
historyIntervalTask: null,
@ -2711,6 +2753,7 @@ export default {
bsyykldtxCharts: null,
//
XDATA: [],
xFlwData: [],
showdata: null,
// echarts
bsxtyl: 0,
@ -2733,6 +2776,7 @@ export default {
bsyykld14: 0,
bsyykld21: 0,
bszdjdl: 0,
bsipcstatus: null,
// 湿
bsdlndCharts: null,
bsdlndtempCharts: null,
@ -2924,7 +2968,9 @@ export default {
response.data.x,
response.data.y,
this.name,
this.unit
this.unit,
response.data.status,
queryObj
);
}
});
@ -2938,7 +2984,9 @@ export default {
response.data.x,
response.data.y,
this.name,
this.unit
this.unit,
response.data.status,
queryObj
);
}
});
@ -2953,13 +3001,15 @@ export default {
response.data.x,
response.data.y,
this.name,
this.unit
this.unit,
response.data.status,
queryObj
);
}
});
}
},
initchart(xData, yData, name, unit) {
initchart(xData, yData, name, unit, status, queryObj) {
let p = new Promise((resolve) => {
resolve();
});
@ -3105,6 +3155,95 @@ export default {
},
],
};
//
if (
queryObj.columnName === "gran4" ||
queryObj.columnName === "gran6" ||
queryObj.columnName === "gran14" ||
queryObj.columnName === "gran21"
) {
var pres = null;
var aredata = [];
var markData = [];
if (status != null) {
for (let i = 0; i < status.length; i++) {
if (status[i] != pres) {
//
if (markData.length == 1) {
//
markData.push({
//
xAxis: xData[i],
});
aredata.push(markData);
markData = [];
// //
// if (status[i] == 10) {
// markData.push({
// xAxis: xData[i],
// name: "",
// itemStyle: {
// color: "red",
// },
// });
// } else if (status[i] == 20) {
// markData.push({
// xAxis: xData[i],
// name: "",
// itemStyle: {
// color: "blue",
// },
// });
// } else if (status[i] == 50) {
// markData.push({
// xAxis: xData[i],
// name: "",
// itemStyle: {
// color: "yellow",
// },
// });
// }
}
//
if (status[i] == 30) {
markData.push({
xAxis: xData[i],
name: "吸油油品监测",
itemStyle: {
color: "rgba(255, 100, 100, 0.3)",
},
});
} else if (status[i] == 40) {
markData.push({
xAxis: xData[i],
name: "回油油品监测",
itemStyle: {
color: "rgba(100, 200, 100, 0.3)",
},
});
} else if (status[i] == 60) {
markData.push({
xAxis: xData[i],
name: "底层油品监测",
itemStyle: {
color: "rgba(100, 100, 255, 0.3)",
},
});
}
}
if (markData.length == 1 && i == status.length - 1) {
markData.push({
xAxis: xData[i],
});
aredata.push(markData);
markData = [];
}
pres = status[i];
}
option.series[0].markArea = { data: aredata };
}
}
this.chart.setOption(option);
this.chartLoading = false;
});
@ -3321,6 +3460,7 @@ export default {
this.bsyykld6 = parseFloat(data.sysgran6).toFixed(2);
this.bsyykld14 = parseFloat(data.sysgran14).toFixed(2);
this.bsyykld21 = parseFloat(data.sysgran21).toFixed(2);
this.bsipcstatus = data.ipcstatus | 0;
this.bssjylData = [
parseFloat(data.prs1.slice(-1)[0]).toFixed(2),
parseFloat(data.prs2.slice(-1)[0]).toFixed(2),
@ -3367,6 +3507,7 @@ export default {
this.bsyykld6 = parseFloat(data.sysgran6).toFixed(2);
this.bsyykld14 = parseFloat(data.sysgran14).toFixed(2);
this.bsyykld21 = parseFloat(data.sysgran21).toFixed(2);
this.bsipcstatus = data.ipcstatus | 0;
this.bssjylData = [
parseFloat(data.prs1.slice(-1)[0]).toFixed(2),
parseFloat(data.prs2.slice(-1)[0]).toFixed(2),
@ -3902,7 +4043,6 @@ export default {
this.generateOptions2({
title: {
left: "center",
text: "油液颗粒度特性",
textStyle: {
//
color: "#ffffff",
@ -3917,7 +4057,7 @@ export default {
name: "PM",
min: 0,
max: 26,
interval: 0.2, //
interval: 0, //
},
series: [
{
@ -4133,6 +4273,7 @@ export default {
this.yykld6 = parseFloat(data.sysgran6).toFixed(2);
this.yykld14 = parseFloat(data.sysgran14).toFixed(2);
this.yykld21 = parseFloat(data.sysgran21).toFixed(2);
this.ipcstatus = data.ipcstatus | 0;
this.sjylData = [
parseFloat(data.prs1.slice(-1)[0]).toFixed(2),
parseFloat(data.prs2.slice(-1)[0]).toFixed(2),
@ -4179,6 +4320,7 @@ export default {
this.yykld6 = parseFloat(data.sysgran6).toFixed(2);
this.yykld14 = parseFloat(data.sysgran14).toFixed(2);
this.yykld21 = parseFloat(data.sysgran21).toFixed(2);
this.ipcstatus = data.ipcstatus | 0;
this.sjylData = [
parseFloat(data.prs1.slice(-1)[0]).toFixed(2),
parseFloat(data.prs2.slice(-1)[0]).toFixed(2),
@ -4261,7 +4403,7 @@ export default {
dlndtempOption.series[0].data[0].value = parseFloat(
this.showdata.visctemp
).toFixed(2);
this.dlndCharts.setOption(dlndtempOption);
this.dlndtempCharts.setOption(dlndtempOption);
let xdsdOption = this.xdsdCharts.getOption();
xdsdOption.series[0].data[0].value = parseFloat(
this.showdata.syshumid
@ -4720,7 +4862,6 @@ export default {
this.generateOptions2({
title: {
left: "center",
text: "油液颗粒度特性",
textStyle: {
//
color: "#ffffff",
@ -4735,7 +4876,7 @@ export default {
name: "PM",
min: 0,
max: 26,
interval: 0.2, //
interval: 0, //
},
series: [
{
@ -4817,9 +4958,9 @@ export default {
},
async queryBottomCylDataInit() {
const { data } = await listBottomCylData();
// console.log("", data);
this.showdata = data;
this.XDATA = data.timelist;
this.xFlwData = data.flwTimeList;
this.cylxtyl = parseFloat(data.sysprs).toFixed(2); //
this.cylxtyw = parseFloat(data.systemp).toFixed(2); //
this.cylxtywei = parseFloat(data.syslevel).toFixed(2); //
@ -4834,6 +4975,7 @@ export default {
this.cylyykld6 = parseFloat(data.sysgran6).toFixed(2); //6mm
this.cylyykld14 = parseFloat(data.sysgran14).toFixed(2); //14mm
this.cylyykld21 = parseFloat(data.sysgran21).toFixed(2); //21mm
this.cylipcstatus = data.ipcstatus | 0; //
// //
this.tsrgsjyl = parseFloat(data.oprsoftrealpress.slice(-1)[0]).toFixed(2); //
this.tsregsjyl = parseFloat(data.oprhotrealpress.slice(-1)[0]).toFixed(2); //
@ -4880,9 +5022,9 @@ export default {
},
async queryBottomCylData() {
const { data } = await listBottomCylData();
// console.log("", data);
this.showdata = data;
this.XDATA = data.timelist;
this.xFlwData = data.flwTimeList;
this.cylxtyl = parseFloat(data.sysprs).toFixed(2); //
this.cylxtyw = parseFloat(data.systemp).toFixed(2); //
this.cylxtywei = parseFloat(data.syslevel).toFixed(2); //
@ -4897,6 +5039,7 @@ export default {
this.cylyykld6 = parseFloat(data.sysgran6).toFixed(2); //6mm
this.cylyykld14 = parseFloat(data.sysgran14).toFixed(2); //14mm
this.cylyykld21 = parseFloat(data.sysgran21).toFixed(2); //21mm
// this.cylipcstatus = data.ipcstatus | 0; //
// //
this.tsrgsjyl = parseFloat(data.oprsoftrealpress.slice(-1)[0]).toFixed(2); //
this.tsregsjyl = parseFloat(data.oprhotrealpress.slice(-1)[0]).toFixed(2); //
@ -5009,7 +5152,7 @@ export default {
this.cdcjyylqxCharts.setOption(cdcjyylqxOption);
let cdcllbhqxOption = this.cdcllbhqxCharts.getOption();
cdcllbhqxOption.xAxis[0].data = this.XDATA;
cdcllbhqxOption.xAxis[0].data = this.xFlwData;
cdcllbhqxOption.series[0].data = this.showdata.oprsoftflw;
cdcllbhqxOption.series[1].data = this.showdata.oprhotflw;
this.cdcllbhqxCharts.setOption(cdcllbhqxOption);
@ -5033,7 +5176,7 @@ export default {
this.czcjyylqxCharts.setOption(czcjyylqxOption);
let czcllbhqxOption = this.czcllbhqxCharts.getOption();
czcllbhqxOption.xAxis[0].data = this.XDATA;
czcllbhqxOption.xAxis[0].data = this.xFlwData;
czcllbhqxOption.series[0].data = this.showdata.drivensoftflw;
czcllbhqxOption.series[1].data = this.showdata.drivenhotflw;
this.czcllbhqxCharts.setOption(czcllbhqxOption);
@ -5309,7 +5452,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "Q(L/min)", min: 0, max: 200 },
yAxis: { name: "Q(L/min)" },
series: [
{
name: "软辊",
@ -5431,7 +5574,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "Q(L/min)", min: 0, max: 200 },
yAxis: { name: "Q(L/min)" },
series: [
{
name: "软辊",
@ -5688,7 +5831,6 @@ export default {
this.generateOptions2({
title: {
left: "center",
text: "油液颗粒度特性",
textStyle: {
//
color: "#ffffff",
@ -5703,7 +5845,7 @@ export default {
name: "PM",
min: 0,
max: 26,
interval: 0.2, //
interval: 0, //
},
series: [
{
@ -6596,7 +6738,7 @@ export default {
}
.font-size-12 {
font-size: 12px;
color: #ccc;
color: rgb(204, 204, 204);
font-weight: lighter;
}
</style>