大屏首页更新

This commit is contained in:
zhangjunwen 2024-04-17 18:32:05 +08:00
parent 8023ed1000
commit 13fe176a92
8 changed files with 31 additions and 26 deletions

View File

@ -45,9 +45,9 @@ public class IpcSysStatusController extends BaseController
* 系统信息
*/
@GetMapping("/getSysStatus")
public AjaxResult getSysStatus(@RequestParam("equipName")String equipName)
public AjaxResult getSysStatus()
{
return AjaxResult.success(ipcSysStatusService.selectLatestIpcSysStatusByEquipName(equipName));
return AjaxResult.success(ipcSysStatusService.selectLatestIpcSysStatus());
}
/**

View File

@ -314,7 +314,7 @@ public class IpcDataProcess implements Runnable {
ipcRunningStatusRecordService.insertIpcRunningStatusRecord(ipcRunningStatusRecord);
//修改系统状态时间
IIpcSysStatusService ipcSysStatusService = SpringUtils.getBean(IIpcSysStatusService.class);
IpcSysStatus sysStatus = ipcSysStatusService.selectIpcSysStatusList(null).get(0);
IpcSysStatus sysStatus = ipcSysStatusService.selectLatestIpcSysStatus();
//0:停机维护1运行2待机3试运行
switch(status) {
case "0" :

View File

@ -7,6 +7,10 @@ package com.inspur.industrial.domain;
*/
public class MonitorInfo {
/**
* 设备id
*/
String equipId;
/**
* 设备名
*/
@ -32,6 +36,14 @@ public class MonitorInfo {
*/
String onlineTime;
public String getEquipId() {
return equipId;
}
public void setEquipId(String equipId) {
this.equipId = equipId;
}
public String getEquipName() {
return equipName;
}

View File

@ -32,7 +32,7 @@ public interface IpcSysStatusMapper
* @param equipId 设备id
* @return 最新一条状态信息
*/
public IpcSysStatus selectLatestIpcSysStatusByEquipId(String equipId);
public IpcSysStatus selectLatestIpcSysStatus();
/**
* 新增系统状态

View File

@ -33,7 +33,7 @@ public interface IIpcSysStatusService
* @param equipName 设备名
* @return 最新一条状态信息
*/
public IpcSysStatus selectLatestIpcSysStatusByEquipName(String equipName);
public IpcSysStatus selectLatestIpcSysStatus();
/**
* 根据设备名查询监控信息

View File

@ -60,16 +60,8 @@ public class IpcSysStatusServiceImpl implements IIpcSysStatusService
* @param equipId 设备id
* @return 最新一条状态信息
*/
public IpcSysStatus selectLatestIpcSysStatusByEquipName(String equipName){
IpcEquipInfo queryEquipInfo = new IpcEquipInfo();
queryEquipInfo.setEquipName(equipName);
List<IpcEquipInfo> equipInfoList = ipcEquipInfoService.selectIpcEquipInfoList(queryEquipInfo);
if (equipInfoList.size() == 0){
return null;
}
String equipId = equipInfoList.get(0).getId();
return ipcSysStatusMapper.selectLatestIpcSysStatusByEquipId(equipId);
public IpcSysStatus selectLatestIpcSysStatus(){
return ipcSysStatusMapper.selectLatestIpcSysStatus();
}
/**
@ -83,12 +75,13 @@ public class IpcSysStatusServiceImpl implements IIpcSysStatusService
if (equipInfo == null){
return null;
}
monitorInfo.setEquipId(equipInfo.getId());
monitorInfo.setEquipName(equipInfo.getEquipName());
monitorInfo.setEquipNum(equipInfo.getEquipNum());
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
monitorInfo.setNowTime(now.format(formatter));
IpcSysStatus sysStatus = selectLatestIpcSysStatusByEquipName(equipName);
IpcSysStatus sysStatus = selectLatestIpcSysStatus();
monitorInfo.setStartTime(sysStatus == null ? null : sysStatus.getTrialTime().format(formatter));
//运行时间
if(sysStatus != null && sysStatus.getTrialTime() != null) {

View File

@ -29,10 +29,10 @@
</where>
</select>
<!-- 根据设备查询最新一条系统状态 selectLatestIpcSysStatusByEquipId-->
<select id="selectLatestIpcSysStatusByEquipId" parameterType="String" resultMap="IpcSysStatusResult">
<!-- 查询最新一条系统状态 selectLatestIpcSysStatus-->
<select id="selectLatestIpcSysStatus" parameterType="String" resultMap="IpcSysStatusResult">
<include refid="selectIpcSysStatusVo"/>
where equip_id = #{equipId} order by id desc limit 1
order by id desc limit 1
</select>
<select id="selectIpcSysStatusById" parameterType="Long" resultMap="IpcSysStatusResult">

View File

@ -2536,7 +2536,7 @@ import {
getBottomScollerDataByDate,
} from "@/api/data/query.js";
import {
getStatusByEquipName,
getSysStatus,
getMonitorInfoByEquipName,
} from "@/api/industrial/sysStatus.js";
import { listAllRecord } from "@/api/industrial/record";
@ -2758,7 +2758,7 @@ export default {
let query = {
equipName: "超压底缸",
};
this.getSysStatusData(query);
this.getSysStatusData();
this.getMonitorData(query);
this.queryBottomCylDataInit();
this.intervalTask = setInterval(() => {
@ -2778,7 +2778,7 @@ export default {
let query = {
equipName: "超压底缸",
};
this.getSysStatusData(query);
this.getSysStatusData();
this.getMonitorData(query);
this.queryBottomCylDataInit();
this.intervalTask = setInterval(() => {
@ -2789,7 +2789,7 @@ export default {
let query = {
equipName: "可控中高辊顶辊",
};
this.getSysStatusData(query);
this.getSysStatusData();
this.getMonitorData(query);
this.queryTopScollerDataInit();
this.intervalTask = setInterval(() => {
@ -2800,7 +2800,7 @@ export default {
let query = {
equipName: "可控中高辊底辊",
};
this.getSysStatusData(query);
this.getSysStatusData();
this.getMonitorData(query);
this.queryBottomScollerDataInit();
this.intervalTask = setInterval(() => {
@ -2810,14 +2810,14 @@ export default {
}
},
getSysStatusData(query) {
getStatusByEquipName(query).then((response) => {
getSysStatus(query).then((response) => {
this.sysStatus = response.data;
this.queryAlarmRecordData(this.sysStatus.equipId);
});
},
getMonitorData(query) {
getMonitorInfoByEquipName(query).then((response) => {
this.monitorInfo = response.data;
this.queryAlarmRecordData(this.monitorInfo.equipId);
});
},
getDefaultTimeRange() {