1、优化告警处理

This commit is contained in:
weidong 2024-02-14 15:02:26 +08:00
parent 2282fdcde3
commit 164e4f3174
4 changed files with 6 additions and 8 deletions

View File

@ -49,9 +49,6 @@ public class GnssStatusJoin {
@ExcelProperty("湿度")
Float humidity;
@ExcelProperty("可见卫星")
Integer satelliteinview;
@ExcelProperty("使用卫星")
Integer satelliteinuse;
// 这里的收发都是服务端统计的终端收发详细统计在msg_trx表里
@ -83,4 +80,6 @@ public class GnssStatusJoin {
@ExcelIgnore
Integer group_id;
@ExcelIgnore
String name;//设备名称
}

View File

@ -18,7 +18,7 @@ public interface GnssStatusMapper extends MPJBaseMapper<GnssStatus> {
@Update({"update gnssstatus set state=0,warning=#{warning},warningcode=#{warningcode} where deviceid=#{deviceid}"})
int setOfflineByDeviceId(GnssStatusJoin status);
@Select({"select s.*, d.devicetype, d.group_id from gnssstatus s ,gnssdevices d where s.deviceid=d.deviceid and s.state <> 0"})
@Select({"select s.*, d.devicetype, d.group_id, d.name from gnssstatus s ,gnssdevices d where s.deviceid=d.deviceid and s.state <> 0"})
List<GnssStatusJoin> queryOnline();
// 需要关联设备类型

View File

@ -75,7 +75,6 @@ public class DeviceStatusVO {
this.rxbytes = gnssStatus.getRxbytes();
this.d3xxbytes = gnssStatus.getD3xxbytes();
this.b562bytes = gnssStatus.getB562bytes();
this.satelliteinview = gnssStatus.getSatelliteinview();
this.satelliteinuse = gnssStatus.getSatelliteinuse();
this.dtuState = gnssStatus.getState();
}

View File

@ -46,7 +46,7 @@ public class DeviceStatusChecker {
GnssDeviceMapper deviceMapper;
static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@Scheduled(cron = "0 18,48 * * * ?") // 每半时执行一次
@Scheduled(cron = "0 18,59 * * * ?") // 每半时执行一次
public void checkDeviceState() throws ExecutionException, InterruptedException {
List<GnssGroup> groupCfgs = groupMapper.selectList(null);
HashMap<Integer,Integer> group_cycle_map=new HashMap<>();
@ -86,7 +86,7 @@ public class DeviceStatusChecker {
warningMsg.setCode(WarningCfg.TYPE_DEVICE_OFF_LINE);
warningMsgMapper.insert(warningMsg);
//短信推送
deviceIds.add(status.getDeviceid());
deviceIds.add(status.getDeviceid()+"("+status.getName()+")");
}
}
if(deviceIds.size()>0){
@ -132,7 +132,7 @@ public class DeviceStatusChecker {
status.setWarningcode(status.getWarningcode() | WarningCfg.TYPE_BS_NO_RESULT);
status.setWarning(WarningCfg.LEVEL_2);
deviceIds.add(bs.getDeviceid());
deviceIds.add(bs.getDeviceid()+"("+bs.getName()+")");
}
gnssStatusMapper.updateById(status);
}