1.新增pro生产环境配置。

2.新增CMINMSGS和COUTMSGS 脚本
3.去除启动自动获取最新动态的功能。
4.完善测试以上功能。修改Sender为OSH5
This commit is contained in:
zhouxiunai
2018-12-29 17:30:43 +08:00
parent 440864110e
commit f799c64682
11 changed files with 443 additions and 264 deletions
@@ -1,7 +1,8 @@
package com.gzzn.omms.msgexchangeapi.runner;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -12,7 +13,6 @@ import org.springframework.stereotype.Component;
import com.gzzn.omms.msgexchangeapi.redis.RedisKeyConstant;
import com.gzzn.omms.msgexchangeapi.redis.RedisService;
import com.gzzn.omms.msgexchangeapi.service.ICmoutmsgService;
@Component
public class AppRunner implements CommandLineRunner {
@@ -22,28 +22,26 @@ public class AppRunner implements CommandLineRunner {
@Autowired
RedisService redisService;
@Autowired
private ICmoutmsgService cmoutmsgService;
@Value("${msgExchange.waitDateLeftOffset}")
private Long waitDateLeftOffset;
@Value("${msgExchange.intervalSeconds}")
private Long intervalSeconds;
@Override
public void run(String... args) throws Exception {
logger.info("发送获取动态航班日计划的消息");
Date nowDate = new Date();
Date waitDate = new Date(nowDate.getTime() - waitDateLeftOffset);//往后偏移指定时钟,避免因不同应用系统时钟相差过大导致的问题。
cmoutmsgService.sendSchdGetMsg(null,null);//发送获取当天日计划的申请
logger.info("app runner start");
//
redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态
redisService.set(RedisKeyConstant.KEY_WAITSCHDDATE,waitDate); //初始化消息进度
logger.info("发送获取动态航班日计划的消息完成");
Executors.newFixedThreadPool(1).execute(new SchdWaitRunner());
redisService.set(RedisKeyConstant.KEY_LASTBEGINID,0L);
//启动消息采集线程
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
scheduledExecutorService.scheduleAtFixedRate(new MsgExchangeRunner(), 0, intervalSeconds , TimeUnit.SECONDS);
logger.info("app runner end");
}//end function run
}