消息联调登机门和值机柜台修改

This commit is contained in:
zhouyuejun
2019-02-21 17:49:24 +08:00
parent b0f94ada23
commit b0fb942139
4 changed files with 113 additions and 17 deletions
+2 -2
View File
@@ -132,7 +132,7 @@ export class MainComponent implements OnInit {
let data = JSON.parse(event as string);
if (data.topic === 'schd') {
let message = JSON.parse(data.message);
// console.log(message);
console.log(message);
//是否可以开始处理动态消息
if (this.canHandleDynamicMessage) {
this.dynamicMessageHandle(message);
@@ -141,7 +141,7 @@ export class MainComponent implements OnInit {
}
} else if (data.topic === 'msg') {
let message = JSON.parse(data.message);
// console.log(message);
console.log(message);
if (this.canHandleDynamicAlert) {
this.dynamicAlertHandle(message);
} else {
+4 -5
View File
@@ -68,9 +68,8 @@ export class AlertMessageHandle {
temp2 = reason;
}
alertText += "\n延误码:" + code;
// alertText += "\n延误码:" + code;
let fimsFlightstatusDefinition = null;
if (flightStatusDefinitions && flightStatusDefinitions.length > 0) {
@@ -153,8 +152,8 @@ export class AlertMessageHandle {
let ckdts = message.FLOP["CKDT"];
for (let i = 0; i < ckdts.length; i++) {
let chkc = ckdts[i]["CHKC"],
cotm = ckdts[i]["GOTM"],
cctm = ckdts[i]["GCTM"];
cotm = ckdts[i]["COTM"],
cctm = ckdts[i]["CCTM"];
if (chkc) {
ckdtCode += chkc + ":【值机打开:" + (!cotm ? "待定" : this.utils.dateFormatter(cotm)) + ";值机关闭:" + (!cctm ? "待定" : this.utils.dateFormatter(cctm)) + "】\n";
}
+52 -6
View File
@@ -58,16 +58,28 @@ export class TransferRenderHandle {
}
}
public gctmFormatter(flight) {
function add0(m) {
return m < 10 ? '0' + m : m
}
if (flight['GTDT']) {
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
let gtdt = flight['GTDT'];
let gctmArray = [];
gtdt.forEach(element => {
if (element['GCTM']) {
let gctmTime = new Date(this.utils.dateFormatter(element['GCTM'])).getTime();
gctmArray.push(gctmTime)
}
});
if (gctmArray.length > 0) {
let laterTime = Math.max.apply(null, gctmArray);
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
} else {
return '';
}
return this.utils.timeFormatter(flight['GTDT'][0]['GCTM']);
// return this.utils.timeFormatter(flight['GTDT'][0]['GCTM']);
} else if (Object.prototype.toString.call(flight['GTDT']) === '[object Object]') {
return this.utils.timeFormatter(flight['GTDT']['GCTM']);
} else {
@@ -183,9 +195,26 @@ export class TransferRenderHandle {
}
}
public cctmFormatter(flight) {
function add0(m) {
return m < 10 ? '0' + m : m
}
if (flight['CKDT']) {
if (Array.isArray(flight['CKDT']) && flight['CKDT'].length > 0) {
return this.utils.timeFormatter(flight['CKDT'][0]['CCTM']);
let ckdt = flight['CKDT'];
let cctmArray = [];
ckdt.forEach(element => {
if (element['CCTM']) {
let cctmTime = new Date(this.utils.dateFormatter(element['CCTM'])).getTime();
cctmArray.push(cctmTime)
}
});
if (cctmArray.length > 0) {
let laterTime = Math.max.apply(null, cctmArray);
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
} else {
return '';
}
} else if (Object.prototype.toString.call(flight['CKDT']) === '[object Object]') {
return this.utils.timeFormatter(flight['CKDT']['CCTM']);
} else {
@@ -196,11 +225,28 @@ export class TransferRenderHandle {
}
}
public cotmFormatter(flight) {
function add0(m) {
return m < 10 ? '0' + m : m
}
if (flight['CKDT']) {
if (Array.isArray(flight['CKDT']) && flight['CKDT'].length > 0) {
return this.utils.timeFormatter(flight['CKDT'][0]['COTM']);
let ckdt = flight['CKDT'];
let cotmArray = [];
ckdt.forEach(element => {
if (element['COTM']) {
let cctmTime = new Date(this.utils.dateFormatter(element['COTM'])).getTime();
cotmArray.push(cctmTime)
}
});
if (cotmArray.length > 0) {
let laterTime = Math.min.apply(null, cotmArray);
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
} else {
return '';
}
} else if (Object.prototype.toString.call(flight['CKDT']) === '[object Object]') {
return this.utils.timeFormatter(flight['CKDT']['COTM']);
return this.utils.timeFormatter(flight['CKDT']['CCTM']);
} else {
return '';
}
+55 -4
View File
@@ -234,9 +234,26 @@ onmessage = function (dynamicData) {
}
},
'GCTM': function gctmFormatter(flight) {
function add0(m) {
return m < 10 ? '0' + m : m
}
if (flight['GTDT']) {
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
return timeFormatter(flight['GTDT'][0]['GCTM']);
let gtdt = flight['GTDT'];
let gctmArray = [];
gtdt.forEach(element => {
if (element['GCTM']) {
let gctmTime = new Date(dateFormatter(element['GCTM'])).getTime();
gctmArray.push(gctmTime)
}
});
if (gctmArray.length > 0) {
let laterTime = Math.max.apply(null, gctmArray);
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
} else {
return '';
}
} else if (Object.prototype.toString.call(flight['GTDT']) === '[object Object]') {
return timeFormatter(flight['GTDT']['GCTM']);
} else {
@@ -352,9 +369,26 @@ onmessage = function (dynamicData) {
}
},
'CCTM': function cctmFormatter(flight) {
function add0(m) {
return m < 10 ? '0' + m : m
}
if (flight['CKDT']) {
if (Array.isArray(flight['CKDT']) && flight['CKDT'].length > 0) {
return timeFormatter(flight['CKDT'][0]['CCTM']);
let ckdt = flight['CKDT'];
let cctmArray = [];
ckdt.forEach(element => {
if (element['CCTM']) {
let cctmTime = new Date(dateFormatter(element['CCTM'])).getTime();
cctmArray.push(cctmTime)
}
});
if (cctmArray.length > 0) {
let laterTime = Math.max.apply(null, cctmArray);
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
} else {
return '';
}
} else if (Object.prototype.toString.call(flight['CKDT']) === '[object Object]') {
return timeFormatter(flight['CKDT']['CCTM']);
} else {
@@ -365,11 +399,28 @@ onmessage = function (dynamicData) {
}
},
'COTM': function cotmFormatter(flight) {
function add0(m) {
return m < 10 ? '0' + m : m
}
if (flight['CKDT']) {
if (Array.isArray(flight['CKDT']) && flight['CKDT'].length > 0) {
return timeFormatter(flight['CKDT'][0]['COTM']);
let ckdt = flight['CKDT'];
let cotmArray = [];
ckdt.forEach(element => {
if (element['COTM']) {
let cctmTime = new Date(dateFormatter(element['COTM'])).getTime();
cotmArray.push(cctmTime)
}
});
if (cotmArray.length > 0) {
let laterTime = Math.min.apply(null, cotmArray);
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
} else {
return '';
}
} else if (Object.prototype.toString.call(flight['CKDT']) === '[object Object]') {
return timeFormatter(flight['CKDT']['COTM']);
return timeFormatter(flight['CKDT']['CCTM']);
} else {
return '';
}