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
cab11d26
Commit
cab11d26
authored
May 18, 2017
by
Java-刘 彧阳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into log_without_phone
parents
dab76508
b2a9fa67
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
10 deletions
+45
-10
MotanUserServiceImpl.java
.../xyqb/controller/external/motan/MotanUserServiceImpl.java
+5
-5
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+24
-0
UserDetail.java
src/main/java/cn/quantgroup/xyqb/entity/UserDetail.java
+2
-2
IUserService.java
...in/java/cn/quantgroup/xyqb/service/user/IUserService.java
+1
-0
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+10
-0
UserDetailVO.java
...java/cn/quantgroup/xyqb/service/user/vo/UserDetailVO.java
+2
-2
application.properties
src/main/resources/config/dev/application.properties
+1
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/motan/MotanUserServiceImpl.java
View file @
cab11d26
...
...
@@ -494,7 +494,7 @@ public class MotanUserServiceImpl implements UserMotanService {
xUserSpouse
.
setSpouseName
(
userSpouse
.
getSpouseName
());
xUserSpouse
.
setCreatedAt
(
userSpouse
.
getCreatedAt
());
xUserSpouse
.
setUpdateAt
(
userSpouse
.
getUpdateAt
());
xUserSpouse
.
setStatus
(
cn
.
quantgroup
.
motan
.
enums
.
MaritalStatus
.
valueOf
(
userSpouse
.
getStatus
().
name
()));
xUserSpouse
.
setStatus
(
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
valueOf
(
userSpouse
.
getStatus
().
name
()));
return
xUserSpouse
;
}
...
...
@@ -528,10 +528,10 @@ public class MotanUserServiceImpl implements UserMotanService {
if
(
xUserSpouse
.
getUserId
()
==
null
||
xUserSpouse
.
getUserId
()
==
0
)
{
return
returnErrorValue
(
"用户不能为空"
);
}
cn
.
quantgroup
.
motan
.
enums
.
MaritalStatus
status
=
xUserSpouse
.
getStatus
();
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
status
=
xUserSpouse
.
getStatus
();
String
spousePhone
=
xUserSpouse
.
getSpousePhone
();
String
spouseName
=
xUserSpouse
.
getSpouseName
();
if
(
xUserSpouse
.
getStatus
()
==
cn
.
quantgroup
.
motan
.
enums
.
MaritalStatus
.
MARRIED
)
{
if
(
xUserSpouse
.
getStatus
()
==
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
MARRIED
)
{
if
(!
ValidationUtil
.
validatePhoneNo
(
spousePhone
))
{
return
returnErrorValue
(
"手机号格式错误"
);
}
...
...
@@ -545,8 +545,8 @@ public class MotanUserServiceImpl implements UserMotanService {
userSpouse
=
new
UserSpouse
(
xUserSpouse
.
getUserId
());
userSpouse
.
setCreatedAt
(
timestamp
);
}
userSpouse
.
setSpouseName
(
status
==
cn
.
quantgroup
.
motan
.
enums
.
MaritalStatus
.
MARRIED
?
spouseName
:
""
);
userSpouse
.
setSpousePhone
(
status
==
cn
.
quantgroup
.
motan
.
enums
.
MaritalStatus
.
MARRIED
?
spousePhone
:
""
);
userSpouse
.
setSpouseName
(
status
==
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
MARRIED
?
spouseName
:
""
);
userSpouse
.
setSpousePhone
(
status
==
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
MARRIED
?
spousePhone
:
""
);
userSpouse
.
setStatus
(
MaritalStatus
.
valueOf
(
status
.
name
()));
userSpouse
.
setUpdateAt
(
timestamp
);
userSpouse
=
userSpouseService
.
save
(
userSpouse
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
cab11d26
...
...
@@ -27,6 +27,7 @@ import java.text.ParseException;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* Created by Miraculous on 2016/12/19.
...
...
@@ -476,6 +477,29 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildSuccessResult
(
null
,
UserSpouseRet
.
getUserSpouseRet
(
userSpouse
));
}
@RequestMapping
(
"/user/findByPhones"
)
public
JsonResult
getUserIdByPhones
(
@RequestParam
(
"userPhones"
)
String
userPhones
){
//todo now
if
(
StringUtils
.
isBlank
(
userPhones
)){
return
JsonResult
.
buildErrorStateResult
(
"传入用户手机号不可为空"
,
null
);
}
List
<
String
>
phones
=
JSONObject
.
parseObject
(
userPhones
,
new
TypeReference
<
List
<
String
>>()
{});
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
phones
))
{
if
(!(
phones
.
size
()>
500
))
{
List
<
User
>
users
=
userService
.
findByPhones
(
phones
);
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
users
))
{
return
JsonResult
.
buildSuccessResult
(
null
,
users
.
stream
().
map
(
User:
:
getId
).
collect
(
Collectors
.
toList
()));
}
else
{
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
}
return
JsonResult
.
buildErrorStateResult
(
"单次批量查询不可超过500个手机号"
,
null
);
}
return
JsonResult
.
buildErrorStateResult
(
"传入用户手机号不可为空"
,
null
);
}
/**
* 重置密码接口,供内部人员使用(例如绝影)
* @param key
...
...
src/main/java/cn/quantgroup/xyqb/entity/UserDetail.java
View file @
cab11d26
...
...
@@ -75,10 +75,10 @@ public class UserDetail implements Serializable {
xUserDetail
.
setName
(
this
.
getName
());
xUserDetail
.
setIdNo
(
this
.
getIdNo
());
if
(
this
.
getIdType
()
!=
null
)
{
xUserDetail
.
setIdType
(
cn
.
quantgroup
.
motan
.
enums
.
IdType
.
valueOf
(
this
.
getIdType
().
name
()));
xUserDetail
.
setIdType
(
cn
.
quantgroup
.
user
.
enums
.
IdType
.
valueOf
(
this
.
getIdType
().
name
()));
}
if
(
this
.
getGender
()
!=
null
)
{
xUserDetail
.
setGender
(
cn
.
quantgroup
.
motan
.
enums
.
Gender
.
valueOf
(
this
.
getGender
().
name
()));
xUserDetail
.
setGender
(
cn
.
quantgroup
.
user
.
enums
.
Gender
.
valueOf
(
this
.
getGender
().
name
()));
}
xUserDetail
.
setEmail
(
this
.
getEmail
());
xUserDetail
.
setQq
(
this
.
getQq
());
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IUserService.java
View file @
cab11d26
...
...
@@ -32,4 +32,5 @@ public interface IUserService {
User
findById
(
Long
userId
);
List
<
User
>
findByPhones
(
List
<
String
>
phones
);
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
cab11d26
...
...
@@ -7,6 +7,7 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
import
cn.quantgroup.xyqb.service.user.ILkbUserService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -17,6 +18,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
javax.persistence.criteria.Predicate
;
import
javax.transaction.Transactional
;
import
java.sql.Timestamp
;
import
java.util.List
;
...
...
@@ -88,6 +90,14 @@ public class UserServiceImpl implements IUserService {
return
userRepository
.
findById
(
userId
);
}
@Override
public
List
<
User
>
findByPhones
(
List
<
String
>
phones
)
{
return
userRepository
.
findAll
((
root
,
query
,
cb
)
->
{
query
.
where
(
root
.
get
(
"phoneNo"
).
as
(
String
.
class
).
in
(
phones
));
return
query
.
getRestriction
();
});
}
@Override
public
User
registerAndReturn
(
String
phoneNo
,
String
password
,
Long
registerFrom
)
{
...
...
src/main/java/cn/quantgroup/xyqb/service/user/vo/UserDetailVO.java
View file @
cab11d26
...
...
@@ -68,10 +68,10 @@ public class UserDetailVO {
xUserDetail
.
setName
(
this
.
getName
());
xUserDetail
.
setIdNo
(
this
.
getIdNo
());
if
(
this
.
getIdType
()
!=
null
)
{
xUserDetail
.
setIdType
(
cn
.
quantgroup
.
motan
.
enums
.
IdType
.
valueOf
(
this
.
getIdType
().
name
()));
xUserDetail
.
setIdType
(
cn
.
quantgroup
.
user
.
enums
.
IdType
.
valueOf
(
this
.
getIdType
().
name
()));
}
if
(
this
.
getGender
()
!=
null
)
{
xUserDetail
.
setGender
(
cn
.
quantgroup
.
motan
.
enums
.
Gender
.
valueOf
(
this
.
getGender
().
name
()));
xUserDetail
.
setGender
(
cn
.
quantgroup
.
user
.
enums
.
Gender
.
valueOf
(
this
.
getGender
().
name
()));
}
xUserDetail
.
setEmail
(
this
.
getEmail
());
xUserDetail
.
setQq
(
this
.
getQq
());
...
...
src/main/resources/config/dev/application.properties
View file @
cab11d26
server.port
=
808
0
server.port
=
808
2
security.sessions
=
if_required
spring.aop.proxy-target-class
=
true
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