From 732074dfc7598ad52c6ecfc0ee99bcda1cb9af94 Mon Sep 17 00:00:00 2001
From: 于紫祥_1901 <email@yuzixiang_1910>
Date: Fri, 18 Sep 2020 14:09:26 +0800
Subject: [PATCH] 重复点删除,剔除特殊经纬度点
---
src/main/webapp/view/cartrajectory.jsp | 37 ++++++++++++++++--
src/main/java/com/moral/controller/ScreenController.java | 25 ++----------
2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java
index 637e37d..816d5eb 100644
--- a/src/main/java/com/moral/controller/ScreenController.java
+++ b/src/main/java/com/moral/controller/ScreenController.java
@@ -34,26 +34,7 @@
import com.moral.entity.alarm.AlarmSensorLevel;
import com.moral.entity.charts.DataSortCondition;
import com.moral.entity.layout.RealTimeDeviceLayout;
-import com.moral.service.AccountService;
-import com.moral.service.AlarmConfigService;
-import com.moral.service.AlarmDailyService;
-import com.moral.service.AreaService;
-import com.moral.service.DeviceService;
-import com.moral.service.DeviceVersionService;
-import com.moral.service.DictionaryDataService;
-import com.moral.service.HangzhouAqiService;
-import com.moral.service.HistoryDailyService;
-import com.moral.service.HistoryHourlyService;
-import com.moral.service.HistoryMinutelyService;
-import com.moral.service.HistoryService;
-import com.moral.service.MachineActivateService;
-import com.moral.service.MonitorPointService;
-import com.moral.service.OrganizationLayoutService;
-import com.moral.service.OrganizationService;
-import com.moral.service.QualityDailyService;
-import com.moral.service.SensorService;
-import com.moral.service.SensorUnitService;
-import com.moral.service.WeatherService;
+import com.moral.service.*;
import com.moral.util.*;
import com.rabbitmq.client.*;
@@ -115,6 +96,9 @@
MonitorPointService monitorPointService;
@Resource
DeviceVersionService deviceVersionService;
+
+ @Resource
+ HistorySpecialService historySpecialService;
/**
* The screen service.
@@ -1521,6 +1505,7 @@
params.put("sensorInfo", sensorList);
params.put("sensorsMap", sensorsMap);
String paramsJson = params.toJSONString();
+ //System.out.println(paramsJson);
model.addObject("carTrajectoryParams", paramsJson);
model.setViewName("cartrajectory");
return model;
diff --git a/src/main/webapp/view/cartrajectory.jsp b/src/main/webapp/view/cartrajectory.jsp
index f70760e..700a48b 100644
--- a/src/main/webapp/view/cartrajectory.jsp
+++ b/src/main/webapp/view/cartrajectory.jsp
@@ -263,6 +263,26 @@
}
var trackPoints = []; //���������������������������������������������������������������
if (sensorInfo.length > 0) {
+ for (var i = 0; i <sensorInfo.length ; i++) {
+ if (typeof (sensorInfo[i]["e76"]) == "undefined") {
+ sensorInfo.splice(i,1);
+ i--;
+ }else {
+ var lon = parseFloat(sensorInfo[i].e76.substr(0, sensorInfo[i].e76.length - 1));
+ var lat = parseFloat(sensorInfo[i].e77.substr(0, sensorInfo[i].e77.length - 1));
+ if (lon>150 || lon<70 || lat<=20 || lat>60){
+ sensorInfo.splice(i,1);
+ i--;
+ }
+ if (i>1){
+ if (sensorInfo[i]["e76"]==sensorInfo[i-1]["e76"] && sensorInfo[i]["e77"]==sensorInfo[i-1]["e77"]){
+ sensorInfo.splice(i,1);
+ i--;
+ }
+ }
+ }
+ }
+
$.each(sensorInfo, function (item, value) {
if (typeof (value.e76) == "undefined") {
showNoFlightTrajectory();
@@ -340,11 +360,18 @@
}else {
var data="<p style='height: 30px;font-size: 15px;font-weight: bold;padding: 10px 0 0 13px;color: #2aabd2'>"+"������������"+"</p>";
data=data+"<p style='padding:10px 0 0 18px '>"+"���������"+info["time"]+"</p>";
- data=data+"<p style='padding:10px 0 0 18px '>"+"PM2.5���"+info["e1"]+"</p>";
- data=data+"<p style='padding:10px 0 0 18px '>"+"PM10���"+info["e2"]+"</p>";
- data=data+"<p style='padding:10px 0 0 18px '>"+"TSP���"+info["e40"]+"</p>";
- if (typeof(info["e17"])==="undefined"){
- }else {
+ if (typeof(info["e1"])!="undefined"){
+ data=data+"<p style='padding:10px 0 0 18px '>"+"PM2.5���"+info["e1"]+"</p>";
+ }
+ if (typeof(info["e2"])!="undefined"){
+ data=data+"<p style='padding:10px 0 0 18px '>"+"PM10���"+info["e2"]+"</p>";
+ }
+
+ if (typeof(info["e40"])!="undefined"){
+ data=data+"<p style='padding:10px 0 0 18px '>"+"TSP���"+info["e40"]+"</p>";
+ }
+
+ if (typeof (info["e17"])!="undefined"){
data=data+"<p style='padding:10px 0 0 18px '>"+"VOCs���������"+info["e17"]+"</p>";
}
textArea=textArea+data+"</div>";
--
Gitblit v1.8.0