增加航班实际时间事件处理
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright 2018 bejson.com
|
||||
*/
|
||||
package com.gzzn.omms.msgexchangeapi.entity.msg.flop.actt;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.META;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2018-12-05 20:16:56
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@JacksonXmlRootElement(localName="MSG")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ACTTMsg {
|
||||
|
||||
@JacksonXmlProperty(localName ="META")
|
||||
private META META;
|
||||
@JacksonXmlProperty(localName ="FLOP")
|
||||
private FLOP FLOP;
|
||||
public void setMETA(META META) {
|
||||
this.META = META;
|
||||
}
|
||||
public META getMETA() {
|
||||
return META;
|
||||
}
|
||||
|
||||
public void setFLOP(FLOP FLOP) {
|
||||
this.FLOP = FLOP;
|
||||
}
|
||||
public FLOP getFLOP() {
|
||||
return FLOP;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Copyright 2018 bejson.com
|
||||
*/
|
||||
package com.gzzn.omms.msgexchangeapi.entity.msg.flop.actt;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2018-12-05 20:16:56
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
public class FLOP {
|
||||
|
||||
@JacksonXmlProperty(localName ="FLID")
|
||||
private String FLID;
|
||||
@JacksonXmlProperty(localName ="FFID")
|
||||
private String FFID;
|
||||
@JacksonXmlProperty(localName ="ACTT")
|
||||
private String ACTT;
|
||||
|
||||
public void setFLID(String FLID) {
|
||||
this.FLID = FLID;
|
||||
}
|
||||
public String getFLID() {
|
||||
return FLID;
|
||||
}
|
||||
|
||||
public void setFFID(String FFID) {
|
||||
this.FFID = FFID;
|
||||
}
|
||||
public String getFFID() {
|
||||
return FFID;
|
||||
}
|
||||
|
||||
public void setACTT(String ACTT) {
|
||||
this.ACTT = ACTT;
|
||||
}
|
||||
public String getACTT() {
|
||||
return ACTT;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,12 +11,19 @@ import com.gzzn.omms.msgexchangeapi.service.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.service.flightInfo.IFlightInfoService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.SpringUtil;
|
||||
|
||||
/**
|
||||
* 航班机型事件
|
||||
* @author zhouxiunai
|
||||
*
|
||||
*/
|
||||
public class ACFTHandler implements IBaseHandler {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ACFTHandler.class);
|
||||
|
||||
/**
|
||||
* 处理航班消息,更新航班动态信息
|
||||
* @param msg 要处理的xml消息
|
||||
* @return 处理结果及影响的动态航班信息
|
||||
*/
|
||||
@Override
|
||||
public HandlerResult run(String msg) {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler.flop;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.flop.actt.ACTTMsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.schd.dnld.FLTR;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.HandlerResult;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.IBaseHandler;
|
||||
import com.gzzn.omms.msgexchangeapi.service.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.service.flightInfo.IFlightInfoService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.SpringUtil;
|
||||
|
||||
/**
|
||||
* 航班实际时间事件
|
||||
* @author zhouxiunai
|
||||
*
|
||||
*/
|
||||
public class ACTTHandler implements IBaseHandler{
|
||||
private static Logger logger = LoggerFactory.getLogger(ACTTHandler.class);
|
||||
|
||||
@Override
|
||||
public HandlerResult run(String msg) {
|
||||
IExchangeService exchangeService = (IExchangeService) SpringUtil.getBean("exchangeService");
|
||||
IFlightInfoService flightInfoService = (IFlightInfoService) SpringUtil.getBean("flightInfoService");
|
||||
|
||||
ACTTMsg acttMsg = exchangeService.xmlstrToObject(msg, ACTTMsg.class);
|
||||
FLTR fltr = flightInfoService.getByFlid(acttMsg.getFLOP().getFLID());
|
||||
if(null != fltr)
|
||||
{
|
||||
fltr.setACTT(acttMsg.getFLOP().getACTT());
|
||||
flightInfoService.saveFltr(fltr);
|
||||
return HandlerResult.success(fltr);
|
||||
}
|
||||
else {
|
||||
//没有该动态航班信息
|
||||
logger.warn("没有flid为:{}的消息",acttMsg.getFLOP().getFLID());
|
||||
}
|
||||
|
||||
return HandlerResult.failure();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user