1、地图显示离线和24小时离线和无效解的位置

This commit is contained in:
weidong 2025-11-12 09:07:25 +08:00
parent b7453a9331
commit 8ca33f908a
7 changed files with 120 additions and 81 deletions

View File

@ -145,6 +145,11 @@ public class GnssDeviceController extends BasicController{
if (StringUtils.hasText(deviceid)) { if (StringUtils.hasText(deviceid)) {
queryWrapper.like("deviceid", deviceid); queryWrapper.like("deviceid", deviceid);
} }
//型号
Integer model = search.getInteger("model");
if (model!=null) {
queryWrapper.eq("model", model);
}
//父设备号 //父设备号
String parentid = search.getString("parentid"); String parentid = search.getString("parentid");
if (StringUtils.hasText(parentid)) { if (StringUtils.hasText(parentid)) {
@ -155,6 +160,11 @@ public class GnssDeviceController extends BasicController{
if (StringUtils.hasText(project_id)) { if (StringUtils.hasText(project_id)) {
queryWrapper.like("project_id", project_id); queryWrapper.like("project_id", project_id);
} }
//桩号
String sector = search.getString("sector");
if (StringUtils.hasText(sector)) {
queryWrapper.like("sector", sector);
}
//所属组织 //所属组织
String tenantname = search.getString("tenantname"); String tenantname = search.getString("tenantname");
if (StringUtils.hasText(tenantname)) { if (StringUtils.hasText(tenantname)) {

View File

@ -87,15 +87,17 @@ public class IndexController extends BasicController{
if(status.getUpdatetime()!=null && if(status.getUpdatetime()!=null &&
status.getUpdatetime().isAfter(now.minusHours(24))){ status.getUpdatetime().isAfter(now.minusHours(24))){
deviceOfflineNumIn24h++; deviceOfflineNumIn24h++;
status.setWarning((short) 3);
}
else {
status.setWarning((short) 2);
} }
} }
else if((status.getWarningcode()&WarningCfg.TYPE_CONT_INVALID_RESULT) != 0) { else if((status.getWarningcode()&WarningCfg.TYPE_CONT_INVALID_RESULT) != 0) {
noFix++; noFix++;
status.setWarning((short) 4);
} }
if(status.getWarning() == WarningCfg.LEVEL_1) warning1Num++;
else if(status.getWarning() == WarningCfg.LEVEL_2) warning2Num++;
// 剔除无经纬度的对象不在地图上显示 // 剔除无经纬度的对象不在地图上显示
if(status.getLatitude()==null || status.getLongitude()==null){ if(status.getLatitude()==null || status.getLongitude()==null){
noGGA++; noGGA++;

View File

@ -1,9 +1,9 @@
var DeviceMarkers = (function() { var DeviceMarkers = (function() {
'use strict'; 'use strict';
var greenFeatures = []; var invalidDataFeatures = [];
var orangeFeatures = []; var offlineIn24hFeatures = [];
var redFeatures = []; var offlineFeatures = [];
var allFeatures = []; var allFeatures = [];
var myLocationFeature = null; var myLocationFeature = null;
var myLocationInterval = null; var myLocationInterval = null;
@ -43,9 +43,9 @@ var DeviceMarkers = (function() {
var scale = isHovered ? 0.85 : 0.7; var scale = isHovered ? 0.85 : 0.7;
// 根据告警级别选择图标 // 根据告警级别选择图标
if (deviceInfo.warning == 2) { if (deviceInfo.warning == 2||deviceInfo.warning == 3) {
iconSrc = '../images/loc1_red.png'; iconSrc = '../images/loc1_red.png';
} else if (deviceInfo.warning == 1) { } else if (deviceInfo.warning == 4) {
iconSrc = '../images/loc1_orange.png'; iconSrc = '../images/loc1_orange.png';
} else { } else {
iconSrc = '../images/loc1_green.png'; iconSrc = '../images/loc1_green.png';
@ -85,9 +85,9 @@ var DeviceMarkers = (function() {
var savedMyLocationFeature = myLocationFeature; var savedMyLocationFeature = myLocationFeature;
vectorSource.clear(); vectorSource.clear();
greenFeatures = []; invalidDataFeatures = [];
orangeFeatures = []; offlineIn24hFeatures = [];
redFeatures = []; offlineFeatures = [];
allFeatures = []; allFeatures = [];
for (var i = 0; i < deviceList.length; i++) { for (var i = 0; i < deviceList.length; i++) {
@ -106,11 +106,12 @@ var DeviceMarkers = (function() {
// 按告警级别分类 // 按告警级别分类
if (device.warning == 2) { if (device.warning == 2) {
redFeatures.push(feature); offlineFeatures.push(feature);
} else if (device.warning == 1) { } else if (device.warning == 3) {
orangeFeatures.push(feature); offlineFeatures.push(feature);
} else { offlineIn24hFeatures.push(feature);
greenFeatures.push(feature); } else if (device.warning == 4) {
invalidDataFeatures.push(feature);
} }
allFeatures.push(feature); allFeatures.push(feature);
@ -149,9 +150,10 @@ var DeviceMarkers = (function() {
} }
} }
function showWarning1Devices() { function showWarning4Devices() {
console.log("showWarning4Devices");
if (!vectorSource) return; if (!vectorSource) return;
console.log("showWarning4Devices:",invalidDataFeatures.length);
var savedMyLocationFeature = myLocationFeature; var savedMyLocationFeature = myLocationFeature;
vectorSource.clear(); vectorSource.clear();
@ -159,18 +161,18 @@ var DeviceMarkers = (function() {
vectorSource.addFeature(savedMyLocationFeature); vectorSource.addFeature(savedMyLocationFeature);
} }
for (var i = 0; i < allFeatures.length; i++) { for (var i = 0; i < invalidDataFeatures.length; i++) {
vectorSource.addFeature(allFeatures[i]); vectorSource.addFeature(invalidDataFeatures[i]);
} }
hideGreenFeatures(); //hideofflineIn24hFeatures();
hideRedFeatures(); //hideofflineFeatures();
} }
function showWarning2Devices() { function showWarning2Devices() {
if (!vectorSource) return; if (!vectorSource) return;
console.log("showWarning2Devices:",offlineFeatures.length);
var savedMyLocationFeature = myLocationFeature; var savedMyLocationFeature = myLocationFeature;
vectorSource.clear(); vectorSource.clear();
@ -178,30 +180,31 @@ var DeviceMarkers = (function() {
vectorSource.addFeature(savedMyLocationFeature); vectorSource.addFeature(savedMyLocationFeature);
} }
for (var i = 0; i < allFeatures.length; i++) { for (var i = 0; i < offlineFeatures.length; i++) {
vectorSource.addFeature(allFeatures[i]); vectorSource.addFeature(offlineFeatures[i]);
} }
hideGreenFeatures(); //hideinvalidDataFeatures();
hideOrangeFeatures(); //hideofflineIn24hFeatures();
} }
function hideGreenFeatures() { function showWarning3Devices() {
for (var i = 0; i < greenFeatures.length; i++) { console.log("showWarning3Devices");
vectorSource.removeFeature(greenFeatures[i]); if (!vectorSource) return;
} console.log("showWarning3Devices:",offlineIn24hFeatures.length);
var savedMyLocationFeature = myLocationFeature;
vectorSource.clear();
if (savedMyLocationFeature) {
vectorSource.addFeature(savedMyLocationFeature);
} }
function hideOrangeFeatures() { for (var i = 0; i < offlineIn24hFeatures.length; i++) {
for (var i = 0; i < orangeFeatures.length; i++) { vectorSource.addFeature(offlineIn24hFeatures[i]);
vectorSource.removeFeature(orangeFeatures[i]);
}
} }
function hideRedFeatures() { //hideinvalidDataFeatures();
for (var i = 0; i < redFeatures.length; i++) { //hideofflineFeatures();
vectorSource.removeFeature(redFeatures[i]);
}
} }
function findDeviceById(deviceId) { function findDeviceById(deviceId) {
@ -375,9 +378,9 @@ var DeviceMarkers = (function() {
function getDeviceStats() { function getDeviceStats() {
return { return {
total: allFeatures.length, total: allFeatures.length,
green: greenFeatures.length, green: invalidDataFeatures.length,
orange: orangeFeatures.length, orange: offlineIn24hFeatures.length,
red: redFeatures.length red: offlineFeatures.length
}; };
} }
@ -386,11 +389,9 @@ var DeviceMarkers = (function() {
createDeviceStyle: createDeviceStyle, createDeviceStyle: createDeviceStyle,
addDeviceMarkers: addDeviceMarkers, addDeviceMarkers: addDeviceMarkers,
showAllDevices: showAllDevices, showAllDevices: showAllDevices,
showWarning1Devices: showWarning1Devices,
showWarning2Devices: showWarning2Devices, showWarning2Devices: showWarning2Devices,
hideGreenFeatures: hideGreenFeatures, showWarning3Devices: showWarning3Devices,
hideOrangeFeatures: hideOrangeFeatures, showWarning4Devices: showWarning4Devices,
hideRedFeatures: hideRedFeatures,
findDeviceById: findDeviceById, findDeviceById: findDeviceById,
locateDevice: locateDevice, locateDevice: locateDevice,
getMyLocation: getMyLocation, getMyLocation: getMyLocation,
@ -402,9 +403,9 @@ var DeviceMarkers = (function() {
getDeviceStats: getDeviceStats, getDeviceStats: getDeviceStats,
getAllFeatures: function() { return allFeatures; }, getAllFeatures: function() { return allFeatures; },
getGreenFeatures: function() { return greenFeatures; }, getinvalidDataFeatures: function() { return invalidDataFeatures; },
getOrangeFeatures: function() { return orangeFeatures; }, getofflineIn24hFeatures: function() { return offlineIn24hFeatures; },
getRedFeatures: function() { return redFeatures; }, getofflineFeatures: function() { return offlineFeatures; },
getMyLocationFeature: function() { return myLocationFeature; } getMyLocationFeature: function() { return myLocationFeature; }
}; };
})(); })();

View File

@ -292,12 +292,16 @@ var MapCore = (function() {
function onWarningFilterChange() { function onWarningFilterChange() {
var filterValue = document.getElementById('warningFilter').value; var filterValue = document.getElementById('warningFilter').value;
console.log("onWarningFilterChange: ",filterValue);
switch(filterValue) { switch(filterValue) {
case 'all': case 'all':
SearchFilter.showAllDevices(); SearchFilter.showAllDevices();
break; break;
case 'warning1': case 'warning4':
SearchFilter.showWarning1Devices(); SearchFilter.showWarning4Devices();
break;
case 'warning3':
SearchFilter.showWarning3Devices();
break; break;
case 'warning2': case 'warning2':
SearchFilter.showWarning2Devices(); SearchFilter.showWarning2Devices();

View File

@ -187,10 +187,13 @@ var SearchFilter = (function() {
showAllDevices(); showAllDevices();
break; break;
case 2: case 2:
showWarning1Devices(); showWarning2Devices();
break; break;
case 3: case 3:
showWarning2Devices(); showWarning3Devices();
break;
case 4:
showWarning4Devices();
break; break;
} }
} }
@ -203,20 +206,30 @@ var SearchFilter = (function() {
updateFilterSelect('all'); updateFilterSelect('all');
} }
function showWarning1Devices() {
currentSearchedDevice = null;
clearSearchInput();
DeviceMarkers.showWarning1Devices();
markerState = 2;
updateFilterSelect('warning1');
}
function showWarning2Devices() { function showWarning2Devices() {
console.log("SearchFilter.showWarning2Devices");
currentSearchedDevice = null; currentSearchedDevice = null;
clearSearchInput(); clearSearchInput();
DeviceMarkers.showWarning2Devices(); DeviceMarkers.showWarning2Devices();
markerState = 3; markerState = 2;
updateFilterSelect('warning2'); updateFilterSelect('warning2');
} }
function showWarning3Devices() {
console.log("SearchFilter.showWarning3Devices");
currentSearchedDevice = null;
clearSearchInput();
DeviceMarkers.showWarning3Devices();
markerState = 3;
updateFilterSelect('warning3');
}
function showWarning4Devices() {
console.log("SearchFilter.showWarning4Devices");
currentSearchedDevice = null;
clearSearchInput();
DeviceMarkers.showWarning4Devices();
markerState = 4;
updateFilterSelect('warning4');
}
function clearSearchInput() { function clearSearchInput() {
var searchInput = document.getElementById('deviceSearchNew'); var searchInput = document.getElementById('deviceSearchNew');
if (searchInput) { if (searchInput) {
@ -233,13 +246,15 @@ var SearchFilter = (function() {
function filterDevicesByStatus(statusType) { function filterDevicesByStatus(statusType) {
switch(statusType) { switch(statusType) {
case 'warning1':
showWarning1Devices();
break;
case 'warning2': case 'warning2':
showWarning2Devices(); showWarning2Devices();
break; break;
case 'offline': case 'warning3':
showWarning3Devices();
break;
case 'warning4':
showWarning4Devices();
break;
case 'no_fwd': case 'no_fwd':
case 'nofixed': case 'nofixed':
case 'nogga': case 'nogga':
@ -311,8 +326,9 @@ var SearchFilter = (function() {
searchDevice: searchDevice, searchDevice: searchDevice,
clearSearch: clearSearch, clearSearch: clearSearch,
showAllDevices: showAllDevices, showAllDevices: showAllDevices,
showWarning1Devices: showWarning1Devices,
showWarning2Devices: showWarning2Devices, showWarning2Devices: showWarning2Devices,
showWarning3Devices: showWarning3Devices,
showWarning4Devices: showWarning4Devices,
filterDevicesByStatus: filterDevicesByStatus, filterDevicesByStatus: filterDevicesByStatus,
queryDevices: queryDevices, queryDevices: queryDevices,
locateDeviceOnMap: locateDeviceOnMap, locateDeviceOnMap: locateDeviceOnMap,

View File

@ -851,16 +851,6 @@
<span>长期无效解</span> <span>长期无效解</span>
<span class="stat-number" th:text="${noFix}">10</span> <span class="stat-number" th:text="${noFix}">10</span>
</div> </div>
<div class="stat-item" onclick="queryDevices('warning2')" th:if="${warning2Num > 0}">
<span class="stat-dot dot-red"></span>
<span>严重告警</span>
<span class="stat-number" th:text="${warning2Num}">40</span>
</div>
<div class="stat-item" onclick="queryDevices('warning1')" th:if="${warning1Num > 0}">
<span class="stat-dot dot-orange"></span>
<span>一般告警</span>
<span class="stat-number" th:text="${warning1Num}">79</span>
</div>
<div class="stat-item" onclick="queryDevices('nogga')" th:if="${noGGA > 0}"> <div class="stat-item" onclick="queryDevices('nogga')" th:if="${noGGA > 0}">
<span class="stat-dot dot-gray"></span> <span class="stat-dot dot-gray"></span>
<span>无GGA告警</span> <span>无GGA告警</span>
@ -930,8 +920,9 @@
<div class="toolbar-item"> <div class="toolbar-item">
<select id="warningFilter" class="toolbar-select" onchange="onWarningFilterChange()"> <select id="warningFilter" class="toolbar-select" onchange="onWarningFilterChange()">
<option value="all">全部设备</option> <option value="all">全部设备</option>
<option value="warning1">一般告警</option> <option value="warning2">离线</option>
<option value="warning2" selected>严重告警</option> <option value="warning3">24小时内离线</option>
<option value="warning4">长期无效解</option>
</select> </select>
</div> </div>

View File

@ -23,6 +23,15 @@
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="deviceid" autocomplete="off" class="layui-input"> <input type="text" name="deviceid" autocomplete="off" class="layui-input">
</div> </div>
</div>
<div class="layui-inline">
<label class="layui-form-label required">产品型号</label>
<div class="layui-input-inline">
<select name="model" id="model" lay-search="">
<option value="0">G505</option>
<option value="1">G510</option>
</select>
</div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">关联基站号</label> <label class="layui-form-label">关联基站号</label>
@ -36,6 +45,12 @@
<input type="text" name="project_id" autocomplete="off" class="layui-input"> <input type="text" name="project_id" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-inline">
<label class="layui-form-label">桩号</label>
<div class="layui-input-inline">
<input type="text" name="sector" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline" th:if="${tenant_id==0}"> <div class="layui-inline" th:if="${tenant_id==0}">
<label class="layui-form-label">所属部门</label> <label class="layui-form-label">所属部门</label>
<div class="layui-input-inline"> <div class="layui-input-inline">