调整航班日计划获取

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(); Date nowDate = new Date();
cmoutmsgService.sendSchdGetMsg(nowDate); cmoutmsgService.sendSchdGetMsg(null,null);//发送获取当天日计划的申请
// //
redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态 redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态
@@ -26,7 +26,7 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
@Autowired @Autowired
private CmoutmsgDao cmoutmsgDao; private CmoutmsgDao cmoutmsgDao;
public Boolean sendSchdGetMsg(Date date) public Boolean sendSchdGetMsg(Date startDate,Date endDate)
{ {
//构造消息 //构造消息
MSG rqfdMsg = new MSGBuilder(). MSG rqfdMsg = new MSGBuilder().
@@ -40,13 +40,15 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
.build(); .build();
RQFD rqfd = new RQFD(); RQFD rqfd = new RQFD();
rqfd.setSTDB( if(null != startDate)
DateTimeUtil.gtFormatStr( {
date, rqfd.setSTDB(getDateStr(startDate));
"ddMMMyyHHmm", }
Locale.ENGLISH) if(null != endDate)
.toUpperCase() {
); rqfd.setSTDE(getDateStr(endDate));
}
rqfdMsg.setRQFD(rqfd); rqfdMsg.setRQFD(rqfd);
//发送消息到数据库 //发送消息到数据库
@@ -59,4 +61,13 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
return rtCmoutmsg != null; 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发送日航班计划获取消息 * 向Cmoutmsgs发送日航班计划获取消息
* @param date 发送获取指定时间后的日航班计划 * 参数均为null 时,代表当天
* @param startDate 开始日期时间 ,航班计划到达,航班计划离港
* @param endDate 结束日期时间,航班计划到达,航班计划离港
* @return 成功或失败 * @return 成功或失败
*/ */
public Boolean sendSchdGetMsg(Date date); public Boolean sendSchdGetMsg(Date startDate,Date endDate);
} }