车辆轨迹

develop
hanrenchun 9 months ago
parent 134ccc7c00
commit 62163826a3

@ -30,6 +30,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -78,14 +79,24 @@ public class TransitVehicleRecordController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
// @GetMapping("/track") @GetMapping("/track")
// @ApiOperation("查询车辆轨迹") @ApiOperation("查询车辆轨迹")
// public TableDataInfo<TransitVehicleRecordVO> trackList(TransitVehicleRecord transitVehicleRecord) { public TableDataInfo<TransitVehicleRecordVO> trackList(TransitVehicleRecord transitVehicleRecord) {
// List<TransitVehicleRecord> list = transitVehicleRecordService.list(new QueryWrapper<>(transitVehicleRecord)); List<TransitVehicleRecord> list = transitVehicleRecordService.list(new QueryWrapper<>(transitVehicleRecord));
// for (TransitVehicleRecord transitVehicleRecord1 : list){ List<TransitVehicleRecord> collect = list.stream()
// .sorted(Comparator.comparing(TransitVehicleRecord::getPassTime))
// } .collect(Collectors.toList());
// } TransitVehicleRecordVO transitVehicleRecordVO = new TransitVehicleRecordVO();
ArrayList<TransitVehicleRecordVO> transitVehicleRecordVOS = new ArrayList<>();
for (TransitVehicleRecord transitVehicleRecord1 : collect){
BeanUtils.copyProperties(transitVehicleRecord1,transitVehicleRecordVO);
DevopsDeviceInfo deviceInfo = devopsDeviceInfoService.lambdaQuery().eq(DevopsDeviceInfo::getGbsChannelNo, transitVehicleRecord1.getDoorwayCode()).list().get(0);
transitVehicleRecordVO.setLongitude(deviceInfo.getLongitude());
transitVehicleRecordVO.setLatitude(deviceInfo.getLatitude());
transitVehicleRecordVOS.add(transitVehicleRecordVO);
}
return getDataTable(transitVehicleRecordVOS);
}
@PostMapping @PostMapping
@ApiOperation("新增车辆记录表") @ApiOperation("新增车辆记录表")

@ -152,4 +152,11 @@ public class TransitVehicleRecordVO extends BaseEntity {
private Date partitionField; private Date partitionField;
@ApiModelProperty("设备经度")
@Excel(name = "设备经度")
private Double longitude;
@ApiModelProperty("设备纬度")
@Excel(name = "设备纬度")
private Double latitude;
} }

Loading…
Cancel
Save