From 0f43b64d0be18afee704067bbafd60426f20b8d3 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Thu, 13 Mar 2025 10:16:44 +0800 Subject: [PATCH] 111 --- .../ruoyi/web/controller/app/AppVerifyController.java | 9 ++++++++- .../web/controller/iot/receive/ReceiveController.java | 1 + .../web/controller/system/EtParkingAreaController.java | 2 +- .../ruoyi/system/service/impl/AsDeviceServiceImpl.java | 9 +++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java index e38dea9..b2da284 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java @@ -42,6 +42,7 @@ import java.text.SimpleDateFormat; import java.util.*; import static com.ruoyi.common.constant.ServiceConstants.PAY_TYPE_TMWX; +import static com.ruoyi.common.constant.ServiceConstants.VEHICLE_STATUS_SCHEDULING; /** * app接口(需要登录校验的) @@ -582,7 +583,13 @@ public class AppVerifyController extends BaseController AsDevice asDevice = new AsDevice(); asDevice.setSn(sn); asDevice.setVehicleNum(vehicleNum); - asDevice.setStatus(status); + AsDevice asDevice1 = asDeviceService.selectAsDeviceBySn(sn); + if (ObjectUtil.isNull(asDevice1)) { + return error("设备不存在"); + } + if (!VEHICLE_STATUS_SCHEDULING.equals(asDevice1.getStatus())) { + asDevice.setStatus(status); + } return toAjax(asDeviceService.updateAsDeviceBySn(asDevice)); } diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java index 354271f..f64a6be 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java @@ -181,6 +181,7 @@ public class ReceiveController { if(ObjectUtil.isNotNull(area) && !oneMinuteDifference){ /** 2. 判断是否在禁行区内 如果在, 根据配置‘禁行区内断电配置’进行断电 **/ String isAdminUnlocking = asDevice.getIsAdminUnlocking();// 是否是管理员开锁:0-否;1-是 + // 禁行区内断电 boolean noRidingArea = isNoRidingArea(lon, lat, value.getStatus(), asDevice, area, isAdminUnlocking); /** 3.超出运营区外断电 包含靠近运营区播报 */ outAreaOutage(value, asDevice, lon, lat, area, isAdminUnlocking, noRidingArea); diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java index 0a93c12..580a751 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java @@ -43,7 +43,7 @@ public class EtParkingAreaController extends BaseController @GetMapping("/list") public TableDataInfo list(EtParkingArea etParkingArea) { -// startPage(); + etParkingArea.setStatus("0"); List<EtParkingArea> list = etParkingAreaService.selectEtParkingAreaList(etParkingArea); return getDataTable(list); } diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index a301865..d94884b 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -121,6 +121,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i @Autowired private IEtTripLogService etTripLogService; + @Autowired + private IEtHardwareVersionService hardwareVersionService; + @Value(value = "${iot.iotUrl}") private String iotUrl; @@ -238,6 +241,12 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i etOperatingArea = etOperatingAreaService.selectEtOperatingAreaByAreaId(areaId); asDevice.setAreaName(etOperatingArea.getAreaName()); } + + Long hardwareVersionId = asDevice.getHardwareVersionId(); + if (ObjectUtil.isNotNull(hardwareVersionId) && areaId!=0) { + EtHardwareVersion etHardwareVersion = hardwareVersionService.selectEtHardwareVersionById(hardwareVersionId); + asDevice.setHardwareVersion(etHardwareVersion.getVersion()); + } pullDeviceInfo(asDevice); //正在进行中的订单 EtOrder order = new EtOrder();