调整航班日计划获取

This commit is contained in:
zhouxiunai
2018-12-19 13:47:05 +08:00
parent 3070e8c551
commit 653c1c554a
3 changed files with 24 additions and 11 deletions
@@ -32,7 +32,7 @@ public class AppRunner implements CommandLineRunner {
Date nowDate = new Date();
cmoutmsgService.sendSchdGetMsg(nowDate);
cmoutmsgService.sendSchdGetMsg(null,null);//发送获取当天日计划的申请
//
redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态
@@ -26,7 +26,7 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
@Autowired
private CmoutmsgDao cmoutmsgDao;
public Boolean sendSchdGetMsg(Date date)
public Boolean sendSchdGetMsg(Date startDate,Date endDate)
{
//构造消息
MSG rqfdMsg = new MSGBuilder().
@@ -40,13 +40,15 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
.build();
RQFD rqfd = new RQFD();
rqfd.setSTDB(
DateTimeUtil.gtFormatStr(
date,
"ddMMMyyHHmm",
Locale.ENGLISH)
.toUpperCase()
);
if(null != startDate)
{
rqfd.setSTDB(getDateStr(startDate));
}
if(null != endDate)
{
rqfd.setSTDE(getDateStr(endDate));
}
rqfdMsg.setRQFD(rqfd);
//发送消息到数据库
@@ -59,4 +61,13 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
return rtCmoutmsg != null;
}
private String getDateStr(Date date)
{
return DateTimeUtil.gtFormatStr(
date,
"ddMMMyyHHmm",
Locale.ENGLISH)
.toUpperCase();
}//end function
}
@@ -11,8 +11,10 @@ public interface ICmoutmsgService {
/**
* 向Cmoutmsgs发送日航班计划获取消息
* @param date 发送获取指定时间后的日航班计划
* 参数均为null 时,代表当天
* @param startDate 开始日期时间 ,航班计划到达,航班计划离港
* @param endDate 结束日期时间,航班计划到达,航班计划离港
* @return 成功或失败
*/
public Boolean sendSchdGetMsg(Date date);
public Boolean sendSchdGetMsg(Date startDate,Date endDate);
}