记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
01be469f
Commit
01be469f
authored
May 25, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
bdedcb0a
b662ab3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
10 deletions
+81
-10
KylinPerformancesController.java
...service/kylin/controller/KylinPerformancesController.java
+35
-8
KylinPerformancesServiceImpl.java
...vice/kylin/service/impl/KylinPerformancesServiceImpl.java
+46
-2
No files found.
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/controller/KylinPerformancesController.java
View file @
01be469f
...
@@ -96,17 +96,44 @@ public class KylinPerformancesController {
...
@@ -96,17 +96,44 @@ public class KylinPerformancesController {
return
ResponseDto
.
success
(
result
);
return
ResponseDto
.
success
(
result
);
}
}
@SneakyThrows
@GetMapping
(
value
=
"search"
)
@ApiOperation
(
"演出搜索"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"title"
,
value
=
"演出名称"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"int"
,
name
=
"page"
,
value
=
"页码"
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"int"
,
name
=
"size"
,
value
=
"每页数量"
)
})
public
ResponseDto
<
HashMap
>
performancesSearch
(
@RequestParam
String
title
,
@RequestParam
(
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
size
)
{
HashMap
result
=
null
;
result
=
kylinPerformancesService
.
performancesSearch
(
title
,
page
,
size
);
return
ResponseDto
.
success
(
result
);
}
@GetMapping
(
value
=
"calendar"
)
@GetMapping
(
value
=
"calendar"
)
@ApiOperation
(
"演出日历"
)
@ApiOperation
(
"演出日历"
)
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"yearMonth"
,
value
=
"年月 2021-01"
,
required
=
true
)
@ApiImplicitParams
({
public
ResponseDto
<
List
>
performanceList
(
@RequestParam
String
yearMonth
)
throws
ParseException
{
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"yearMonth"
,
value
=
"年月 2021-01"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"cityName"
,
value
=
"城市名称"
,
required
=
true
)
})
public
ResponseDto
<
List
>
performanceCalendar
(
@RequestParam
String
yearMonth
,
@RequestParam
String
cityName
)
throws
ParseException
{
List
result
=
null
;
List
result
=
null
;
try
{
result
=
kylinPerformancesService
.
performanceCalendar
(
yearMonth
,
cityName
);
result
=
kylinPerformancesService
.
performanceCalendar
(
yearMonth
);
return
ResponseDto
.
success
(
result
);
}
catch
(
ParseException
e
)
{
}
e
.
printStackTrace
();
}
@GetMapping
(
value
=
"calendarPerformances"
)
@ApiOperation
(
"演出日历-演出列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"yearMonthDay"
,
value
=
"年月日 2021-01-01"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"cityName"
,
value
=
"城市名称"
,
required
=
true
)
})
public
ResponseDto
<
List
>
calendarPerformances
(
@RequestParam
String
yearMonthDay
,
@RequestParam
String
cityName
)
{
List
result
=
null
;
result
=
kylinPerformancesService
.
calendarPerformances
(
yearMonthDay
,
cityName
);
return
ResponseDto
.
success
(
result
);
return
ResponseDto
.
success
(
result
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinPerformancesServiceImpl.java
View file @
01be469f
...
@@ -344,14 +344,20 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
...
@@ -344,14 +344,20 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
return
list
;
return
list
;
}
}
public
List
performanceCalendar
(
String
yearMonth
)
throws
ParseException
{
public
List
performanceCalendar
(
String
yearMonth
,
String
cityName
)
throws
ParseException
{
Document
queryObject
=
new
Document
();
if
(!
cityName
.
isEmpty
())
{
queryObject
.
put
(
"cityName"
,
Pattern
.
compile
(
cityName
,
Pattern
.
CASE_INSENSITIVE
));
}
Query
query
=
new
BasicQuery
(
queryObject
);
// 处理成正常格式
// 处理成正常格式
yearMonth
=
yearMonth
.
concat
(
"-01 00:00:00"
);
yearMonth
=
yearMonth
.
concat
(
"-01 00:00:00"
);
// 获取此月开始结束时间
// 获取此月开始结束时间
String
monthStart
=
DateUtil
.
getMonthFirst
(
yearMonth
);
String
monthStart
=
DateUtil
.
getMonthFirst
(
yearMonth
);
String
monthEnd
=
DateUtil
.
getMonthLast
(
yearMonth
);
String
monthEnd
=
DateUtil
.
getMonthLast
(
yearMonth
);
Query
query
=
Query
.
query
(
Criteria
.
where
(
"timeStart"
).
gte
(
monthStart
).
lte
(
monthEnd
));
query
.
addCriteria
(
Criteria
.
where
(
"timeStart"
).
gte
(
monthStart
).
lte
(
monthEnd
));
query
.
fields
().
include
(
"timeStart"
);
query
.
fields
().
include
(
"timeStart"
);
List
<
KylinPerformanceVo
>
list
=
mongoTemplate
.
find
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
List
<
KylinPerformanceVo
>
list
=
mongoTemplate
.
find
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
...
@@ -369,4 +375,42 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
...
@@ -369,4 +375,42 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
return
newList
;
return
newList
;
}
}
public
List
calendarPerformances
(
String
yearMonthDay
,
String
cityName
)
{
Document
queryObject
=
new
Document
();
queryObject
.
put
(
"cityName"
,
Pattern
.
compile
(
cityName
,
Pattern
.
CASE_INSENSITIVE
));
Query
query
=
new
BasicQuery
(
queryObject
);
String
yearMonthDayEnd
=
yearMonthDay
.
concat
(
" 23:59:59"
);
query
.
addCriteria
(
Criteria
.
where
(
"timeStart"
).
gte
(
yearMonthDay
).
lte
(
yearMonthDayEnd
));
query
.
fields
().
exclude
(
"details"
);
query
.
fields
().
exclude
(
"noticeImage"
);
List
<
KylinPerformanceVo
>
list
=
mongoTemplate
.
find
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
return
list
;
}
public
HashMap
performancesSearch
(
String
title
,
int
page
,
int
size
)
{
Document
queryObject
=
new
Document
();
queryObject
.
put
(
"title"
,
Pattern
.
compile
(
title
,
Pattern
.
CASE_INSENSITIVE
));
Query
query
=
new
BasicQuery
(
queryObject
);
long
count
=
mongoTemplate
.
count
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
query
.
fields
().
exclude
(
"details"
);
query
.
fields
().
exclude
(
"noticeImage"
);
Sort
sortName
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"timeStart"
);
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
size
,
sortName
);
query
.
with
(
pageable
);
List
<
KylinPerformanceVo
>
list
=
mongoTemplate
.
find
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
HashMap
info
=
new
HashMap
();
info
.
put
(
"total"
,
count
);
info
.
put
(
"list"
,
list
);
return
info
;
}
}
}
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