航线变更通知内容修改
This commit is contained in:
@@ -134,21 +134,31 @@ export class AlertMessageHandle {
|
||||
let mvin = message.FLOP.FFID.split('-')[2];
|
||||
let rout = [];
|
||||
|
||||
if (Array.isArray(message.FLOP['ROUT']) && message.FLOP['ROUT'] > 0) {
|
||||
if (Array.isArray(message.FLOP['ROUT']) && message.FLOP['ROUT'].length > 0) {
|
||||
for (let i = 0; i < message.FLOP['ROUT'].length; i++) {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === message.FLOP['ROUT'][i]['APCD']);
|
||||
let cityIndex = citys.findIndex(val => airports[airportIndex].cityId === val.cityId);
|
||||
rout.push(citys[cityIndex].cityNameChn);
|
||||
if(airportIndex>-1){
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
rout.push(airports[airportIndex].briefNameChn);
|
||||
} else {
|
||||
rout.push(airports[airportIndex].airportNameChn);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (Object.prototype.toString.call(message.FLOP['ROUT']) === '[object Object]') {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === message.FLOP['ROUT']['APCD']);
|
||||
let cityIndex = citys.findIndex(val => airports[airportIndex].cityId === val.cityId);
|
||||
rout.push(citys[cityIndex].cityNameChn);
|
||||
if(airportIndex>-1){
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
rout.push(airports[airportIndex].briefNameChn);
|
||||
} else {
|
||||
rout.push(airports[airportIndex].airportNameChn);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mvin === 'A') {
|
||||
rout.push('成都');
|
||||
rout.push('蓉');
|
||||
} else if (mvin === 'D') {
|
||||
rout.unshift('成都');
|
||||
rout.unshift('蓉');
|
||||
}
|
||||
return message.FLOP.FFID + '航线更改为:' + rout.join(' - ');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user