Commit 4a92c189 by levphon

车辆同步接口

1 parent 4f25886d
......@@ -157,18 +157,29 @@ public class WorkOrderService {
}
public Vehicle syncVehicle(SyncWorkOrderVehicleBO vehicleBO) {
Vehicle vehicle = generateVehicleByVehicle(vehicleBO);
log.info("同步车辆信息:{}", JSONUtil.toJsonStr(vehicle));
vehicleMapper.insert(vehicle);
List<ComplexDeviceBO> devices = vehicleBO.getDevices();
log.info("同步车辆设备信息:{}", JSONUtil.toJsonStr(devices));
if (CollectionUtils.isNotEmpty(devices)) {
devices.forEach(cd -> {
});
if (vehicle != null) {
vehicleMapper.insert(vehicle);
List<ComplexDeviceBO> cdevices = vehicleBO.getDevices();
log.info("同步车辆设备信息:{}", JSONUtil.toJsonStr(cdevices));
if (CollectionUtils.isNotEmpty(cdevices)) {
List<VehicleDevice> devices = Lists.newArrayList();
cdevices.forEach(device -> {
VehicleDevice vdev = new VehicleDevice();
vdev.setVehicleId(vehicle.getId());
vdev.setSn(device.getSn());
vdev.setBindStatus(1);
vdev.setTrialType(0);
vdev.setHisType(0);
vdev.setCreatedDate(new Date());
vdev.setCreatedBy(vehicle.getCreatedBy());
devices.add(vdev);
});
vehicleDeviceMapper.insertList(devices);
}
}
return vehicle;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!