1. 联调

This commit is contained in:
邱贞招 2024-06-04 17:30:27 +08:00
parent ba9f9fa754
commit 156e7f33a4
4 changed files with 11 additions and 1 deletions

View File

@ -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("您还未充值押金,请先充值押金");

View File

@ -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());

View File

@ -77,7 +77,7 @@ public class AsDevice extends BaseEntityPlus implements Serializable {
/** 最后定位时间 */
@Excel(name = "最后定位时间")
private String lastTime;
private Date lastTime;
/** 剩余电量 */
@Excel(name = "剩余电量")

View File

@ -1347,6 +1347,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> 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);
}