From f9e8fafc10ccd1c2e5f6060b4cdc29559927aa16 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 30 十二月 2024 16:18:39 +0800
Subject: [PATCH] 修改bug

---
 guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PatrolTaskServiceImpl.java |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PatrolTaskServiceImpl.java b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PatrolTaskServiceImpl.java
index 005a083..6d8a46f 100644
--- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PatrolTaskServiceImpl.java
+++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PatrolTaskServiceImpl.java
@@ -35,6 +35,7 @@
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
@@ -192,7 +193,8 @@
 				Integer vehicleId = taskDetailVehicle.getVehicleId();
 				VehicleOnline vehicleOnline1 = null;
 				for (VehicleOnline vehicleOnline : vehicleOnlines2018) {
-					if(vehicleOnline.getVehicleId().equals(vehicleId) && vehicleOnline.getVehicleType().equals(vehicleType)){
+					if(null != vehicleOnline.getVehicleId() && vehicleOnline.getVehicleId().equals(vehicleId) &&
+							null != vehicleOnline.getVehicleType() && vehicleOnline.getVehicleType().equals(vehicleType)){
 						vehicleOnline1 = vehicleOnline;
 						String vehicleGpsProtocol = vehicleOnline.getVehicleGpsProtocol();
 						vehicleOnline1.setVehicleGpsProtocol("808-guangzhou".equals(vehicleGpsProtocol) ? "1" : "2");
@@ -201,7 +203,8 @@
 				}
 				if(null == vehicleOnline1){
 					for (VehicleOnline vehicleOnline : vehicleOnlines203) {
-						if(vehicleOnline.getVehicleId().equals(vehicleId) && vehicleOnline.getVehicleType().equals(vehicleType)){
+						if(null != vehicleOnline.getVehicleId() && vehicleOnline.getVehicleId().equals(vehicleId) &&
+								null != vehicleOnline.getVehicleType() && vehicleOnline.getVehicleType().equals(vehicleType)){
 							vehicleOnline1 = vehicleOnline;
 							vehicleOnline1.setVehicleGpsProtocol(vehicleOnline.getVehicleGpsProtocol());
 							break;
@@ -224,6 +227,7 @@
 				String terminalId = vehicleOnline1.getTerminalId();
 				for (TaskDetailVehiclesChannel taskDetailVehiclesChannel : taskDetailVehiclesChannels) {
 					Integer videoChannel = taskDetailVehiclesChannel.getVideoChannel();
+					
 					if("1".equals(vehicleGpsProtocol)){
 						//2018 协议
 						String fileId = VideoGateway.cameraShot2018(terminalId, videoChannel, 0);
@@ -232,7 +236,7 @@
 							throw new RuntimeException();
 						}else{
 							//等待15秒
-							Thread.sleep(15000);
+							Thread.sleep(30000);
 							
 							String fileUrl = VideoGateway.getCameraShotByFileId2018(terminalId, fileId, 0);
 							if(null == fileUrl){
@@ -244,7 +248,7 @@
 									throw new Exception();
 								}else{
 									//等待15秒
-									Thread.sleep(15000);
+									Thread.sleep(30000);
 									
 									fileUrl = VideoGateway.getCameraShotByFileId2018(terminalId, fileId, 0);
 									if(null == fileUrl){
@@ -278,7 +282,7 @@
 							throw new Exception();
 						}else{
 							//等待15秒
-							Thread.sleep(15000);
+							Thread.sleep(30000);
 							
 							String fileUrl = VideoGateway.getCameraShotByFileId2023(fileId, 0);
 							if(null == fileUrl){
@@ -290,7 +294,7 @@
 									throw new Exception();
 								}else{
 									//等待15秒
-									Thread.sleep(15000);
+									Thread.sleep(30000);
 									
 									fileUrl = VideoGateway.getCameraShotByFileId2023(fileId, 0);
 									if(null == fileUrl){

--
Gitblit v1.7.1