记得上下班打卡 | 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
a28b26ed
Commit
a28b26ed
authored
Jul 12, 2022
by
GaoHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:演出预告列表
parent
895fd5ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
52 deletions
+95
-52
KylinPerformancesController.java
...service/kylin/controller/KylinPerformancesController.java
+3
-3
KylinPerformancesServiceImpl.java
...vice/kylin/service/impl/KylinPerformancesServiceImpl.java
+1
-1
DataUtils.java
...ain/java/com/liquidnet/service/kylin/utils/DataUtils.java
+91
-48
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 @
a28b26ed
...
...
@@ -91,9 +91,9 @@ public class KylinPerformancesController {
@GetMapping
(
"setRedisIds"
)
@ApiOperation
(
"redis插入ids"
)
public
ResponseDto
<
Boolean
>
setRedisIds
(){
Boolean
tag
=
kylinPerformancesService
.
setRedisIds
();
return
ResponseDto
.
success
(
tag
);
public
ResponseDto
<
HashMap
<
String
,
Object
>
>
setRedisIds
(){
HashMap
<
String
,
Object
>
map
=
kylinPerformancesService
.
setRedisIds
();
return
ResponseDto
.
success
(
map
);
}
@GetMapping
(
"recommendList"
)
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinPerformancesServiceImpl.java
View file @
a28b26ed
...
...
@@ -175,7 +175,7 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
return
newList
;
}
public
Boolean
setRedisIds
()
{
public
HashMap
<
String
,
Object
>
setRedisIds
()
{
return
dataUtils
.
setRedisIds
();
}
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/utils/DataUtils.java
View file @
a28b26ed
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo
;
...
...
@@ -377,52 +378,95 @@ public class DataUtils {
List
<
String
>
toDayCombinationIds
=
(
List
<
String
>)
map
.
get
(
"toDayCombinationIds"
);
List
<
String
>
threeDayCombinationIds
=
(
List
<
String
>)
map
.
get
(
"threeDayCombinationIds"
);
List
<
KylinPerformanceVo
>
toDayList
=
new
ArrayList
<>();
List
<
KylinPerformanceVo
>
threeDaysList
=
new
ArrayList
<>();
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
new
ArrayList
<>();
List
<
GoblinGoodsSkuInfoVo
>
threeNftList
=
new
ArrayList
<>();
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
new
ArrayList
<>();
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
new
ArrayList
<>();
// 固定条件
Query
query
=
new
Query
();
query
.
fields
().
exclude
(
"details"
);
query
.
fields
().
exclude
(
"noticeImage"
);
query
.
fields
().
exclude
(
"ticketTimeList"
);
query
.
fields
().
exclude
(
"describeElectronic"
);
query
.
addCriteria
(
Criteria
.
where
(
"mid"
).
in
(
toDayIds
));
List
<
KylinPerformanceVo
>
toDayList
=
mongoTemplate
.
find
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
if
(
toDayIds
!=
null
&&
toDayIds
.
size
()
>
0
)
{
Query
query
=
new
Query
();
query
.
fields
().
exclude
(
"details"
);
query
.
fields
().
exclude
(
"noticeImage"
);
query
.
fields
().
exclude
(
"ticketTimeList"
);
query
.
fields
().
exclude
(
"describeElectronic"
);
query
.
addCriteria
(
Criteria
.
where
(
"mid"
).
in
(
toDayIds
));
toDayList
=
mongoTemplate
.
find
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
}
// 固定条件
Query
queryT
=
new
Query
();
queryT
.
fields
().
exclude
(
"details"
);
queryT
.
fields
().
exclude
(
"noticeImage"
);
queryT
.
fields
().
exclude
(
"ticketTimeList"
);
queryT
.
fields
().
exclude
(
"describeElectronic"
);
queryT
.
addCriteria
(
Criteria
.
where
(
"mid"
).
in
(
threeDayIds
));
List
<
KylinPerformanceVo
>
threeDaysList
=
mongoTemplate
.
find
(
queryT
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
if
(
threeDayIds
!=
null
&&
threeDayIds
.
size
()
>
0
)
{
Query
queryT
=
new
Query
();
queryT
.
fields
().
exclude
(
"details"
);
queryT
.
fields
().
exclude
(
"noticeImage"
);
queryT
.
fields
().
exclude
(
"ticketTimeList"
);
queryT
.
fields
().
exclude
(
"describeElectronic"
);
queryT
.
addCriteria
(
Criteria
.
where
(
"mid"
).
in
(
threeDayIds
));
threeDaysList
=
mongoTemplate
.
find
(
queryT
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
}
//数字藏品
//当天
Query
queryToDayNft
=
new
Query
();
queryToDayNft
.
fields
().
exclude
(
"extagVoList"
);
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"skuId"
).
in
(
toDayNftIds
));
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
mongoTemplate
.
find
(
queryToDayNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
if
(
toDayNftIds
!=
null
&&
toDayNftIds
.
size
()
>
0
)
{
Query
queryToDayNft
=
new
Query
();
queryToDayNft
.
fields
().
exclude
(
"extagVoList"
);
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"skuId"
).
in
(
toDayNftIds
));
toDaysNftList
=
mongoTemplate
.
find
(
queryToDayNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
}
//三天的
Query
queryThreeNft
=
new
Query
();
queryToDayNft
.
fields
().
exclude
(
"extagVoList"
);
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"skuId"
).
in
(
threeNftIds
));
List
<
GoblinGoodsSkuInfoVo
>
threeNftList
=
mongoTemplate
.
find
(
queryThreeNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
if
(
threeNftIds
!=
null
&&
threeNftIds
.
size
()
>
0
)
{
Query
queryThreeNft
=
new
Query
();
queryThreeNft
.
fields
().
exclude
(
"extagVoList"
);
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"skuId"
).
in
(
threeNftIds
));
threeNftList
=
mongoTemplate
.
find
(
queryThreeNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
}
//组合购
//当天
Query
queryToDayCombination
=
new
Query
();
Sort
sortToDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryToDayCombination
.
with
(
sortToDayCombination
);
queryToDayCombination
.
addCriteria
(
Criteria
.
where
(
"mixId"
).
in
(
toDayCombinationIds
));
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
mongoTemplate
.
find
(
queryToDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
if
(
toDayCombinationIds
!=
null
&&
toDayCombinationIds
.
size
()
>
0
)
{
Query
queryToDayCombination
=
new
Query
();
Sort
sortToDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryToDayCombination
.
with
(
sortToDayCombination
);
queryToDayCombination
.
fields
().
exclude
(
"details"
);
queryToDayCombination
.
addCriteria
(
Criteria
.
where
(
"mixId"
).
in
(
toDayCombinationIds
));
toDayCombinationList
=
mongoTemplate
.
find
(
queryToDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
toDayCombinationList
.
forEach
(
goblinMixDetailsVo
->
{
List
<
GoblinMixDetailsItemVo
>
item
=
goblinMixDetailsVo
.
getItem
();
item
.
forEach
(
goblinMixDetailsItemVo
->{
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"skuId"
).
is
(
goblinMixDetailsItemVo
.
getSkuId
()));
GoblinGoodsSkuInfoVo
one
=
mongoTemplate
.
findOne
(
query
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
if
(
one
!=
null
){
goblinMixDetailsItemVo
.
setSkuName
(
one
.
getName
());
}
});
});
}
//三天
Query
queryThreeDayCombination
=
new
Query
();
Sort
sortThreeDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryThreeDayCombination
.
with
(
sortThreeDayCombination
);
queryThreeDayCombination
.
addCriteria
(
Criteria
.
where
(
"mixId"
).
in
(
toDayCombinationIds
));
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
mongoTemplate
.
find
(
queryThreeDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
if
(
threeDayCombinationIds
!=
null
&&
threeDayCombinationIds
.
size
()
>
0
)
{
Query
queryThreeDayCombination
=
new
Query
();
Sort
sortThreeDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryThreeDayCombination
.
with
(
sortThreeDayCombination
);
queryThreeDayCombination
.
fields
().
exclude
(
"details"
);
queryThreeDayCombination
.
addCriteria
(
Criteria
.
where
(
"mixId"
).
in
(
threeDayCombinationIds
));
threeDayCombinationList
=
mongoTemplate
.
find
(
queryThreeDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
threeDayCombinationList
.
forEach
(
goblinMixDetailsVo
->
{
List
<
GoblinMixDetailsItemVo
>
item
=
goblinMixDetailsVo
.
getItem
();
item
.
forEach
(
goblinMixDetailsItemVo
->{
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"skuId"
).
is
(
goblinMixDetailsItemVo
.
getSkuId
()));
GoblinGoodsSkuInfoVo
one
=
mongoTemplate
.
findOne
(
query
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
if
(
one
!=
null
){
goblinMixDetailsItemVo
.
setSkuName
(
one
.
getName
());
}
});
});
}
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
...
...
@@ -430,15 +474,15 @@ public class DataUtils {
info
.
put
(
"threeDaysList"
,
threeDaysList
);
info
.
put
(
"toDaysNftList"
,
toDaysNftList
);
info
.
put
(
"threeNftList"
,
threeNftList
);
info
.
put
(
"toDayCombinationList"
,
toDayCombinationList
);
info
.
put
(
"threeDayCombinationList"
,
threeDayCombinationList
);
info
.
put
(
"toDayCombinationList"
,
toDayCombinationList
);
info
.
put
(
"threeDayCombinationList"
,
threeDayCombinationList
);
return
info
;
}
return
(
HashMap
<
String
,
Object
>)
obj
;
}
//执行脚本
public
Boolean
setRedisIds
()
{
public
HashMap
<
String
,
Object
>
setRedisIds
()
{
// 固定条件
Query
query
=
getCommonWhere
();
// 排序
...
...
@@ -482,12 +526,12 @@ public class DataUtils {
//查询预约(当天)
// List<GoblinGoodsSkuInfoVo> toDayAboutNft = getAboutNftByStartAndEndTime(nowTimeTime, toDayEndTime,0);
// List<String> toDayAboutNftSkuIds = toDayAboutNft.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
List
<
String
>
toDayAboutNft
=
getAboutNftByStartAndEndTime
(
nowTimeTime
,
toDayEndTime
,
0
);
List
<
String
>
toDayAboutNft
=
getAboutNftByStartAndEndTime
(
nowTimeTime
,
toDayEndTime
,
0
);
//查询预约(三天)
// List<GoblinGoodsSkuInfoVo> threeDayAboutNft = getAboutNftByStartAndEndTime(toDayEndTime, threeEndTime,1);
// List<String> threeDayAboutNftSkuIds = threeDayAboutNft.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
// toDayAboutNftSkuIds.addAll(threeDayAboutNftSkuIds);
List
<
String
>
threeDayAboutNft
=
getAboutNftByStartAndEndTime
(
toDayEndTime
,
threeEndTime
,
1
);
List
<
String
>
threeDayAboutNft
=
getAboutNftByStartAndEndTime
(
toDayEndTime
,
threeEndTime
,
1
);
ArrayList
<
String
>
allListSkuIds
=
new
ArrayList
<>();
allListSkuIds
.
addAll
(
toDayAboutNft
);
allListSkuIds
.
addAll
(
threeDayAboutNft
);
...
...
@@ -522,7 +566,6 @@ public class DataUtils {
threeNftIds
.
addAll
(
threeDayAboutNft
);
//组合购
//当天
Query
queryToDayCombination
=
new
Query
();
...
...
@@ -536,9 +579,9 @@ public class DataUtils {
Query
queryThreeDayCombination
=
new
Query
();
Sort
sortThreeDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryThreeDayCombination
.
addCriteria
(
Criteria
.
where
(
"timeStart"
).
gte
(
toDayEndTimeStr
).
lt
(
threeDaysLaterStr
));
queryT
o
DayCombination
.
addCriteria
(
Criteria
.
where
(
"status"
).
ne
(
7
));
queryT
hree
DayCombination
.
addCriteria
(
Criteria
.
where
(
"status"
).
ne
(
7
));
queryThreeDayCombination
.
with
(
sortThreeDayCombination
);
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
mongoTemplate
.
find
(
queryT
o
DayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
mongoTemplate
.
find
(
queryT
hree
DayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
List
<
String
>
threeDayCombinationIds
=
threeDayCombinationList
.
stream
().
map
(
GoblinMixDetailsVo:
:
getMixId
).
collect
(
Collectors
.
toList
());
...
...
@@ -550,27 +593,27 @@ public class DataUtils {
idsList
.
put
(
"threeNftIds"
,
threeNftIds
);
idsList
.
put
(
"toDayCombinationIds"
,
toDayCombinationIds
);
idsList
.
put
(
"threeDayCombinationIds"
,
threeDayCombinationIds
);
idsList
.
put
(
"now"
,
nowTimeTime
);
idsList
.
put
(
"now"
,
nowTimeTime
);
String
redisKeyIds
=
KylinRedisConst
.
PERFORMANCES_LIST_NOTICE_IDS
;
redisUtil
.
set
(
redisKeyIds
,
idsList
);
return
true
;
redisUtil
.
set
(
redisKeyIds
,
idsList
);
return
idsList
;
}
// private List<GoblinGoodsSkuInfoVo> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime,Integer tag) {
private
List
<
String
>
getAboutNftByStartAndEndTime
(
LocalDateTime
nowTime
,
LocalDateTime
EndTime
,
Integer
tag
)
{
// private List<GoblinGoodsSkuInfoVo> getAboutNftByStartAndEndTime(LocalDateTime nowTime, LocalDateTime EndTime,Integer tag) {
private
List
<
String
>
getAboutNftByStartAndEndTime
(
LocalDateTime
nowTime
,
LocalDateTime
EndTime
,
Integer
tag
)
{
Query
aboutQuery
=
new
Query
();
if
(
tag
.
equals
(
0
)){
if
(
tag
.
equals
(
0
))
{
//当天 查询当天可预约的nft 预约结束时间>当前时间>预约开始
aboutQuery
.
addCriteria
(
Criteria
.
where
(
"aboutStartDate"
).
lt
(
nowTime
));
aboutQuery
.
addCriteria
(
Criteria
.
where
(
"aboutEndDate"
).
gte
(
EndTime
));
}
else
{
}
else
{
//三天 预约开始时间 范围在三天以内
aboutQuery
.
addCriteria
(
Criteria
.
where
(
"aboutStartDate"
).
gte
(
nowTime
).
lt
(
EndTime
));
}
aboutQuery
.
addCriteria
(
Criteria
.
where
(
"delTag"
).
is
(
0
));
List
<
GoblinGoodsAnticipateValueVo
>
aboutQueryList
=
mongoTemplate
.
find
(
aboutQuery
,
GoblinGoodsAnticipateValueVo
.
class
,
GoblinGoodsAnticipateValueVo
.
class
.
getSimpleName
());
List
<
String
>
aboutIds
=
aboutQueryList
.
stream
().
map
(
GoblinGoodsAnticipateValueVo:
:
getSkuId
).
collect
(
Collectors
.
toList
());
if
(
aboutIds
.
size
()
>
0
)
{
if
(
aboutIds
.
size
()
>
0
)
{
/* Query queryAbout = new Query();
queryAbout.addCriteria(Criteria.where("skuId").in(aboutIds));
return mongoTemplate.find(queryAbout, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());*/
...
...
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