Commit 2e30e046 by 黄小葱

修复编辑车辆绑定设备的bug

1 parent 77ecce66
......@@ -302,6 +302,12 @@ public class VehicleService {
* @param bindVehicleDevice
*/
private void checkSnBindDevice(TrialDriveVehicleEditBo driveVehicleoBo, String sn, List<VehicleDevice> bindVehicleDevice) {
//查询该设备是否绑定过其他车辆 绑定过 抛出异常
VehicleDevice vdBind = vehicleDeviceService.getVehicleDeviceBySnBind(sn);
if (vdBind != null && !String.valueOf(vdBind.getVehicleId()).equals(driveVehicleoBo.getTempId())) {
throw new AdminException(ResultEnum.TRIAL_DRIVE_DEVICE_EXISTS.getCode(),
String.format(ResultEnum.TRIAL_DRIVE_DEVICE_EXISTS.getMessage(), vdBind.getVehicleId()));
}
if (StringUtils.isNotBlank(sn) && !deviceService.checkSnExist(sn)) {
// 旧e盾不存在 抛出异常 存在则保存数据
TrackInfoBo trackInfoBo = deviceService.remoteGetDeviceBySn(sn);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!