消息警示添加内容及航班列表优化
This commit is contained in:
@@ -1,89 +1,159 @@
|
||||
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':'',
|
||||
}
|
||||
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(){
|
||||
return '航班取消事件'
|
||||
public flopCncl(message, airports) {
|
||||
return message.FLOP.FFID + '航班取消';
|
||||
}
|
||||
public flopFret(){
|
||||
return '航班返航事件'
|
||||
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;
|
||||
} else {
|
||||
return message.FLOP.FFID + '航班从空中或地面返回,返回原因:' + message.FLOP.FRET.content || message.FLOP.FRET.VALUE;
|
||||
}
|
||||
}
|
||||
public flopFdiv(){
|
||||
return '航班备降事件'
|
||||
public flopFdiv(message, airports) {
|
||||
let airportName = '';
|
||||
let index = airports.findIndex(airport => airport.airportCodeIata === message.FLOP.FDIV.DDES);
|
||||
if (index > -1) {
|
||||
airportName = airports[index].airportNameChn;
|
||||
}
|
||||
if (message.FLOP.FDIV.DDIR === 'FROM') {
|
||||
return message.FLOP.FFID + '航班备降自' + airportName + ',备降原因:' + message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE;
|
||||
} else if (message.FLOP.FDIV.DDIR === 'TO') {
|
||||
return message.FLOP.FFID + '航班备降到' + airportName + ',备降原因:' + message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE;
|
||||
} else {
|
||||
return message.FLOP.FFID + '航班备降,备降原因:' + message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE;
|
||||
}
|
||||
}
|
||||
public flopFdel(){
|
||||
return '航班删除事件'
|
||||
public flopFdel(message, airports) {
|
||||
return message.FLOP.FFID + '航班被删除了'
|
||||
}
|
||||
public flopDely(){
|
||||
return '航班延误事件'
|
||||
public flopDely(message, airports) {
|
||||
return message.FLOP.FFID + '航班延误' + message.FLOP.DELY.DURA + '分钟;延误码:' + message.FLOP.DELY.CODE + ';延误信息:' + message.FLOP.DELY.content || message.FLOP.DELY.VALUE
|
||||
}
|
||||
public flopActt(){
|
||||
return '航班实际时间事件'
|
||||
public flopActt(message, airports) {
|
||||
return message.FLOP.FFID + '航班实际时间:' + dateFormatter(message.FLOP.ACTT);
|
||||
}
|
||||
public flopGtdt(){
|
||||
return '航班登机门事件'
|
||||
public flopGtdt(message, airports) {
|
||||
return message.FLOP.FFID + '登机门分配为:' + message.FLOP.GTDT.GATE
|
||||
}
|
||||
public flopPsdt(){
|
||||
return '航班机位变更事件'
|
||||
public flopPsdt(message, airports) {
|
||||
if (Array.isArray(message.FLOP['PSDT']) && message.FLOP['PSDT'].length > 0) {
|
||||
let psst = [];
|
||||
for (let i = 0; i < message.FLOP['PSDT'].length; i++) {
|
||||
psst.push(message.FLOP['PSDT'][i]['PSST']);
|
||||
}
|
||||
let set = new Set(psst);
|
||||
return message.FLOP.FFID + '计划机位变更为:' + Array.from(set).join(',');
|
||||
} else if (Object.prototype.toString.call(message.FLOP['PSDT']) === '[object Object]') {
|
||||
return message.FLOP.FFID + '计划机位变更为:' + message.FLOP['PSDT']['PSST'];
|
||||
} else {
|
||||
return message.FLOP.FFID + '计划机位变更为:';
|
||||
}
|
||||
}
|
||||
public flopEstt(){
|
||||
return '航班预计时间事件'
|
||||
public flopEstt(message, airports) {
|
||||
return message.FLOP.FFID + '预计时间变更为' + dateFormatter(message.FLOP.ESTT);
|
||||
}
|
||||
public flopPadt(){
|
||||
return '航班站起飞时间事件'
|
||||
public flopPadt(message, airports) {
|
||||
return message.FLOP.FFID + '航班前站实际起飞时间:' + dateFormatter(message.FLOP.PADT);
|
||||
}
|
||||
public flopCkdt(){
|
||||
return '航班值机柜台事件'
|
||||
public flopCkdt(message, airports) {
|
||||
if (Array.isArray(message.FLOP['CKDT']) && message.FLOP['CKDT'].length > 0) {
|
||||
let chkc = [];
|
||||
for (let i = 0; i < message.FLOP['CKDT'].length; i++) {
|
||||
chkc.push(message.FLOP['CKDT'][i]['CHKC']);
|
||||
}
|
||||
let set = new Set(chkc);
|
||||
return message.FLOP.FFID + '航班值机柜台分配为:' + Array.from(set).join(',');
|
||||
} else if (Object.prototype.toString.call(message.FLOP['CKDT']) === '[object Object]') {
|
||||
return message.FLOP.FFID + '航班值机柜台分配为:' + message.FLOP['CKDT']['CHKC'];
|
||||
} else {
|
||||
return message.FLOP.FFID + '航班值机柜台分配为:';
|
||||
}
|
||||
}
|
||||
public flopBotm(){
|
||||
return '航班登机开始事件'
|
||||
public flopBotm(message, airports) {
|
||||
return message.FLOP.FFID + '登机开始时间:' + dateFormatter(message.FLOP.BOTM);
|
||||
}
|
||||
public flopCldt(){
|
||||
return '航班行李转盘事件'
|
||||
public flopCldt(message, airports) {
|
||||
if (Array.isArray(message.FLOP['CLDT']) && message.FLOP['CLDT'].length > 0) {
|
||||
let belt = [];
|
||||
for (let i = 0; i < message.FLOP['CLDT'].length; i++) {
|
||||
belt.push(message.FLOP['CLDT'][i]['BELT']);
|
||||
}
|
||||
let set = new Set(belt);
|
||||
return message.FLOP.FFID + '行李转盘分配为:' + Array.from(set).join(',');
|
||||
} else if (Object.prototype.toString.call(message.FLOP['CLDT']) === '[object Object]') {
|
||||
return message.FLOP.FFID + '行李转盘分配为:' + message.FLOP['CLDT']['BELT'];
|
||||
} else {
|
||||
return message.FLOP.FFID + '行李转盘分配为:';
|
||||
}
|
||||
}
|
||||
public flopRout(){
|
||||
return '航班航线事件'
|
||||
public flopRout(message, airports, citys) {
|
||||
let mvin = message.FLOP.FFID.split('-')[2];
|
||||
let rout = [];
|
||||
|
||||
if (Array.isArray(message.FLOP['ROUT']) && message.FLOP['ROUT'] > 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);
|
||||
}
|
||||
} 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 (mvin === 'A') {
|
||||
rout.push('成都');
|
||||
} else if (mvin === 'D') {
|
||||
rout.unshift('成都');
|
||||
}
|
||||
return message.FLOP.FFID + '航线更改为:' + rout.join(' - ');
|
||||
}
|
||||
public flopVipp(){
|
||||
return '航班VIP事件'
|
||||
public flopVipp(message, airports, citys) {
|
||||
return message.FLOP.FFID + 'VIP旅客:' + message.FLOP.VIPP + '人';
|
||||
}
|
||||
public flopHnag(){
|
||||
public flopHnag() {
|
||||
return '航班代理事件'
|
||||
}
|
||||
public flopFlbg(){
|
||||
return '航班首末件行李到达事件'
|
||||
public flopFlbg(message,airports,citys) {
|
||||
return message.FLOP.FFID + '首末件行李到达时间消息';
|
||||
}
|
||||
public flopReno(){
|
||||
return '航班飞机号变更事件'
|
||||
public flopReno(message,airports,citys) {
|
||||
return message.FLOP.FFID + '更换飞机号:' + message.FLOP.RENO;
|
||||
}
|
||||
public flopAbtm(){
|
||||
return '航班靠桥撤桥事件'
|
||||
public flopAbtm(message,airports,citys) {
|
||||
return message.FLOP.FFID + '靠桥撤桥消息';
|
||||
}
|
||||
public flopChdt(){
|
||||
return '航班上下轮档事件'
|
||||
public flopChdt(message,airports,citys) {
|
||||
return message.FLOP.FFID + '上下轮档消息';
|
||||
}
|
||||
public flopTrml(){
|
||||
return '航班航站楼事件'
|
||||
public flopTrml(message,airports,citys) {
|
||||
return message.FLOP.FFID + '航站楼:' + message.FLOP.TRML;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user