Commit 0b1def1f by zhouhaibao

[+]试驾服务

1 parent a86820b5
...@@ -17,7 +17,7 @@ public class VehicleDocDto { ...@@ -17,7 +17,7 @@ public class VehicleDocDto {
/** /**
* 资料类型 * 资料类型
*/ */
private Byte docType; private Integer docType;
/** /**
* 文件链接 * 文件链接
......
...@@ -198,6 +198,25 @@ public class VehicleService { ...@@ -198,6 +198,25 @@ public class VehicleService {
} }
/** /**
* 解绑车辆设备(根据车辆id解绑)
*
* @param tempId
*/
@Transactional(rollbackFor = Exception.class)
public void unbindDriveVehicle(String tempId) {
List<VehicleDevice> vehicleDevices = vehicleDeviceService.listVehicleDeviceByVehicleIdBind(Long.parseLong(tempId));
if (CollectionUtils.isEmpty(vehicleDevices)) {
throw new AdminException(ResultEnum.PARAM_ERROR);
}
for (VehicleDevice vehicleDevice : vehicleDevices) {
vehicleDevice.setBindStatus(ConstantsDevice.UN_BIND_VEHICLE_STATUS);
vehicleDevice.setUpdatedBy(ShieldContextHolder.getUserId());
vehicleDevice.setUpdatedDate(new Date());
vehicleDeviceService.updateByPrimaryKey(vehicleDevice);
}
}
/**
* 编辑回显车辆数据 * 编辑回显车辆数据
* *
* @param tempId * @param tempId
...@@ -232,25 +251,6 @@ public class VehicleService { ...@@ -232,25 +251,6 @@ public class VehicleService {
} }
/** /**
* 解绑车辆设备(根据车辆id解绑)
*
* @param tempId
*/
@Transactional(rollbackFor = Exception.class)
public void unbindDriveVehicle(String tempId) {
List<VehicleDevice> vehicleDevices = vehicleDeviceService.listVehicleDeviceByVehicleIdBind(Long.parseLong(tempId));
if (CollectionUtils.isEmpty(vehicleDevices)) {
throw new AdminException(ResultEnum.PARAM_ERROR);
}
for (VehicleDevice vehicleDevice : vehicleDevices) {
vehicleDevice.setBindStatus(ConstantsDevice.UN_BIND_VEHICLE_STATUS);
vehicleDevice.setUpdatedBy(ShieldContextHolder.getUserId());
vehicleDevice.setUpdatedDate(new Date());
vehicleDeviceService.updateByPrimaryKey(vehicleDevice);
}
}
/**
* 批量删除车辆 * 批量删除车辆
* *
* @param tempId * @param tempId
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!