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
f7d4f4ca
Commit
f7d4f4ca
authored
Oct 29, 2019
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
魔法值修复---一堆变量名
parent
32e0366f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
33 deletions
+41
-33
Constants.java
src/main/java/cn/quantgroup/xyqb/Constants.java
+8
-0
WeChatController.java
...quantgroup/xyqb/controller/external/WeChatController.java
+5
-5
UserQueryLogController.java
.../controller/internal/querylog/UserQueryLogController.java
+28
-28
No files found.
src/main/java/cn/quantgroup/xyqb/Constants.java
View file @
f7d4f4ca
...
...
@@ -53,6 +53,12 @@ public interface Constants {
* 登录账号/手机号参数名
*/
String
PHONE_NO
=
"phoneNo"
;
String
ID_NO
=
"idNo"
;
String
USER_ID
=
"userId"
;
String
USER_NAME
=
"name"
;
String
ERROR_MSG
=
"errorMsg"
;
String
BANK_CARD
=
"bankCard"
;
String
ADDRESS
=
"address"
;
/**
* 微信标识参数名
*/
...
...
@@ -61,6 +67,8 @@ public interface Constants {
String
RESULT_CODE
=
"code"
;
String
RESULT_DATA
=
"data"
;
String
SUCCESS_CODE
=
"0000"
;
String
PROTOCOL_HEAD_HTTPS
=
"https:"
;
String
PROTOCOL_HEAD_HTTP
=
"http"
;
// -- Start -- IPV4安全策略常量组
/**
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/WeChatController.java
View file @
f7d4f4ca
...
...
@@ -192,7 +192,7 @@ public class WeChatController implements IBaseController {
receiveCodeWithDefault
(
code
,
systemKey
,
schema
,
registerFrom
,
redirect
,
response
);
return
;
}
schema
=
extDataObj
.
getOrDefault
(
"protocol"
,
"http:"
).
toString
();
schema
=
extDataObj
.
getOrDefault
(
"protocol"
,
Constants
.
PROTOCOL_HEAD_HTTP
).
toString
();
LOGGER
.
info
(
"从微信登录extData中获得协议信息,protocol:{}"
,
schema
);
registerFrom
=
Long
.
valueOf
(
extDataObj
.
getOrDefault
(
"registerFrom"
,
"1"
).
toString
());
redirect
=
(
String
)
extDataObj
.
getOrDefault
(
"redirect"
,
"redirect"
);
...
...
@@ -221,7 +221,7 @@ public class WeChatController implements IBaseController {
redirect
=
Optional
.
ofNullable
(
redirect
).
orElse
(
""
);
schema
=
StringUtils
.
isBlank
(
schema
)
?
getProtocol
()
:
schema
;
String
domain
=
userUiDomain
;
if
(
Objects
.
equals
(
schema
,
"https:"
))
{
if
(
Objects
.
equals
(
schema
,
Constants
.
PROTOCOL_HEAD_HTTPS
))
{
domain
=
userUiDomainS
;
}
// 从code获取token
...
...
@@ -314,9 +314,9 @@ public class WeChatController implements IBaseController {
public
void
receiveCodeNoRedirect
(
String
code
,
@PathVariable
(
value
=
"key"
)
String
systemKey
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
Long
registerFrom
=
null
;
String
redirect
=
null
;
String
schema
=
"http:"
;
if
(
Objects
.
equals
(
"https:"
,
request
.
getScheme
()))
{
schema
=
"https:"
;
String
schema
=
Constants
.
PROTOCOL_HEAD_HTTP
;
if
(
Objects
.
equals
(
Constants
.
PROTOCOL_HEAD_HTTPS
,
request
.
getScheme
()))
{
schema
=
Constants
.
PROTOCOL_HEAD_HTTPS
;
}
receiveCodeWithDefault
(
code
,
systemKey
,
schema
,
registerFrom
,
redirect
,
response
);
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/querylog/UserQueryLogController.java
View file @
f7d4f4ca
...
...
@@ -172,7 +172,7 @@ public class UserQueryLogController {
if
(!
columns
.
contains
(
key
))
{
columns
=
columns
+
","
+
key
;
}
if
(
Objects
.
equals
(
key
,
"userId"
))
{
if
(
Objects
.
equals
(
key
,
Constants
.
USER_ID
))
{
List
<
Long
>
userIds
=
new
ArrayList
<>();
try
{
for
(
String
s
:
queryV
)
{
...
...
@@ -193,7 +193,7 @@ public class UserQueryLogController {
}
}
userDetailPage
=
userDetailService
.
getUserDetailsPage
(
null
,
queryV
,
null
,
pageId
,
pageSize
,
"auto"
);
}
else
if
(
Objects
.
equals
(
key
,
"idNo"
))
{
}
else
if
(
Objects
.
equals
(
key
,
Constants
.
ID_NO
))
{
for
(
String
idno
:
queryV
)
{
if
(!
IdcardValidator
.
is18Idcard
(
idno
)
&&
!
IdcardValidator
.
is15Idcard
(
idno
))
{
return
JsonResult
.
buildErrorStateResult
(
"查询的身份证号"
+
idno
+
"格式有误"
,
null
);
...
...
@@ -204,12 +204,12 @@ public class UserQueryLogController {
if
(
userDetailPage
!=
null
)
{
userDetails
=
userDetailPage
.
getContent
();
}
if
(
columns
.
contains
(
"bankCard"
))
{
if
(
columns
.
contains
(
Constants
.
BANK_CARD
))
{
//需加银行卡信息
if
(
Objects
.
equals
(
key
,
Constants
.
PHONE_NO
))
{
phonesCards
=
getBankCardsByPhoneNos
(
queryV
);
if
(
phonesCards
!=
null
&&
phonesCards
.
get
(
"errorMsg"
)
!=
null
&&
!
StringUtils
.
isEmpty
(
phonesCards
.
get
(
"errorMsg"
)))
{
return
JsonResult
.
buildErrorStateResult
(
phonesCards
.
get
(
"errorMsg"
),
null
);
if
(
phonesCards
!=
null
&&
phonesCards
.
get
(
Constants
.
ERROR_MSG
)
!=
null
&&
!
StringUtils
.
isEmpty
(
phonesCards
.
get
(
Constants
.
ERROR_MSG
)))
{
return
JsonResult
.
buildErrorStateResult
(
phonesCards
.
get
(
Constants
.
ERROR_MSG
),
null
);
}
}
else
{
List
<
String
>
phones
=
new
ArrayList
<>();
...
...
@@ -217,12 +217,12 @@ public class UserQueryLogController {
phones
.
add
(
uda
.
getPhoneNo
());
}
phonesCards
=
getBankCardsByPhoneNos
(
phones
);
if
(
phonesCards
!=
null
&&
phonesCards
.
get
(
"errorMsg"
)
!=
null
&&
!
StringUtils
.
isEmpty
(
phonesCards
.
get
(
"errorMsg"
)))
{
return
JsonResult
.
buildErrorStateResult
(
phonesCards
.
get
(
"errorMsg"
),
null
);
if
(
phonesCards
!=
null
&&
phonesCards
.
get
(
Constants
.
ERROR_MSG
)
!=
null
&&
!
StringUtils
.
isEmpty
(
phonesCards
.
get
(
Constants
.
ERROR_MSG
)))
{
return
JsonResult
.
buildErrorStateResult
(
phonesCards
.
get
(
Constants
.
ERROR_MSG
),
null
);
}
}
}
if
(
columns
.
contains
(
"address"
))
{
if
(
columns
.
contains
(
Constants
.
ADDRESS
))
{
List
<
Long
>
uidss
=
new
ArrayList
<>();
//加地址信息
for
(
UserDetail
ud
:
userDetails
)
{
...
...
@@ -234,33 +234,33 @@ public class UserQueryLogController {
}
for
(
UserDetail
ud
:
userDetails
)
{
UserQueryInfo
uqi
=
new
UserQueryInfo
();
if
(
columns
.
contains
(
"idNo"
))
{
if
(
columns
.
contains
(
Constants
.
ID_NO
))
{
uqi
.
setIdNo
(
ud
.
getIdNo
());
}
if
(
columns
.
contains
(
Constants
.
PHONE_NO
))
{
uqi
.
setPhoneNo
(
ud
.
getPhoneNo
());
}
if
(
columns
.
contains
(
"name"
))
{
if
(
columns
.
contains
(
Constants
.
USER_NAME
))
{
uqi
.
setName
(
ud
.
getName
());
}
if
(
columns
.
contains
(
"userId"
))
{
if
(
columns
.
contains
(
Constants
.
USER_ID
))
{
uqi
.
setUserId
(
ud
.
getUserId
());
}
if
(
columns
.
contains
(
"address"
))
{
if
(
columns
.
contains
(
Constants
.
ADDRESS
))
{
Optional
<
Address
>
oad
=
addresslist
.
stream
().
filter
(
addr
->
Objects
.
equals
(
addr
.
getUserId
(),
ud
.
getUserId
())).
findFirst
();
oad
.
ifPresent
(
address
->
uqi
.
setAddress
(
address
.
toString
()));
}
if
(
columns
.
contains
(
"bankCard"
)
&&
phonesCards
!=
null
)
{
if
(
columns
.
contains
(
Constants
.
BANK_CARD
)
&&
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"
,
"地址"
));
log
.
setQueryItems
(
columns
.
replace
(
Constants
.
USER_ID
,
"用户ID"
).
replace
(
Constants
.
PHONE_NO
,
"手机号"
).
replace
(
Constants
.
USER_NAME
,
"姓名"
).
replace
(
Constants
.
ID_NO
,
"身份证号"
).
replace
(
Constants
.
BANK_CARD
,
"银行卡号"
).
replace
(
Constants
.
ADDRESS
,
"地址"
));
log
.
setResultAmount
(
userDetailPage
.
getTotalElements
());
//转换存储
log
.
setQueryCondition
(
key
.
replace
(
"userId"
,
"用户ID"
).
replace
(
Constants
.
PHONE_NO
,
"手机号"
).
replace
(
"name"
,
"姓名"
).
replace
(
"idNo"
,
"身份证号"
));
log
.
setQueryCondition
(
key
.
replace
(
Constants
.
USER_ID
,
"用户ID"
).
replace
(
Constants
.
PHONE_NO
,
"手机号"
).
replace
(
Constants
.
USER_NAME
,
"姓名"
).
replace
(
Constants
.
ID_NO
,
"身份证号"
));
log
.
setQueryDetail
(
keyValues
.
replace
(
"\n"
,
";"
));
log
.
setLoginUserName
(
userName
);
userQueryLogService
.
save
(
log
);
...
...
@@ -287,7 +287,7 @@ public class UserQueryLogController {
sign
=
Md5Util
.
build
(
data
);
}
catch
(
Exception
e
)
{
LOGGER
.
info
(
"参数加密异常"
);
phonesMap
.
put
(
"errorMsg"
,
"参数加密异常"
);
phonesMap
.
put
(
Constants
.
ERROR_MSG
,
"参数加密异常"
);
return
null
;
}
...
...
@@ -322,12 +322,12 @@ public class UserQueryLogController {
}
}
else
{
phonesMap
.
put
(
"errorMsg"
,
"签名校验失败!"
);
phonesMap
.
put
(
Constants
.
ERROR_MSG
,
"签名校验失败!"
);
LOGGER
.
info
(
"签名校验失败!"
);
}
}
}
catch
(
Exception
e
)
{
phonesMap
.
put
(
"errorMsg"
,
"查询银行卡信息接口返回解析异常"
);
phonesMap
.
put
(
Constants
.
ERROR_MSG
,
"查询银行卡信息接口返回解析异常"
);
LOGGER
.
info
(
"查询银行卡信息接口返回解析异常"
);
}
return
phonesMap
;
...
...
@@ -368,7 +368,7 @@ public class UserQueryLogController {
List
<
UserDetail
>
userDetails
=
new
ArrayList
<>();
List
<
Address
>
addresslist
=
new
ArrayList
<>();
HashMap
<
String
,
String
>
phonesCards
=
new
HashMap
<>();
if
(
Objects
.
equals
(
key
,
"userId"
))
{
if
(
Objects
.
equals
(
key
,
Constants
.
USER_ID
))
{
List
<
Long
>
userIds
=
new
ArrayList
<>();
try
{
for
(
String
s
:
queryV
)
{
...
...
@@ -392,7 +392,7 @@ public class UserQueryLogController {
}
userDetails
=
userDetailService
.
findByPhoneNos
(
queryV
);
}
else
if
(
Objects
.
equals
(
key
,
"idNo"
))
{
}
else
if
(
Objects
.
equals
(
key
,
Constants
.
ID_NO
))
{
for
(
String
idno
:
queryV
)
{
if
(!
IdcardValidator
.
is18Idcard
(
idno
)
&&
!
IdcardValidator
.
is15Idcard
(
idno
))
{
return
JsonResult
.
buildErrorStateResult
(
"查询的身份证号"
+
idno
+
"格式有误"
,
idno
);
...
...
@@ -401,7 +401,7 @@ public class UserQueryLogController {
userDetails
=
userDetailService
.
findByIdnos
(
queryV
);
}
if
(
columns
.
contains
(
"bankCard"
))
{
if
(
columns
.
contains
(
Constants
.
BANK_CARD
))
{
//需加银行卡信息
if
(
key
.
equals
(
Constants
.
PHONE_NO
))
{
phonesCards
=
getBankCardsByPhoneNos
(
queryV
);
...
...
@@ -414,7 +414,7 @@ public class UserQueryLogController {
}
}
if
(
columns
.
contains
(
"address"
))
{
if
(
columns
.
contains
(
Constants
.
ADDRESS
))
{
List
<
Long
>
uidss
=
new
ArrayList
<>();
//加地址信息
for
(
UserDetail
ud
:
userDetails
)
{
...
...
@@ -428,23 +428,23 @@ public class UserQueryLogController {
for
(
UserDetail
ud
:
userDetails
)
{
UserQueryInfo
uqi
=
new
UserQueryInfo
();
if
(
columns
.
contains
(
"idNo"
))
{
if
(
columns
.
contains
(
Constants
.
ID_NO
))
{
uqi
.
setIdNo
(
ud
.
getIdNo
());
}
if
(
columns
.
contains
(
Constants
.
PHONE_NO
))
{
uqi
.
setPhoneNo
(
ud
.
getPhoneNo
());
}
if
(
columns
.
contains
(
"name"
))
{
if
(
columns
.
contains
(
Constants
.
USER_NAME
))
{
uqi
.
setName
(
ud
.
getName
());
}
if
(
columns
.
contains
(
"userId"
))
{
if
(
columns
.
contains
(
Constants
.
USER_ID
))
{
uqi
.
setUserId
(
ud
.
getUserId
());
}
if
(
columns
.
contains
(
"address"
))
{
if
(
columns
.
contains
(
Constants
.
ADDRESS
))
{
Optional
<
Address
>
oad
=
addresslist
.
stream
().
filter
(
addr
->
Objects
.
equals
(
addr
.
getUserId
(),
ud
.
getUserId
())).
findFirst
();
oad
.
ifPresent
(
address
->
uqi
.
setAddress
(
address
.
toString
()));
}
if
(
columns
.
contains
(
"bankCard"
)
&&
phonesCards
!=
null
)
{
if
(
columns
.
contains
(
Constants
.
BANK_CARD
)
&&
phonesCards
!=
null
)
{
uqi
.
setBankCards
(
phonesCards
.
get
(
ud
.
getPhoneNo
()));
}
uqls
.
add
(
uqi
);
...
...
@@ -462,7 +462,7 @@ public class UserQueryLogController {
style
.
setAlignment
(
HSSFCellStyle
.
ALIGN_CENTER
);
HSSFCell
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"userId"
);
cell
.
setCellValue
(
Constants
.
USER_ID
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
"手机号"
);
...
...
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