航班返航及撤销返航消息处理

This commit is contained in:
zhouyuejun
2019-01-24 10:22:06 +08:00
parent 9acf53cfc6
commit 63741d8ae8
4 changed files with 28 additions and 43 deletions
+6 -31
View File
@@ -1,29 +1,5 @@
import dateFormatter from './date-formatter';
export class AlertMessageHandle {
// public alertMessage = {
// 'FLOP-CNCL':'',
// 'FLOP-FRET':'',
// 'FLOP-FDIV':'',
// 'FLOP-FDEL':'',
// 'FLOP-DELY':'',
// 'FLOP-ACTT':'',
// 'FLOP-GTDT':'',
// 'FLOP-PSDT':'',
// 'FLOP-ESTT':'',
// 'FLOP-PADT':'',
// 'FLOP-CKDT':'',
// 'FLOP-BOTM':'',
// 'FLOP-CLDT':'',
// 'FLOP-ROUT':'',
// 'FLOP-VIPP':'',
// 'FLOP-HNAG':'',
// 'FLOP-FLBG':'',
// 'FLOP-RENO':'',
// 'FLOP-ABTM':'',
// 'FLOP-CHOT':'',
// 'FLOP-TRML':'',
// }
public flopCncl(message, airports) {
if (message.FLOP.CNCL) {
return message.FLOP.FFID + '航班取消';
@@ -32,12 +8,11 @@ export class AlertMessageHandle {
}
}
public flopFret(message, airports) {
if (message.FLOP.FRET.REID === 'G') {
return message.FLOP.FFID + '航班从地面返回,返回原因:' + (message.FLOP.FRET.content || message.FLOP.FRET.VALUE);
} else if (message.FLOP.FRET.REID === 'A') {
return message.FLOP.FFID + '航班从空中返回,返回原因:' + (message.FLOP.FRET.content || message.FLOP.FRET.VALUE);
let returnData = message.FLOP.FRET
if (returnData && returnData.REID && returnData.VALUE) {
return message.FLOP.FFID + "航班从" + ((returnData.REID === "A") ? "空中返回" : "地面返回") + " \n\n返回原因:" + returnData.VALUE;
} else {
return message.FLOP.FFID + '航班从空中或地面返回,返回原因:' + (message.FLOP.FRET.content || message.FLOP.FRET.VALUE);
return message.FLOP.FFID + "航班返航撤销";
}
}
public flopFdiv(message, airports) {
@@ -137,7 +112,7 @@ export class AlertMessageHandle {
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']);
if(airportIndex>-1){
if (airportIndex > -1) {
if (airports[airportIndex].briefNameChn) {
rout.push(airports[airportIndex].briefNameChn);
} else {
@@ -147,7 +122,7 @@ export class AlertMessageHandle {
}
} else if (Object.prototype.toString.call(message.FLOP['ROUT']) === '[object Object]') {
let airportIndex = airports.findIndex(val => val.airportCodeIata === message.FLOP['ROUT']['APCD']);
if(airportIndex>-1){
if (airportIndex > -1) {
if (airports[airportIndex].briefNameChn) {
rout.push(airports[airportIndex].briefNameChn);
} else {