From febbb1777fe4e4585399f7f33011481df01041e5 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Wed, 25 Dec 2024 09:18:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/system/service/impl/AsDeviceServiceImpl.java | 8 ++++++++ .../src/main/resources/mapper/system/AsDeviceMapper.xml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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 d6f01be..28a42f1 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 @@ -156,6 +156,14 @@ public class AsDeviceServiceImpl extends ServiceImpl i if (ObjectUtil.isNotNull(areaId) && areaId!=0){ EtOperatingArea etOperatingArea = etOperatingAreaService.selectEtOperatingAreaByAreaId(areaId); device.setAreaName(etOperatingArea.getAreaName()); + device.setDeptName(etOperatingArea.getDeptName()); + } + EtModel model = etModelService.selectEtModelByModelId(device.getModelId()); + if(ObjectUtil.isNotNull(model)){ + device.setModel(model.getModel()); + if(StrUtil.isNotBlank(device.getVoltage())){ + device.setRemainingMileage(CommonUtil.getRemainingMileage(device.getVoltage(),model.getFullVoltage(),model.getLowVoltage(),model.getFullEndurance())); + } } if(ObjectUtil.isNotNull(areaId) && areaId!=0){ SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId); diff --git a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml index d8ef000..46d29df 100644 --- a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml @@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, area_id, activation_time, online_status, create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark, status, - lock_status, location, remaining_power, voltage, qrcode, longitude, latitude, is_area_out_outage, is_admin_unlocking, + lock_status, location, remaining_power, voltage, version, qrcode, longitude, latitude, is_area_out_outage, is_admin_unlocking, signal_strength, satellites, quality, appid, app_name, dept_id from et_device @@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num, de.area_id, de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by, de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location, - de.remaining_power, de.voltage, de.qrcode, de.longitude, de.latitude, de.is_area_out_outage, de.is_admin_unlocking,de.appid, de.app_name, de.dept_id from et_device de + de.remaining_power, de.voltage, de.version, de.qrcode, de.longitude, de.latitude, de.is_area_out_outage, de.is_admin_unlocking,de.appid, de.app_name, de.dept_id from et_device de left join et_area_dept ad on ad.area_id = de.area_id left join sys_dept d on d.dept_id = ad.dept_id where 1 = 1