From ff93a75e1ede2f3a66de84efd822cfa94b0ac821 Mon Sep 17 00:00:00 2001 From: zhangnaisong <2434969829@qq.com> Date: 星期四, 01 二月 2024 15:59:59 +0800 Subject: [PATCH] 三一车辆追踪修改提交 --- ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java index 2b5a858..d18da11 100644 --- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java +++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java @@ -29,6 +29,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -43,7 +44,7 @@ /** * 涓変竴杞﹁締Controller - * + * * @author ard * @date 2023-06-26 */ @@ -75,6 +76,9 @@ private ArdSyCarController ardSyCarController; + @Value("${syCar.enabled}") + private Boolean syCarEnabled; + @PostConstruct public void init(){ ardSyCarController = this; @@ -84,7 +88,8 @@ config.setConfigKey("syCarPT"); List<SysConfig> sysConfigResult = sysConfigService.selectConfigList(config); String syURL = ""; - if(sysConfigResult.size() == 0){ + //if(sysConfigResult.size() == 0){ + if(!syCarEnabled){//涓変竴杞﹁締鍔犲叆寮�鍏� return; }else{ syURL = sysConfigResult.get(0).getConfigValue(); @@ -108,8 +113,8 @@ ardSyCarService.sendArdSyCarPosition(); } }; - carPositionTimer.scheduleAtFixedRate(carPositionTask,date,3*1000);//鍚敤 - //杞﹁締瀹炴椂浣嶇疆绾跨▼ + //carPositionTimer.scheduleAtFixedRate(carPositionTask,date,3*1000);//寮冪敤 + //杞﹁締瀹炴椂鎶ヨ绾跨▼ PushClientImplAlarm pushClientImplAlarm = new PushClientImplAlarm(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword()); Thread pushClientImplAlarmThread = new Thread(pushClientImplAlarm); pushClientImplAlarmThread.start(); @@ -455,7 +460,7 @@ @GetMapping("getThreeOne") @ApiOperation("鑾峰彇涓変竴瑙嗛鍦板潃") public AjaxResult getThreeOne() { - return AjaxResult.success("鑾峰彇鍦板潃鎴愬姛锛�",sysConfigService.selectConfigByKey("threeOneVideo")); + return AjaxResult.success("鑾峰彇鍦板潃鎴愬姛锛�",sysConfigService.getSYVideo()); } @PreAuthorize("@ss.hasPermi('sy:syCar:getAlarmHPfmCountDetail')") @@ -473,4 +478,17 @@ return AjaxResult.success(mapDetail); } + @GetMapping("/getOnlineSYCarPosition") + @ApiOperation("鍗曞叺绔煡鐪嬪凡閫氳繃瀹℃壒鐨勫湪绾夸笁涓�杞﹁締浣嶇疆") + public AjaxResult getOnlineSYCarPosition() { + String soilderId = SecurityUtils.getUserId(); + try{ + Map<String,Object> result = ardSyCarService.getOnlineSYCarPosition(soilderId); + return AjaxResult.success(result); + }catch(Exception e){ + e.printStackTrace(); + return AjaxResult.error(); + } + } + } -- Gitblit v1.9.3