Commit b547ac63 by 杨林龙

修改查询试驾车列表的传入参数

1 parent f0c2fcb9
...@@ -162,6 +162,21 @@ public class VehicleDeviceService { ...@@ -162,6 +162,21 @@ public class VehicleDeviceService {
} }
/** /**
* 查询没有标记为试驾的设备信息
*
* @param sn 设备号
* @return
*/
public VehicleDevice getNotTrialDeviceBySn(String sn) {
VehicleDevice param = new VehicleDevice();
param.setSn(sn);
param.setBindStatus(ConstantsDevice.BIND_VEHICLE_STATUS);
param.setTrialType(ConstantsDevice.NOT_TRIAL_DEVICE_STATUS);
param.setDelFlag(ConstantsDevice.NOT_DEL_FLAG);
return vehicleDeviceMapper.selectOne(param);
}
/**
* 查询车辆绑定了哪些设备 * 查询车辆绑定了哪些设备
* *
* @param vehicleId 车辆Id * @param vehicleId 车辆Id
......
...@@ -1307,11 +1307,14 @@ public class VehicleService { ...@@ -1307,11 +1307,14 @@ public class VehicleService {
} }
// 将设备标记为试驾设备 // 将设备标记为试驾设备
VehicleDevice vehicleDevice = vehicleDeviceService.getTrialDeviceBySn(testVehicleSearch.getSn()); VehicleDevice vehicleDevice = vehicleDeviceService.getNotTrialDeviceBySn(testVehicleSearch.getSn());
vehicleDevice.setTrialType(1); if (vehicleDevice != null) {
vehicleDevice.setUpdatedDate(new Date()); log.info("修改设备为试驾设备===" + testVehicleSearch.getSn());
vehicleDevice.setUpdatedBy(ShieldContextHolder.getUserId()); vehicleDevice.setTrialType(ConstantsDevice.TRIAL_DEVICE_STATUS);
vehicleDeviceService.updateByPrimaryKey(vehicleDevice); vehicleDevice.setUpdatedDate(new Date());
vehicleDevice.setUpdatedBy(ShieldContextHolder.getUserId());
vehicleDeviceService.updateByPrimaryKey(vehicleDevice);
}
// 同步设备给围栏 // 同步设备给围栏
log.info("同步设备信息到围栏===" + testVehicleSearch.getId()); log.info("同步设备信息到围栏===" + testVehicleSearch.getId());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!