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
54c6b427
Commit
54c6b427
authored
Apr 04, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运营系统脱敏查询 -- 调整记录控制数:1000 -->50000-->3000
parent
75ca7b4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
50 deletions
+7
-50
UserQueryLogController.java
.../controller/external/queryLog/UserQueryLogController.java
+4
-33
LoanVestMQServiceImpl.java
...uantgroup/xyqb/service/mq/Impl/LoanVestMQServiceImpl.java
+3
-17
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/queryLog/UserQueryLogController.java
View file @
54c6b427
...
...
@@ -110,7 +110,6 @@ public class UserQueryLogController {
}
else
if
(
pageSize
>
200
){
pageSize
=
200
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
try
{
for
(
UserQueryLog
ll:
userQueryLogs
){
...
...
@@ -120,26 +119,20 @@ public class UserQueryLogController {
LOGGER
.
info
(
"日期时间转换异常"
);
return
JsonResult
.
buildErrorStateResult
(
"日期时间转换异常"
,
null
);
}
uqp
.
setPageSize
(
pageSize
);
uqp
.
setPageId
(
pageId
);
uqp
.
setPageList
(
userQueryLogs
);
int
yu
=
total
.
intValue
()%
pageSize
;
Double
d
=
Math
.
ceil
(
total
/
pageSize
);
uqp
.
setPages
(
yu
>
0
?
d
.
intValue
()+
1
:
d
.
intValue
());
return
JsonResult
.
buildSuccessResult
(
"查询成功"
,
uqp
);
}
catch
(
Exception
e
){
return
JsonResult
.
buildErrorStateResult
(
"查询失败"
,
null
);
}
}
@RequestMapping
(
"/queryUserInfo"
)
public
JsonResult
queryForResult
(
HttpServletRequest
request
,
String
key
,
String
keyValues
,
String
columns
,
Integer
pageId
,
Integer
pageSize
)
{
LOGGER
.
info
(
"查询条件:key{},columns{}"
,
key
,
columns
);
String
token
=
request
.
getHeader
(
Constants
.
X_AUTH_TOKEN
);
if
(
StringUtils
.
isEmpty
(
token
)){
...
...
@@ -162,45 +155,36 @@ public class UserQueryLogController {
}
String
[]
values
=
keyValues
.
split
(
"\\n"
);
List
<
String
>
queryV
=
Arrays
.
asList
(
values
);
if
(
queryV
!=
null
&&
queryV
.
size
()>
50000
){
return
JsonResult
.
buildErrorStateResult
(
"查询记录数是"
+
queryV
.
size
()+
",超过50000条限制"
,
null
);
if
(
queryV
!=
null
&&
queryV
.
size
()>
3000
){
return
JsonResult
.
buildErrorStateResult
(
"查询记录数是"
+
queryV
.
size
()+
",超过3000条限制"
,
null
);
}
List
<
UserQueryInfo
>
userQueryInfos
=
new
ArrayList
<
UserQueryInfo
>();
List
<
UserDetail
>
userDetails
=
new
ArrayList
<
UserDetail
>();
Page
<
UserDetail
>
userDetailPage
=
null
;
List
<
Address
>
addresslist
=
new
ArrayList
<
Address
>();
HashMap
<
String
,
String
>
phonesCards
=
new
HashMap
<
String
,
String
>();
if
(
pageSize
==
0
||
pageSize
<
0
){
pageSize
=
30
;
}
else
if
(
pageSize
>
200
){
pageSize
=
200
;
}
//如果维度里面没有保护查询条件则加入条件
if
(!
columns
.
contains
(
key
)){
columns
=
columns
+
","
+
key
;
}
if
(
Objects
.
equals
(
key
,
"userId"
)){
List
<
Long
>
userIds
=
new
ArrayList
<
Long
>();
try
{
for
(
String
s:
queryV
){
if
(
s
.
length
()>
8
){
return
JsonResult
.
buildErrorStateResult
(
"查询的userId"
+
s
+
"长度超过8位"
,
null
);
}
long
uid
=
Long
.
valueOf
(
s
);
userIds
.
add
(
uid
);
}
}
catch
(
Exception
e
){
return
JsonResult
.
buildErrorStateResult
(
"查询的userId有误"
,
null
);
}
userDetailPage
=
userDetailService
.
getUserDetailsPage
(
userIds
,
null
,
null
,
pageId
,
pageSize
,
"auto"
);
}
else
if
(
Objects
.
equals
(
key
,
Constants
.
PHONE_NO
)){
for
(
String
pn:
queryV
){
...
...
@@ -208,7 +192,6 @@ public class UserQueryLogController {
return
JsonResult
.
buildErrorStateResult
(
"查询的手机号码"
+
pn
+
"格式有误"
,
null
);
}
}
userDetailPage
=
userDetailService
.
getUserDetailsPage
(
null
,
queryV
,
null
,
pageId
,
pageSize
,
"auto"
);
}
else
if
(
Objects
.
equals
(
key
,
"idNo"
)){
IdcardValidator
iv
=
new
IdcardValidator
();
...
...
@@ -219,14 +202,11 @@ public class UserQueryLogController {
}
userDetailPage
=
userDetailService
.
getUserDetailsPage
(
null
,
null
,
queryV
,
pageId
,
pageSize
,
"auto"
);
}
if
(
userDetailPage
!=
null
){
userDetails
=
userDetailPage
.
getContent
();
}
if
(
columns
.
contains
(
"bankCard"
)){
//需加银行卡信息
if
(
Objects
.
equals
(
key
,
Constants
.
PHONE_NO
)){
phonesCards
=
getBankCardsByPhoneNos
(
queryV
);
if
(
phonesCards
!=
null
&&
phonesCards
.
get
(
"errorMsg"
)!=
null
&&!
StringUtils
.
isEmpty
(
phonesCards
.
get
(
"errorMsg"
))){
...
...
@@ -242,9 +222,7 @@ public class UserQueryLogController {
return
JsonResult
.
buildErrorStateResult
(
phonesCards
.
get
(
"errorMsg"
),
null
);
}
}
}
if
(
columns
.
contains
(
"address"
)){
List
<
Long
>
uidss
=
new
ArrayList
<
Long
>();
//加地址信息
...
...
@@ -254,9 +232,7 @@ public class UserQueryLogController {
if
(
uidss
!=
null
&&
uidss
.
size
()>
0
){
addresslist
=
addressService
.
findByUserIds
(
uidss
);
}
}
for
(
UserDetail
ud:
userDetails
){
UserQueryInfo
uqi
=
new
UserQueryInfo
();
if
(
columns
.
contains
(
"idNo"
)){
...
...
@@ -280,11 +256,8 @@ public class UserQueryLogController {
if
(
columns
.
contains
(
"bankCard"
)&&
phonesCards
!=
null
){
uqi
.
setBankCards
(
phonesCards
.
get
(
ud
.
getPhoneNo
()));
}
userQueryInfos
.
add
(
uqi
);
}
//保存记录
UserQueryLog
log
=
new
UserQueryLog
();
log
.
setQueryItems
(
columns
.
replace
(
"userId"
,
"用户ID"
).
replace
(
Constants
.
PHONE_NO
,
"手机号"
).
replace
(
"name"
,
"姓名"
).
replace
(
"idNo"
,
"身份证号"
).
replace
(
"bankCard"
,
"银行卡号"
).
replace
(
"address"
,
"地址"
));
...
...
@@ -294,14 +267,12 @@ public class UserQueryLogController {
log
.
setQueryDetail
(
keyValues
.
replace
(
"\n"
,
";"
));
log
.
setLoginUserName
(
userName
);
userQueryLogService
.
save
(
log
);
PageModel
<
UserQueryInfo
>
uqi
=
new
PageModel
<
UserQueryInfo
>();
uqi
.
setPageId
(
pageId
);
uqi
.
setPageList
(
userQueryInfos
);
uqi
.
setPageSize
(
pageSize
);
uqi
.
setPages
(
userDetailPage
.
getTotalPages
());
uqi
.
setTotal
(
userDetailPage
.
getTotalElements
());
return
JsonResult
.
buildSuccessResult
(
"查询成功"
,
uqi
);
}
...
...
@@ -395,8 +366,8 @@ public class UserQueryLogController {
List
<
String
>
queryV
=
Arrays
.
asList
(
values
);
if
(
queryV
!=
null
&&
queryV
.
size
()>
50
000
){
return
JsonResult
.
buildErrorStateResult
(
"查询记录数是"
+
queryV
.
size
()+
",超过
50
000条限制"
,
null
);
if
(
queryV
!=
null
&&
queryV
.
size
()>
3
000
){
return
JsonResult
.
buildErrorStateResult
(
"查询记录数是"
+
queryV
.
size
()+
",超过
3
000条限制"
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/service/mq/Impl/LoanVestMQServiceImpl.java
View file @
54c6b427
...
...
@@ -12,8 +12,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
;
/**
* Created by xuran on 2017/6/21.
* 用户统计信息
...
...
@@ -30,13 +28,6 @@ public class LoanVestMQServiceImpl implements IVestService {
@Qualifier
(
value
=
"loanVestQueue"
)
Queue
loanVestQueue
;
/**
* 发送用登陆统计信息
* @param message 订单信息
...
...
@@ -44,17 +35,12 @@ public class LoanVestMQServiceImpl implements IVestService {
@Async
public
void
send
(
UserStatistics
message
){
if
(
null
==
message
){
LOGGER
.
error
(
"用登陆统计消息不能为空"
);
LOGGER
.
error
(
"用
户
登陆统计消息不能为空"
);
}
LOGGER
.
info
(
"用登陆统计发送,message={}"
,
message
);
LOGGER
.
info
(
"用户登陆统计发送,message={}"
,
message
);
String
msg
=
JSONObject
.
toJSONString
(
message
);
loanVestRabbitTemplate
.
convertAndSend
(
"statistics-user"
,
msg
);
LOGGER
.
info
(
"用登陆统计成功,message={}"
,
msg
);
LOGGER
.
info
(
"用户登陆统计成功,message={}"
,
msg
);
}
}
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