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 | 14 ++++++++------ guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/videoGateway/VideoGateway.java | 4 +++- guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaskDetailMapper.xml | 1 + guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/imageModel/ImageModelUtil.java | 5 +++-- guns-admin/src/main/resources/application.yml | 4 +--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaskDetailMapper.xml b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaskDetailMapper.xml index df11919..845c041 100644 --- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaskDetailMapper.xml +++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaskDetailMapper.xml @@ -19,6 +19,7 @@ <if test="null != item.status"> and a.status = #{item.status} </if> + order by a.execution_time desc </select> 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 4f0ee07..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 @@ -193,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"); @@ -202,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; @@ -234,7 +236,7 @@ throw new RuntimeException(); }else{ //等待15秒 - Thread.sleep(15000); + Thread.sleep(30000); String fileUrl = VideoGateway.getCameraShotByFileId2018(terminalId, fileId, 0); if(null == fileUrl){ @@ -246,7 +248,7 @@ throw new Exception(); }else{ //等待15秒 - Thread.sleep(15000); + Thread.sleep(30000); fileUrl = VideoGateway.getCameraShotByFileId2018(terminalId, fileId, 0); if(null == fileUrl){ @@ -280,7 +282,7 @@ throw new Exception(); }else{ //等待15秒 - Thread.sleep(15000); + Thread.sleep(30000); String fileUrl = VideoGateway.getCameraShotByFileId2023(fileId, 0); if(null == fileUrl){ @@ -292,7 +294,7 @@ throw new Exception(); }else{ //等待15秒 - Thread.sleep(15000); + Thread.sleep(30000); fileUrl = VideoGateway.getCameraShotByFileId2023(fileId, 0); if(null == fileUrl){ diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/imageModel/ImageModelUtil.java b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/imageModel/ImageModelUtil.java index 2b92474..2b302b3 100644 --- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/imageModel/ImageModelUtil.java +++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/imageModel/ImageModelUtil.java @@ -12,6 +12,7 @@ import com.stylefeng.guns.modular.system.util.UUIDUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; import java.io.File; import java.io.IOException; @@ -32,8 +33,8 @@ /** * 本地存储图片地址 */ - @Value("${filePath}") - private static String filePath; + private static String filePath = "/home/file/image/"; +// private static String filePath = "d:/file/"; /** diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/videoGateway/VideoGateway.java b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/videoGateway/VideoGateway.java index 89cce0e..7274d05 100644 --- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/videoGateway/VideoGateway.java +++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/videoGateway/VideoGateway.java @@ -286,6 +286,7 @@ HttpRequest post = HttpUtil.createPost("https://zhyn.cg.gz.gov.cn/map/web/vehicleCtrl/" + terminalId + "/cameraShot"); post.header("operate-terminal", "4"); post.header("token", accountLogin.getToken()); + log.info("【2018年协议发送拍摄指令接口】请求地址:" + post.getUrl()); Map<String, Object> body = new HashMap<>(); body.put("channelId", channelId); log.info("【2018年协议发送拍摄指令接口】请求参数:" + JSON.toJSONString(body)); @@ -328,7 +329,6 @@ HttpRequest get = HttpUtil.createGet("https://zhyn.cg.gz.gov.cn/api/cws-business/biz-device-send-records/v1/cameraShot?vehicleId=" + vehicleId + "&vehicleType=" + vehicleType + "&terminalId=" + terminalId + "&channelId=" + channelId); get.header("operate-terminal", "4"); get.header("token", accountLogin.getToken()); - Map<String, Object> body = new HashMap<>(); log.info("【2023年协议发送拍摄指令接口】请求参数:" + get.getUrl()); HttpResponse execute = get.execute(); if(401 == execute.getStatus()){ @@ -390,6 +390,7 @@ if(null == data){ return null; } + data = data.replaceAll(";", ""); return "https://zhyn-pic.cg.gz.gov.cn" + data; } @@ -430,6 +431,7 @@ if(null == data){ return null; } + data = data.replaceAll(";", ""); return "https://zhyn-pic.cg.gz.gov.cn" + data; } diff --git a/guns-admin/src/main/resources/application.yml b/guns-admin/src/main/resources/application.yml index f7f63d3..97d8a23 100644 --- a/guns-admin/src/main/resources/application.yml +++ b/guns-admin/src/main/resources/application.yml @@ -41,7 +41,7 @@ # url: jdbc:mysql://127.0.0.1:3306/vehicle_inspection?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai # username: root # password: 123456 -# db-name: guns #用来搜集数据库的所有表 +# db-name: vehicle_inspection #用来搜集数据库的所有表 # filters: wall,mergeStat #线上环境 @@ -98,5 +98,3 @@ threadPriority: 5 threadsInheritContextClassLoaderOfInitializingThread: true ---- -filePath: /home/file/image/ \ No newline at end of file -- Gitblit v1.7.1