diff --git a/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IpcDataProcess.java b/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IpcDataProcess.java index 951d10a..62c11fc 100644 --- a/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IpcDataProcess.java +++ b/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IpcDataProcess.java @@ -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 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 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 rulesList = alarmRulesService.selectIpcAlarmRulesConfigListByCache(equipId); alarmRecordList.addAll(ipcUtil.dealRealTimeData(fields, tags, Constant.RUNNING, rulesList));//TODO 根据运行状态确定规则 diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/DataQueryService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/DataQueryService.java index b20697b..3590a7f 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/DataQueryService.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/DataQueryService.java @@ -39,6 +39,7 @@ public class DataQueryService implements IDataQueryService { @Override public Map queryBottomCylScreenData(){ List> list = selectAllDataByEquId("zfipc_industrial_monitor_data1", "e2ae4710b516419c84d1d4a819429348", null, null, 60, 1); + List> 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 drivenbottomdis = new ArrayList<>();//传动侧底缸位移 List timelist = new ArrayList<>(); - + List flwTimeList = new ArrayList<>(); for (int i = list.size() - 1; i >= 0; i--) { Map 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 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 columnList = new ArrayList<>(); List timelist = new ArrayList<>(); - List statusList = new ArrayList<>(); + List statusList = new ArrayList<>(); if(intervalHours > 6){ columnName = "mean"; } for (Map 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> 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 表名 diff --git a/zfipc-ui/src/views/zf/bigscreen/bigscreen.vue b/zfipc-ui/src/views/zf/bigscreen/bigscreen.vue index 9d39959..1b7b9a4 100644 --- a/zfipc-ui/src/views/zf/bigscreen/bigscreen.vue +++ b/zfipc-ui/src/views/zf/bigscreen/bigscreen.vue @@ -534,7 +534,20 @@ {{ cylyykld21 }} - + +
吸油油品监测
+
回油油品监测
+
底层油品监测
+
{{ yykld21 }} - + +
吸油油品监测
+
回油油品监测
+
底层油品监测
+
{{ bsyykld21 }} - + +
吸油油品监测
+
回油油品监测
+
底层油品监测
+
{ 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; }