Skip to content

Commit

Permalink
traffic-a22-forecast: sync data types and add origin to stations
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Sep 25, 2023
1 parent b9375be commit fb5bea8
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
import it.bz.idm.bdp.dto.StationDto;
import it.bz.idm.bdp.dto.StationList;

import com.opendatahub.traffic.a22.forecast.config.DataTypes;;
import com.opendatahub.traffic.a22.forecast.config.DataTypes;
import com.opendatahub.traffic.a22.forecast.config.ProvenanceConfig;;

@Service
public class JobScheduler {
Expand Down Expand Up @@ -68,17 +69,17 @@ public class JobScheduler {
@Value("${station.stationType}")
public String stationType;

// @Autowired
// private ProvenanceConfig provenanceConfig;
@Autowired
private ProvenanceConfig provenanceConfig;

@PostConstruct
public void postConstruct() {
// sync data types
// odhClient.syncDataTypes(stationType,
// Arrays.stream(DataTypes.values())
// .filter(d -> d.syncToOdh)
// .map(DataTypes::toDataTypeDto)
// .toList());
odhClient.syncDataTypes(stationType,
Arrays.stream(DataTypes.values())
.filter(d -> d.syncToOdh)
.map(DataTypes::toDataTypeDto)
.toList());

// historical import
if (historyEnabled) {
Expand Down Expand Up @@ -120,7 +121,7 @@ public void syncData(YearMonth from, YearMonth to) {
Coordinate coordinate = coordinateMap.get(km);
StationDto stationDto = new StationDto(tollBoothName, tollBoothName, coordinate.latitude,
coordinate.longitude);
// stationDto.setOrigin(provenanceConfig.origin);
stationDto.setOrigin(provenanceConfig.origin);
stations.add(stationDto);

// create measurements
Expand Down

0 comments on commit fb5bea8

Please sign in to comment.