From c4efaf9345da0f7012a277408bef6db24cdaf542 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期四, 25 一月 2024 16:09:50 +0800
Subject: [PATCH] 单兵端查看指挥端位置提交
---
ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java | 33 +++++++++++-----
ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java | 12 +++--
ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java | 24 +++++++----
ard-work/src/main/java/com/ruoyi/app/position/mapper/ArdAppPositionMapper.java | 4 ++
ard-work/src/main/resources/mapper/app/ArdAppPositionMapper.xml | 12 ++++++
5 files changed, 61 insertions(+), 24 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java b/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
index 15ff5c2..7565542 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
@@ -226,7 +226,20 @@
return AjaxResult.success(result);
}
- @PostMapping("/sendCheckCommandersPosition")
+ @GetMapping("/getOnlineCommanderPosition")
+ @ApiOperation("鍗曞叺绔煡鐪嬪凡閫氳繃瀹℃壒鐨勫湪绾挎寚鎸ョ浣嶇疆")
+ public AjaxResult getOnlineCommanderPosition() {
+ String soilderId = SecurityUtils.getUserId();
+ try{
+ List<Map<String,Object>> result = ardAppPositionService.getOnlineCommanderPosition(soilderId);
+ return AjaxResult.success(result);
+ }catch(Exception e){
+ e.printStackTrace();
+ return AjaxResult.error();
+ }
+ }
+
+ /*@PostMapping("/sendCheckCommandersPosition")
@ApiOperation("鍙戣捣鏌ョ湅鎸囨尌绔綅缃�")
public AjaxResult sendCheckCommandersPosition(@RequestBody Map<String,Object> para) {
String usersId = SecurityUtils.getUserId();
@@ -236,9 +249,9 @@
}catch(Exception e){
return AjaxResult.error();
}
- }
+ }*/
- @PostMapping("/sendCheckSYCarsPosition")
+ /*@PostMapping("/sendCheckSYCarsPosition")
@ApiOperation("鍙戣捣鏌ョ湅杞﹁締浣嶇疆")
public AjaxResult sendCheckSYCarsPosition(@RequestBody Map<String,Object> para) {
String usersId = SecurityUtils.getUserId();
@@ -248,9 +261,9 @@
}catch(Exception e){
return AjaxResult.error();
}
- }
+ }*/
- @GetMapping("/getCheckCommandersPosition")
+ /*@GetMapping("/getCheckCommandersPosition")
@ApiOperation("鎸囨尌绔煡鐪嬫寚鎸ョ浣嶇疆鐢宠")
public AjaxResult getCheckCommandersPosition() {//寮冪敤
String usersId = SecurityUtils.getUserId();
@@ -261,9 +274,9 @@
e.printStackTrace();
return AjaxResult.error();
}
- }
+ }*/
- @GetMapping("/getCheckSYCarsPosition")
+ /*@GetMapping("/getCheckSYCarsPosition")
@ApiOperation("鎸囨尌绔煡鐪嬭溅杈嗕綅缃敵璇�")
public AjaxResult getCheckSYCarsPosition() {//寮冪敤
String usersId = SecurityUtils.getUserId();
@@ -274,9 +287,9 @@
e.printStackTrace();
return AjaxResult.error();
}
- }
+ }*/
- @GetMapping("/getCheckPosition")
+ /*@GetMapping("/getCheckPosition")
@ApiOperation("鎸囨尌绔煡鐪嬩綅缃敵璇�")
public AjaxResult getCheckPosition() {
String usersId = SecurityUtils.getUserId();
@@ -287,6 +300,6 @@
e.printStackTrace();
return AjaxResult.error();
}
- }
+ }*/
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/mapper/ArdAppPositionMapper.java b/ard-work/src/main/java/com/ruoyi/app/position/mapper/ArdAppPositionMapper.java
index 117dd30..83c5a45 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/mapper/ArdAppPositionMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/mapper/ArdAppPositionMapper.java
@@ -1,6 +1,8 @@
package com.ruoyi.app.position.mapper;
import java.util.List;
+import java.util.Map;
+
import com.ruoyi.app.position.domain.ArdAppPosition;
@@ -66,4 +68,6 @@
* @return 缁撴灉
*/
public int deleteArdAppPositionByIds(String[] ids);
+
+ public List<Map<String,Object>> getOnlineCommanderPosition(String soilderId);
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java b/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java
index 7bb349f..64e1606 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java
@@ -86,13 +86,15 @@
public Map<String,List<SysUser>> getOnlinePCOrCommander(String usersId);
- public void sendCheckCommandersPosition(String usersId,Map<String,Object> para);
+ public List<Map<String,Object>> getOnlineCommanderPosition(String soilderId);
- public void sendCheckSYCarsPosition(String usersId,Map<String,Object> para);
+ //public void sendCheckCommandersPosition(String usersId,Map<String,Object> para);
- public List<Map<String,Object>> getCheckCommandersPosition(String usersId);
+ //public void sendCheckSYCarsPosition(String usersId,Map<String,Object> para);
- public List<Map<String,Object>> getCheckSYCarsPosition(String usersId);
+ //public List<Map<String,Object>> getCheckCommandersPosition(String usersId);
- public Map<String,List<Map<String,Object>>> getCheckPosition(String usersId);
+ //public List<Map<String,Object>> getCheckSYCarsPosition(String usersId);
+
+ //public Map<String,List<Map<String,Object>>> getCheckPosition(String usersId);
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java b/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java
index 52031a3..d4ce82c 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java
@@ -349,6 +349,12 @@
}
@Override
+ public List<Map<String,Object>> getOnlineCommanderPosition(String soilderId) {
+ List<Map<String,Object>> result = ardAppPositionMapper.getOnlineCommanderPosition(soilderId);
+ return result;
+ }
+
+ /*@Override
public void sendCheckCommandersPosition(String usersId,Map<String, Object> para) {
String reason = (String) para.get("reason");
List<String> usersIdList = (List<String>) para.get("usersIdList");
@@ -363,9 +369,9 @@
value.put("soilderId",usersId);
redisCache.setCacheObject(key, JSON.toJSONString(value));
}
- }
+ }*/
- @Override
+ /*@Override
public void sendCheckSYCarsPosition(String usersId, Map<String, Object> para) {
String reason = (String) para.get("reason");
List<String> usersIdList = (List<String>) para.get("usersIdList");
@@ -380,9 +386,9 @@
value.put("soilderId",usersId);
redisCache.setCacheObject(key, JSON.toJSONString(value));
}
- }
+ }*/
- @Override
+ /*@Override
public List<Map<String, Object>> getCheckCommandersPosition(String usersId) {
String key = "checkCommanderPosition_" + usersId + "_";
List<Object> keyValueList = redisCache.getListKey(key);
@@ -396,9 +402,9 @@
}
}
return result;
- }
+ }*/
- @Override
+ /*@Override
public List<Map<String, Object>> getCheckSYCarsPosition(String usersId) {
String key = "checkSYCarsPosition_" + usersId + "_";
List<Object> keyValueList = redisCache.getListKey(key);
@@ -412,9 +418,9 @@
}
}
return result;
- }
+ }*/
- @Override
+ /*@Override
public Map<String, List<Map<String, Object>>> getCheckPosition(String usersId) {
Map<String, List<Map<String, Object>>> result = new HashMap();
//鏌ョ湅鎸囨尌绔綅缃敵璇�
@@ -454,5 +460,5 @@
result.put("commander",resultCommanderPosition);
result.put("SYCars",resultSYCarsPosition);
return result;
- }
+ }*/
}
diff --git a/ard-work/src/main/resources/mapper/app/ArdAppPositionMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppPositionMapper.xml
index 81371a7..f9c55f4 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppPositionMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppPositionMapper.xml
@@ -85,4 +85,16 @@
#{id}
</foreach>
</delete>
+
+ <select id="getOnlineCommanderPosition" parameterType="java.lang.String" resultType="java.util.Map">
+ select su.user_name as "userName",su.nick_name as "nickName",
+ aap.user_id as "userId",aap.longitude,aap.latitude,aap.altitude,
+ aap.speed,aap.bearing,aap.create_time as "createTime"
+ from ard_app_application aaa
+ inner join sys_user su on aaa.commander_id = su.user_id
+ inner join ard_app_position aap on su.user_id = aap.user_id
+ where aaa.soilder_id = #{soilderId} and aaa.application_type = 'Commander'
+ and aaa.state = '1' and su.app_online_state = '1'
+ order by aap.create_time desc limit 1 offset 0
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3