Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
task3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
首航-临时账号
task3.0
Commits
5510658b
Commit
5510658b
authored
Nov 20, 2020
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开发航线监控定时
parent
4d064360
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
7 deletions
+24
-7
pom.xml
pom.xml
+1
-1
StatisticalDao.java
src/main/java/com/foc/dao/StatisticalDao.java
+4
-3
DynamicFlightService.java
src/main/java/com/foc/service/DynamicFlightService.java
+4
-3
DateUtils.java
src/main/java/com/foc/util/DateUtils.java
+11
-0
StatisticalMapper.xml
src/main/resources/mapper/StatisticalMapper.xml
+4
-0
No files found.
pom.xml
View file @
5510658b
...
...
@@ -120,7 +120,7 @@
<transformers>
<transformer
implementation=
"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"
>
<mainClass>
com.foc.
DbSoundsMonitor
Task
</mainClass>
<mainClass>
com.foc.
Statistical
Task
</mainClass>
</transformer>
</transformers>
</configuration>
...
...
src/main/java/com/foc/dao/StatisticalDao.java
View file @
5510658b
...
...
@@ -11,19 +11,20 @@ import java.util.List;
public
interface
StatisticalDao
{
/**
* 获取所有类型为J,状态为ATA的航线
*
*
@param date
* @return
*/
List
<
StatisticalEntity
>
getFlightList
();
List
<
StatisticalEntity
>
getFlightList
(
String
date
);
/**
* 根据起飞地和到达地获取航线最近时间
*
* @param entity
* @param acTypes
* @param date
* @return
*/
String
getFlightByDepAndArr
(
@Param
(
value
=
"entity"
)
StatisticalEntity
entity
,
@Param
(
value
=
"acTypes"
)
List
acTypes
);
String
getFlightByDepAndArr
(
@Param
(
value
=
"entity"
)
StatisticalEntity
entity
,
@Param
(
value
=
"acTypes"
)
List
acTypes
,
@Param
(
value
=
"date"
)
String
date
);
/**
* 根据论证机型获取小机型
...
...
src/main/java/com/foc/service/DynamicFlightService.java
View file @
5510658b
...
...
@@ -56,12 +56,13 @@ public class DynamicFlightService {
List
<
String
>
verifyAcTypes
=
Arrays
.
asList
(
verifyAcType
.
split
(
","
));
StatisticalDao
dao
=
session
.
getMapper
(
StatisticalDao
.
class
);
//获取航班动态表中所有航班性质为J,状态为ATA,机型为319/A320,321,320neo,330的航线的最后一班时间
List
<
StatisticalEntity
>
list
=
dao
.
getFlightList
();
String
date
=
DateUtils
.
getLastDate
();
List
<
StatisticalEntity
>
list
=
dao
.
getFlightList
(
date
);
List
<
StatisticalEntity
>
slist
=
new
ArrayList
<>();
List
<
String
>
acTypes
=
dao
.
getLacTypesByVerifyAcTypes
(
verifyAcTypes
);
list
.
forEach
(
e
->
{
//获取该航线所有论证机型(319/A320,321,320neo,330)的最后执行时间(实际起飞时间)
String
lastDate
=
dao
.
getFlightByDepAndArr
(
e
,
acTypes
);
String
lastDate
=
dao
.
getFlightByDepAndArr
(
e
,
acTypes
,
date
);
StatisticalEntity
entity
=
new
StatisticalEntity
();
entity
.
setArrIata
(
e
.
getArrIata
());
entity
.
setArrIataName
(
e
.
getArrIataName
());
...
...
@@ -78,7 +79,7 @@ public class DynamicFlightService {
continue
;
}
//获取该航线特定机型下的最后执行时间
String
acTypeLastTime
=
dao
.
getFlightByDepAndArr
(
e
,
lacTypes
);
String
acTypeLastTime
=
dao
.
getFlightByDepAndArr
(
e
,
lacTypes
,
date
);
if
(
StringUtils
.
isEmpty
(
acTypeLastTime
))
{
int
count
=
dao
.
getSailingCommand
(
e
,
str
);
//查询开航指令,有的话为可用
...
...
src/main/java/com/foc/util/DateUtils.java
View file @
5510658b
...
...
@@ -3,6 +3,8 @@ package com.foc.util;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.temporal.ChronoUnit
;
import
java.util.Calendar
;
import
java.util.Date
;
/**
* @author lisu
...
...
@@ -22,4 +24,13 @@ public class DateUtils {
SimpleDateFormat
format
=
new
SimpleDateFormat
(
formatType
);
return
format
.
format
(
System
.
currentTimeMillis
());
}
public
static
String
getLastDate
(){
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
add
(
Calendar
.
DATE
,-
1
);
Date
d
=
cal
.
getTime
();
SimpleDateFormat
sp
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
time
=
sp
.
format
(
d
);
return
time
;
}
}
src/main/resources/mapper/StatisticalMapper.xml
View file @
5510658b
...
...
@@ -15,6 +15,7 @@
WHERE
d.`status` = 'ATA'
AND d.`stc` = 'J'
AND d.`atd`
<
= #{date}
GROUP BY
d.dep_stn,
d.arr_stn
...
...
@@ -25,6 +26,9 @@
DATE_FORMAT(atd,'%Y/%m/%d') as lastAirlineTime
from foc_flight_dynamics
where dep_stn=#{entity.depIata} and arr_stn=#{entity.arrIata}
and `status` = 'ATA'
AND `stc` = 'J'
AND `atd`
<
= #{date}
and ac_type in
<foreach
item=
"acType"
collection=
"acTypes"
separator=
","
open=
"("
close=
")"
index=
""
>
#{acType}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment