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
6c5ea055
Commit
6c5ea055
authored
Jul 27, 2018
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : 修复傻逼模糊查询的问题. 暂时不允许. 直接给个空
parent
e1686bf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
UserDetailServiceImpl.java
...ntgroup/xyqb/service/user/impl/UserDetailServiceImpl.java
+25
-21
No files found.
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserDetailServiceImpl.java
View file @
6c5ea055
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Predicate
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.quantgroup.acolyte.buddhistscriptures.pojo.UserRealInfo
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.entity.User
;
...
...
@@ -34,6 +13,23 @@ import cn.quantgroup.xyqb.service.auth.IIdCardService;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Predicate
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* Created by 11 on 2016/12/29.
...
...
@@ -130,12 +126,20 @@ public class UserDetailServiceImpl implements IUserDetailService {
if
(
ValidationUtil
.
validatePhoneNo
(
phoneNo
)){
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
Constants
.
PHONE_NO
).
as
(
String
.
class
),
phoneNo
));
}
else
if
(
StringUtils
.
isNotBlank
(
phoneNo
))
{
if
(
phoneNo
.
length
()
<
9
)
{
log
.
info
(
"哪个傻逼用这么少的数字查. phoneNo:{}"
,
phoneNo
);
return
null
;
}
list
.
add
(
criteriaBuilder
.
like
(
root
.
get
(
Constants
.
PHONE_NO
).
as
(
String
.
class
),
phoneNo
.
concat
(
"%"
)));
}
if
(
StringUtils
.
isNotBlank
(
idNo
))
{
if
(
Objects
.
equals
(
Constants
.
IDNO_LENGTH
,
idNo
.
length
())){
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"idNo"
).
as
(
String
.
class
),
idNo
));
}
else
{
if
(
idNo
.
length
()
<
16
)
{
log
.
info
(
"哪个傻逼用这么少的数字查. idNo:{}"
,
idNo
);
return
null
;
}
list
.
add
(
criteriaBuilder
.
like
(
root
.
get
(
"idNo"
).
as
(
String
.
class
),
idNo
.
concat
(
"%"
)));
}
}
...
...
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