1.修复bug

This commit is contained in:
邱贞招 2024-09-29 16:21:48 +08:00
parent 3a7c23aa15
commit 5f50bf6b0b

View File

@ -1163,10 +1163,29 @@ public class AppVerifyController extends BaseController
@PostMapping("/changeVehicle/lock")
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)){
logger.info("没有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);
Boolean aBoolean = etOrderService.changeVehicleLock(orderNo,changeReason,isBluetooth,lon,lat,voltage,newSn);
return success(aBoolean);