2018-11-16 11:52:45 +08:00
|
|
|
import { Injectable } from '@angular/core';
|
2018-12-15 17:04:16 +08:00
|
|
|
import { HttpClientService } from './http-client.service';
|
2018-11-19 09:30:59 +08:00
|
|
|
import { Subject, forkJoin, zip } from 'rxjs'
|
2018-11-16 11:52:45 +08:00
|
|
|
|
|
|
|
|
@Injectable()
|
2018-11-19 09:30:59 +08:00
|
|
|
export class BasicDataService {
|
2019-02-19 15:57:47 +08:00
|
|
|
public flightStatusDefinitions:Array<any>;
|
2019-01-28 17:12:03 +08:00
|
|
|
public flightStatusDefinitions_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public flightAgents:Array<any>;
|
2018-12-19 13:40:46 +08:00
|
|
|
public flightAgents_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public flightTypes:Array<any>;
|
2018-12-15 10:30:38 +08:00
|
|
|
public flightTypes_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public flightStatus:Array<any>;
|
2018-11-21 18:55:57 +08:00
|
|
|
public flightStatus_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public checkin_group: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public checkin_group_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public gate: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public gate_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public terminal: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public terminal_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public chut: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public chut_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public stand: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public stand_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public standType: Array<any>;
|
2018-12-24 14:07:12 +08:00
|
|
|
public standType_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public carousel: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public carousel_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public checkin_desk: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public checkin_desk_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public airport: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public airport_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public city: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public city_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public aircraft_type: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public aircraft_type_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public aircraft: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public aircraft_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public terminal_area: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public terminal_area_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public airline: Array<any>;
|
2018-11-16 11:52:45 +08:00
|
|
|
public airline_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public country: Array<any>;
|
2018-12-07 13:37:33 +08:00
|
|
|
public country_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public aircraft_type_group: Array<any>;
|
2018-12-07 13:37:33 +08:00
|
|
|
public aircraft_type_group_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public airportgroup: Array<any>;
|
2018-12-07 13:37:33 +08:00
|
|
|
public airportgroup_subject = new Subject<any>();
|
2019-02-19 15:57:47 +08:00
|
|
|
public airlinegroup: Array<any>;
|
2018-12-07 13:37:33 +08:00
|
|
|
public airlinegroup_subject = new Subject<any>();
|
2018-11-16 11:52:45 +08:00
|
|
|
|
|
|
|
|
constructor(
|
2018-11-19 09:30:59 +08:00
|
|
|
private httpClient: HttpClientService
|
|
|
|
|
) { }
|
2018-11-16 11:52:45 +08:00
|
|
|
|
2018-11-19 09:30:59 +08:00
|
|
|
loadBasicData() {
|
2019-01-28 17:12:03 +08:00
|
|
|
let flightStatusDefinitionHttp = this.httpClient.get('/adminapi/basicdata/flmsFlightStatusDefinition');
|
2018-12-19 13:40:46 +08:00
|
|
|
let flightAgentsHttp = this.httpClient.get('/adminapi/basicdata/sysFlightAgents');
|
2018-12-15 10:30:38 +08:00
|
|
|
let flightTypesHttp = this.httpClient.get('/adminapi/basicdata/sysFlightTypes');
|
2018-11-21 18:55:57 +08:00
|
|
|
let flightStatusHttp = this.httpClient.get('/adminapi/basicdata/sysFlightStatus');
|
2018-11-19 09:30:59 +08:00
|
|
|
let checkinGroupHttp = this.httpClient.get('/adminapi/basicdata/checkinGroups');
|
|
|
|
|
let gateHttp = this.httpClient.get('/adminapi/basicdata/ormsGates');
|
|
|
|
|
let terminalHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminals');
|
|
|
|
|
let chutHttp = this.httpClient.get('/adminapi/basicdata/ormsChuts');
|
|
|
|
|
let standHttp = this.httpClient.get('/adminapi/basicdata/ormsStands');
|
2018-12-24 14:07:12 +08:00
|
|
|
let standTypeHttp = this.httpClient.get('/adminapi/basicdata/ormsStandTypes');
|
2018-11-19 09:30:59 +08:00
|
|
|
let carouselHttp = this.httpClient.get('/adminapi/basicdata/ormsCarousels');
|
|
|
|
|
let checkinDeskHttp = this.httpClient.get('/adminapi/basicdata/ormsCheckindesks');
|
|
|
|
|
let airportHttp = this.httpClient.get('/adminapi/basicdata/sysAirports');
|
|
|
|
|
let cityHttp = this.httpClient.get('/adminapi/basicdata/sysCitys');
|
|
|
|
|
let aircraftTypeHttp = this.httpClient.get('/adminapi/basicdata/sysAircrafttypes');
|
|
|
|
|
let aircraftHttp = this.httpClient.get('/adminapi/basicdata/sysAircrafts');
|
|
|
|
|
let terminalAreaHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminalareas');
|
|
|
|
|
let airlineHttp = this.httpClient.get('/adminapi/basicdata/sysAirlines');
|
2018-12-07 13:37:33 +08:00
|
|
|
let countryHttp = this.httpClient.get('/adminapi/basicdata/sysCountry');
|
|
|
|
|
let aircrafttypesGroupHttp = this.httpClient.get('/adminapi/basicdata/sysAircrafttypesGroup');
|
|
|
|
|
let airportGroupsHttp = this.httpClient.get('/adminapi/basicdata/sysAirportGroups');
|
|
|
|
|
let airlineGroupHttp = this.httpClient.get('/adminapi/basicdata/sysAirlineGroup');
|
2018-11-19 09:30:59 +08:00
|
|
|
zip(
|
2019-01-28 17:12:03 +08:00
|
|
|
flightStatusDefinitionHttp,
|
2018-12-19 13:40:46 +08:00
|
|
|
flightAgentsHttp,
|
2018-12-15 10:30:38 +08:00
|
|
|
flightTypesHttp,
|
2018-11-21 18:55:57 +08:00
|
|
|
flightStatusHttp,
|
2018-11-19 09:30:59 +08:00
|
|
|
checkinGroupHttp,
|
|
|
|
|
gateHttp,
|
|
|
|
|
terminalHttp,
|
|
|
|
|
chutHttp,
|
|
|
|
|
standHttp,
|
2018-12-24 14:07:12 +08:00
|
|
|
standTypeHttp,
|
2018-11-19 09:30:59 +08:00
|
|
|
carouselHttp,
|
|
|
|
|
checkinDeskHttp,
|
|
|
|
|
airportHttp,
|
|
|
|
|
cityHttp,
|
|
|
|
|
aircraftTypeHttp,
|
|
|
|
|
aircraftHttp,
|
|
|
|
|
terminalAreaHttp,
|
2018-12-07 13:37:33 +08:00
|
|
|
airlineHttp,
|
|
|
|
|
countryHttp,
|
|
|
|
|
aircrafttypesGroupHttp,
|
|
|
|
|
airportGroupsHttp,
|
|
|
|
|
airlineGroupHttp
|
2018-11-19 09:30:59 +08:00
|
|
|
).subscribe(
|
|
|
|
|
([
|
2019-01-28 17:12:03 +08:00
|
|
|
flightStatusDefinitionRes,
|
2018-12-19 13:40:46 +08:00
|
|
|
flightAgentsRes,
|
2018-12-15 10:30:38 +08:00
|
|
|
flightTypesRes,
|
2018-11-21 18:55:57 +08:00
|
|
|
flightStatusRes,
|
2018-11-19 09:30:59 +08:00
|
|
|
checkinGroupRes,
|
|
|
|
|
gateRes,
|
|
|
|
|
terminalRes,
|
|
|
|
|
chutRes,
|
|
|
|
|
standRes,
|
2018-12-24 14:07:12 +08:00
|
|
|
standTypesRes,
|
2018-11-19 09:30:59 +08:00
|
|
|
carouselRes,
|
|
|
|
|
checkinDeskRes,
|
|
|
|
|
airportRes,
|
|
|
|
|
cityRes,
|
|
|
|
|
aircraftTypeRes,
|
|
|
|
|
aircraftRes,
|
|
|
|
|
terminalAreaRes,
|
2018-12-07 13:37:33 +08:00
|
|
|
airlineRes,
|
|
|
|
|
countryRes,
|
|
|
|
|
aircraftTypeGroupRes,
|
|
|
|
|
airportGroupRes,
|
|
|
|
|
airlineGroupRes
|
2018-11-19 09:30:59 +08:00
|
|
|
]) => {
|
2019-01-28 17:12:03 +08:00
|
|
|
this.flightStatusDefinitions = flightStatusDefinitionRes.body;
|
|
|
|
|
this.flightStatusDefinitions_subject.next(flightStatusDefinitionRes.body);
|
2018-12-19 13:40:46 +08:00
|
|
|
this.flightAgents = flightAgentsRes.body;
|
|
|
|
|
this.flightAgents_subject.next(flightAgentsRes.body);
|
2018-12-15 10:30:38 +08:00
|
|
|
this.flightTypes = flightTypesRes.body;
|
|
|
|
|
this.flightTypes_subject.next(flightTypesRes.body)
|
2018-11-21 18:55:57 +08:00
|
|
|
this.flightStatus = flightStatusRes.body;
|
|
|
|
|
this.flightStatus_subject.next(flightStatusRes.body);
|
2018-11-19 09:30:59 +08:00
|
|
|
this.checkin_group = checkinGroupRes.body;
|
|
|
|
|
this.checkin_group_subject.next(checkinGroupRes.body);
|
|
|
|
|
this.gate = gateRes.body;
|
|
|
|
|
this.gate_subject.next(gateRes.body);
|
|
|
|
|
this.terminal = terminalRes.body;
|
2018-11-21 18:55:57 +08:00
|
|
|
this.terminal_subject.next(terminalRes.body);
|
2018-11-19 09:30:59 +08:00
|
|
|
this.chut = chutRes.body;
|
|
|
|
|
this.chut_subject.next(chutRes.body);
|
|
|
|
|
this.stand = standRes.body;
|
|
|
|
|
this.stand_subject.next(standRes.body);
|
2018-12-24 14:07:12 +08:00
|
|
|
this.standType = standTypesRes.body;
|
|
|
|
|
this.standType_subject.next(standTypesRes.body);
|
2018-11-19 09:30:59 +08:00
|
|
|
this.carousel = carouselRes.body;
|
|
|
|
|
this.carousel_subject.next(carouselRes.body);
|
|
|
|
|
this.checkin_desk = checkinDeskRes.body;
|
|
|
|
|
this.checkin_desk_subject.next(checkinDeskRes.body);
|
|
|
|
|
this.aircraft_type = aircraftTypeRes.body;
|
|
|
|
|
this.aircraft_type_subject.next(aircraftTypeRes.body);
|
|
|
|
|
this.aircraft = aircraftRes.body;
|
|
|
|
|
this.aircraft_subject.next(aircraftRes.body);
|
|
|
|
|
this.terminal_area = terminalAreaRes.body;
|
|
|
|
|
this.terminal_area_subject.next(terminalAreaRes.body);
|
|
|
|
|
this.airline = airlineRes.body;
|
|
|
|
|
this.airline_subject.next(airlineRes.body);
|
2018-11-21 18:55:57 +08:00
|
|
|
this.city = cityRes.body;
|
|
|
|
|
this.city_subject.next(cityRes.body);
|
|
|
|
|
this.airport = airportRes.body;
|
|
|
|
|
this.airport_subject.next(airportRes.body);
|
2018-12-07 13:37:33 +08:00
|
|
|
this.country = countryRes.body;
|
|
|
|
|
this.country_subject.next(countryRes.body);
|
|
|
|
|
this.aircraft_type_group = aircraftTypeGroupRes.body;
|
|
|
|
|
this.aircraft_type_group_subject.next(aircraftTypeGroupRes.body);
|
|
|
|
|
this.airportgroup = airportGroupRes.body;
|
|
|
|
|
this.airportgroup_subject.next(airportGroupRes.body);
|
|
|
|
|
this.airlinegroup = airlineGroupRes.body;
|
|
|
|
|
this.airlinegroup_subject.next(airlineGroupRes.body);
|
2018-11-16 11:52:45 +08:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|