记得上下班打卡 | 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
2b8a481e
Commit
2b8a481e
authored
Jul 30, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix;
parent
8dd2ba4c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
233 additions
and
313 deletions
+233
-313
AdamRedisConst.java
...a/com/liquidnet/service/adam/constant/AdamRedisConst.java
+2
-0
RedisUtil.java
...java/com.liquidnet.common.cache/redis/util/RedisUtil.java
+0
-188
AdamRdmService.java
...va/com/liquidnet/service/adam/service/AdamRdmService.java
+76
-7
AdamAddressesServiceImpl.java
...t/service/adam/service/impl/AdamAddressesServiceImpl.java
+8
-8
AdamEntersServiceImpl.java
...dnet/service/adam/service/impl/AdamEntersServiceImpl.java
+8
-8
AdamMemberOrderServiceImpl.java
...service/adam/service/impl/AdamMemberOrderServiceImpl.java
+139
-102
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/constant/AdamRedisConst.java
View file @
2b8a481e
...
@@ -31,6 +31,8 @@ public class AdamRedisConst {
...
@@ -31,6 +31,8 @@ public class AdamRedisConst {
public
static
final
String
INFO_MEMBER_RIGHTS
=
INFO
.
concat
(
"member:rights:"
);
public
static
final
String
INFO_MEMBER_RIGHTS
=
INFO
.
concat
(
"member:rights:"
);
public
static
final
String
INFO_MEMBER_AGREEMENT
=
INFO
.
concat
(
"member:agreement"
);
public
static
final
String
INFO_MEMBER_AGREEMENT
=
INFO
.
concat
(
"member:agreement"
);
public
static
final
String
INFO_MEMBER_CODE
=
INFO
.
concat
(
"member:code:"
);
public
static
final
String
INFO_MEMBER_CODE
=
INFO
.
concat
(
"member:code:"
);
public
static
final
String
INFO_MEMBER_ORDER
=
INFO
.
concat
(
"morder:"
);
public
static
final
String
INFO_BUY_MEMBER_ORDER_CODE
=
INFO
.
concat
(
"mordercode:"
);
public
static
final
String
INFO_LIBRARY_NKNAME
=
INFO
.
concat
(
"library:nkname"
);
public
static
final
String
INFO_LIBRARY_NKNAME
=
INFO
.
concat
(
"library:nkname"
);
...
...
liquidnet-bus-common/liquidnet-common-cache/liquidnet-common-cache-redis/src/main/java/com.liquidnet.common.cache/redis/util/RedisUtil.java
View file @
2b8a481e
...
@@ -45,8 +45,6 @@ public final class RedisUtil {
...
@@ -45,8 +45,6 @@ public final class RedisUtil {
public
boolean
expire
(
String
key
,
long
time
)
{
public
boolean
expire
(
String
key
,
long
time
)
{
try
{
if
(
time
>
0
)
{
if
(
time
>
0
)
{
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
...
@@ -55,14 +53,6 @@ public final class RedisUtil {
...
@@ -55,14 +53,6 @@ public final class RedisUtil {
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -95,18 +85,8 @@ public final class RedisUtil {
...
@@ -95,18 +85,8 @@ public final class RedisUtil {
public
boolean
hasKey
(
String
key
)
{
public
boolean
hasKey
(
String
key
)
{
try
{
return
redisTemplate
.
hasKey
(
key
);
return
redisTemplate
.
hasKey
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
/**
/**
...
@@ -187,19 +167,11 @@ public final class RedisUtil {
...
@@ -187,19 +167,11 @@ public final class RedisUtil {
public
boolean
set
(
String
key
,
Object
value
)
{
public
boolean
set
(
String
key
,
Object
value
)
{
try
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -221,7 +193,6 @@ public final class RedisUtil {
...
@@ -221,7 +193,6 @@ public final class RedisUtil {
public
boolean
set
(
String
key
,
Object
value
,
long
time
)
{
public
boolean
set
(
String
key
,
Object
value
,
long
time
)
{
try
{
if
(
time
>
0
)
{
if
(
time
>
0
)
{
...
@@ -235,13 +206,6 @@ public final class RedisUtil {
...
@@ -235,13 +206,6 @@ public final class RedisUtil {
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -350,19 +314,11 @@ public final class RedisUtil {
...
@@ -350,19 +314,11 @@ public final class RedisUtil {
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
)
{
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
)
{
try
{
redisTemplate
.
opsForHash
().
putAll
(
key
,
map
);
redisTemplate
.
opsForHash
().
putAll
(
key
,
map
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -383,7 +339,6 @@ public final class RedisUtil {
...
@@ -383,7 +339,6 @@ public final class RedisUtil {
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
,
long
time
)
{
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
,
long
time
)
{
try
{
redisTemplate
.
opsForHash
().
putAll
(
key
,
map
);
redisTemplate
.
opsForHash
().
putAll
(
key
,
map
);
...
@@ -395,13 +350,6 @@ public final class RedisUtil {
...
@@ -395,13 +350,6 @@ public final class RedisUtil {
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -422,19 +370,11 @@ public final class RedisUtil {
...
@@ -422,19 +370,11 @@ public final class RedisUtil {
public
boolean
hset
(
String
key
,
String
item
,
Object
value
)
{
public
boolean
hset
(
String
key
,
String
item
,
Object
value
)
{
try
{
redisTemplate
.
opsForHash
().
put
(
key
,
item
,
value
);
redisTemplate
.
opsForHash
().
put
(
key
,
item
,
value
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -457,7 +397,6 @@ public final class RedisUtil {
...
@@ -457,7 +397,6 @@ public final class RedisUtil {
public
boolean
hset
(
String
key
,
String
item
,
Object
value
,
long
time
)
{
public
boolean
hset
(
String
key
,
String
item
,
Object
value
,
long
time
)
{
try
{
redisTemplate
.
opsForHash
().
put
(
key
,
item
,
value
);
redisTemplate
.
opsForHash
().
put
(
key
,
item
,
value
);
...
@@ -469,13 +408,6 @@ public final class RedisUtil {
...
@@ -469,13 +408,6 @@ public final class RedisUtil {
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -572,17 +504,9 @@ public final class RedisUtil {
...
@@ -572,17 +504,9 @@ public final class RedisUtil {
public
Set
<
Object
>
sGet
(
String
key
)
{
public
Set
<
Object
>
sGet
(
String
key
)
{
try
{
return
redisTemplate
.
opsForSet
().
members
(
key
);
return
redisTemplate
.
opsForSet
().
members
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
}
...
@@ -601,17 +525,9 @@ public final class RedisUtil {
...
@@ -601,17 +525,9 @@ public final class RedisUtil {
public
boolean
sHasKey
(
String
key
,
Object
value
)
{
public
boolean
sHasKey
(
String
key
,
Object
value
)
{
try
{
return
redisTemplate
.
opsForSet
().
isMember
(
key
,
value
);
return
redisTemplate
.
opsForSet
().
isMember
(
key
,
value
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -630,17 +546,9 @@ public final class RedisUtil {
...
@@ -630,17 +546,9 @@ public final class RedisUtil {
public
long
sSet
(
String
key
,
Object
...
values
)
{
public
long
sSet
(
String
key
,
Object
...
values
)
{
try
{
return
redisTemplate
.
opsForSet
().
add
(
key
,
values
);
return
redisTemplate
.
opsForSet
().
add
(
key
,
values
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
}
...
@@ -661,7 +569,6 @@ public final class RedisUtil {
...
@@ -661,7 +569,6 @@ public final class RedisUtil {
public
long
sSetAndTime
(
String
key
,
long
time
,
Object
...
values
)
{
public
long
sSetAndTime
(
String
key
,
long
time
,
Object
...
values
)
{
try
{
Long
count
=
redisTemplate
.
opsForSet
().
add
(
key
,
values
);
Long
count
=
redisTemplate
.
opsForSet
().
add
(
key
,
values
);
...
@@ -671,13 +578,6 @@ public final class RedisUtil {
...
@@ -671,13 +578,6 @@ public final class RedisUtil {
return
count
;
return
count
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
}
...
@@ -694,17 +594,9 @@ public final class RedisUtil {
...
@@ -694,17 +594,9 @@ public final class RedisUtil {
public
long
sGetSetSize
(
String
key
)
{
public
long
sGetSetSize
(
String
key
)
{
try
{
return
redisTemplate
.
opsForSet
().
size
(
key
);
return
redisTemplate
.
opsForSet
().
size
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
}
...
@@ -723,19 +615,11 @@ public final class RedisUtil {
...
@@ -723,19 +615,11 @@ public final class RedisUtil {
public
long
setRemove
(
String
key
,
Object
...
values
)
{
public
long
setRemove
(
String
key
,
Object
...
values
)
{
try
{
Long
count
=
redisTemplate
.
opsForSet
().
remove
(
key
,
values
);
Long
count
=
redisTemplate
.
opsForSet
().
remove
(
key
,
values
);
return
count
;
return
count
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
}
...
@@ -758,17 +642,9 @@ public final class RedisUtil {
...
@@ -758,17 +642,9 @@ public final class RedisUtil {
public
List
<
Object
>
lGet
(
String
key
,
long
start
,
long
end
)
{
public
List
<
Object
>
lGet
(
String
key
,
long
start
,
long
end
)
{
try
{
return
redisTemplate
.
opsForList
().
range
(
key
,
start
,
end
);
return
redisTemplate
.
opsForList
().
range
(
key
,
start
,
end
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
}
...
@@ -785,17 +661,9 @@ public final class RedisUtil {
...
@@ -785,17 +661,9 @@ public final class RedisUtil {
public
long
lGetListSize
(
String
key
)
{
public
long
lGetListSize
(
String
key
)
{
try
{
return
redisTemplate
.
opsForList
().
size
(
key
);
return
redisTemplate
.
opsForList
().
size
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
}
...
@@ -814,17 +682,9 @@ public final class RedisUtil {
...
@@ -814,17 +682,9 @@ public final class RedisUtil {
public
Object
lGetIndex
(
String
key
,
long
index
)
{
public
Object
lGetIndex
(
String
key
,
long
index
)
{
try
{
return
redisTemplate
.
opsForList
().
index
(
key
,
index
);
return
redisTemplate
.
opsForList
().
index
(
key
,
index
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
}
...
@@ -837,19 +697,11 @@ public final class RedisUtil {
...
@@ -837,19 +697,11 @@ public final class RedisUtil {
*/
*/
public
boolean
lSet
(
String
key
,
Object
value
)
{
public
boolean
lSet
(
String
key
,
Object
value
)
{
try
{
redisTemplate
.
opsForList
().
rightPush
(
key
,
value
);
redisTemplate
.
opsForList
().
rightPush
(
key
,
value
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -870,7 +722,6 @@ public final class RedisUtil {
...
@@ -870,7 +722,6 @@ public final class RedisUtil {
public
boolean
lSet
(
String
key
,
Object
value
,
long
time
)
{
public
boolean
lSet
(
String
key
,
Object
value
,
long
time
)
{
try
{
redisTemplate
.
opsForList
().
rightPush
(
key
,
value
);
redisTemplate
.
opsForList
().
rightPush
(
key
,
value
);
...
@@ -880,13 +731,6 @@ public final class RedisUtil {
...
@@ -880,13 +731,6 @@ public final class RedisUtil {
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -899,19 +743,11 @@ public final class RedisUtil {
...
@@ -899,19 +743,11 @@ public final class RedisUtil {
*/
*/
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
)
{
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
)
{
try
{
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
value
);
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
value
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -934,7 +770,6 @@ public final class RedisUtil {
...
@@ -934,7 +770,6 @@ public final class RedisUtil {
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
,
long
time
)
{
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
,
long
time
)
{
try
{
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
value
);
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
value
);
...
@@ -944,13 +779,6 @@ public final class RedisUtil {
...
@@ -944,13 +779,6 @@ public final class RedisUtil {
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -971,19 +799,11 @@ public final class RedisUtil {
...
@@ -971,19 +799,11 @@ public final class RedisUtil {
public
boolean
lUpdateIndex
(
String
key
,
long
index
,
Object
value
)
{
public
boolean
lUpdateIndex
(
String
key
,
long
index
,
Object
value
)
{
try
{
redisTemplate
.
opsForList
().
set
(
key
,
index
,
value
);
redisTemplate
.
opsForList
().
set
(
key
,
index
,
value
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
}
...
@@ -1004,19 +824,11 @@ public final class RedisUtil {
...
@@ -1004,19 +824,11 @@ public final class RedisUtil {
public
long
lRemove
(
String
key
,
long
count
,
Object
value
)
{
public
long
lRemove
(
String
key
,
long
count
,
Object
value
)
{
try
{
Long
remove
=
redisTemplate
.
opsForList
().
remove
(
key
,
count
,
value
);
Long
remove
=
redisTemplate
.
opsForList
().
remove
(
key
,
count
,
value
);
return
remove
;
return
remove
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
0
;
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/AdamRdmService.java
View file @
2b8a481e
...
@@ -14,10 +14,7 @@ import org.springframework.util.CollectionUtils;
...
@@ -14,10 +14,7 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
...
@@ -51,7 +48,7 @@ public class AdamRdmService {
...
@@ -51,7 +48,7 @@ public class AdamRdmService {
public
boolean
setSmsCodeByMobile
(
String
mobile
,
String
smsCode
)
{
public
boolean
setSmsCodeByMobile
(
String
mobile
,
String
smsCode
)
{
// TODO: 2021/7/29 改为1分钟
// TODO: 2021/7/29 改为1分钟
return
redisUtil
.
set
(
AdamRedisConst
.
VALID_SMS_CODE_MOBILE
+
mobile
,
smsCode
,
1
*
60
);
return
redisUtil
.
set
(
AdamRedisConst
.
VALID_SMS_CODE_MOBILE
+
mobile
,
smsCode
,
60
);
}
}
public
String
getSmsCodeByMobile
(
String
mobile
)
{
public
String
getSmsCodeByMobile
(
String
mobile
)
{
...
@@ -240,6 +237,23 @@ public class AdamRdmService {
...
@@ -240,6 +237,23 @@ public class AdamRdmService {
return
vos
;
return
vos
;
}
}
public
boolean
addEntersVoByUid
(
String
uid
,
List
<
AdamEntersVo
>
vos
,
AdamEntersVo
vo
)
{
if
(
CollectionUtils
.
isEmpty
(
vos
))
{
vos
=
Collections
.
singletonList
(
vo
);
}
else
{
vos
.
add
(
vo
);
}
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_ENTERS
+
uid
,
vos
);
}
public
boolean
rmvEntersVoByUid
(
String
uid
,
List
<
AdamEntersVo
>
vos
,
String
entersId
)
{
if
(
CollectionUtils
.
isEmpty
(
vos
))
{
return
true
;
}
vos
.
removeIf
(
r
->
r
.
getEntersId
().
equals
(
entersId
));
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_ENTERS
+
uid
,
vos
);
}
public
AdamEntersVo
getEntersVoByUidEntersId
(
List
<
AdamEntersVo
>
vos
,
String
entersId
)
{
public
AdamEntersVo
getEntersVoByUidEntersId
(
List
<
AdamEntersVo
>
vos
,
String
entersId
)
{
return
vos
.
stream
().
filter
(
r
->
r
.
getEntersId
().
equals
(
entersId
)).
findAny
().
orElse
(
null
);
return
vos
.
stream
().
filter
(
r
->
r
.
getEntersId
().
equals
(
entersId
)).
findAny
().
orElse
(
null
);
}
}
...
@@ -281,6 +295,23 @@ public class AdamRdmService {
...
@@ -281,6 +295,23 @@ public class AdamRdmService {
return
vos
;
return
vos
;
}
}
public
boolean
addAddressesVoByUid
(
String
uid
,
List
<
AdamAddressesVo
>
vos
,
AdamAddressesVo
vo
)
{
if
(
CollectionUtils
.
isEmpty
(
vos
))
{
vos
=
Collections
.
singletonList
(
vo
);
}
else
{
vos
.
add
(
vo
);
}
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_ADDRESSES
+
uid
,
vos
);
}
public
boolean
rmvAddressesVoByUid
(
String
uid
,
List
<
AdamAddressesVo
>
vos
,
String
addressesId
)
{
if
(
CollectionUtils
.
isEmpty
(
vos
))
{
return
true
;
}
vos
.
removeIf
(
r
->
r
.
getAddressesId
().
equals
(
addressesId
));
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_ADDRESSES
+
uid
,
vos
);
}
public
AdamAddressesVo
getAddressesVoByUidAddressesId
(
List
<
AdamAddressesVo
>
vos
,
String
addressesId
)
{
public
AdamAddressesVo
getAddressesVoByUidAddressesId
(
List
<
AdamAddressesVo
>
vos
,
String
addressesId
)
{
return
vos
.
stream
().
filter
(
r
->
r
.
getAddressesId
().
equals
(
addressesId
)).
findAny
().
orElse
(
null
);
return
vos
.
stream
().
filter
(
r
->
r
.
getAddressesId
().
equals
(
addressesId
)).
findAny
().
orElse
(
null
);
}
}
...
@@ -455,6 +486,40 @@ public class AdamRdmService {
...
@@ -455,6 +486,40 @@ public class AdamRdmService {
return
val
;
return
val
;
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <UID, MEMBER_ORDER_LIST(SUCC)> */
public
boolean
setMemberOrderVosByUid
(
String
uid
,
List
<
AdamMemberOrderVo
>
vos
)
{
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_MEMBER_ORDER
+
uid
,
vos
);
}
public
ArrayList
<
AdamMemberOrderVo
>
getMemberOrderVosByUid
(
String
uid
)
{
long
s
=
System
.
currentTimeMillis
();
ArrayList
<
AdamMemberOrderVo
>
vos
=
(
ArrayList
<
AdamMemberOrderVo
>)
redisUtil
.
get
(
AdamRedisConst
.
INFO_MEMBER_ORDER
+
uid
);
log
.
debug
(
"#RDM耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
return
vos
;
}
public
boolean
addMemberOrderVoByUid
(
String
uid
,
List
<
AdamMemberOrderVo
>
vos
,
AdamMemberOrderVo
vo
)
{
if
(
CollectionUtils
.
isEmpty
(
vos
))
{
vos
=
Collections
.
singletonList
(
vo
);
}
else
{
vos
.
add
(
vo
);
}
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_MEMBER_ORDER
+
uid
,
vos
);
}
public
boolean
rmvMemberOrderVoByUid
(
String
uid
,
List
<
AdamMemberOrderVo
>
vos
,
String
orderNo
)
{
if
(
CollectionUtils
.
isEmpty
(
vos
))
{
return
true
;
}
vos
.
removeIf
(
r
->
r
.
getOrderNo
().
equals
(
orderNo
));
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_MEMBER_ORDER
+
uid
,
vos
);
}
public
void
delMemberOrderVoByUid
(
String
uid
)
{
redisUtil
.
del
(
AdamRedisConst
.
INFO_MEMBER_ORDER
+
uid
);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <ORDER_NO, MEMBER_ORDER_INFO> */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <ORDER_NO, MEMBER_ORDER_INFO> */
public
boolean
setShotMemberOrderVoByOrderNo
(
String
orderNo
,
AdamMemberOrderVo
vo
)
{
public
boolean
setShotMemberOrderVoByOrderNo
(
String
orderNo
,
AdamMemberOrderVo
vo
)
{
...
@@ -528,11 +593,15 @@ public class AdamRdmService {
...
@@ -528,11 +593,15 @@ public class AdamRdmService {
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <AdamMemberCodeVo::buyOrderNo, MEMBER_CODE> */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <AdamMemberCodeVo::buyOrderNo, MEMBER_CODE> */
public
boolean
setMemberCodeByBuyOrderNo
(
String
buyOrderNo
,
String
memberCode
)
{
public
boolean
setMemberCodeByBuyOrderNo
(
String
buyOrderNo
,
String
memberCode
)
{
return
redisUtil
.
set
(
buyOrderNo
,
memberCode
);
return
redisUtil
.
set
(
AdamRedisConst
.
INFO_BUY_MEMBER_ORDER_CODE
+
buyOrderNo
,
memberCode
);
}
}
public
String
getMemberCodeByBuyOrderNo
(
String
buyOrderNo
)
{
public
String
getMemberCodeByBuyOrderNo
(
String
buyOrderNo
)
{
return
(
String
)
redisUtil
.
get
(
buyOrderNo
);
return
(
String
)
redisUtil
.
get
(
AdamRedisConst
.
INFO_BUY_MEMBER_ORDER_CODE
+
buyOrderNo
);
}
public
void
delMemberCodeByBuyOrderNo
(
String
buyOrderNo
)
{
redisUtil
.
del
(
AdamRedisConst
.
INFO_BUY_MEMBER_ORDER_CODE
+
buyOrderNo
);
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamAddressesServiceImpl.java
View file @
2b8a481e
...
@@ -63,8 +63,7 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
...
@@ -63,8 +63,7 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
long
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
// adamRdmService.delAddressesVoByUid(currentUid);
// adamRdmService.delAddressesVoByUid(currentUid);
vos
.
add
(
vo
);
adamRdmService
.
addAddressesVoByUid
(
currentUid
,
vos
,
vo
);
adamRdmService
.
setAddressesVoByUid
(
currentUid
,
vos
);
log
.
debug
(
"#RDS耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
log
.
debug
(
"#RDS耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
s
=
System
.
currentTimeMillis
();
s
=
System
.
currentTimeMillis
();
...
@@ -201,13 +200,14 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
...
@@ -201,13 +200,14 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
// Query.query(Criteria.where("uid").is(currentUid).and("addressesId").is(addressesId)), AdamAddressesVo.class.getSimpleName()
// Query.query(Criteria.where("uid").is(currentUid).and("addressesId").is(addressesId)), AdamAddressesVo.class.getSimpleName()
// );
// );
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
List
<
AdamAddressesVo
>
vos
=
adamRdmService
.
getAddressesVoByUid
(
uid
);
// List<AdamAddressesVo> vos = adamRdmService.getAddressesVoByUid(uid);
vos
.
removeIf
(
r
->
r
.
getAddressesId
().
equals
(
addressesId
));
// vos.removeIf(r -> r.getAddressesId().equals(addressesId));
long
s
=
System
.
currentTimeMillis
();
// s = System.currentTimeMillis();
adamRdmService
.
setAddressesVoByUid
(
uid
,
vos
);
// adamRdmService.setAddressesVoByUid(uid, vos);
log
.
debug
(
"#RDS耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
// log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
adamRdmService
.
rmvAddressesVoByUid
(
uid
,
adamRdmService
.
getAddressesVoByUid
(
uid
),
addressesId
);
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
queueUtils
.
sendMsgByRedis
(
queueUtils
.
sendMsgByRedis
(
MQConst
.
AdamQueue
.
SQL_UCENTER
.
getKey
(),
MQConst
.
AdamQueue
.
SQL_UCENTER
.
getKey
(),
SqlMapping
.
get
(
"adam_addresses.remove"
,
now
,
now
,
addressesId
)
SqlMapping
.
get
(
"adam_addresses.remove"
,
now
,
now
,
addressesId
)
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamEntersServiceImpl.java
View file @
2b8a481e
...
@@ -78,8 +78,7 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
...
@@ -78,8 +78,7 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
long
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
// adamRdmService.delEntersVoByUid(currentUid);
// adamRdmService.delEntersVoByUid(currentUid);
vos
.
add
(
vo
);
adamRdmService
.
addEntersVoByUid
(
currentUid
,
vos
,
vo
);
adamRdmService
.
setEntersVoByUid
(
currentUid
,
vos
);
log
.
debug
(
"#RDS耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
log
.
debug
(
"#RDS耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
s
=
System
.
currentTimeMillis
();
s
=
System
.
currentTimeMillis
();
...
@@ -220,13 +219,14 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
...
@@ -220,13 +219,14 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
// Query.query(Criteria.where("uid").is(currentUid).and("entersId").is(entersId)), AdamEntersVo.class.getSimpleName()
// Query.query(Criteria.where("uid").is(currentUid).and("entersId").is(entersId)), AdamEntersVo.class.getSimpleName()
// );
// );
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
List
<
AdamEntersVo
>
vos
=
adamRdmService
.
getEntersVoByUid
(
uid
);
// List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(uid);
vos
.
removeIf
(
r
->
r
.
getEntersId
().
equals
(
entersId
));
// vos.removeIf(r -> r.getEntersId().equals(entersId));
long
s
=
System
.
currentTimeMillis
();
// s = System.currentTimeMillis();
adamRdmService
.
setEntersVoByUid
(
uid
,
vos
);
// adamRdmService.setEntersVoByUid(uid, vos);
log
.
debug
(
"#RDS耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
// log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
adamRdmService
.
rmvEntersVoByUid
(
uid
,
adamRdmService
.
getEntersVoByUid
(
uid
),
entersId
);
s
=
System
.
currentTimeMillis
();
long
s
=
System
.
currentTimeMillis
();
queueUtils
.
sendMsgByRedis
(
queueUtils
.
sendMsgByRedis
(
MQConst
.
AdamQueue
.
SQL_UCENTER
.
getKey
(),
MQConst
.
AdamQueue
.
SQL_UCENTER
.
getKey
(),
SqlMapping
.
get
(
"adam_enters.remove"
,
now
,
now
,
entersId
)
SqlMapping
.
get
(
"adam_enters.remove"
,
now
,
now
,
entersId
)
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamMemberOrderServiceImpl.java
View file @
2b8a481e
This diff is collapsed.
Click to expand it.
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