From c31952b05395cabe7627e5e3502ceacd56132889 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期六, 06 一月 2024 11:24:31 +0800
Subject: [PATCH] 飞机和车
---
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
index a281656..fb1216d 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
@@ -231,13 +231,15 @@
String carId = carVo.getCarId();
Map<String,Object> map = ardSyCarService.getCarGPSBycarId(usersId,carId,syURL,ardSyUser);
List list1 = (List) map.get("list");
- JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(list1.get(0)));
- String carPlate = (String) jsonObject.get("carPlate");
- carVo.setCarPlate(carPlate);
- String drvName = (String) jsonObject.get("drvName");
- carVo.setDrvName(drvName);
- String drvPhone = (String) jsonObject.get("drvPhone");
- carVo.setDrvPhone(drvPhone);
+ if(list1.size()>0){
+ JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(list1.get(0)));
+ String carPlate = (String) jsonObject.get("carPlate");
+ carVo.setCarPlate(carPlate);
+ String drvName = (String) jsonObject.get("drvName");
+ carVo.setDrvName(drvName);
+ String drvPhone = (String) jsonObject.get("drvPhone");
+ carVo.setDrvPhone(drvPhone);
+ }
}
return list;
}
--
Gitblit v1.9.3