修改psdt增加原值机位信息记录。 修改dnld发送消息到msg
This commit is contained in:
@@ -421,6 +421,10 @@ public class SCHD
|
||||
@JsonProperty("PSDT")
|
||||
protected List<STANDDATA> psdt;//航班计划机位数据 plan stand data
|
||||
|
||||
@XmlElement(name = "LPSDT")
|
||||
@JsonProperty("LPSDT")
|
||||
protected String lpsdt;//上次航班机位数据,机位逗号分隔
|
||||
|
||||
@XmlElement(name = "CKDT")
|
||||
@JsonProperty("CKDT")
|
||||
protected List<DESKDATA> ckdt;// check in counter data 值机位数据
|
||||
@@ -2034,6 +2038,14 @@ public class SCHD
|
||||
this.naat = value;
|
||||
}
|
||||
|
||||
public String getLpsdt() {
|
||||
return lpsdt;
|
||||
}
|
||||
|
||||
public void setLpsdt(String lpsdt) {
|
||||
this.lpsdt = lpsdt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,19 @@ public class PSDTHandler extends FlopBaseHandler {
|
||||
@Override
|
||||
protected SCHD.FLTR updateFltr(FLOP flop,SCHD.FLTR fltr)
|
||||
{
|
||||
//先保存当前航班机位数据
|
||||
String lpsdt="";
|
||||
for(STANDDATA node : fltr.getPSDT())
|
||||
{
|
||||
lpsdt += node.getPSST();
|
||||
lpsdt += ",";
|
||||
}
|
||||
if(lpsdt.endsWith(","))
|
||||
{
|
||||
lpsdt = lpsdt.substring(0, lpsdt.length() - 1);
|
||||
}
|
||||
fltr.setLpsdt(lpsdt);
|
||||
|
||||
fltr.getPSDT().clear(); //清空旧数据
|
||||
for(OPTSTANDDATA optStandata : flop.getPSDT() )
|
||||
{
|
||||
|
||||
+8
-2
@@ -57,8 +57,14 @@ public class SchdBaseHandler implements IBaseHandler{
|
||||
int recs = dnldMsg.getSCHD().getRECS();
|
||||
logger.info("发送日计划到kafka,条数:{}",recs);
|
||||
|
||||
ResponseDto<Integer> resDto = ResponseDto.success(recs);
|
||||
kafkaservice.msgSend("dschd", JsonUtil.getString(resDto));
|
||||
|
||||
//去除body部分
|
||||
MSG dnldMsgCopy = new MSG();
|
||||
dnldMsgCopy.setMETA(dnldMsg.getMETA());
|
||||
dnldMsgCopy.setSCHD(null);
|
||||
|
||||
String msg = exchangeService.msgToJson(dnldMsgCopy);
|
||||
kafkaservice.msgSend("msg", msg);
|
||||
|
||||
logger.info("发送日计划到kafka完毕");
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler;
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler.flop;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -9,6 +9,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import com.gzzn.omms.msgexchangeapi.dao.CminmsgDao;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.Cminmsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.CminmsgWapper;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.HandlerResult;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.flop.ABTMHandler;
|
||||
import com.gzzn.omms.msgexchangeapi.service.exchange.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.JsonUtil;
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler;
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler.flop;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -9,6 +9,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import com.gzzn.omms.msgexchangeapi.dao.CminmsgDao;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.Cminmsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.CminmsgWapper;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.HandlerResult;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.flop.CHOTHandler;
|
||||
import com.gzzn.omms.msgexchangeapi.service.exchange.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.JsonUtil;
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler;
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler.flop;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -9,6 +9,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import com.gzzn.omms.msgexchangeapi.dao.CminmsgDao;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.Cminmsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.CminmsgWapper;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.HandlerResult;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.flop.LACLHandler;
|
||||
import com.gzzn.omms.msgexchangeapi.service.exchange.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.JsonUtil;
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler.flop;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.dao.CminmsgDao;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.Cminmsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.CminmsgWapper;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.HandlerResult;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.flop.PSDTHandler;
|
||||
import com.gzzn.omms.msgexchangeapi.service.exchange.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.JsonUtil;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class PSDTHandlerTest {
|
||||
|
||||
@Autowired
|
||||
private CminmsgDao cminmsgDao;
|
||||
|
||||
@Autowired
|
||||
private IExchangeService exchangeService;
|
||||
|
||||
@Test
|
||||
public void testRun()
|
||||
{
|
||||
Cminmsg cminmsg = cminmsgDao.findOne(33L);
|
||||
CminmsgWapper cminmsgWapper = new CminmsgWapper(cminmsg);
|
||||
cminmsgWapper.setMsg(exchangeService.xmlToMsg(cminmsg.getCminmsgsClobMsg()));
|
||||
|
||||
PSDTHandler psdthandler = new PSDTHandler();
|
||||
HandlerResult result = psdthandler.run(cminmsgWapper);
|
||||
|
||||
System.out.println(JsonUtil.getString(result));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.gzzn.omms.msgexchangeapi.msghandler.schd;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.dao.CminmsgDao;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.Cminmsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.CminmsgWapper;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.HandlerResult;
|
||||
import com.gzzn.omms.msgexchangeapi.msghandler.flop.LACLHandler;
|
||||
import com.gzzn.omms.msgexchangeapi.service.exchange.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.JsonUtil;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class DNLDHandlerTest {
|
||||
|
||||
@Autowired
|
||||
private CminmsgDao cminmsgDao;
|
||||
|
||||
@Autowired
|
||||
private IExchangeService exchangeService;
|
||||
|
||||
@Test
|
||||
public void testRun()
|
||||
{
|
||||
Cminmsg cminmsg = cminmsgDao.findOne(82463L);
|
||||
CminmsgWapper cminmsgWapper = new CminmsgWapper(cminmsg);
|
||||
cminmsgWapper.setMsg(exchangeService.xmlToMsg(cminmsg.getCminmsgsClobMsg()));
|
||||
|
||||
DNLDHandler dnldhandler = new DNLDHandler();
|
||||
HandlerResult result = dnldhandler.run(cminmsgWapper);
|
||||
|
||||
System.out.println(JsonUtil.getString(result));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user