增加BDPB事件处理代码

This commit is contained in:
zhouxiunai
2018-12-05 20:42:21 +08:00
parent f967ff6f6e
commit fae5a87d1d
3 changed files with 122 additions and 0 deletions
@@ -0,0 +1,38 @@
package com.gzzn.omms.msgexchangeapi.msghandler.flop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.gzzn.omms.msgexchangeapi.entity.msg.flop.bdpb.BDPBMsg;
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;
public class BDPBHandler implements IBaseHandler {
private static Logger logger = LoggerFactory.getLogger(ACFTHandler.class);
@Override
public HandlerResult run(String msg) {
IExchangeService exchangeService = (IExchangeService) SpringUtil.getBean("exchangeService");
IFlightInfoService flightInfoService = (IFlightInfoService) SpringUtil.getBean("flightInfoService");
BDPBMsg bdpbMsg = exchangeService.xmlstrToObject(msg, BDPBMsg.class);
FLTR fltr = flightInfoService.getByFlid(bdpbMsg.getFLOP().getFLID());
if(null != fltr)
{
//TO: 文档未描述该事件是什么
//fltr.setBOTM(bdpbMsg.getFLOP().getBDPB());
//flightInfoService.saveFltr(fltr);
return HandlerResult.success(fltr);
}
else {
//没有该动态航班信息
logger.warn("没有flid为:{}的消息",bdpbMsg.getFLOP().getFLID());
}
return HandlerResult.failure();
} //end method
}