Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
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
首航-临时账号
api
Commits
08acdc22
Commit
08acdc22
authored
Nov 13, 2020
by
java-温文海
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
航线论证查询和导出
parent
e5cfde1a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
321 additions
and
2 deletions
+321
-2
StatisticalController.java
src/com/ejweb/modules/airport/api/StatisticalController.java
+47
-0
StatisticalListBean.java
src/com/ejweb/modules/airport/bean/StatisticalListBean.java
+78
-0
StatisticalDao.java
src/com/ejweb/modules/airport/dao/StatisticalDao.java
+3
-0
AirPlaneEntity.java
src/com/ejweb/modules/airport/entity/AirPlaneEntity.java
+36
-0
StatisticalListEntity.java
src/com/ejweb/modules/airport/entity/StatisticalListEntity.java
+118
-0
StatisticalService.java
src/com/ejweb/modules/airport/service/StatisticalService.java
+39
-2
No files found.
src/com/ejweb/modules/airport/api/StatisticalController.java
View file @
08acdc22
...
...
@@ -9,6 +9,8 @@ import java.util.List;
import
javax.servlet.http.HttpServletResponse
;
import
com.ejweb.modules.airport.bean.StatisticalListBean
;
import
com.ejweb.modules.airport.entity.StatisticalListEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -95,4 +97,49 @@ public class StatisticalController{
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
}
@ResponseBody
@RequestMapping
(
value
=
"/getList"
)
public
ResponseBean
getList
(
RequestBean
requestBean
){
ResponseBean
responseBean
=
new
ResponseBean
();
StatisticalListBean
bean
=
requestBean
.
getObjectBean
(
StatisticalListBean
.
class
);
// 参数校验为通过
PageEntity
<
StatisticalListEntity
>
list
=
statisticalService
.
getList
(
bean
);
// 查询结果为空
if
(
list
==
null
)
{
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
return
responseBean
;
}
responseBean
.
setData
(
list
);
responseBean
.
setMessage
(
GConstants
.
OK
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2000
);
return
responseBean
;
}
@RequestMapping
(
value
=
"newExport"
)
public
ResponseBean
newExport
(
RequestBean
requestBean
,
HttpServletResponse
response
){
ResponseBean
responseBean
=
new
ResponseBean
();
StatisticalListBean
bean
=
requestBean
.
getObjectBean
(
StatisticalListBean
.
class
);
// 参数校验为通过
PageEntity
<
StatisticalListEntity
>
page
=
statisticalService
.
getList
(
bean
);
List
<
StatisticalListEntity
>
list
=
new
ArrayList
<
StatisticalListEntity
>();
if
(
page
!=
null
){
// 查询结果为空
list
=
page
.
getList
();
String
fileName
=
"航线论证数据统计.xlsx"
;
try
{
new
ExportExcel
(
"航线论证数据统计"
,
StatisticalEntity
.
class
).
setDataList
(
list
).
write
(
response
,
fileName
).
dispose
();
}
catch
(
IOException
e
)
{
responseBean
.
setMessage
(
"导出数据失败"
+
e
.
getMessage
());
return
responseBean
;
}
return
null
;
}
responseBean
.
setMessage
(
GConstants
.
OK
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
}
}
src/com/ejweb/modules/airport/bean/StatisticalListBean.java
0 → 100644
View file @
08acdc22
package
com
.
ejweb
.
modules
.
airport
.
bean
;
import
com.ejweb.core.base.GenericBean
;
import
com.ejweb.core.conf.GConstants
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
javax.validation.constraints.Min
;
public
class
StatisticalListBean
extends
GenericBean
{
private
String
depIata
;
private
String
arrIata
;
@NotEmpty
(
message
=
"userCode不能为空"
)
private
String
userCode
;
@Min
(
value
=
1
,
message
=
"pageNo必须大于等于1"
)
private
int
pageNo
=
1
;
//第几页
@Min
(
value
=
1
,
message
=
"pageSize必须大于等于1"
)
private
int
pageSize
=
GConstants
.
PAGE_SIZE
;
//每页条数
private
String
benchmarkingTime
;
private
int
airlineStatus
;
public
String
getDepIata
()
{
return
depIata
;
}
public
void
setDepIata
(
String
depIata
)
{
this
.
depIata
=
depIata
;
}
public
String
getArrIata
()
{
return
arrIata
;
}
public
void
setArrIata
(
String
arrIata
)
{
this
.
arrIata
=
arrIata
;
}
public
String
getUserCode
()
{
return
userCode
;
}
public
void
setUserCode
(
String
userCode
)
{
this
.
userCode
=
userCode
;
}
public
int
getPageNo
()
{
return
pageNo
;
}
public
void
setPageNo
(
int
pageNo
)
{
this
.
pageNo
=
pageNo
;
}
public
int
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
int
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
public
String
getBenchmarkingTime
()
{
return
benchmarkingTime
;
}
public
void
setBenchmarkingTime
(
String
benchmarkingTime
)
{
this
.
benchmarkingTime
=
benchmarkingTime
;
}
public
int
getAirlineStatus
()
{
return
airlineStatus
;
}
public
void
setAirlineStatus
(
int
airlineStatus
)
{
this
.
airlineStatus
=
airlineStatus
;
}
}
src/com/ejweb/modules/airport/dao/StatisticalDao.java
View file @
08acdc22
...
...
@@ -5,7 +5,9 @@ package com.ejweb.modules.airport.dao;
import
com.ejweb.core.base.BaseDao
;
import
com.ejweb.modules.airport.bean.StatisticalBean
;
import
com.ejweb.modules.airport.bean.StatisticalListBean
;
import
com.ejweb.modules.airport.entity.StatisticalEntity
;
import
com.ejweb.modules.airport.entity.StatisticalListEntity
;
import
java.util.List
;
...
...
@@ -21,4 +23,5 @@ public interface StatisticalDao extends BaseDao{
List
<
StatisticalEntity
>
getStatisticalList
(
StatisticalBean
bean
);
List
<
StatisticalEntity
>
getStatisticalArrIataList
(
StatisticalBean
bean
);
Integer
getDay
(
StatisticalEntity
entity
);
List
<
StatisticalListEntity
>
getList
(
StatisticalListBean
statisticalListBean
);
}
src/com/ejweb/modules/airport/entity/AirPlaneEntity.java
0 → 100644
View file @
08acdc22
package
com
.
ejweb
.
modules
.
airport
.
entity
;
import
com.ejweb.core.base.BaseEntity
;
public
class
AirPlaneEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
4211749532324022040L
;
private
String
type
;
private
int
status
;
private
String
lastTime
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
String
getLastTime
()
{
return
lastTime
;
}
public
void
setLastTime
(
String
lastTime
)
{
this
.
lastTime
=
lastTime
;
}
}
src/com/ejweb/modules/airport/entity/StatisticalListEntity.java
0 → 100644
View file @
08acdc22
package
com
.
ejweb
.
modules
.
airport
.
entity
;
import
com.ejweb.core.base.BaseEntity
;
import
java.util.List
;
public
class
StatisticalListEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
4211749532324022040L
;
private
String
arrIata
;
private
String
arrIataName
;
private
String
depIata
;
private
String
depIataName
;
private
String
departId
;
private
String
roundtripType
;
private
String
verifId
;
// 拟用机型
private
String
verifNo
;
private
String
lastAirlineTime
;
private
String
updateTime
;
private
int
airlineStatus
;
private
String
airlineJson
;
public
String
getArrIata
()
{
return
arrIata
;
}
public
void
setArrIata
(
String
arrIata
)
{
this
.
arrIata
=
arrIata
;
}
public
String
getArrIataName
()
{
return
arrIataName
;
}
public
void
setArrIataName
(
String
arrIataName
)
{
this
.
arrIataName
=
arrIataName
;
}
public
String
getDepIata
()
{
return
depIata
;
}
public
void
setDepIata
(
String
depIata
)
{
this
.
depIata
=
depIata
;
}
public
String
getDepIataName
()
{
return
depIataName
;
}
public
void
setDepIataName
(
String
depIataName
)
{
this
.
depIataName
=
depIataName
;
}
public
String
getDepartId
()
{
return
departId
;
}
public
void
setDepartId
(
String
departId
)
{
this
.
departId
=
departId
;
}
public
String
getRoundtripType
()
{
return
roundtripType
;
}
public
void
setRoundtripType
(
String
roundtripType
)
{
this
.
roundtripType
=
roundtripType
;
}
public
String
getVerifId
()
{
return
verifId
;
}
public
void
setVerifId
(
String
verifId
)
{
this
.
verifId
=
verifId
;
}
public
String
getVerifNo
()
{
return
verifNo
;
}
public
void
setVerifNo
(
String
verifNo
)
{
this
.
verifNo
=
verifNo
;
}
public
String
getLastAirlineTime
()
{
return
lastAirlineTime
;
}
public
void
setLastAirlineTime
(
String
lastAirlineTime
)
{
this
.
lastAirlineTime
=
lastAirlineTime
;
}
public
int
getAirlineStatus
()
{
return
airlineStatus
;
}
public
void
setAirlineStatus
(
int
airlineStatus
)
{
this
.
airlineStatus
=
airlineStatus
;
}
public
String
getAirlineJson
()
{
return
airlineJson
;
}
public
void
setAirlineJson
(
String
airlineJson
)
{
this
.
airlineJson
=
airlineJson
;
}
public
String
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
String
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
src/com/ejweb/modules/airport/service/StatisticalService.java
View file @
08acdc22
...
...
@@ -6,8 +6,11 @@ package com.ejweb.modules.airport.service;
import
com.ejweb.core.base.BaseService
;
import
com.ejweb.core.base.PageEntity
;
import
com.ejweb.modules.airport.bean.StatisticalBean
;
import
com.ejweb.modules.airport.bean.StatisticalListBean
;
import
com.ejweb.modules.airport.dao.StatisticalDao
;
import
com.ejweb.modules.airport.entity.AirPlaneEntity
;
import
com.ejweb.modules.airport.entity.StatisticalEntity
;
import
com.ejweb.modules.airport.entity.StatisticalListEntity
;
import
com.ejweb.modules.verify.bean.AirlineVerifiedAddBean
;
import
com.ejweb.modules.verify.dao.AirlineVerifiedDao
;
import
com.ejweb.modules.verify.dao.AirlineVerifyDao
;
...
...
@@ -19,8 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
/**
* @author huhy
...
...
@@ -36,6 +38,8 @@ public class StatisticalService extends BaseService<StatisticalDao> {
private
AirlineVerifiedDao
airlineVerifiedDao
;
@Autowired
private
AirlineVerifyDao
verifdao
;
@Autowired
private
StatisticalDao
statisticalDao
;
public
PageEntity
<
StatisticalEntity
>
getStatisticalList
(
StatisticalBean
bean
)
{
//查询同一机场被屏蔽三字码数据(历史数据关联)
...
...
@@ -136,4 +140,37 @@ public class StatisticalService extends BaseService<StatisticalDao> {
return
page
;
}
public
PageEntity
<
StatisticalListEntity
>
getList
(
StatisticalListBean
statisticalListBean
){
PageEntity
<
StatisticalListEntity
>
page
=
new
PageEntity
<
StatisticalListEntity
>();
PageInfo
<
StatisticalListEntity
>
pageInfo
=
null
;
List
<
StatisticalListEntity
>
lists
=
null
;
lists
=
statisticalDao
.
getList
(
statisticalListBean
);
//使用迭代器进行筛选
Iterator
<
StatisticalListEntity
>
iter
=
lists
.
iterator
();
while
(
iter
.
hasNext
())
{
StatisticalListEntity
s
=
iter
.
next
();
if
(
Objects
.
nonNull
(
statisticalListBean
.
getAirlineStatus
())){
//当此对象状态与传入状态不一致时remove对象
if
(
s
.
getAirlineStatus
()
!=
statisticalListBean
.
getAirlineStatus
()){
lists
.
remove
(
s
);
}
}
}
for
(
StatisticalListEntity
s:
lists
)
{
}
pageInfo
=
new
PageInfo
<
StatisticalListEntity
>(
lists
);
page
.
setPageNo
(
pageInfo
.
getPageNum
());
page
.
setPageSize
(
pageInfo
.
getPageSize
());
page
.
setCount
(
pageInfo
.
getTotal
());
page
.
setTotalPage
(
pageInfo
.
getPages
());
page
.
setList
(
pageInfo
.
getList
());
return
page
;
}
}
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