记得上下班打卡 | 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
78e47e97
Commit
78e47e97
authored
Jul 15, 2022
by
GaoHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常拦截
parent
596c4a85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
74 deletions
+90
-74
DataUtils.java
...ain/java/com/liquidnet/service/kylin/utils/DataUtils.java
+90
-74
No files found.
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/utils/DataUtils.java
View file @
78e47e97
...
...
@@ -396,24 +396,35 @@ public class DataUtils {
}).collect(Collectors.toList());*/
//数字藏品
//当天
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
getGoblinGoodsSkuInfoVos
(
toDayNftIds
);
String
anticipateKey
=
GoblinRedisConst
.
ANTICIPATE_VALUE_SKUID
;
List
<
NoticeGoblinGoodsSkuInfoVo
>
toDayNftVoList
=
aboutDayNftVoList
(
toDaysNftList
,
anticipateKey
);
//三天的
List
<
GoblinGoodsSkuInfoVo
>
threeNftList
=
getGoblinGoodsSkuInfoVos
(
threeNftIds
);
List
<
NoticeGoblinGoodsSkuInfoVo
>
threeDayNftVoList
=
aboutDayNftVoList
(
threeNftList
,
anticipateKey
);
List
<
NoticeGoblinGoodsSkuInfoVo
>
toDayNftVoList
=
null
;
List
<
NoticeGoblinGoodsSkuInfoVo
>
threeDayNftVoList
=
null
;
try
{
//当天
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
getGoblinGoodsSkuInfoVos
(
toDayNftIds
);
toDayNftVoList
=
aboutDayNftVoList
(
toDaysNftList
);
//三天的
List
<
GoblinGoodsSkuInfoVo
>
threeNftList
=
getGoblinGoodsSkuInfoVos
(
threeNftIds
);
threeDayNftVoList
=
aboutDayNftVoList
(
threeNftList
);
}
catch
(
Exception
e
)
{
log
.
error
(
"return NftVoList error!"
);
}
//组合购
//当天
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
getGoblinMixDetailsVos
(
toDayCombinationIds
);
List
<
NoticeGoblinMixDetailsVo
>
toDayCombinationVoList
=
toDayCombinationList
.
stream
().
map
(
goblinMixDetailsVo
->
NoticeGoblinMixDetailsVo
.
getNew
().
copy
(
goblinMixDetailsVo
)).
collect
(
Collectors
.
toList
());
//三天
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
getGoblinMixDetailsVos
(
threeDayCombinationIds
);
List
<
NoticeGoblinMixDetailsVo
>
threeDayCombinationVoList
=
threeDayCombinationList
.
stream
().
map
(
goblinMixDetailsVo
->
NoticeGoblinMixDetailsVo
.
getNew
().
copy
(
goblinMixDetailsVo
)).
collect
(
Collectors
.
toList
());
List
<
NoticeGoblinMixDetailsVo
>
toDayCombinationVoList
=
null
;
List
<
NoticeGoblinMixDetailsVo
>
threeDayCombinationVoList
=
null
;
try
{
//当天
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
getGoblinMixDetailsVos
(
toDayCombinationIds
);
toDayCombinationVoList
=
toDayCombinationList
.
stream
().
map
(
goblinMixDetailsVo
->
NoticeGoblinMixDetailsVo
.
getNew
().
copy
(
goblinMixDetailsVo
)).
collect
(
Collectors
.
toList
());
//三天
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
getGoblinMixDetailsVos
(
threeDayCombinationIds
);
threeDayCombinationVoList
=
threeDayCombinationList
.
stream
().
map
(
goblinMixDetailsVo
->
NoticeGoblinMixDetailsVo
.
getNew
().
copy
(
goblinMixDetailsVo
)).
collect
(
Collectors
.
toList
());
}
catch
(
Exception
e
)
{
log
.
error
(
"return CombinationVoList error!"
);
}
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
info
.
put
(
"toDayList"
,
toDayList
);
...
...
@@ -434,8 +445,9 @@ public class DataUtils {
return
(
HashMap
<
String
,
Object
>)
obj
;
}
private
List
<
NoticeGoblinGoodsSkuInfoVo
>
aboutDayNftVoList
(
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
,
String
anticipateKey
)
{
private
List
<
NoticeGoblinGoodsSkuInfoVo
>
aboutDayNftVoList
(
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
String
anticipateKey
=
GoblinRedisConst
.
ANTICIPATE_VALUE_SKUID
;
List
<
NoticeGoblinGoodsSkuInfoVo
>
toDayNftVoList
=
toDaysNftList
.
stream
().
map
(
goblinGoodsSkuInfoVo
->
{
NoticeGoblinGoodsSkuInfoVo
noticeGoblinGoodsSkuInfoVo
=
NoticeGoblinGoodsSkuInfoVo
.
getNew
().
copy
(
goblinGoodsSkuInfoVo
);
...
...
@@ -571,14 +583,6 @@ public class DataUtils {
}
}
});
//查询mongodb
/*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());*/
}
return
toDayList
;
}
...
...
@@ -622,69 +626,81 @@ public class DataUtils {
List
<
String
>
threeDayIds
=
threeDaysList
.
stream
().
map
(
KylinPerformanceVo:
:
getPerformancesId
).
collect
(
Collectors
.
toList
());
//数字藏品
LocalDateTime
nowTimeTime
=
DateUtil
.
asLocalDateTime
((
Date
)
toDayTime
.
get
(
"start"
));
LocalDateTime
toDayEndTime
=
DateUtil
.
asLocalDateTime
((
Date
)
toDayTime
.
get
(
"end"
));
LocalDateTime
threeEndTime
=
DateUtil
.
asLocalDateTime
(
beforeDayEnd
);
//查询预约(当天)
LocalDateTime
nowTimeTime
=
null
;
List
<
String
>
toDayNftIds
=
null
;
List
<
String
>
threeNftIds
=
null
;
try
{
nowTimeTime
=
DateUtil
.
asLocalDateTime
((
Date
)
toDayTime
.
get
(
"start"
));
LocalDateTime
toDayEndTime
=
DateUtil
.
asLocalDateTime
((
Date
)
toDayTime
.
get
(
"end"
));
LocalDateTime
threeEndTime
=
DateUtil
.
asLocalDateTime
(
beforeDayEnd
);
//查询预约(当天)
// 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);*/
//当天
Query
queryToDayNft
=
new
Query
();
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"skuType"
).
is
(
1
));
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
));
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"saleStartTime"
).
gte
(
nowTimeTime
).
lt
(
toDayEndTime
));
//当天
Query
queryToDayNft
=
new
Query
();
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"skuType"
).
is
(
1
));
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
));
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"saleStartTime"
).
gte
(
nowTimeTime
).
lt
(
toDayEndTime
));
// queryToDayNft.addCriteria(Criteria.where("skuId").nin(toDayAboutNftSkuIds));
/* queryToDayNft.addCriteria(Criteria.where("skuId").nin(allListSkuIds));*/
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"shelvesHandle"
).
ne
(
"3"
));
Sort
sortNameToDayNft
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryToDayNft
.
with
(
sortNameToDayNft
);
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
mongoTemplate
.
find
(
queryToDayNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
/* queryToDayNft.addCriteria(Criteria.where("skuId").nin(allListSkuIds));*/
queryToDayNft
.
addCriteria
(
Criteria
.
where
(
"shelvesHandle"
).
ne
(
"3"
));
Sort
sortNameToDayNft
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryToDayNft
.
with
(
sortNameToDayNft
);
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
mongoTemplate
.
find
(
queryToDayNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
// toDaysNftList.addAll(toDayAboutNft);
List
<
String
>
toDayNftIds
=
toDaysNftList
.
stream
().
map
(
GoblinGoodsSkuInfoVo:
:
getSkuId
).
collect
(
Collectors
.
toList
());
/*toDayNftIds.addAll(toDayAboutNft);*/
//三天的
Query
queryThreeNft
=
new
Query
();
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"skuType"
).
is
(
1
));
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
));
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"saleStartTime"
).
gte
(
toDayEndTime
).
lt
(
threeEndTime
));
/*queryThreeNft.addCriteria(Criteria.where("skuId").nin(allListSkuIds));*/
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"shelvesHandle"
).
ne
(
"3"
));
Sort
sortThreeNft
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryThreeNft
.
with
(
sortThreeNft
);
List
<
GoblinGoodsSkuInfoVo
>
threeNftList
=
mongoTemplate
.
find
(
queryThreeNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
// threeNftList.addAll(threeDayAboutNft);
List
<
String
>
threeNftIds
=
threeNftList
.
stream
().
map
(
GoblinGoodsSkuInfoVo:
:
getSkuId
).
collect
(
Collectors
.
toList
());
/*threeNftIds.addAll(threeDayAboutNft);*/
toDayNftIds
=
toDaysNftList
.
stream
().
map
(
GoblinGoodsSkuInfoVo:
:
getSkuId
).
collect
(
Collectors
.
toList
());
/*toDayNftIds.addAll(toDayAboutNft);*/
//三天的
Query
queryThreeNft
=
new
Query
();
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"skuType"
).
is
(
1
));
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
));
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"saleStartTime"
).
gte
(
toDayEndTime
).
lt
(
threeEndTime
));
/*queryThreeNft.addCriteria(Criteria.where("skuId").nin(allListSkuIds));*/
queryThreeNft
.
addCriteria
(
Criteria
.
where
(
"shelvesHandle"
).
ne
(
"3"
));
Sort
sortThreeNft
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryThreeNft
.
with
(
sortThreeNft
);
List
<
GoblinGoodsSkuInfoVo
>
threeNftList
=
mongoTemplate
.
find
(
queryThreeNft
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
// threeNftList.addAll(threeDayAboutNft);
threeNftIds
=
threeNftList
.
stream
().
map
(
GoblinGoodsSkuInfoVo:
:
getSkuId
).
collect
(
Collectors
.
toList
());
/*threeNftIds.addAll(threeDayAboutNft);*/
}
catch
(
Exception
e
)
{
log
.
error
(
"get NftIds error!"
);
}
//组合购
//当天
Query
queryToDayCombination
=
new
Query
();
Sort
sortToDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryToDayCombination
.
addCriteria
(
Criteria
.
where
(
"timeStart"
).
gte
(
nowTimeTStr
).
lt
(
toDayEndTimeStr
));
queryToDayCombination
.
addCriteria
(
Criteria
.
where
(
"status"
).
ne
(
7
));
queryToDayCombination
.
with
(
sortToDayCombination
);
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
mongoTemplate
.
find
(
queryToDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
List
<
String
>
toDayCombinationIds
=
toDayCombinationList
.
stream
().
map
(
GoblinMixDetailsVo:
:
getMixId
).
collect
(
Collectors
.
toList
());
//三天
Query
queryThreeDayCombination
=
new
Query
();
Sort
sortThreeDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryThreeDayCombination
.
addCriteria
(
Criteria
.
where
(
"timeStart"
).
gte
(
toDayEndTimeStr
).
lt
(
threeDaysLaterStr
));
queryThreeDayCombination
.
addCriteria
(
Criteria
.
where
(
"status"
).
ne
(
7
));
queryThreeDayCombination
.
with
(
sortThreeDayCombination
);
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
mongoTemplate
.
find
(
queryThreeDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
List
<
String
>
threeDayCombinationIds
=
threeDayCombinationList
.
stream
().
map
(
GoblinMixDetailsVo:
:
getMixId
).
collect
(
Collectors
.
toList
());
List
<
String
>
toDayCombinationIds
=
null
;
List
<
String
>
threeDayCombinationIds
=
null
;
try
{
//当天
Query
queryToDayCombination
=
new
Query
();
Sort
sortToDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryToDayCombination
.
addCriteria
(
Criteria
.
where
(
"timeStart"
).
gte
(
nowTimeTStr
).
lt
(
toDayEndTimeStr
));
queryToDayCombination
.
addCriteria
(
Criteria
.
where
(
"status"
).
ne
(
7
));
queryToDayCombination
.
with
(
sortToDayCombination
);
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
mongoTemplate
.
find
(
queryToDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
toDayCombinationIds
=
toDayCombinationList
.
stream
().
map
(
GoblinMixDetailsVo:
:
getMixId
).
collect
(
Collectors
.
toList
());
//三天
Query
queryThreeDayCombination
=
new
Query
();
Sort
sortThreeDayCombination
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
);
queryThreeDayCombination
.
addCriteria
(
Criteria
.
where
(
"timeStart"
).
gte
(
toDayEndTimeStr
).
lt
(
threeDaysLaterStr
));
queryThreeDayCombination
.
addCriteria
(
Criteria
.
where
(
"status"
).
ne
(
7
));
queryThreeDayCombination
.
with
(
sortThreeDayCombination
);
List
<
GoblinMixDetailsVo
>
threeDayCombinationList
=
mongoTemplate
.
find
(
queryThreeDayCombination
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
threeDayCombinationIds
=
threeDayCombinationList
.
stream
().
map
(
GoblinMixDetailsVo:
:
getMixId
).
collect
(
Collectors
.
toList
());
}
catch
(
Exception
e
)
{
log
.
error
(
"get CombinationIds error!"
);
}
//缓存ids
...
...
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