记得上下班打卡 | 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
32d2f2a3
Commit
32d2f2a3
authored
May 14, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推荐和预告接口
parent
0ac15854
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
26 deletions
+55
-26
KylinPerformancesController.java
...service/kylin/controller/KylinPerformancesController.java
+11
-10
KylinPerformancesServiceImpl.java
...vice/kylin/service/impl/KylinPerformancesServiceImpl.java
+44
-16
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 @
32d2f2a3
...
@@ -83,16 +83,17 @@ public class KylinPerformancesController {
...
@@ -83,16 +83,17 @@ public class KylinPerformancesController {
return
ResponseDto
.
success
(
result
);
return
ResponseDto
.
success
(
result
);
}
}
@GetMapping
(
"noticeRecommendList"
)
@GetMapping
(
"noticeList"
)
@ApiOperation
(
"推荐演出/演出预告 列表"
)
@ApiOperation
(
"演出预告列表"
)
@ApiImplicitParams
({
public
ResponseDto
<
HashMap
<
String
,
Object
>>
noticeList
()
{
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"listType"
,
value
=
"1推荐 2预告"
,
required
=
true
),
HashMap
<
String
,
Object
>
result
=
kylinPerformancesService
.
noticeList
();
})
return
ResponseDto
.
success
(
result
);
public
ResponseDto
<
List
<
PerformanceVo
>>
noticeRecommendList
(
}
@RequestParam
Integer
listType
)
{
@GetMapping
(
"recommendList"
)
List
<
PerformanceVo
>
result
=
new
ArrayList
();
@ApiOperation
(
"推荐演出列表"
)
result
=
kylinPerformancesService
.
noticeRecommendList
(
listType
);
public
ResponseDto
<
List
<
PerformanceVo
>>
recommendList
()
{
List
<
PerformanceVo
>
result
=
kylinPerformancesService
.
recommendList
();
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 @
32d2f2a3
...
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
...
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -42,7 +43,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
...
@@ -42,7 +43,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
Integer
page
,
Integer
size
,
Integer
page
,
Integer
size
,
String
orderBy
,
String
sort
String
orderBy
,
String
sort
)
{
)
{
HashMap
<
String
,
Object
>
info
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
info
=
new
HashMap
<>();
// 排序 分页
// 排序 分页
Sort
sortName
=
null
;
// 默认开票越早的在上面
Sort
sortName
=
null
;
// 默认开票越早的在上面
...
@@ -50,7 +51,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
...
@@ -50,7 +51,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
if
(!
orderBy
.
isEmpty
())
{
if
(!
orderBy
.
isEmpty
())
{
sortName
=
Sort
.
by
(
Sort
.
Direction
.
DESC
,
orderBy
);
sortName
=
Sort
.
by
(
Sort
.
Direction
.
DESC
,
orderBy
);
}
}
}
else
if
(
sort
.
equals
(
"ASC"
))
{
}
else
if
(
sort
.
equals
(
"ASC"
))
{
if
(!
orderBy
.
isEmpty
())
{
if
(!
orderBy
.
isEmpty
())
{
sortName
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
orderBy
);
sortName
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
orderBy
);
}
}
...
@@ -111,35 +112,62 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
...
@@ -111,35 +112,62 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
List
<
PerformanceVo
>
list
=
mongoTemplate
.
find
(
query
,
PerformanceVo
.
class
,
PerformanceVo
.
class
.
getSimpleName
());
List
<
PerformanceVo
>
list
=
mongoTemplate
.
find
(
query
,
PerformanceVo
.
class
,
PerformanceVo
.
class
.
getSimpleName
());
// 组合数据
// 组合数据
info
.
put
(
"total"
,
count
);
info
.
put
(
"total"
,
count
);
info
.
put
(
"data"
,
list
);
info
.
put
(
"data"
,
list
);
return
info
;
return
info
;
}
}
public
List
<
PerformanceVo
>
noticeRecommendList
(
Integer
listType
)
{
public
HashMap
<
String
,
Object
>
noticeList
(
)
{
// 固定条件
// 固定条件
Query
query
=
new
Query
();
Query
query
=
new
Query
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
nowTimeStr
=
nowTime
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
String
nowTimeStr
=
nowTime
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
query
.
addCriteria
(
Criteria
.
where
(
"stopSellTime"
).
gte
(
nowTimeStr
));
query
.
addCriteria
(
Criteria
.
where
(
"stopSellTime"
).
gte
(
nowTimeStr
));
query
.
addCriteria
(
Criteria
.
where
(
"statusSell"
).
is
(
1
));
query
.
addCriteria
(
Criteria
.
where
(
"statusSell"
).
is
(
1
));
// 推荐
if
(
listType
.
equals
(
1
))
{
// 今天的
query
.
addCriteria
(
Criteria
.
where
(
"isRecommend"
).
is
(
1
));
LocalDateTime
toDayTime
=
LocalDateTime
.
now
();
}
else
if
(
listType
.
equals
(
2
))
{
String
toDayTimeStr
=
toDayTime
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
LocalDateTime
threeDaysLater
=
nowTime
.
plusDays
(
3
);
LocalDateTime
toDayEndTime
=
toDayTime
.
plusDays
(
1
);
String
toDayEndTimeStr
=
toDayEndTime
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
query
.
addCriteria
(
Criteria
.
where
(
"sellTime"
).
gte
(
toDayTimeStr
).
lt
(
toDayEndTimeStr
));
List
<
PerformanceVo
>
toDayList
=
mongoTemplate
.
find
(
query
,
PerformanceVo
.
class
,
PerformanceVo
.
class
.
getSimpleName
());
// 三天的
Query
queryT
=
new
Query
();
LocalDateTime
nowTimeT
=
LocalDateTime
.
now
();
String
nowTimeStrT
=
nowTimeT
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
queryT
.
addCriteria
(
Criteria
.
where
(
"stopSellTime"
).
gte
(
nowTimeStrT
));
queryT
.
addCriteria
(
Criteria
.
where
(
"statusSell"
).
is
(
1
));
LocalDateTime
threeDaysLater
=
toDayTime
.
plusDays
(
3
);
String
threeDaysLaterStr
=
threeDaysLater
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
threeDaysLaterStr
=
threeDaysLater
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
query
.
addCriteria
(
Criteria
.
where
(
"sellTime"
).
gte
(
nowTimeStr
).
lt
(
threeDaysLaterStr
).
and
(
"statusSell"
).
is
(
1
));
queryT
.
addCriteria
(
Criteria
.
where
(
"sellTime"
).
gte
(
toDayEndTimeStr
).
lt
(
threeDaysLaterStr
));
List
<
PerformanceVo
>
threeDaysList
=
mongoTemplate
.
find
(
queryT
,
PerformanceVo
.
class
,
PerformanceVo
.
class
.
getSimpleName
());
HashMap
<
String
,
Object
>
info
=
new
HashMap
<>();
info
.
put
(
"toDayList"
,
toDayList
);
info
.
put
(
"threeDaysList"
,
threeDaysList
);
return
info
;
}
}
List
<
PerformanceVo
>
list
=
mongoTemplate
.
find
(
query
,
PerformanceVo
.
class
,
PerformanceVo
.
class
.
getSimpleName
());
public
List
<
PerformanceVo
>
recommendList
()
{
// 固定条件
Query
query
=
new
Query
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
nowTimeStr
=
nowTime
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
query
.
addCriteria
(
Criteria
.
where
(
"stopSellTime"
).
gte
(
nowTimeStr
));
query
.
addCriteria
(
Criteria
.
where
(
"statusSell"
).
is
(
1
));
// 推荐
query
.
addCriteria
(
Criteria
.
where
(
"isRecommend"
).
is
(
1
));
List
<
PerformanceVo
>
recommendList
=
mongoTemplate
.
find
(
query
,
PerformanceVo
.
class
,
PerformanceVo
.
class
.
getSimpleName
());
return
l
ist
;
return
recommendL
ist
;
}
}
public
HashMap
<
String
,
Object
>
detail
(
String
performancesId
)
{
public
HashMap
<
String
,
Object
>
detail
(
String
performancesId
)
{
HashMap
<
String
,
Object
>
info
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
info
=
new
HashMap
<>();
PerformanceVo
performancesInfo
=
mongoTemplate
.
findOne
(
PerformanceVo
performancesInfo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"performancesId"
).
is
(
performancesId
)),
Query
.
query
(
Criteria
.
where
(
"performancesId"
).
is
(
performancesId
)),
...
...
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