From b5bb69ff301470233bf193959f1a1c4553aaf86b Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期二, 23 一月 2024 09:20:51 +0800
Subject: [PATCH] app指挥端查看指挥端位置及车辆位置审批加入nickName提交
---
ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java | 17 +++++++-
ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java | 2 +
ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java | 42 +++++++++++++++++++++
3 files changed, 59 insertions(+), 2 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 75b8e6a..15ff5c2 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
@@ -252,7 +252,7 @@
@GetMapping("/getCheckCommandersPosition")
@ApiOperation("鎸囨尌绔煡鐪嬫寚鎸ョ浣嶇疆鐢宠")
- public AjaxResult getCheckCommandersPosition() {
+ public AjaxResult getCheckCommandersPosition() {//寮冪敤
String usersId = SecurityUtils.getUserId();
try{
List<Map<String,Object>> result = ardAppPositionService.getCheckCommandersPosition(usersId);
@@ -265,7 +265,7 @@
@GetMapping("/getCheckSYCarsPosition")
@ApiOperation("鎸囨尌绔煡鐪嬭溅杈嗕綅缃敵璇�")
- public AjaxResult getCheckSYCarsPosition() {
+ public AjaxResult getCheckSYCarsPosition() {//寮冪敤
String usersId = SecurityUtils.getUserId();
try{
List<Map<String,Object>> result = ardAppPositionService.getCheckSYCarsPosition(usersId);
@@ -276,4 +276,17 @@
}
}
+ @GetMapping("/getCheckPosition")
+ @ApiOperation("鎸囨尌绔煡鐪嬩綅缃敵璇�")
+ public AjaxResult getCheckPosition() {
+ String usersId = SecurityUtils.getUserId();
+ try{
+ Map<String,List<Map<String,Object>>> result = ardAppPositionService.getCheckPosition(usersId);
+ return AjaxResult.success(result);
+ }catch(Exception e){
+ e.printStackTrace();
+ return AjaxResult.error();
+ }
+ }
+
}
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 e8d3dc0..7bb349f 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
@@ -93,4 +93,6 @@
public List<Map<String,Object>> getCheckCommandersPosition(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 1f15b65..52031a3 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
@@ -413,4 +413,46 @@
}
return result;
}
+
+ @Override
+ public Map<String, List<Map<String, Object>>> getCheckPosition(String usersId) {
+ Map<String, List<Map<String, Object>>> result = new HashMap();
+ //鏌ョ湅鎸囨尌绔綅缃敵璇�
+ String keyCommanderPosition = "checkCommanderPosition_" + usersId + "_";
+ List<Object> keyValueCommanderPositionList = redisCache.getListKey(keyCommanderPosition);
+ List<Map<String, Object>> resultCommanderPosition = new ArrayList();
+ for(Object o : keyValueCommanderPositionList){
+ Map<String,Object> map = JSON.parseObject((String) o);
+ if(((String)map.get("state")).equals("0")){//state涓�0灏辨槸鏈鎵�
+ SysUser sysUser = sysUserMapper.selectUserById((String) map.get("soilderId"));
+ map.put("userName",sysUser.getUserName());
+ if(sysUser.getNickName() != null){
+ map.put("nickName",sysUser.getNickName());
+ }else{
+ map.put("nickName",sysUser.getNickName());
+ }
+ resultCommanderPosition.add(map);
+ }
+ }
+ //鏌ョ湅杞﹁締浣嶇疆鐢宠
+ String keySYCarsPosition = "checkSYCarsPosition_" + usersId + "_";
+ List<Object> keyValueSYCarsPositionList = redisCache.getListKey(keySYCarsPosition);
+ List<Map<String, Object>> resultSYCarsPosition = new ArrayList();
+ for(Object o : keyValueSYCarsPositionList){
+ Map<String,Object> map = JSON.parseObject((String) o);
+ if(((String)map.get("state")).equals("0")){//state涓�0灏辨槸鏈鎵�
+ SysUser sysUser = sysUserMapper.selectUserById((String) map.get("soilderId"));
+ map.put("userName",sysUser.getUserName());
+ if(sysUser.getNickName() != null){
+ map.put("nickName",sysUser.getNickName());
+ }else{
+ map.put("nickName",sysUser.getNickName());
+ }
+ resultSYCarsPosition.add(map);
+ }
+ }
+ result.put("commander",resultCommanderPosition);
+ result.put("SYCars",resultSYCarsPosition);
+ return result;
+ }
}
--
Gitblit v1.9.3