From 9d22dab9b29b1a59b00ff34bad6b01f31b0666d5 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期六, 13 一月 2024 11:15:41 +0800
Subject: [PATCH] 锁
---
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
index 8d80b1f..66331fa 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
@@ -391,22 +391,27 @@
QueryWrapper<ArdSyCarRtu> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("car_id",carId);
ArdSyCarRtu ardSyCarRtu = rtuMapper.selectOne(queryWrapper);
- List<ArdSyCarLock> locks = lockMapper.lockList(ardSyCarRtu.getId());
- if(locks.size()>0){
- for (int i = 0; i < locks.size(); i++) {
- ArdSyCarLock ardSyCarLock = locks.get(i);
- if(ardSyCarLock.getCurrentInfo()!=null){
- double info = ardSyCarLock.getCurrentInfo();
- int d = (int) ((int)(info*150/138.3 - 4)/0.16);
- ardSyCarLock.setCurrentInfo((double) d);
- }else {
- ardSyCarLock.setCurrentInfo(0.0);
+ if(ardSyCarRtu!=null){
+ List<ArdSyCarLock> locks = lockMapper.lockList(ardSyCarRtu.getId());
+ if(locks.size()>0){
+ for (int i = 0; i < locks.size(); i++) {
+ ArdSyCarLock ardSyCarLock = locks.get(i);
+ if(ardSyCarLock.getCurrentInfo()!=null){
+ double info = ardSyCarLock.getCurrentInfo();
+ int d = (int) ((int)(info*150/138.3 - 4)/0.16);
+ ardSyCarLock.setCurrentInfo((double) d);
+ }else {
+ ardSyCarLock.setCurrentInfo(0.0);
+ }
}
+ return AjaxResult.success(locks);
+ }else {
+ return AjaxResult.error("鏃犺杞︾殑閿佹暟鎹紒");
}
- return AjaxResult.success(locks);
- }else {
- return AjaxResult.error("鏃犺杞︾殑閿佹暟鎹紒");
+ }else{
+ return AjaxResult.error("璇ヨ溅鏃燫TU锛�");
}
+
}
--
Gitblit v1.9.3