From 156e7f33a42a9d9b27945728cb72f0cfd3a1859a Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Tue, 4 Jun 2024 17:30:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/app/AppVerifyController.java | 7 +++++++ .../web/controller/iot/receive/ReceiveController.java | 2 ++ .../src/main/java/com/ruoyi/system/domain/AsDevice.java | 2 +- .../com/ruoyi/system/service/impl/AsDeviceServiceImpl.java | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) 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 dcf4ef4..7b5d190 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 @@ -156,6 +156,13 @@ public class AppVerifyController extends BaseController if(!asDeviceService.isOperatingTime(order.getSn())){ return error("不在营业时间内,不得骑行"); } + //非正常状态不得骑行 + AsDevice asDevice = asDeviceService.selectAsDeviceBySn(order.getSn()); + String status = asDevice.getStatus(); + if(!ServiceConstants.VEHICLE_STATUS_NORMAL.equals(status)){ + //根据状态值返回不同的提示 + return error(CommonUtil.format(status)); + } //根据余额和充值记录判断是否有充值过押金,没有充值过押金,提示充值押金 if(!asUserService.checkIsDeposit(order.getUserId())){ return error("您还未充值押金,请先充值押金"); 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 f09e623..b7a3596 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 @@ -12,6 +12,7 @@ import com.ruoyi.common.constant.ServiceConstants; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.CommonUtil; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.map.GeoUtils; import com.ruoyi.common.utils.map.GpsCoordinateUtils; import com.ruoyi.common.utils.onenet.Token; @@ -148,6 +149,7 @@ public class ReceiveController { Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage());//电量百分百 device.setRemainingMileage(remainingMileage); device.setRemainingPower(electricQuantity.toString()); + device.setLastTime(DateUtils.getNowDate()); int i = asDeviceService.updateLocation(device); if(i>0){ log.info("更新定位成功==========================>" +logEntry.getDevName()); diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java b/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java index 5636536..13db153 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java @@ -77,7 +77,7 @@ public class AsDevice extends BaseEntityPlus implements Serializable { /** 最后定位时间 */ @Excel(name = "最后定位时间") - private String lastTime; + private Date lastTime; /** 剩余电量 */ @Excel(name = "剩余电量") 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 2b20e97..dae535e 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 @@ -1347,6 +1347,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i .set("longitude",device.getLongitude()) .set("latitude",device.getLatitude()) .set("remaining_power",device.getRemainingPower()) + .set("last_time",device.getLastTime()) .set("voltage",device.getVoltage()); return asDeviceMapper.update(null,wrapper); }