1.修复bug
This commit is contained in:
parent
3a7c23aa15
commit
5f50bf6b0b
|
@ -1163,10 +1163,29 @@ public class AppVerifyController extends BaseController
|
||||||
@PostMapping("/changeVehicle/lock")
|
@PostMapping("/changeVehicle/lock")
|
||||||
public AjaxResult changeVehicleLock(String orderNo,String changeReason,String isBluetooth,String lon,String lat,String voltage,String newSn)
|
public AjaxResult changeVehicleLock(String orderNo,String changeReason,String isBluetooth,String lon,String lat,String voltage,String newSn)
|
||||||
{
|
{
|
||||||
|
if (StrUtil.isBlank(newSn)){
|
||||||
|
logger.info("没有sn号参数:【newSn={}】",newSn);
|
||||||
|
return error("请传sn号参数"+"【newSn="+newSn+"】");
|
||||||
|
}
|
||||||
if (StrUtil.isBlank(orderNo)){
|
if (StrUtil.isBlank(orderNo)){
|
||||||
logger.info("没有orderNo参数:【orderNo={}】",orderNo);
|
logger.info("没有orderNo参数:【orderNo={}】",orderNo);
|
||||||
return error("请传orderNo号参数"+"【orderNo="+orderNo+"】");
|
return error("请传orderNo号参数"+"【orderNo="+orderNo+"】");
|
||||||
}
|
}
|
||||||
|
//非正常状态不得骑行
|
||||||
|
AsDevice newDevice = asDeviceMapper.selectAsDeviceBySn(newSn);
|
||||||
|
String status = newDevice.getStatus();
|
||||||
|
if(!ServiceConstants.VEHICLE_STATUS_NORMAL.equals(status)){
|
||||||
|
return error(CommonUtil.format(status));
|
||||||
|
}
|
||||||
|
// 当前有骑行中的订单
|
||||||
|
EtOrder currentOrder = etOrderService.getCurrentOrder(newDevice.getSn());
|
||||||
|
if(ObjectUtil.isNotNull(currentOrder) && !currentOrder.getOrderNo().equals(orderNo)){
|
||||||
|
return error("当前车辆有骑行中的订单,请换车");
|
||||||
|
}
|
||||||
|
//低电量不得骑行判断
|
||||||
|
if(asDeviceService.isLowBattery(newDevice.getSn())){
|
||||||
|
return error("低电量不得骑行");
|
||||||
|
}
|
||||||
logger.info("【换车关锁请求】:orderNo={}",orderNo);
|
logger.info("【换车关锁请求】:orderNo={}",orderNo);
|
||||||
Boolean aBoolean = etOrderService.changeVehicleLock(orderNo,changeReason,isBluetooth,lon,lat,voltage,newSn);
|
Boolean aBoolean = etOrderService.changeVehicleLock(orderNo,changeReason,isBluetooth,lon,lat,voltage,newSn);
|
||||||
return success(aBoolean);
|
return success(aBoolean);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user