优化航班历史转换代码
This commit is contained in:
@@ -84,7 +84,7 @@ public class FlightHisScheduled {
|
||||
.must(QueryBuilders.termQuery("SODT",SODT))
|
||||
.must(QueryBuilders.termQuery("FLID",FLID));
|
||||
List<Map<String, Object>> listInEs = ElasticsearchUtil.searchListData(INDEX_NAME, ES_TYPE, boolQuery, null, "FLID", null, null, null);
|
||||
if(null!=listInEs && listInEs.size()>0){
|
||||
if(!CollectionUtils.isEmpty(listInEs)){
|
||||
//获取es中的id 并更新当前历史数据
|
||||
//唯一 获取第一个
|
||||
Map<String, Object> map = listInEs.get(0);
|
||||
@@ -99,7 +99,7 @@ public class FlightHisScheduled {
|
||||
}
|
||||
|
||||
//删除redis中已成为历史数据的动态消息
|
||||
if(null!=fltrIdForHistory && fltrIdForHistory.size()>0){
|
||||
if(!CollectionUtils.isEmpty(fltrIdForHistory)){
|
||||
flightInfoService.batchDeleteFltr(fltrIdForHistory);
|
||||
logger.info("本次删除转历史动态航班数据:{}条",fltrIdForHistory.size());
|
||||
}
|
||||
|
||||
+5
-5
@@ -102,7 +102,7 @@ public class FlightHisServiceImpl {
|
||||
* @param fltr 动态航班信息
|
||||
* @return
|
||||
*/
|
||||
private boolean isSODTMatch(FLTR fltr)
|
||||
public boolean isSODTMatch(FLTR fltr)
|
||||
{
|
||||
String SODT = fltr.getSODT(); //航班计划时间 ddMMMyyHHmm
|
||||
Long SODT_long = DateTimeUtil.toDate(SODT, "ddMMMyyHHmm",Locale.ENGLISH).getTime();
|
||||
@@ -120,7 +120,7 @@ public class FlightHisServiceImpl {
|
||||
* @param fltr
|
||||
* @return
|
||||
*/
|
||||
private boolean isCNCLMatch(FLTR fltr)
|
||||
public boolean isCNCLMatch(FLTR fltr)
|
||||
{
|
||||
/**===================2.航班取消===================**/
|
||||
String CNCL = fltr.getCNCL(); //航班取消时间 ddMMMyyHHmm
|
||||
@@ -140,7 +140,7 @@ public class FlightHisServiceImpl {
|
||||
* @param fltr
|
||||
* @return
|
||||
*/
|
||||
private boolean isFDIVMatch(FLTR fltr)
|
||||
public boolean isFDIVMatch(FLTR fltr)
|
||||
{
|
||||
String SODT = fltr.getSODT(); //航班计划时间 ddMMMyyHHmm
|
||||
Long SODT_long = DateTimeUtil.toDate(SODT, "ddMMMyyHHmm",Locale.ENGLISH).getTime();
|
||||
@@ -163,7 +163,7 @@ public class FlightHisServiceImpl {
|
||||
* @param fltr
|
||||
* @return
|
||||
*/
|
||||
private boolean isDMatch(FLTR fltr)
|
||||
public boolean isDMatch(FLTR fltr)
|
||||
{
|
||||
String SODT = fltr.getSODT(); //航班计划时间 ddMMMyyHHmm
|
||||
Long SODT_long = DateTimeUtil.toDate(SODT, "ddMMMyyHHmm",Locale.ENGLISH).getTime();
|
||||
@@ -190,7 +190,7 @@ public class FlightHisServiceImpl {
|
||||
* @param fltr
|
||||
* @return
|
||||
*/
|
||||
private boolean isAMatch(FLTR fltr)
|
||||
public boolean isAMatch(FLTR fltr)
|
||||
{
|
||||
String SODT = fltr.getSODT(); //航班计划时间 ddMMMyyHHmm
|
||||
Long SODT_long = DateTimeUtil.toDate(SODT, "ddMMMyyHHmm",Locale.ENGLISH).getTime();
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.gzzn.omms.msgexchangeapi.service.flightInfo;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
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.entity.msg.MOVEMENTINDICATOR;
|
||||
import com.gzzn.omms.msgexchangeapi.entity.msg.SCHD.FLTR;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class FlightHisServiceImplTest {
|
||||
|
||||
@Autowired
|
||||
private FlightHisServiceImpl flightHisServiceImpl;
|
||||
|
||||
@Test
|
||||
public void testIsCNCLMatch()
|
||||
{
|
||||
FLTR fltr = new FLTR();
|
||||
fltr.setMVIN(MOVEMENTINDICATOR.A);
|
||||
assertThat(fltr.getMVIN().equals(MOVEMENTINDICATOR.A));
|
||||
|
||||
|
||||
//flightHisServiceImpl.isAMatch(fltr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.gzzn.omms.msgexchangeapi.utils;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class DateTimeUtilTest {
|
||||
|
||||
@Test
|
||||
public void testGetTodayStartTime()
|
||||
{
|
||||
System.out.println(DateTimeUtil.getTodayStartTime());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user