1、地图显示离线和24小时离线和无效解的位置
This commit is contained in:
parent
b7453a9331
commit
8ca33f908a
@ -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)) {
|
||||
|
||||
@ -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++;
|
||||
|
||||
@ -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,30 +180,31 @@ 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();
|
||||
//hideinvalidDataFeatures();
|
||||
//hideofflineIn24hFeatures();
|
||||
}
|
||||
|
||||
function hideGreenFeatures() {
|
||||
for (var i = 0; i < greenFeatures.length; i++) {
|
||||
vectorSource.removeFeature(greenFeatures[i]);
|
||||
}
|
||||
}
|
||||
function showWarning3Devices() {
|
||||
console.log("showWarning3Devices");
|
||||
if (!vectorSource) return;
|
||||
console.log("showWarning3Devices:",offlineIn24hFeatures.length);
|
||||
var savedMyLocationFeature = myLocationFeature;
|
||||
vectorSource.clear();
|
||||
|
||||
function hideOrangeFeatures() {
|
||||
for (var i = 0; i < orangeFeatures.length; i++) {
|
||||
vectorSource.removeFeature(orangeFeatures[i]);
|
||||
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) {
|
||||
@ -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; }
|
||||
};
|
||||
})();
|
||||
@ -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();
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -851,16 +851,6 @@
|
||||
<span>长期无效解</span>
|
||||
<span class="stat-number" th:text="${noFix}">10</span>
|
||||
</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}">
|
||||
<span class="stat-dot dot-gray"></span>
|
||||
<span>无GGA告警</span>
|
||||
@ -930,8 +920,9 @@
|
||||
<div class="toolbar-item">
|
||||
<select id="warningFilter" class="toolbar-select" onchange="onWarningFilterChange()">
|
||||
<option value="all">全部设备</option>
|
||||
<option value="warning1">一般告警</option>
|
||||
<option value="warning2" selected>严重告警</option>
|
||||
<option value="warning2">离线</option>
|
||||
<option value="warning3">24小时内离线</option>
|
||||
<option value="warning4">长期无效解</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@ -24,6 +24,15 @@
|
||||
<input type="text" name="deviceid" autocomplete="off" class="layui-input">
|
||||
</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 class="layui-inline">
|
||||
<label class="layui-form-label">关联基站号</label>
|
||||
<div class="layui-input-inline">
|
||||
@ -36,6 +45,12 @@
|
||||
<input type="text" name="project_id" autocomplete="off" class="layui-input">
|
||||
</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}">
|
||||
<label class="layui-form-label">所属部门</label>
|
||||
<div class="layui-input-inline">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user