From 492bae41a21616852b8007660c679fcd37e7ea2a Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 06 十一月 2023 10:16:34 +0800
Subject: [PATCH] app人员查询
---
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java | 2
ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java | 2
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java | 21 +++++++---
ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java | 8 ++-
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java | 43 ++++++++-------------
5 files changed, 38 insertions(+), 38 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 fcb0887..d0ee286 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
@@ -402,17 +402,20 @@
long tenSeconds = 1000L;
Date beforeTenSeconds = new Date(currentTime.getTime() - tenSeconds);
String startTime = sdf.format(beforeTenSeconds);
+ System.out.println(startTime);
String usersId = SecurityUtils.getUserId();
ArdSyUser ardSyUser = iArdSyUserService.userById(usersId);
String syURL = sysConfigService.getSYURL();
+ String sessionId = ardSyCarService.getSessionId(syURL,ardSyUser);
+ System.out.println(sessionId);
//鑾峰彇鎽勫儚閫氶亾淇℃伅
- Map<String, Object> result = ardSyCarService.getCarPicture(carId,syURL,ardSyUser);
+ Map<String, Object> result = ardSyCarService.getCarPicture(carId,syURL,sessionId);
String vs = "";
try {
//鎻愬彇閫氶亾淇℃伅
Map<String,Object> map = ((List<Map<String,Object>>)result.get("list")).get(0);
Map<String, Object> videos = (Map<String, Object>) JSON.parse((String) map.get("videos"));
-// System.out.println(videos);
+ System.out.println(videos);
vs = (String) videos.get("vs");
} catch (Exception e) {
return AjaxResult.error("璇ヨ溅杈嗘病鏈夋憚鍍忛�氶亾鏃犵収鐗囨暟鎹紒");
@@ -424,11 +427,11 @@
channelList.add(vsArray[i].substring(0,1));
}
//鎷嶇収
- Map<String,Object> sendCmdMap = ardSyCarService.sendCmd(syURL,ardSyUser,carId,channelList);
-// System.out.println(sendCmdMap);
+ Map<String,Object> sendCmdMap = ardSyCarService.sendCmd(ardSyUser.getUserId(),syURL,sessionId,carId,channelList);
+ System.out.println(sendCmdMap);
//鑾峰彇鐓х墖
- Map<String,Object> photoMap = ardSyCarService.getPhoto(syURL,carId,ardSyUser,startTime);
-// System.out.println(photoMap);
+ Map<String,Object> photoMap = ardSyCarService.getPhoto(syURL,carId,sessionId,startTime);
+ System.out.println(photoMap);
return AjaxResult.success(photoMap);
}
@@ -442,4 +445,10 @@
return AjaxResult.success(video);
}
+ @GetMapping("getTreeOne")
+ @ApiOperation("娓呮筏涓変竴鍦板潃")
+ public AjaxResult getTreeOne() {
+ return AjaxResult.success(sysConfigService.selectConfigByKey("syCarPT"));
+ }
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java b/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
index d1ea79f..d8e9a5d 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
@@ -129,11 +129,13 @@
Results getCarGPSBycarId(String usersId, String carId, String syURL, ArdSyUser ardSyUser);
- Map<String, Object> getCarPicture(String carId, String syURL, ArdSyUser ardSyUser);
+ String getSessionId(String syURL,ArdSyUser ardSyUser);
- Map<String, Object> sendCmd(String syURL,ArdSyUser ardSyUser,String carId, List<String> channelList) throws UnsupportedEncodingException;
+ Map<String, Object> getCarPicture(String carId, String syURL, String sessionId);
- Map<String, Object> getPhoto(String syURL,String carId,ArdSyUser ardSyUser,String startTime);
+ Map<String, Object> sendCmd(String userId,String syURL,String sessionId,String carId, List<String> channelList) throws UnsupportedEncodingException;
+
+ Map<String, Object> getPhoto(String syURL,String carId,String sessionId,String startTime);
Map<String, Object> getVideo(String syURL,String carId,ArdSyUser ardSyUser);
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
index e7d97ce..0cd276d 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
@@ -798,25 +798,22 @@
}
@Override
- public Map<String, Object> getCarPicture(String carId, String syURL, ArdSyUser ardSyUser) {
- //31鐢ㄦ埛鍚嶅瘑鐮�
- String username31 = ardSyUser.getUserId();
- String password31 = ardSyUser.getPassword();
- String passwordMd5 = DigestUtils.md5Hex(password31);
- Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31);
- Map<String, Object> result0 = new HashMap();
- result0 = sYClient.getCarPicture(syURL, carId, (String) result1.get("sessionId"));
- return result0;
+ public Map<String, Object> getCarPicture(String carId, String syURL, String sessionId) {
+ return sYClient.getCarPicture(syURL, carId, sessionId);
}
@Override
- public Map<String, Object> sendCmd(String syURL, ArdSyUser ardSyUser, String carId, List<String> channelList) throws UnsupportedEncodingException {
- //31鐢ㄦ埛鍚嶅瘑鐮�
- String userId = ardSyUser.getUserId();
+ public String getSessionId(String syURL,ArdSyUser ardSyUser) {
+ String username31 = ardSyUser.getUserId();
String password31 = ardSyUser.getPassword();
- String password = DigestUtils.md5Hex(password31);
- Map<String, Object> result1 = sYClient.logIn(syURL, password, userId);
- Map<String, Object> sendCmdMap = new HashMap();
+ String passwordMd5 = DigestUtils.md5Hex(password31);
+ System.out.println(passwordMd5);
+ Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31);
+ return (String) result1.get("sessionId");
+ }
+
+ @Override
+ public Map<String, Object> sendCmd(String userId,String syURL, String sessionId, String carId, List<String> channelList) throws UnsupportedEncodingException {
// for (int i = 0; i < channelList.size(); i++) {
Map<String,String> params = new HashMap();
params.put("channel", channelList.get(1));//閫夋嫨閫氶亾1
@@ -826,23 +823,15 @@
String paramsStr = com.alibaba.fastjson2.JSON.toJSONString(params);
paramsStr = URLEncoder.encode(paramsStr,"UTF-8");
System.out.println(paramsStr);
- sendCmdMap = sYClient.sendCmd(syURL,userId,carId,301,"MediaTake",paramsStr,(String) result1.get("sessionId"));
+ return sYClient.sendCmd(syURL,userId,carId,301,"MediaTake",paramsStr,sessionId);
// }
- return sendCmdMap;
+// return sendCmdMap;
}
@Override
- public Map<String, Object> getPhoto(String syURL, String carId, ArdSyUser ardSyUser,String startTime) {
+ public Map<String, Object> getPhoto(String syURL, String carId, String sessionId,String startTime) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
- //31鐢ㄦ埛鍚嶅瘑鐮�
- String username31 = ardSyUser.getUserId();
- String password31 = ardSyUser.getPassword();
- String passwordMd5 = DigestUtils.md5Hex(password31);
-// System.out.println(username31+"----------"+passwordMd5);
- Map<String, Object> result1 = sYClient.logIn(syURL, passwordMd5, username31);
- Map<String, Object> photoMap = new HashMap();
- photoMap = sYClient.getPhoto(syURL,carId,startTime,sdf.format(new Date()),(String) result1.get("sessionId"));
- return photoMap;
+ return sYClient.getPhoto(syURL,carId,startTime,sdf.format(new Date()),sessionId);
}
@Override
diff --git a/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java b/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java
index 62d60f7..adf90fd 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/forest/SYClient.java
@@ -21,7 +21,7 @@
@Get(url = "${syURL}/gps-web/api/get_car_list.jsp?teamId=${teamId}&detail=true&userId=${userId}&loginType=user&loginWay=interface&loginLang=zh_CN&appDevId=&appId=android&sessionId=${sessionId}")
Map<String,Object> getCarList1(@Var("syURL") String syURL, @Var("teamId") String teamId, @Var("userId") String userId, @Var("sessionId") String sessionId);
- @Get(url = "${syURL}/gps-web/api/get_gps_h.jsp?carId=${carId}&startTime=${startTime}&endTime=${endTime}&filter0=true&maxSpeed=${maxSpeed}&stopLong=5&queryAlarm=false&userId=yanshi&loginType=user&loginWay=android&loginLang=zh_CN&appDevId=&sessionId=${sessionId}")
+ @Get(url = "${syURL}/gps-web/api/get_gps_h.jsp?carId=${carId}&startTime=${startTime}&endTime=${endTime}&sessionId=${sessionId}")
Map<String,Object> getCarGPSTrack(@Var("syURL") String syURL, @Var("carId") String carId, @Var("startTime") String startTime,@Var("endTime") String endTime,@Var("maxSpeed") String maxSpeed, @Var("sessionId") String sessionId);
@Get(url = "${syURL}/gps-web/api/get_gps_r.jsp?teamId=&carIds=${carId}&simple=false&userId=${userId}&loginType=user&loginWay=interface&loginLang=zh_CN&appDevId=&appId=android&sessionId=${sessionId}")
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
index a38e204..013f24a 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -644,7 +644,7 @@
@Override
public List<SysUser> userByDept(Long deptId) {
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("dept_id",deptId);
+ queryWrapper.eq("dept_id",deptId).eq("delFlag","0").eq("appUserType","1");
return userMapper.selectList(queryWrapper);
}
}
--
Gitblit v1.9.3