记得上下班打卡 | 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
1f573f03
Commit
1f573f03
authored
Nov 30, 2021
by
Tice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换 redis 数据源
parent
065d7e52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
MerchantRedisUtil.java
...ient/admin/zhengzai/merchant/utils/MerchantRedisUtil.java
+23
-23
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/merchant/utils/MerchantRedisUtil.java
View file @
1f573f03
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
merchant
.
utils
;
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
merchant
.
utils
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.cache.redis.util.Redis
DataSource
Util
;
import
com.liquidnet.service.merchant.constant.MerchantRedisConst
;
import
com.liquidnet.service.merchant.constant.MerchantRedisConst
;
import
com.liquidnet.service.merchant.dto.vo.*
;
import
com.liquidnet.service.merchant.dto.vo.*
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -16,7 +16,7 @@ import java.util.stream.IntStream;
...
@@ -16,7 +16,7 @@ import java.util.stream.IntStream;
@Service
@Service
public
class
MerchantRedisUtil
{
public
class
MerchantRedisUtil
{
@Autowired
@Autowired
Redis
Util
redis
Util
;
Redis
DataSourceUtil
redisDataSource
Util
;
@Autowired
@Autowired
MerchantMongoUtil
mongoUtil
;
MerchantMongoUtil
mongoUtil
;
...
@@ -28,18 +28,18 @@ public class MerchantRedisUtil {
...
@@ -28,18 +28,18 @@ public class MerchantRedisUtil {
}
}
String
key
=
MerchantRedisConst
.
INFO_FIELD
.
concat
(
fieldId
);
String
key
=
MerchantRedisConst
.
INFO_FIELD
.
concat
(
fieldId
);
long
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
MerchantFieldsVo
vo
=
(
MerchantFieldsVo
)
redis
Util
.
get
(
key
);
MerchantFieldsVo
vo
=
(
MerchantFieldsVo
)
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
get
(
key
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
if
(
null
==
vo
)
{
if
(
null
==
vo
)
{
vo
=
mongoUtil
.
getFieldsVoByFieldId
(
fieldId
);
vo
=
mongoUtil
.
getFieldsVoByFieldId
(
fieldId
);
redis
Util
.
set
(
key
,
vo
);
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
key
,
vo
);
}
}
return
vo
;
return
vo
;
}
}
// 【场地】更新详情
// 【场地】更新详情
public
boolean
setFieldsVoByFieldId
(
String
fieldId
,
MerchantFieldsVo
vo
)
{
public
boolean
setFieldsVoByFieldId
(
String
fieldId
,
MerchantFieldsVo
vo
)
{
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_FIELD
.
concat
(
fieldId
),
vo
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_FIELD
.
concat
(
fieldId
),
vo
);
}
}
...
@@ -50,18 +50,18 @@ public class MerchantRedisUtil {
...
@@ -50,18 +50,18 @@ public class MerchantRedisUtil {
}
}
String
key
=
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
);
String
key
=
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
);
long
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
List
<
MerchantFieldAppliesVo
>
vos
=
(
List
<
MerchantFieldAppliesVo
>)
redis
Util
.
get
(
key
);
List
<
MerchantFieldAppliesVo
>
vos
=
(
List
<
MerchantFieldAppliesVo
>)
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
get
(
key
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
if
(
null
==
vos
)
{
if
(
null
==
vos
)
{
vos
=
mongoUtil
.
getFieldAppliesVosByUid
(
uid
);
vos
=
mongoUtil
.
getFieldAppliesVosByUid
(
uid
);
redis
Util
.
set
(
key
,
vos
);
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
key
,
vos
);
}
}
return
vos
;
return
vos
;
}
}
// 【场地认领】更新我的列表
// 【场地认领】更新我的列表
public
boolean
setFieldAppliesVosByUid
(
String
uid
,
List
<
MerchantFieldAppliesVo
>
vos
)
{
public
boolean
setFieldAppliesVosByUid
(
String
uid
,
List
<
MerchantFieldAppliesVo
>
vos
)
{
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
}
}
// 【场地申请】新增
// 【场地申请】新增
...
@@ -70,7 +70,7 @@ public class MerchantRedisUtil {
...
@@ -70,7 +70,7 @@ public class MerchantRedisUtil {
vos
=
new
ArrayList
<>();
vos
=
new
ArrayList
<>();
}
}
vos
.
add
(
vo
);
vos
.
add
(
vo
);
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
}
}
// 【场地申请】删除
// 【场地申请】删除
...
@@ -79,7 +79,7 @@ public class MerchantRedisUtil {
...
@@ -79,7 +79,7 @@ public class MerchantRedisUtil {
return
true
;
return
true
;
}
}
vos
.
removeIf
(
r
->
r
.
getFieldApplyId
().
equals
(
vo
.
getFieldApplyId
()));
vos
.
removeIf
(
r
->
r
.
getFieldApplyId
().
equals
(
vo
.
getFieldApplyId
()));
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
}
}
// 【场地申请】更新
// 【场地申请】更新
...
@@ -94,7 +94,7 @@ public class MerchantRedisUtil {
...
@@ -94,7 +94,7 @@ public class MerchantRedisUtil {
return
false
;
return
false
;
}
}
vos
.
set
(
idx
,
vo
);
vos
.
set
(
idx
,
vo
);
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_FIELD_APPLIES
.
concat
(
uid
),
vos
);
}
}
...
@@ -102,7 +102,7 @@ public class MerchantRedisUtil {
...
@@ -102,7 +102,7 @@ public class MerchantRedisUtil {
public
List
<
MerchantFieldCheckersVo
>
getFieldCheckersVosByFieldId
(
String
fieldId
)
{
public
List
<
MerchantFieldCheckersVo
>
getFieldCheckersVosByFieldId
(
String
fieldId
)
{
String
key
=
MerchantRedisConst
.
INFO_FIELD_CHECKERS
.
concat
(
fieldId
);
String
key
=
MerchantRedisConst
.
INFO_FIELD_CHECKERS
.
concat
(
fieldId
);
long
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
List
<
MerchantFieldCheckersVo
>
vos
=
(
List
<
MerchantFieldCheckersVo
>)
redis
Util
.
get
(
key
);
List
<
MerchantFieldCheckersVo
>
vos
=
(
List
<
MerchantFieldCheckersVo
>)
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
get
(
key
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
return
vos
;
return
vos
;
}
}
...
@@ -113,7 +113,7 @@ public class MerchantRedisUtil {
...
@@ -113,7 +113,7 @@ public class MerchantRedisUtil {
vos
=
new
ArrayList
<>();
vos
=
new
ArrayList
<>();
}
}
vos
.
add
(
vo
);
vos
.
add
(
vo
);
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_FIELD_CHECKERS
.
concat
(
fieldId
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_FIELD_CHECKERS
.
concat
(
fieldId
),
vos
);
}
}
// 【场地默认验票员】删除
// 【场地默认验票员】删除
...
@@ -122,7 +122,7 @@ public class MerchantRedisUtil {
...
@@ -122,7 +122,7 @@ public class MerchantRedisUtil {
return
true
;
return
true
;
}
}
vos
.
removeIf
(
r
->
r
.
getFieldCheckerId
().
equals
(
vo
.
getFieldCheckerId
()));
vos
.
removeIf
(
r
->
r
.
getFieldCheckerId
().
equals
(
vo
.
getFieldCheckerId
()));
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_FIELD_CHECKERS
.
concat
(
fieldId
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_FIELD_CHECKERS
.
concat
(
fieldId
),
vos
);
}
}
// 【主办】详情
// 【主办】详情
...
@@ -132,18 +132,18 @@ public class MerchantRedisUtil {
...
@@ -132,18 +132,18 @@ public class MerchantRedisUtil {
}
}
String
key
=
MerchantRedisConst
.
INFO_SPONSOR
.
concat
(
sponsorId
);
String
key
=
MerchantRedisConst
.
INFO_SPONSOR
.
concat
(
sponsorId
);
long
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
MerchantSponsorsVo
vo
=
(
MerchantSponsorsVo
)
redis
Util
.
get
(
key
);
MerchantSponsorsVo
vo
=
(
MerchantSponsorsVo
)
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
get
(
key
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
if
(
null
==
vo
)
{
if
(
null
==
vo
)
{
vo
=
mongoUtil
.
getSponsorsVoBySponsorId
(
sponsorId
);
vo
=
mongoUtil
.
getSponsorsVoBySponsorId
(
sponsorId
);
redis
Util
.
set
(
key
,
vo
);
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
key
,
vo
);
}
}
return
vo
;
return
vo
;
}
}
// 【主办】更新详情
// 【主办】更新详情
public
boolean
setSponsorsVoBySponsorId
(
String
sponsorId
,
MerchantSponsorsVo
vo
)
{
public
boolean
setSponsorsVoBySponsorId
(
String
sponsorId
,
MerchantSponsorsVo
vo
)
{
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_SPONSOR
.
concat
(
sponsorId
),
vo
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_SPONSOR
.
concat
(
sponsorId
),
vo
);
}
}
// 【主办申请】我的列表
// 【主办申请】我的列表
...
@@ -153,18 +153,18 @@ public class MerchantRedisUtil {
...
@@ -153,18 +153,18 @@ public class MerchantRedisUtil {
}
}
String
key
=
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
);
String
key
=
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
);
long
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
List
<
MerchantSponsorAppliesVo
>
vos
=
(
List
<
MerchantSponsorAppliesVo
>)
redis
Util
.
get
(
key
);
List
<
MerchantSponsorAppliesVo
>
vos
=
(
List
<
MerchantSponsorAppliesVo
>)
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
get
(
key
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
if
(
null
==
vos
)
{
if
(
null
==
vos
)
{
vos
=
mongoUtil
.
getSponsorAppliesVosByUid
(
uid
);
vos
=
mongoUtil
.
getSponsorAppliesVosByUid
(
uid
);
redis
Util
.
set
(
key
,
vos
);
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
key
,
vos
);
}
}
return
vos
;
return
vos
;
}
}
// 【主办申请】更新我的列表
// 【主办申请】更新我的列表
public
boolean
setSponsorAppliesVosByUid
(
String
uid
,
List
<
MerchantSponsorAppliesVo
>
vos
)
{
public
boolean
setSponsorAppliesVosByUid
(
String
uid
,
List
<
MerchantSponsorAppliesVo
>
vos
)
{
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
}
}
// 【主办申请】新增
// 【主办申请】新增
...
@@ -173,7 +173,7 @@ public class MerchantRedisUtil {
...
@@ -173,7 +173,7 @@ public class MerchantRedisUtil {
vos
=
new
ArrayList
<>();
vos
=
new
ArrayList
<>();
}
}
vos
.
add
(
vo
);
vos
.
add
(
vo
);
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
}
}
// 【主办申请】删除
// 【主办申请】删除
...
@@ -182,7 +182,7 @@ public class MerchantRedisUtil {
...
@@ -182,7 +182,7 @@ public class MerchantRedisUtil {
return
true
;
return
true
;
}
}
vos
.
removeIf
(
r
->
r
.
getSponsorApplyId
().
equals
(
vo
.
getSponsorApplyId
()));
vos
.
removeIf
(
r
->
r
.
getSponsorApplyId
().
equals
(
vo
.
getSponsorApplyId
()));
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
}
}
// 【主办申请】更新
// 【主办申请】更新
...
@@ -197,7 +197,7 @@ public class MerchantRedisUtil {
...
@@ -197,7 +197,7 @@ public class MerchantRedisUtil {
return
false
;
return
false
;
}
}
vos
.
set
(
idx
,
vo
);
vos
.
set
(
idx
,
vo
);
return
redis
Util
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
return
redis
DataSourceUtil
.
getRedisKylinUtil
()
.
set
(
MerchantRedisConst
.
INFO_SPONSOR_APPLIES
.
concat
(
uid
),
vos
);
}
}
}
}
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