提取发送获取日航班计划消息的代码
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.gzzn.omms.msgexchangeapi.runner;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -9,14 +8,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.dao.CmoutmsgDao;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.Cmoutmsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.rqfd.RefdMsg;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.rqfd.RefdMsgBody;
|
||||
import com.gzzn.omms.msgexchangeapi.redis.RedisKeyConstant;
|
||||
import com.gzzn.omms.msgexchangeapi.redis.RedisService;
|
||||
import com.gzzn.omms.msgexchangeapi.service.IExchangeService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.DateTimeUtil;
|
||||
import com.gzzn.omms.msgexchangeapi.service.ICmoutmsgService;
|
||||
|
||||
@Component
|
||||
public class AppRunner implements CommandLineRunner {
|
||||
@@ -26,35 +20,18 @@ public class AppRunner implements CommandLineRunner {
|
||||
@Autowired
|
||||
RedisService redisService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private CmoutmsgDao cmoutmsgDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IExchangeService exchangeService;
|
||||
private ICmoutmsgService cmoutmsgService;
|
||||
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
|
||||
logger.info("发送获取动态航班日计划的消息");
|
||||
|
||||
//构造消息
|
||||
Date nowDate = new Date();
|
||||
Cmoutmsg cmoutmsg = new Cmoutmsg();
|
||||
RefdMsgBody body = new RefdMsgBody();
|
||||
body.setStdb(
|
||||
DateTimeUtil.gtFormatStr(
|
||||
nowDate,
|
||||
"ddMMMyyHHmm",
|
||||
Locale.ENGLISH)
|
||||
.toUpperCase()
|
||||
);
|
||||
RefdMsg msg = new RefdMsg();
|
||||
msg.setRefd(body);
|
||||
cmoutmsg.setCminmsgsClobMsg(exchangeService.objectToXmlstr(msg));
|
||||
cmoutmsg.setCminmsgsStatus("VALID");
|
||||
|
||||
cmoutmsgDao.save(cmoutmsg);
|
||||
Date nowDate = new Date();
|
||||
cmoutmsgService.sendSchdGetMsg(nowDate);
|
||||
|
||||
//
|
||||
redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态
|
||||
|
||||
Reference in New Issue
Block a user