提交可正常处理acft消息的代码
This commit is contained in:
@@ -3,14 +3,19 @@ package com.gzzn.omms.msgexchangeapi.msghandler;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.Msg;
|
||||
import com.gzzn.omms.msgexchangeapi.service.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.JsonUtil;
|
||||
|
||||
@Service
|
||||
public class MsgHandlerDispatcher {
|
||||
private Logger logger = LoggerFactory.getLogger(MsgHandlerDispatcher.class);
|
||||
|
||||
@Autowired
|
||||
IExchangeService exchangeService;
|
||||
|
||||
@@ -34,7 +39,9 @@ public class MsgHandlerDispatcher {
|
||||
| SecurityException
|
||||
| IllegalArgumentException
|
||||
| InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
//throw new RuntimeException(e);
|
||||
logger.error("消息处理失败:{}",e.getMessage());
|
||||
return HandlerResult.failure();
|
||||
}
|
||||
}//end function
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.gzzn.omms.msgexchangeapi.msghandler.flop;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.flop.acft.ACFTMsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.schd.dnld.FLTR;
|
||||
@@ -10,22 +9,20 @@ 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 ACFTHandler implements IBaseHandler {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ACFTHandler.class);
|
||||
|
||||
@Autowired
|
||||
IExchangeService exchangeService;
|
||||
|
||||
@Autowired
|
||||
IFlightInfoService flightInfoService;
|
||||
|
||||
/**
|
||||
* 处理航班消息,更新航班动态信息
|
||||
*/
|
||||
@Override
|
||||
public HandlerResult run(String msg) {
|
||||
IExchangeService exchangeService = (IExchangeService) SpringUtil.getBean("exchangeService");
|
||||
IFlightInfoService flightInfoService = (IFlightInfoService) SpringUtil.getBean("flightInfoService");
|
||||
|
||||
ACFTMsg acftMsg = exchangeService.xmlstrToObject(msg, ACFTMsg.class);
|
||||
FLTR fltr = flightInfoService.getByFlid(acftMsg.getFLOP().getFLID());
|
||||
if(null != fltr)
|
||||
|
||||
Reference in New Issue
Block a user