记得上下班打卡 | 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
8dd44456
Commit
8dd44456
authored
Jul 18, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_notice_0708' into dev_bd_rm_consumer_od
parents
4e336549
15c14b79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
60 deletions
+67
-60
DataUtils.java
...ain/java/com/liquidnet/service/kylin/utils/DataUtils.java
+46
-59
ObjectUtil.java
...in/java/com/liquidnet/service/kylin/utils/ObjectUtil.java
+21
-1
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 @
8dd44456
...
@@ -46,7 +46,6 @@ public class DataUtils {
...
@@ -46,7 +46,6 @@ public class DataUtils {
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
@Autowired
@Autowired
private
RedisUtil
redisUtil
;
private
RedisUtil
redisUtil
;
@Autowired
@Autowired
GoblinRedisUtils
goblinRedisUtils
;
GoblinRedisUtils
goblinRedisUtils
;
...
@@ -357,15 +356,24 @@ public class DataUtils {
...
@@ -357,15 +356,24 @@ public class DataUtils {
return
(
List
<
KylinPerformanceVo
>)
obj
;
return
(
List
<
KylinPerformanceVo
>)
obj
;
}
}
/**
/**
* 获取演出预告列表redis
* 获取演出预告列表redis
*/
*/
public
HashMap
<
String
,
Object
>
getPerformancesListNotice
()
{
public
HashMap
<
String
,
Object
>
getPerformancesListNotice
()
{
String
redisKeyIds
=
KylinRedisConst
.
PERFORMANCES_LIST_NOTICE_IDS
;
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
Object
obj
=
redisUtil
.
get
(
redisKeyIds
);
//演出
if
(
obj
!=
null
)
{
List
<
KylinPerformanceVo
>
toDayList
=
ObjectUtil
.
getKylinPerformanceVoArrayList
();
List
<
KylinPerformanceVo
>
threeDaysList
=
ObjectUtil
.
getKylinPerformanceVoArrayList
();
//数字藏品
List
<
NoticeGoblinGoodsSkuInfoVo
>
toDayNftVoList
=
ObjectUtil
.
getNoticeGoblinGoodsSkuInfoVoList
();
List
<
NoticeGoblinGoodsSkuInfoVo
>
threeDayNftVoList
=
ObjectUtil
.
getNoticeGoblinGoodsSkuInfoVoList
();
//组合购
List
<
NoticeGoblinMixDetailsVo
>
toDayCombinationVoList
=
ObjectUtil
.
getNoticeGoblinMixDetailsVoList
();
List
<
NoticeGoblinMixDetailsVo
>
threeDayCombinationVoList
=
ObjectUtil
.
getNoticeGoblinMixDetailsVoList
();
Map
<
String
,
Object
>
map
=
getRedisNoticeIsd
();
if
(
map
!=
null
)
{
//获取ids
//获取ids
HashMap
<
String
,
Object
>
map
=
(
HashMap
<
String
,
Object
>)
obj
;
List
<
String
>
toDayIds
=
(
List
<
String
>)
map
.
get
(
"toDayIds"
);
List
<
String
>
toDayIds
=
(
List
<
String
>)
map
.
get
(
"toDayIds"
);
List
<
String
>
threeDayIds
=
(
List
<
String
>)
map
.
get
(
"threeDayIds"
);
List
<
String
>
threeDayIds
=
(
List
<
String
>)
map
.
get
(
"threeDayIds"
);
List
<
String
>
toDayNftIds
=
(
List
<
String
>)
map
.
get
(
"toDayNftIds"
);
List
<
String
>
toDayNftIds
=
(
List
<
String
>)
map
.
get
(
"toDayNftIds"
);
...
@@ -374,7 +382,7 @@ public class DataUtils {
...
@@ -374,7 +382,7 @@ public class DataUtils {
List
<
String
>
threeDayCombinationIds
=
(
List
<
String
>)
map
.
get
(
"threeDayCombinationIds"
);
List
<
String
>
threeDayCombinationIds
=
(
List
<
String
>)
map
.
get
(
"threeDayCombinationIds"
);
// 固定条件
// 固定条件
List
<
KylinPerformanceVo
>
toDayList
=
getKylinPerformanceVos
(
toDayIds
);
toDayList
=
getKylinPerformanceVos
(
toDayIds
);
toDayList
.
forEach
(
kylinPerformanceVo
->
{
toDayList
.
forEach
(
kylinPerformanceVo
->
{
kylinPerformanceVo
.
setNoticeImage
(
null
);
kylinPerformanceVo
.
setNoticeImage
(
null
);
kylinPerformanceVo
.
setTicketTimeList
(
null
);
kylinPerformanceVo
.
setTicketTimeList
(
null
);
...
@@ -385,7 +393,7 @@ public class DataUtils {
...
@@ -385,7 +393,7 @@ public class DataUtils {
}).collect(Collectors.toList());*/
}).collect(Collectors.toList());*/
// 固定条件
// 固定条件
List
<
KylinPerformanceVo
>
threeDaysList
=
getKylinPerformanceVos
(
threeDayIds
);
threeDaysList
=
getKylinPerformanceVos
(
threeDayIds
);
threeDaysList
.
forEach
(
kylinPerformanceVo
->
{
threeDaysList
.
forEach
(
kylinPerformanceVo
->
{
kylinPerformanceVo
.
setNoticeImage
(
null
);
kylinPerformanceVo
.
setNoticeImage
(
null
);
kylinPerformanceVo
.
setTicketTimeList
(
null
);
kylinPerformanceVo
.
setTicketTimeList
(
null
);
...
@@ -395,9 +403,6 @@ public class DataUtils {
...
@@ -395,9 +403,6 @@ public class DataUtils {
return NoticeKylinPerformanceVo.getNew().copy(kylinPerformanceVo);
return NoticeKylinPerformanceVo.getNew().copy(kylinPerformanceVo);
}).collect(Collectors.toList());*/
}).collect(Collectors.toList());*/
//数字藏品
List
<
NoticeGoblinGoodsSkuInfoVo
>
toDayNftVoList
=
null
;
List
<
NoticeGoblinGoodsSkuInfoVo
>
threeDayNftVoList
=
null
;
try
{
try
{
//当天
//当天
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
getGoblinGoodsSkuInfoVos
(
toDayNftIds
);
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
getGoblinGoodsSkuInfoVos
(
toDayNftIds
);
...
@@ -411,9 +416,6 @@ public class DataUtils {
...
@@ -411,9 +416,6 @@ public class DataUtils {
log
.
error
(
"return NftVoList error!"
);
log
.
error
(
"return NftVoList error!"
);
}
}
//组合购
List
<
NoticeGoblinMixDetailsVo
>
toDayCombinationVoList
=
null
;
List
<
NoticeGoblinMixDetailsVo
>
threeDayCombinationVoList
=
null
;
try
{
try
{
//当天
//当天
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
getGoblinMixDetailsVos
(
toDayCombinationIds
);
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
getGoblinMixDetailsVos
(
toDayCombinationIds
);
...
@@ -426,23 +428,15 @@ public class DataUtils {
...
@@ -426,23 +428,15 @@ public class DataUtils {
log
.
error
(
"return CombinationVoList error!"
);
log
.
error
(
"return CombinationVoList error!"
);
}
}
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
info
.
put
(
"toDayList"
,
toDayList
);
info
.
put
(
"threeDaysList"
,
threeDaysList
);
//过滤数据
info
.
put
(
"toDaysNftList"
,
toDayNftVoList
);
info
.
put
(
"threeDayNftList"
,
threeDayNftVoList
);
info
.
put
(
"toDayCombinationList"
,
toDayCombinationVoList
);
info
.
put
(
"threeDayCombinationList"
,
threeDayCombinationVoList
);
//原始数据
// info.put("toDaysNftList", toDaysNftList);
// info.put("threeNftList", threeNftList);
// info.put("toDayCombinationList", toDayCombinationList);
// info.put("threeDayCombinationList", threeDayCombinationList);
return
info
;
}
}
return
(
HashMap
<
String
,
Object
>)
obj
;
info
.
put
(
"toDayList"
,
toDayList
);
info
.
put
(
"threeDaysList"
,
threeDaysList
);
//过滤数据
info
.
put
(
"toDaysNftList"
,
toDayNftVoList
);
info
.
put
(
"threeDayNftList"
,
threeDayNftVoList
);
info
.
put
(
"toDayCombinationList"
,
toDayCombinationVoList
);
info
.
put
(
"threeDayCombinationList"
,
threeDayCombinationVoList
);
return
info
;
}
}
/**
/**
...
@@ -543,7 +537,7 @@ public class DataUtils {
...
@@ -543,7 +537,7 @@ public class DataUtils {
}
}
private
List
<
GoblinMixDetailsVo
>
getGoblinMixDetailsVos
(
List
<
String
>
toDayCombinationIds
)
{
private
List
<
GoblinMixDetailsVo
>
getGoblinMixDetailsVos
(
List
<
String
>
toDayCombinationIds
)
{
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
new
ArrayList
<>
();
List
<
GoblinMixDetailsVo
>
toDayCombinationList
=
ObjectUtil
.
getGoblinMixDetailsVoList
();
//redis key
//redis key
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_DETAILS
;
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_DETAILS
;
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
;
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
;
...
@@ -591,17 +585,14 @@ public class DataUtils {
...
@@ -591,17 +585,14 @@ public class DataUtils {
return
toDayCombinationList
;
return
toDayCombinationList
;
}
}
private
List
<
GoblinGoodsSkuInfoVo
>
getGoblinGoodsSkuInfoVos
(
List
<
String
>
toDayNftIds
)
{
private
List
<
GoblinGoodsSkuInfoVo
>
getGoblinGoodsSkuInfoVos
(
List
<
String
>
toDayNftIds
)
{
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
new
ArrayList
<>();
List
<
GoblinGoodsSkuInfoVo
>
toDaysNftList
=
ObjectUtil
.
getGoblinGoodsSkuInfoVoList
();
//redis key
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
;
if
(
toDayNftIds
!=
null
&&
toDayNftIds
.
size
()
>
0
)
{
if
(
toDayNftIds
!=
null
&&
toDayNftIds
.
size
()
>
0
)
{
//查询redis
//查询redis
toDayNftIds
.
forEach
(
id
->
{
toDayNftIds
.
forEach
(
id
->
{
Object
obj
=
redisUtil
.
get
(
rk
.
concat
(
id
));
GoblinGoodsSkuInfoVo
goodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
id
);
if
(
obj
!=
null
)
{
toDaysNftList
.
add
(
goodsSkuInfoVo
);
toDaysNftList
.
add
((
GoblinGoodsSkuInfoVo
)
obj
);
}
});
});
//查询mongodb
//查询mongodb
/*Query queryToDayNft = new Query();
/*Query queryToDayNft = new Query();
...
@@ -613,29 +604,12 @@ public class DataUtils {
...
@@ -613,29 +604,12 @@ public class DataUtils {
}
}
private
List
<
KylinPerformanceVo
>
getKylinPerformanceVos
(
List
<
String
>
toDayIds
)
{
private
List
<
KylinPerformanceVo
>
getKylinPerformanceVos
(
List
<
String
>
toDayIds
)
{
List
<
KylinPerformanceVo
>
toDayList
=
new
ArrayList
<>();
List
<
KylinPerformanceVo
>
toDayList
=
ObjectUtil
.
getKylinPerformanceVoArrayList
();
//redis key
String
key
=
KylinRedisConst
.
PERFORMANCES
;
if
(
toDayIds
!=
null
&&
toDayIds
.
size
()
>
0
)
{
if
(
toDayIds
!=
null
&&
toDayIds
.
size
()
>
0
)
{
//查询redis
//查询redis
toDayIds
.
forEach
(
id
->
{
toDayIds
.
forEach
(
id
->
{
Object
obj
=
redisUtil
.
get
(
key
+
id
);
KylinPerformanceVo
one
=
getPerformanceVo
(
id
);
if
(
obj
!=
null
)
{
toDayList
.
add
(
one
);
toDayList
.
add
((
KylinPerformanceVo
)
obj
);
}
else
{
Query
query
=
new
Query
();
query
.
fields
().
exclude
(
"details"
);
query
.
fields
().
exclude
(
"noticeImage"
);
query
.
fields
().
exclude
(
"ticketTimeList"
);
query
.
fields
().
exclude
(
"describeElectronic"
);
query
.
addCriteria
(
Criteria
.
where
(
"performancesId"
).
is
(
id
));
KylinPerformanceVo
one
=
mongoTemplate
.
findOne
(
query
,
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
if
(
one
!=
null
)
{
//增加redis缓存
redisUtil
.
set
(
key
+
id
,
one
);
toDayList
.
add
(
one
);
}
}
});
});
}
}
return
toDayList
;
return
toDayList
;
...
@@ -766,8 +740,7 @@ public class DataUtils {
...
@@ -766,8 +740,7 @@ public class DataUtils {
idsList
.
put
(
"toDayCombinationIds"
,
toDayCombinationIds
);
idsList
.
put
(
"toDayCombinationIds"
,
toDayCombinationIds
);
idsList
.
put
(
"threeDayCombinationIds"
,
threeDayCombinationIds
);
idsList
.
put
(
"threeDayCombinationIds"
,
threeDayCombinationIds
);
idsList
.
put
(
"now"
,
nowTimeTime
);
idsList
.
put
(
"now"
,
nowTimeTime
);
String
redisKeyIds
=
KylinRedisConst
.
PERFORMANCES_LIST_NOTICE_IDS
;
setRedisNoticeIsd
(
idsList
);
redisUtil
.
set
(
redisKeyIds
,
idsList
);
return
idsList
;
return
idsList
;
}
}
...
@@ -1061,6 +1034,20 @@ public class DataUtils {
...
@@ -1061,6 +1034,20 @@ public class DataUtils {
}
}
}
}
public
void
setRedisNoticeIsd
(
HashMap
<
String
,
Object
>
idsList
)
{
String
redisKeyIds
=
KylinRedisConst
.
PERFORMANCES_LIST_NOTICE_IDS
;
redisUtil
.
set
(
redisKeyIds
,
idsList
);
}
public
Map
<
String
,
Object
>
getRedisNoticeIsd
()
{
String
redisKeyIds
=
KylinRedisConst
.
PERFORMANCES_LIST_NOTICE_IDS
;
Object
obj
=
redisUtil
.
get
(
redisKeyIds
);
if
(
obj
!=
null
)
{
return
(
HashMap
<
String
,
Object
>)
obj
;
}
return
null
;
}
/**
/**
* 获取我的演出列表
* 获取我的演出列表
*/
*/
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/utils/ObjectUtil.java
View file @
8dd44456
...
@@ -2,7 +2,7 @@ package com.liquidnet.service.kylin.utils;
...
@@ -2,7 +2,7 @@ package com.liquidnet.service.kylin.utils;
import
com.liquidnet.service.adam.dto.vo.AdamEntersVo
;
import
com.liquidnet.service.adam.dto.vo.AdamEntersVo
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.goblin.dto.vo.
GoblinListCollectVo
;
import
com.liquidnet.service.goblin.dto.vo.
*
;
import
com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo
;
import
com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo
;
import
com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage
;
import
com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage
;
import
com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo
;
import
com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo
;
...
@@ -36,12 +36,32 @@ public class ObjectUtil {
...
@@ -36,12 +36,32 @@ public class ObjectUtil {
/*正在热卖*/
/*正在热卖*/
private
static
final
ArrayList
<
GoblinListCollectVo
>
goblinListCollectVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinListCollectVo
>
goblinListCollectVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
NoticeGoblinGoodsSkuInfoVo
>
noticeGoblinGoodsSkuInfoVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
NoticeGoblinMixDetailsVo
>
noticeGoblinMixDetailsVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixDetailsVo
>
goblinMixDetailsVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinGoodsSkuInfoVo
>
goblinGoodsSkuInfoVoArrayList
=
new
ArrayList
<>();
public
static
ArrayList
<
KylinStationPerformanceVo
>
getKylinStationPerformanceVoArrayList
()
{
public
static
ArrayList
<
KylinStationPerformanceVo
>
getKylinStationPerformanceVoArrayList
()
{
return
(
ArrayList
<
KylinStationPerformanceVo
>)
kylinStationPerformanceVoArrayList
.
clone
();
return
(
ArrayList
<
KylinStationPerformanceVo
>)
kylinStationPerformanceVoArrayList
.
clone
();
}
}
public
static
ArrayList
<
NoticeGoblinGoodsSkuInfoVo
>
getNoticeGoblinGoodsSkuInfoVoList
()
{
return
(
ArrayList
<
NoticeGoblinGoodsSkuInfoVo
>)
noticeGoblinGoodsSkuInfoVoArrayList
.
clone
();
}
public
static
ArrayList
<
GoblinGoodsSkuInfoVo
>
getGoblinGoodsSkuInfoVoList
()
{
return
(
ArrayList
<
GoblinGoodsSkuInfoVo
>)
goblinGoodsSkuInfoVoArrayList
.
clone
();
}
public
static
ArrayList
<
NoticeGoblinMixDetailsVo
>
getNoticeGoblinMixDetailsVoList
()
{
return
(
ArrayList
<
NoticeGoblinMixDetailsVo
>)
noticeGoblinMixDetailsVoArrayList
.
clone
();
}
public
static
ArrayList
<
GoblinMixDetailsVo
>
getGoblinMixDetailsVoList
()
{
return
(
ArrayList
<
GoblinMixDetailsVo
>)
goblinMixDetailsVoArrayList
.
clone
();
}
public
static
ArrayList
<
KylinTicketVo
>
getKylinTicketVoArrayList
()
{
public
static
ArrayList
<
KylinTicketVo
>
getKylinTicketVoArrayList
()
{
return
(
ArrayList
<
KylinTicketVo
>)
kylinTicketVoArrayList
.
clone
();
return
(
ArrayList
<
KylinTicketVo
>)
kylinTicketVoArrayList
.
clone
();
}
}
...
...
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