diff --git a/sec-beidou/src/main/java/com/imdroid/beidou/controller/GnssDeviceController.java b/sec-beidou/src/main/java/com/imdroid/beidou/controller/GnssDeviceController.java index 72d410e5..eb72a590 100644 --- a/sec-beidou/src/main/java/com/imdroid/beidou/controller/GnssDeviceController.java +++ b/sec-beidou/src/main/java/com/imdroid/beidou/controller/GnssDeviceController.java @@ -145,6 +145,11 @@ public class GnssDeviceController extends BasicController{ if (StringUtils.hasText(deviceid)) { queryWrapper.like("deviceid", deviceid); } + //型号 + Integer model = search.getInteger("model"); + if (model!=null) { + queryWrapper.eq("model", model); + } //父设备号 String parentid = search.getString("parentid"); if (StringUtils.hasText(parentid)) { @@ -155,6 +160,11 @@ public class GnssDeviceController extends BasicController{ if (StringUtils.hasText(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"); if (StringUtils.hasText(tenantname)) { diff --git a/sec-beidou/src/main/java/com/imdroid/beidou/controller/IndexController.java b/sec-beidou/src/main/java/com/imdroid/beidou/controller/IndexController.java index 59f69ab0..76be39c8 100644 --- a/sec-beidou/src/main/java/com/imdroid/beidou/controller/IndexController.java +++ b/sec-beidou/src/main/java/com/imdroid/beidou/controller/IndexController.java @@ -87,15 +87,17 @@ public class IndexController extends BasicController{ if(status.getUpdatetime()!=null && status.getUpdatetime().isAfter(now.minusHours(24))){ deviceOfflineNumIn24h++; + status.setWarning((short) 3); + } + else { + status.setWarning((short) 2); } } else if((status.getWarningcode()&WarningCfg.TYPE_CONT_INVALID_RESULT) != 0) { 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){ noGGA++; diff --git a/sec-beidou/src/main/resources/static/js/device-overview-module/device-markers.js b/sec-beidou/src/main/resources/static/js/device-overview-module/device-markers.js index afe1912b..64da580d 100644 --- a/sec-beidou/src/main/resources/static/js/device-overview-module/device-markers.js +++ b/sec-beidou/src/main/resources/static/js/device-overview-module/device-markers.js @@ -1,9 +1,9 @@ var DeviceMarkers = (function() { 'use strict'; - var greenFeatures = []; - var orangeFeatures = []; - var redFeatures = []; + var invalidDataFeatures = []; + var offlineIn24hFeatures = []; + var offlineFeatures = []; var allFeatures = []; var myLocationFeature = null; var myLocationInterval = null; @@ -43,9 +43,9 @@ var DeviceMarkers = (function() { var scale = isHovered ? 0.85 : 0.7; // 根据告警级别选择图标 - if (deviceInfo.warning == 2) { + if (deviceInfo.warning == 2||deviceInfo.warning == 3) { iconSrc = '../images/loc1_red.png'; - } else if (deviceInfo.warning == 1) { + } else if (deviceInfo.warning == 4) { iconSrc = '../images/loc1_orange.png'; } else { iconSrc = '../images/loc1_green.png'; @@ -85,9 +85,9 @@ var DeviceMarkers = (function() { var savedMyLocationFeature = myLocationFeature; vectorSource.clear(); - greenFeatures = []; - orangeFeatures = []; - redFeatures = []; + invalidDataFeatures = []; + offlineIn24hFeatures = []; + offlineFeatures = []; allFeatures = []; for (var i = 0; i < deviceList.length; i++) { @@ -106,11 +106,12 @@ var DeviceMarkers = (function() { // 按告警级别分类 if (device.warning == 2) { - redFeatures.push(feature); - } else if (device.warning == 1) { - orangeFeatures.push(feature); - } else { - greenFeatures.push(feature); + offlineFeatures.push(feature); + } else if (device.warning == 3) { + offlineFeatures.push(feature); + offlineIn24hFeatures.push(feature); + } else if (device.warning == 4) { + invalidDataFeatures.push(feature); } allFeatures.push(feature); @@ -149,9 +150,10 @@ var DeviceMarkers = (function() { } } - function showWarning1Devices() { + function showWarning4Devices() { + console.log("showWarning4Devices"); if (!vectorSource) return; - + console.log("showWarning4Devices:",invalidDataFeatures.length); var savedMyLocationFeature = myLocationFeature; vectorSource.clear(); @@ -159,18 +161,18 @@ var DeviceMarkers = (function() { vectorSource.addFeature(savedMyLocationFeature); } - for (var i = 0; i < allFeatures.length; i++) { - vectorSource.addFeature(allFeatures[i]); + for (var i = 0; i < invalidDataFeatures.length; i++) { + vectorSource.addFeature(invalidDataFeatures[i]); } - hideGreenFeatures(); - hideRedFeatures(); + //hideofflineIn24hFeatures(); + //hideofflineFeatures(); } function showWarning2Devices() { if (!vectorSource) return; - + console.log("showWarning2Devices:",offlineFeatures.length); var savedMyLocationFeature = myLocationFeature; vectorSource.clear(); @@ -178,32 +180,33 @@ var DeviceMarkers = (function() { vectorSource.addFeature(savedMyLocationFeature); } - for (var i = 0; i < allFeatures.length; i++) { - vectorSource.addFeature(allFeatures[i]); + for (var i = 0; i < offlineFeatures.length; i++) { + vectorSource.addFeature(offlineFeatures[i]); } - hideGreenFeatures(); - hideOrangeFeatures(); - } - - function hideGreenFeatures() { - for (var i = 0; i < greenFeatures.length; i++) { - vectorSource.removeFeature(greenFeatures[i]); - } + //hideinvalidDataFeatures(); + //hideofflineIn24hFeatures(); } - function hideOrangeFeatures() { - for (var i = 0; i < orangeFeatures.length; i++) { - vectorSource.removeFeature(orangeFeatures[i]); + function showWarning3Devices() { + console.log("showWarning3Devices"); + if (!vectorSource) return; + console.log("showWarning3Devices:",offlineIn24hFeatures.length); + var savedMyLocationFeature = myLocationFeature; + vectorSource.clear(); + + if (savedMyLocationFeature) { + vectorSource.addFeature(savedMyLocationFeature); } - } - - function hideRedFeatures() { - for (var i = 0; i < redFeatures.length; i++) { - vectorSource.removeFeature(redFeatures[i]); + + for (var i = 0; i < offlineIn24hFeatures.length; i++) { + vectorSource.addFeature(offlineIn24hFeatures[i]); } + + //hideinvalidDataFeatures(); + //hideofflineFeatures(); } - + function findDeviceById(deviceId) { // console.log('搜索设备:', deviceId, '(类型:', typeof deviceId, ')'); // console.log('当前设备总数:', allFeatures.length); @@ -375,9 +378,9 @@ var DeviceMarkers = (function() { function getDeviceStats() { return { total: allFeatures.length, - green: greenFeatures.length, - orange: orangeFeatures.length, - red: redFeatures.length + green: invalidDataFeatures.length, + orange: offlineIn24hFeatures.length, + red: offlineFeatures.length }; } @@ -386,11 +389,9 @@ var DeviceMarkers = (function() { createDeviceStyle: createDeviceStyle, addDeviceMarkers: addDeviceMarkers, showAllDevices: showAllDevices, - showWarning1Devices: showWarning1Devices, showWarning2Devices: showWarning2Devices, - hideGreenFeatures: hideGreenFeatures, - hideOrangeFeatures: hideOrangeFeatures, - hideRedFeatures: hideRedFeatures, + showWarning3Devices: showWarning3Devices, + showWarning4Devices: showWarning4Devices, findDeviceById: findDeviceById, locateDevice: locateDevice, getMyLocation: getMyLocation, @@ -402,9 +403,9 @@ var DeviceMarkers = (function() { getDeviceStats: getDeviceStats, getAllFeatures: function() { return allFeatures; }, - getGreenFeatures: function() { return greenFeatures; }, - getOrangeFeatures: function() { return orangeFeatures; }, - getRedFeatures: function() { return redFeatures; }, + getinvalidDataFeatures: function() { return invalidDataFeatures; }, + getofflineIn24hFeatures: function() { return offlineIn24hFeatures; }, + getofflineFeatures: function() { return offlineFeatures; }, getMyLocationFeature: function() { return myLocationFeature; } }; })(); \ No newline at end of file diff --git a/sec-beidou/src/main/resources/static/js/device-overview-module/map-core.js b/sec-beidou/src/main/resources/static/js/device-overview-module/map-core.js index 030999ac..3db7feba 100644 --- a/sec-beidou/src/main/resources/static/js/device-overview-module/map-core.js +++ b/sec-beidou/src/main/resources/static/js/device-overview-module/map-core.js @@ -292,12 +292,16 @@ var MapCore = (function() { function onWarningFilterChange() { var filterValue = document.getElementById('warningFilter').value; + console.log("onWarningFilterChange: ",filterValue); switch(filterValue) { case 'all': SearchFilter.showAllDevices(); break; - case 'warning1': - SearchFilter.showWarning1Devices(); + case 'warning4': + SearchFilter.showWarning4Devices(); + break; + case 'warning3': + SearchFilter.showWarning3Devices(); break; case 'warning2': SearchFilter.showWarning2Devices(); diff --git a/sec-beidou/src/main/resources/static/js/device-overview-module/search-filter.js b/sec-beidou/src/main/resources/static/js/device-overview-module/search-filter.js index 09cc91e5..9f87580f 100644 --- a/sec-beidou/src/main/resources/static/js/device-overview-module/search-filter.js +++ b/sec-beidou/src/main/resources/static/js/device-overview-module/search-filter.js @@ -187,10 +187,13 @@ var SearchFilter = (function() { showAllDevices(); break; case 2: - showWarning1Devices(); + showWarning2Devices(); break; case 3: - showWarning2Devices(); + showWarning3Devices(); + break; + case 4: + showWarning4Devices(); break; } } @@ -203,20 +206,30 @@ var SearchFilter = (function() { updateFilterSelect('all'); } - function showWarning1Devices() { - currentSearchedDevice = null; - clearSearchInput(); - DeviceMarkers.showWarning1Devices(); - markerState = 2; - updateFilterSelect('warning1'); - } function showWarning2Devices() { + console.log("SearchFilter.showWarning2Devices"); currentSearchedDevice = null; clearSearchInput(); DeviceMarkers.showWarning2Devices(); - markerState = 3; + markerState = 2; 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() { var searchInput = document.getElementById('deviceSearchNew'); if (searchInput) { @@ -233,13 +246,15 @@ var SearchFilter = (function() { function filterDevicesByStatus(statusType) { switch(statusType) { - case 'warning1': - showWarning1Devices(); - break; case 'warning2': showWarning2Devices(); break; - case 'offline': + case 'warning3': + showWarning3Devices(); + break; + case 'warning4': + showWarning4Devices(); + break; case 'no_fwd': case 'nofixed': case 'nogga': @@ -311,8 +326,9 @@ var SearchFilter = (function() { searchDevice: searchDevice, clearSearch: clearSearch, showAllDevices: showAllDevices, - showWarning1Devices: showWarning1Devices, showWarning2Devices: showWarning2Devices, + showWarning3Devices: showWarning3Devices, + showWarning4Devices: showWarning4Devices, filterDevicesByStatus: filterDevicesByStatus, queryDevices: queryDevices, locateDeviceOnMap: locateDeviceOnMap, diff --git a/sec-beidou/src/main/resources/templates/page/device_overview.html b/sec-beidou/src/main/resources/templates/page/device_overview.html index 2b40c956..e0a79b0c 100644 --- a/sec-beidou/src/main/resources/templates/page/device_overview.html +++ b/sec-beidou/src/main/resources/templates/page/device_overview.html @@ -851,16 +851,6 @@ 长期无效解 10 -