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
5de6b024
Commit
5de6b024
authored
Mar 26, 2019
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idNo模糊查询用户信息
parent
5a12a8bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
10 deletions
+34
-10
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+14
-6
IUserDetailRepository.java
.../cn/quantgroup/xyqb/repository/IUserDetailRepository.java
+4
-0
IUserDetailService.java
...a/cn/quantgroup/xyqb/service/user/IUserDetailService.java
+6
-4
UserDetailServiceImpl.java
...ntgroup/xyqb/service/user/impl/UserDetailServiceImpl.java
+10
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
5de6b024
...
...
@@ -600,7 +600,7 @@ public class InnerController implements IBaseController {
* @param name - 姓名
* @param phoneNo - 手机号
* @param idNo - 身份证号
* @return JsonResult<List
<
UserDetail>>
* @return JsonResult<List
<
UserDetail>>
*/
@RequestMapping
(
"/user_detail/search_list"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"按照姓名、份证号或手机号查询用户实名信息 - 精确查询,供客服用,不限制入参正确性"
)
...
...
@@ -619,16 +619,16 @@ public class InnerController implements IBaseController {
*
* @param phoneNo - 手机号
* @param idNo - 身份证号
* @return JsonResult<List
<
UserDetail>>
* @return JsonResult<List
<
UserDetail>>
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"按照身份证号和手机号查询用户实名信息查询 - 模糊查询"
)
@RequestMapping
(
"/user_detail/fuzzyQuery"
)
@TargetDataSource
(
type
=
DSType
.
SLAVE
)
public
JsonResult
<
List
<
UserDetail
>>
fuzzyQueryUserDetailList
(
@ApiParam
(
value
=
"手机号"
,
required
=
true
)
@RequestParam
(
name
=
"phoneNo"
)
String
phoneNo
,
@ApiParam
(
value
=
"身份证号"
,
required
=
true
)
@RequestParam
(
name
=
"idNo"
)
String
idNo
,
@ApiParam
(
value
=
"用户姓名"
)
@RequestParam
(
name
=
"userName"
,
required
=
false
)
String
userName
)
{
public
JsonResult
<
List
<
UserDetail
>>
fuzzyQueryUserDetailList
(
@ApiParam
(
value
=
"手机号"
)
@RequestParam
(
name
=
"phoneNo"
)
String
phoneNo
,
@ApiParam
(
value
=
"身份证号"
)
@RequestParam
(
name
=
"idNo"
)
String
idNo
,
@ApiParam
(
value
=
"用户姓名"
)
@RequestParam
(
name
=
"userName"
)
String
userName
)
{
log
.
info
(
"fuzzyQueryUserDetailList, phone:{},idNo:{},ip:{}"
,
phoneNo
,
idNo
,
getIp
());
if
(
StringUtils
.
isBlank
(
phoneNo
)
||
StringUtils
.
isBlank
(
idNo
))
{
if
(
StringUtils
.
isBlank
(
phoneNo
)
&&
StringUtils
.
isBlank
(
idNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"查询条件不能为空"
,
null
);
}
//最多掩码四位
...
...
@@ -645,6 +645,14 @@ public class InnerController implements IBaseController {
}
return
JsonResult
.
buildSuccessResult
(
"success"
,
userDetailList
);
}
if
(!
phoneNoValid
&&
idNoValid
)
{
List
<
UserDetail
>
userDetailList
=
userDetailService
.
findByIdNoStartingWith
(
idNo
);
return
JsonResult
.
buildSuccessResult
(
"success"
,
userDetailList
);
}
if
(
phoneNoValid
)
{
List
<
UserDetail
>
userDetailList
=
userDetailService
.
findByPhoneNoStartingWith
(
phoneNo
);
return
JsonResult
.
buildSuccessResult
(
"success"
,
userDetailList
);
}
return
JsonResult
.
buildErrorStateResult
(
"查询条件不规范!"
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/repository/IUserDetailRepository.java
View file @
5de6b024
...
...
@@ -60,6 +60,10 @@ public interface IUserDetailRepository extends JpaRepository<UserDetail, Long>,
@Query
(
value
=
"select * from user_detail where phone_no like ?1 and id_no like ?2"
,
nativeQuery
=
true
)
List
<
UserDetail
>
fuzzyQueryByPhoneNoAndIdNo
(
String
phoneNo
,
String
idNo
);
List
<
UserDetail
>
findByIdNoStartingWithLimit20
(
String
idNo
);
List
<
UserDetail
>
findByPhoneNoStartingWith
(
String
phoneNo
);
List
<
UserDetail
>
findByIdBetween
(
Long
id
,
Long
endId
);
}
src/main/java/cn/quantgroup/xyqb/service/user/IUserDetailService.java
View file @
5de6b024
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
java.util.List
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.data.domain.Page
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
java.util.List
;
/**
* Created by 11 on 2016/12/29.
...
...
@@ -30,6 +29,9 @@ public interface IUserDetailService {
List
<
UserDetail
>
findByIdnos
(
List
<
String
>
idnos
);
List
<
UserDetail
>
findByIdNoStartingWith
(
String
idNo
);
List
<
UserDetail
>
findByPhoneNoStartingWith
(
String
phoneNo
);
Page
<
UserDetail
>
getUserDetailsPage
(
List
<
Long
>
userId
,
List
<
String
>
phoneNos
,
List
<
String
>
idNos
,
int
pageNumber
,
int
pageSize
,
String
sortType
);
/**
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserDetailServiceImpl.java
View file @
5de6b024
...
...
@@ -120,6 +120,16 @@ public class UserDetailServiceImpl implements IUserDetailService {
});
}
@Override
public
List
<
UserDetail
>
findByIdNoStartingWith
(
String
idNo
)
{
return
userDetailRepository
.
findByIdNoStartingWithLimit20
(
idNo
);
}
@Override
public
List
<
UserDetail
>
findByPhoneNoStartingWith
(
String
phoneNo
)
{
return
userDetailRepository
.
findByPhoneNoStartingWith
(
phoneNo
);
}
private
Specification
<
UserDetail
>
getSpecification
(
String
name
,
String
phoneNo
,
String
idNo
)
{
List
<
Predicate
>
list
=
new
ArrayList
<>();
Specification
<
UserDetail
>
specification
=
(
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
...
...
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