Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
7447d990
Commit
7447d990
authored
Mar 19, 2021
by
于桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sonar fix
parent
3d99e408
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
RedisLockAspect.java
.../java/cn/quantgroup/xyqb/aspect/lock/RedisLockAspect.java
+2
-1
BlackHoleRegisteredEventListener.java
...antgroup/xyqb/event/BlackHoleRegisteredEventListener.java
+3
-3
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+1
-1
RedisLock.java
src/main/java/cn/quantgroup/xyqb/util/RedisLock.java
+5
-2
No files found.
src/main/java/cn/quantgroup/xyqb/aspect/lock/RedisLockAspect.java
View file @
7447d990
...
...
@@ -60,7 +60,8 @@ public class RedisLockAspect {
}
else
if
(
StringUtils
.
isNotBlank
(
annotation
.
key
()))
{
String
keySPEL
=
annotation
.
key
();
try
{
if
(
keySPEL
.
startsWith
(
"#this"
))
{
//判断是否是spel表达式
String
keyPrefix
=
"#this"
;
if
(
keySPEL
.
startsWith
(
keyPrefix
))
{
//判断是否是spel表达式
Expression
expression
=
new
SpelExpressionParser
().
parseExpression
(
keySPEL
);
String
value
=
expression
.
getValue
(
args
,
String
.
class
);
lockKey
=
prefix
.
concat
(
":"
).
concat
(
value
);
...
...
src/main/java/cn/quantgroup/xyqb/event/BlackHoleRegisteredEventListener.java
View file @
7447d990
...
...
@@ -24,8 +24,8 @@ public class BlackHoleRegisteredEventListener implements ApplicationListener<Reg
private
String
routingKey
;
@Resource
private
RabbitTemplate
registeredNotifyBlackHoleRabbitTemplate
;
long
[]
templateIds
=
{
8
l
,
280
l
};
long
[]
templateIds_159913
=
{
433
l
,
434
l
};
// 羊小咩小程序的渠道,合同内容不包含现金分期业务,如果这种情况较多可以考虑配置化
private
long
[]
templateIds
=
{
8L
,
280L
};
private
long
[]
templateIds_159913
=
{
433L
,
434L
};
// 羊小咩小程序的渠道,合同内容不包含现金分期业务,如果这种情况较多可以考虑配置化
private
static
final
Long
YXM_CHANNEL
=
159913L
;
// 羊小咩小程序的渠道(小程序_电商,小程序_VCC)
@Override
...
...
@@ -37,7 +37,7 @@ public class BlackHoleRegisteredEventListener implements ApplicationListener<Reg
String
dateStr
=
signDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy年MM月dd日"
));
int
day
=
signDate
.
getDayOfMonth
();
// 信用钱包服务与隐私协议
long
[]
regTempIds
=
userRegisterParam
.
getRegisterFrom
().
equals
(
YXM_CHANNEL
)
?
templateIds_159913
:
templateIds
;
long
[]
regTempIds
=
YXM_CHANNEL
.
equals
(
userRegisterParam
.
getRegisterFrom
()
)
?
templateIds_159913
:
templateIds
;
for
(
long
id
:
regTempIds
)
{
JSONObject
fields
=
new
JSONObject
();
fields
.
put
(
"phoneNo"
,
user
.
getPhoneNo
());
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
7447d990
...
...
@@ -261,7 +261,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
List
<
UserHashMapping
>
userHashMappings
=
userHashMappingRepository
.
findByIdNoMd5AndIdNoMd5Short
(
md5Value
,
value
);
if
(!
CollectionUtils
.
isEmpty
(
userHashMappings
))
{
//如果多个只返回最新的
userHashMapping
=
userHashMappings
.
stream
().
max
(
Comparator
.
comparing
(
UserHashMapping:
:
getId
)).
get
(
);
userHashMapping
=
userHashMappings
.
stream
().
max
(
Comparator
.
comparing
(
UserHashMapping:
:
getId
)).
orElse
(
null
);
}
}
else
{
userHashMapping
=
null
;
...
...
src/main/java/cn/quantgroup/xyqb/util/RedisLock.java
View file @
7447d990
...
...
@@ -221,8 +221,11 @@ public class RedisLock {
retryCount
++;
if
(
timeout
>
100
)
{
timeout
-=
100
;
}
else
timeout
=
1
;
{
else
{
timeout
=
1
;
}
// TODO sonar检查,else语句缺少大括号发现问题,下面这个大括号什么鬼?
{
Thread
.
sleep
(
100
);
}
}
}
...
...
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