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
b3e2d471
Commit
b3e2d471
authored
Jun 22, 2017
by
技术部—现金贷—曾丽宾
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into master-queryLog
# Conflicts: # src/main/resources/config/dev/xyqb.properties
parents
14ee8a1d
0f43bf91
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
169 additions
and
181 deletions
+169
-181
LogCallHttpAspect.java
...n/quantgroup/xyqb/aspect/logcaller/LogCallHttpAspect.java
+0
-1
MotanUserServiceImpl.java
.../xyqb/controller/external/motan/MotanUserServiceImpl.java
+1
-1
AppController.java
...antgroup/xyqb/controller/external/user/AppController.java
+1
-1
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+83
-124
WeChatController.java
...group/xyqb/controller/external/user/WeChatController.java
+63
-32
AuthInfoController.java
...up/xyqb/controller/internal/login/AuthInfoController.java
+2
-2
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+4
-1
UserRet.java
src/main/java/cn/quantgroup/xyqb/model/UserRet.java
+10
-11
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+1
-0
xyqb.properties
src/main/resources/config/dev/xyqb.properties
+3
-8
xyqb.properties
src/main/resources/config/release01/xyqb.properties
+1
-0
No files found.
src/main/java/cn/quantgroup/xyqb/aspect/logcaller/LogCallHttpAspect.java
View file @
b3e2d471
...
...
@@ -52,7 +52,6 @@ public class LogCallHttpAspect {
return
result
;
}
@Async
public
void
asyncRecordIt
(
ProceedingJoinPoint
pjp
,
Object
result
,
String
remoteIP
){
Object
[]
args
=
pjp
.
getArgs
();
String
methodName
=
pjp
.
getSignature
().
getName
();
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/motan/MotanUserServiceImpl.java
View file @
b3e2d471
...
...
@@ -296,7 +296,7 @@ public class MotanUserServiceImpl implements UserMotanService {
SessionStruct
sessionStruct
=
sessionService
.
createSessionAndPersist
(
user
,
loginProperties
);
LoginInfo
loginInfo
=
new
LoginInfo
();
loginInfo
.
setUser
(
UserRet
.
get
UserRet
(
user
));
loginInfo
.
setUser
(
new
UserRet
(
user
));
loginInfo
.
setToken
(
sessionStruct
.
getSid
());
LoginInfo
.
LoginContext
context
=
new
LoginInfo
.
LoginContext
();
context
.
setChannelId
(
sessionStruct
.
getValues
().
getLoginProperties
().
getChannelId
());
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/AppController.java
View file @
b3e2d471
...
...
@@ -148,7 +148,7 @@ public class AppController implements IBaseController {
SessionStruct
sessionStruct
=
sessionService
.
createSessionAndPersist
(
user
,
loginProperties
);
LoginInfo
loginInfo
=
new
LoginInfo
();
loginInfo
.
setUser
(
UserRet
.
get
UserRet
(
user
));
loginInfo
.
setUser
(
new
UserRet
(
user
));
loginInfo
.
setToken
(
sessionStruct
.
getSid
());
LoginInfo
.
LoginContext
context
=
new
LoginInfo
.
LoginContext
();
context
.
setChannelId
(
sessionStruct
.
getValues
().
getLoginProperties
().
getChannelId
());
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
b3e2d471
package
cn
.
quantgroup
.
xyqb
.
controller
.
external
.
user
;
import
cn.quantgroup.user.enums.*
;
import
cn.quantgroup.xyqb.aspect.logcaller.LogHttpCaller
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.entity.*
;
import
cn.quantgroup.xyqb.entity.enumerate.*
;
import
cn.quantgroup.xyqb.entity.enumerate.EducationEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.IncomeEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.IncomeRangeEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.MaritalStatus
;
import
cn.quantgroup.xyqb.entity.enumerate.OccupationEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.Relation
;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.user.enums.*
;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.entity.Address
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
cn.quantgroup.xyqb.entity.User
;
...
...
@@ -22,12 +9,11 @@ import cn.quantgroup.xyqb.entity.UserDetail;
import
cn.quantgroup.xyqb.entity.UserExtInfo
;
import
cn.quantgroup.xyqb.entity.UserSpouse
;
import
cn.quantgroup.xyqb.entity.WechatUserInfo
;
//import cn.quantgroup.xyqb.entity.enumerate.EducationEnum;
//import cn.quantgroup.xyqb.entity.enumerate.IncomeEnum;
//import cn.quantgroup.xyqb.entity.enumerate.IncomeRangeEnum;
//import cn.quantgroup.xyqb.entity.enumerate.MaritalStatus;
//import cn.quantgroup.xyqb.entity.enumerate.OccupationEnum;
//import cn.quantgroup.xyqb.entity.enumerate.Relation;
import
cn.quantgroup.xyqb.entity.enumerate.EducationEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.IncomeEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.IncomeRangeEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.MaritalStatus
;
import
cn.quantgroup.xyqb.entity.enumerate.OccupationEnum
;
import
cn.quantgroup.xyqb.model.AddressRet
;
import
cn.quantgroup.xyqb.model.ContactRet
;
import
cn.quantgroup.xyqb.model.IdType
;
...
...
@@ -39,13 +25,18 @@ import cn.quantgroup.xyqb.model.UserSpouseRet;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.http.IHttpService
;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.user.IAddressService
;
import
cn.quantgroup.xyqb.service.user.IContactService
;
import
cn.quantgroup.xyqb.service.user.ILkbUserService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserExtInfoService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.service.user.IUserSpouseService
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.google.common.base.MoreObjects
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
...
...
@@ -56,6 +47,7 @@ import java.text.ParseException;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
...
...
@@ -68,13 +60,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.stream.Collectors
;
//import cn.quantgroup.xyqb.entity.enumerate.EducationEnum;
//import cn.quantgroup.xyqb.entity.enumerate.IncomeEnum;
//import cn.quantgroup.xyqb.entity.enumerate.IncomeRangeEnum;
//import cn.quantgroup.xyqb.entity.enumerate.MaritalStatus;
//import cn.quantgroup.xyqb.entity.enumerate.OccupationEnum;
//import cn.quantgroup.xyqb.entity.enumerate.Relation;
/**
* Created by Miraculous on 2016/12/19.
...
...
@@ -133,7 +124,9 @@ public class InnerController implements IBaseController {
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
UserRet
userRet
=
UserRet
.
getUserRet
(
user
);
UserRet
userRet
=
new
UserRet
(
user
);
return
JsonResult
.
buildSuccessResult
(
""
,
userRet
);
}
...
...
@@ -144,7 +137,7 @@ public class InnerController implements IBaseController {
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
UserRet
userRet
=
UserRet
.
get
UserRet
(
user
);
UserRet
userRet
=
new
UserRet
(
user
);
return
JsonResult
.
buildSuccessResult
(
""
,
userRet
);
}
...
...
@@ -157,11 +150,11 @@ public class InnerController implements IBaseController {
}
List
<
Long
>
userIds
=
JSONObject
.
parseObject
(
userIdsString
,
new
TypeReference
<
List
<
Long
>>()
{
});
if
(!
CollectionUtils
.
isEmpty
(
userIds
)
&&
userIds
.
size
()<=
500
)
{
if
(!
CollectionUtils
.
isEmpty
(
userIds
)
&&
userIds
.
size
()
<=
500
)
{
Map
<
Long
,
String
>
userIdAndPhoneMap
=
userService
.
findPhoneByIdsInDb
(
userIds
);
return
JsonResult
.
buildSuccessResult
(
""
,
userIdAndPhoneMap
);
}
else
{
return
JsonResult
.
buildErrorStateResult
(
"批量查询每次最多进行500条用户信息的查询"
,
null
);
}
else
{
return
JsonResult
.
buildErrorStateResult
(
"批量查询每次最多进行500条用户信息的查询"
,
null
);
}
}
...
...
@@ -189,7 +182,7 @@ public class InnerController implements IBaseController {
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
if
(
user
==
null
)
{
user
=
new
User
();
}
else
if
(!
user
.
getEnable
())
{
}
else
if
(!
user
.
getEnable
())
{
return
JsonResult
.
buildErrorStateResult
(
"用户已经注销"
,
null
);
}
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isEmpty
(
user
.
getUuid
()))
{
...
...
@@ -205,24 +198,17 @@ public class InnerController implements IBaseController {
user
=
userService
.
saveUser
(
user
);
UserRet
userRet
=
null
;
if
(
user
!=
null
)
{
userRet
=
UserRet
.
get
UserRet
(
user
);
userRet
=
new
UserRet
(
user
);
}
return
JsonResult
.
buildSuccessResult
(
null
,
userRet
);
}
/**
* 保存用户详细信息
*
* @param userId
* @param phoneNo
* @param name
* @param idNo
* @param email
* @return
*/
@RequestMapping
(
"/user_detail/save"
)
public
JsonResult
saveUserDetail
(
Long
userId
,
String
phoneNo
,
String
name
,
String
idNo
,
String
email
,
Long
id
)
{
String
email
,
Long
id
)
{
//参数验证
if
(
userId
==
null
||
userId
==
0L
)
{
return
JsonResult
.
buildErrorStateResult
(
"用户id为空."
,
null
);
...
...
@@ -264,9 +250,6 @@ public class InnerController implements IBaseController {
/**
* 根据用户id查询用户的详细信息
*
* @param userId
* @return
*/
@RequestMapping
(
"/user_detail/search/userId"
)
@LogHttpCaller
...
...
@@ -283,7 +266,7 @@ public class InnerController implements IBaseController {
public
JsonResult
findUserByUserId
(
Long
userId
)
{
User
user
=
userService
.
findById
(
userId
);
if
(
user
!=
null
)
{
return
JsonResult
.
buildSuccessResult
(
null
,
UserRet
.
get
UserRet
(
user
));
return
JsonResult
.
buildSuccessResult
(
null
,
new
UserRet
(
user
));
}
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
...
...
@@ -348,14 +331,12 @@ public class InnerController implements IBaseController {
for
(
Contact
c
:
contacts
)
{
c
.
setId
(
null
);
c
.
setUserId
(
userId
);
c
.
setRelation
(
c
.
getRelation
()
==
null
?
cn
.
quantgroup
.
user
.
enums
.
Relation
.
OTHER
:
c
.
getRelation
());
c
.
setRelation
(
c
.
getRelation
()
==
null
?
cn
.
quantgroup
.
user
.
enums
.
Relation
.
OTHER
:
c
.
getRelation
());
c
.
setCreatedAt
(
now
);
c
.
setUpdateAt
(
now
);
}
}
@RequestMapping
(
"/address/search/user_id"
)
public
JsonResult
findAddressByUserId
(
Long
userId
)
{
if
(
userId
==
null
)
{
...
...
@@ -395,7 +376,6 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildSuccessResult
(
null
,
AddressRet
.
address2AddressRet
(
addressObj
));
}
@RequestMapping
(
"/user_ext_info/update"
)
public
JsonResult
updateMarryStatus
(
Long
userId
,
IncomeEnum
incomeEnum
,
IncomeRangeEnum
incomeRangeEnum
,
...
...
@@ -444,7 +424,7 @@ public class InnerController implements IBaseController {
@LogHttpCaller
public
JsonResult
searchUserDetailList
(
String
name
,
String
phoneNo
,
String
idNo
)
{
LOGGER
.
info
(
"searchUserDetailList ,param.name:{},phone:{},idNo:{},ip:{}"
,
name
,
phoneNo
,
idNo
,
getIp
());
LOGGER
.
info
(
"searchUserDetailList ,param.name:{},phone:{},idNo:{},ip:{}"
,
name
,
phoneNo
,
idNo
,
getIp
());
if
(
StringUtils
.
isBlank
(
name
)
&&
StringUtils
.
isBlank
(
phoneNo
)
&&
StringUtils
.
isBlank
(
idNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"至少必须满足一个条件不为空"
,
null
);
}
...
...
@@ -453,18 +433,18 @@ public class InnerController implements IBaseController {
return JsonResult.buildSuccessResult("success", userDetails);*/
ImmutableMap
.
Builder
<
String
,
String
>
builder
=
ImmutableMap
.
builder
();
if
(
StringUtils
.
isNotBlank
(
name
))
{
builder
.
put
(
"name"
,
name
);
if
(
StringUtils
.
isNotBlank
(
name
))
{
builder
.
put
(
"name"
,
name
);
}
if
(
StringUtils
.
isNotBlank
(
phoneNo
))
{
builder
.
put
(
"phoneNo"
,
phoneNo
);
if
(
StringUtils
.
isNotBlank
(
phoneNo
))
{
builder
.
put
(
"phoneNo"
,
phoneNo
);
}
if
(
StringUtils
.
isNotBlank
(
idNo
))
{
builder
.
put
(
"idNo"
,
idNo
);
if
(
StringUtils
.
isNotBlank
(
idNo
))
{
builder
.
put
(
"idNo"
,
idNo
);
}
Map
<
String
,
String
>
param
=
builder
.
build
();
Map
<
String
,
String
>
param
=
builder
.
build
();
String
s
=
httpService
.
get
(
queryUrl
.
concat
(
"/innerapi/user_detail/search_list"
),
param
);
return
JSON
.
parseObject
(
s
,
JsonResult
.
class
);
return
JSON
.
parseObject
(
s
,
JsonResult
.
class
);
}
@RequestMapping
(
"/user_ext_info/search/user_id"
)
...
...
@@ -522,7 +502,7 @@ public class InnerController implements IBaseController {
sessionService
.
deleteByUserId
(
userId
);
}
LOGGER
.
info
(
"去清除函谷关的缓存"
);
httpService
.
get
(
hanguguanUrl
.
concat
(
"/innerapi/disableUserCache"
),
ImmutableMap
.
of
(
"phone"
,
user
.
getPhoneNo
()));
httpService
.
get
(
hanguguanUrl
.
concat
(
"/innerapi/disableUserCache"
),
ImmutableMap
.
of
(
"phone"
,
user
.
getPhoneNo
()));
return
JsonResult
.
buildSuccessResult
(
"用户已禁用."
,
user
.
getEnable
()
==
false
);
}
...
...
@@ -567,136 +547,116 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildSuccessResult
(
null
,
UserSpouseRet
.
getUserSpouseRet
(
userSpouse
));
}
@RequestMapping
(
"/user/findByPhones"
)
public
JsonResult
getUserIdByPhones
(
@RequestParam
(
"userPhones"
)
String
userPhones
)
{
if
(
StringUtils
.
isBlank
(
userPhones
))
{
return
JsonResult
.
buildErrorStateResult
(
"传入用户手机号不可为空"
,
null
);
public
JsonResult
getUserIdByPhones
(
@RequestParam
(
"userPhones"
)
String
userPhones
)
{
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
))
{
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
().
collect
(
Collectors
.
toMap
(
User:
:
getPhoneNo
,
User:
:
getId
)));
}
else
{
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
users
))
{
return
JsonResult
.
buildSuccessResult
(
null
,
users
.
stream
().
collect
(
Collectors
.
toMap
(
User:
:
getPhoneNo
,
User:
:
getId
)));
}
else
{
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
}
return
JsonResult
.
buildErrorStateResult
(
"单次批量查询不可超过500个手机号"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"单次批量查询不可超过500个手机号"
,
null
);
}
return
JsonResult
.
buildErrorStateResult
(
"传入用户手机号不可为空"
,
null
);
}
/**
* 重置密码接口,供内部人员使用(例如绝影)
* @param key
* @param phone
* @return
*/
@RequestMapping
(
"/user/password/reset/{key}/{phone}"
)
public
JsonResult
resetPassword
(
@PathVariable
(
"key"
)
String
key
,
@PathVariable
(
"phone"
)
String
phone
)
{
LOGGER
.
info
(
"密码重置请求,phone:[{}]"
,
phone
);
if
(
StringUtils
.
isBlank
(
key
))
{
public
JsonResult
resetPassword
(
@PathVariable
(
"key"
)
String
key
,
@PathVariable
(
"phone"
)
String
phone
)
{
LOGGER
.
info
(
"密码重置请求,phone:[{}]"
,
phone
);
if
(
StringUtils
.
isBlank
(
key
))
{
return
JsonResult
.
buildErrorStateResult
(
"用户密码重置失败."
,
null
);
}
if
(!
"ecf75c1f-2ccb-4661-8e4b-2874c0f45a2b"
.
equalsIgnoreCase
(
key
))
{
if
(!
"ecf75c1f-2ccb-4661-8e4b-2874c0f45a2b"
.
equalsIgnoreCase
(
key
))
{
LOGGER
.
error
(
"密码重置失败,key错误!@!,phone:[{}]"
,
phone
);
return
JsonResult
.
buildErrorStateResult
(
"用户密码重置失败."
,
null
);
}
try
{
userService
.
resetPassword
(
phone
,
"123456"
);
//默认重置的密码是123456
return
JsonResult
.
buildSuccessResult
(
"用户密码已重置."
,
"null"
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"密码重置失败,phone[{}],err:[{}]"
,
phone
,
e
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"密码重置失败,phone[{}],err:[{}]"
,
phone
,
e
);
}
return
JsonResult
.
buildErrorStateResult
(
"用户密码重置失败."
,
null
);
}
/**
* 保存用户信息,地址信息,联系人信息
* @param registeredFrom
* @param channelId
* @param phoneNo
* @param name
* @param idNo
* @param provinceCode
* @param cityCode
* @param districtCode
* @param address
* @param contacts
* @return
*/
@RequestMapping
(
"/user/save_multi"
)
public
JsonResult
saveMulti
(
String
registeredFrom
,
String
channelId
,
String
phoneNo
,
String
name
,
String
idNo
,
String
provinceCode
,
String
province
,
String
cityCode
,
String
city
,
String
districtCode
,
String
district
,
String
address
,
String
contacts
)
{
String
registeredFrom
,
String
channelId
,
String
phoneNo
,
String
name
,
String
idNo
,
String
provinceCode
,
String
province
,
String
cityCode
,
String
city
,
String
districtCode
,
String
district
,
String
address
,
String
contacts
)
{
LOGGER
.
info
(
"保存用户、联系人、地址信息:registeredFrom:[{}], phoneNo[{}],name[{}],idNo[{}],provinceCode[{}],cityCode[{}],districtCode[{}],"
+
"address[{}],contacts[{}]"
,
registeredFrom
,
phoneNo
,
name
,
idNo
,
provinceCode
,
cityCode
,
districtCode
,
address
,
contacts
);
"address[{}],contacts[{}]"
,
registeredFrom
,
phoneNo
,
name
,
idNo
,
provinceCode
,
cityCode
,
districtCode
,
address
,
contacts
);
if
(!
NumberUtils
.
isDigits
(
registeredFrom
))
{
if
(!
NumberUtils
.
isDigits
(
registeredFrom
))
{
return
JsonResult
.
buildErrorStateResult
(
"注册渠道异常."
,
null
);
}
if
(!
NumberUtils
.
isDigits
(
phoneNo
))
{
if
(!
NumberUtils
.
isDigits
(
phoneNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"手机号异常."
,
null
);
}
if
(
StringUtils
.
isBlank
(
name
))
{
if
(
StringUtils
.
isBlank
(
name
))
{
return
JsonResult
.
buildErrorStateResult
(
"用户名异常."
,
null
);
}
if
(!
NumberUtils
.
isDigits
(
idNo
))
{
if
(!
NumberUtils
.
isDigits
(
idNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"用户身份证号异常."
,
null
);
}
if
(!
NumberUtils
.
isDigits
(
provinceCode
))
{
if
(!
NumberUtils
.
isDigits
(
provinceCode
))
{
return
JsonResult
.
buildErrorStateResult
(
"省份编号异常."
,
null
);
}
if
(
StringUtils
.
isBlank
(
province
))
{
if
(
StringUtils
.
isBlank
(
province
))
{
return
JsonResult
.
buildErrorStateResult
(
"省份异常."
,
null
);
}
if
(!
NumberUtils
.
isDigits
(
cityCode
))
{
if
(!
NumberUtils
.
isDigits
(
cityCode
))
{
return
JsonResult
.
buildErrorStateResult
(
"城市编号异常."
,
null
);
}
if
(
StringUtils
.
isBlank
(
city
))
{
if
(
StringUtils
.
isBlank
(
city
))
{
return
JsonResult
.
buildErrorStateResult
(
"城市异常."
,
null
);
}
if
(!
NumberUtils
.
isDigits
(
districtCode
))
{
if
(!
NumberUtils
.
isDigits
(
districtCode
))
{
return
JsonResult
.
buildErrorStateResult
(
"区县编号异常."
,
null
);
}
if
(
StringUtils
.
isBlank
(
district
))
{
if
(
StringUtils
.
isBlank
(
district
))
{
return
JsonResult
.
buildErrorStateResult
(
"区县异常."
,
null
);
}
if
(
StringUtils
.
isBlank
(
address
))
{
return
JsonResult
.
buildErrorStateResult
(
"详细地址异常."
,
null
);
}
channelId
=
MoreObjects
.
firstNonNull
(
channelId
,
"-1"
);
// 验证用户是否已存在
User
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
if
(
null
!=
user
)
{
if
(
null
!=
user
)
{
return
JsonResult
.
buildErrorStateResult
(
"用户已存在,手机号被占用"
,
null
);
}
user
=
userService
.
registerAndReturn
(
Long
.
valueOf
(
registeredFrom
),
Long
.
valueOf
(
channelId
),
phoneNo
,
name
,
idNo
,
provinceCode
,
province
,
cityCode
,
city
,
districtCode
,
district
,
address
,
contacts
);
UserRet
userRet
=
UserRet
.
get
UserRet
(
user
);
UserRet
userRet
=
new
UserRet
(
user
);
return
JsonResult
.
buildSuccessResult
(
null
,
userRet
);
}
@RequestMapping
(
"/user/register"
)
...
...
@@ -711,7 +671,6 @@ public class InnerController implements IBaseController {
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"注册失败"
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
null
,
UserRet
.
get
UserRet
(
user
));
return
JsonResult
.
buildSuccessResult
(
null
,
new
UserRet
(
user
));
}
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/controller/external/user/WeChatController.java
View file @
b3e2d471
...
...
@@ -79,6 +79,10 @@ public class WeChatController implements IBaseController {
@Autowired
private
IHttpService
httpService
;
//加https地址
@Value
(
"${xyqb-user.ui-s}"
)
private
String
userUIAddrS
;
/**
* 开发者资质认证,有必要吗?
*
...
...
@@ -177,6 +181,8 @@ public class WeChatController implements IBaseController {
extData
=
""
;
}
String
protocol
=
"http:"
;
LOGGER
.
info
(
"从微信extdata版本接口进入:{}, extData:{}"
,
schema
,
extData
);
if
(
StringUtils
.
isEmpty
(
extData
))
{
// 从code获取token
...
...
@@ -185,7 +191,7 @@ public class WeChatController implements IBaseController {
AccessTokenResponse
token
=
wechatService
.
getToken
(
code
);
if
(
token
==
null
)
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
);
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
WechatUserInfo
userInfo
=
...
...
@@ -193,7 +199,7 @@ public class WeChatController implements IBaseController {
token
.
getOpenId
());
if
(
userInfo
==
null
||
StringUtils
.
isEmpty
(
userInfo
.
getOpenId
()))
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
);
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
WechatUserInfo
userInfoInDb
=
wechatService
.
findWechatUserInfoFromDb
(
userInfo
.
getOpenId
());
...
...
@@ -206,19 +212,19 @@ public class WeChatController implements IBaseController {
}
userInfo
=
wechatService
.
saveWechatUserInfo
(
userInfo
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfo
,
Constants
.
Channel
.
WECHAT
);
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
if
(
userInfoInDb
.
getUserId
()
==
null
)
{
// 用户已经微信登录了,但是没有关联信用钱包,跳转到注册页面
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
);
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
User
user
=
userService
.
findById
(
userInfoInDb
.
getUserId
());
if
(
user
==
null
)
{
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
);
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
// 已经关联了用户
...
...
@@ -241,7 +247,7 @@ public class WeChatController implements IBaseController {
AccessTokenResponse
token
=
wechatService
.
getToken
(
code
);
if
(
token
==
null
)
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
);
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
WechatUserInfo
userInfo
=
...
...
@@ -249,7 +255,7 @@ public class WeChatController implements IBaseController {
token
.
getOpenId
());
if
(
userInfo
==
null
||
StringUtils
.
isEmpty
(
userInfo
.
getOpenId
()))
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
);
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
WechatUserInfo
userInfoInDb
=
...
...
@@ -263,19 +269,19 @@ public class WeChatController implements IBaseController {
}
userInfo
=
wechatService
.
saveWechatUserInfo
(
userInfo
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfo
,
Constants
.
Channel
.
WECHAT
);
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
if
(
userInfoInDb
.
getUserId
()
==
null
)
{
// 用户已经微信登录了,但是没有关联信用钱包,跳转到注册页面
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
);
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
User
user
=
userService
.
findById
(
userInfoInDb
.
getUserId
());
if
(
user
==
null
)
{
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
);
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
// 已经关联了用户
...
...
@@ -286,6 +292,9 @@ public class WeChatController implements IBaseController {
response
.
setStatus
(
301
);
return
;
}
protocol
=
extDataObj
.
getOrDefault
(
"protocol"
,
"http:"
).
toString
();
LOGGER
.
info
(
"从微信登录extData中获得协议信息,protocol:{}"
,
protocol
);
Long
registerFrom
=
Long
.
valueOf
(
extDataObj
.
getOrDefault
(
"registerFrom"
,
"1"
).
toString
());
String
redirect
=
(
String
)
extDataObj
.
getOrDefault
(
"redirect"
,
"redirect"
);
LOGGER
.
info
(
"从微信登录,registerFrom:{}, redirect:{}"
,
registerFrom
,
redirect
);
...
...
@@ -293,7 +302,7 @@ public class WeChatController implements IBaseController {
AccessTokenResponse
token
=
wechatService
.
getToken
(
code
);
if
(
token
==
null
)
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
registerFrom
);
redirectNormalUrl
(
response
,
merchant
,
registerFrom
,
protocol
);
return
;
}
WechatUserInfo
userInfo
=
...
...
@@ -301,7 +310,7 @@ public class WeChatController implements IBaseController {
token
.
getOpenId
());
if
(
userInfo
==
null
||
StringUtils
.
isEmpty
(
userInfo
.
getOpenId
()))
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
registerFrom
);
redirectNormalUrl
(
response
,
merchant
,
registerFrom
,
protocol
);
return
;
}
WechatUserInfo
userInfoInDb
=
wechatService
.
findWechatUserInfoFromDb
(
userInfo
.
getOpenId
());
...
...
@@ -313,17 +322,17 @@ public class WeChatController implements IBaseController {
userInfo
.
setNickName
(
nickName
);
}
userInfo
=
wechatService
.
saveWechatUserInfo
(
userInfo
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfo
,
registerFrom
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfo
,
registerFrom
,
protocol
);
return
;
}
if
(
userInfoInDb
.
getUserId
()
==
null
)
{
// 用户已经微信登录了,但是没有关联信用钱包,跳转到注册页面
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
registerFrom
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
registerFrom
,
protocol
);
return
;
}
User
user
=
userService
.
findById
(
userInfoInDb
.
getUserId
());
if
(
user
==
null
)
{
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
registerFrom
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
registerFrom
,
protocol
);
return
;
}
// 已经关联了用户
...
...
@@ -348,6 +357,7 @@ public class WeChatController implements IBaseController {
@RequestMapping
(
"/receiveCode/{key}"
)
public
void
receiveCodeNoRedirect
(
String
code
,
@PathVariable
(
value
=
"key"
)
String
systemKey
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
schema
=
request
.
getScheme
();
String
protocol
=
"http:"
;
LOGGER
.
info
(
"HTTP协议no redirect:"
+
schema
);
// 从code获取token
Merchant
merchant
=
merchantService
.
findMerchantByName
(
systemKey
);
...
...
@@ -355,13 +365,13 @@ public class WeChatController implements IBaseController {
AccessTokenResponse
token
=
wechatService
.
getToken
(
code
);
if
(
token
==
null
)
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
);
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
WechatUserInfo
userInfo
=
wechatService
.
getWechatUserInfoFromWechatServer
(
token
.
getAccessToken
(),
token
.
getOpenId
());
if
(
userInfo
==
null
||
StringUtils
.
isEmpty
(
userInfo
.
getOpenId
()))
{
// 让用户登录,不关联微信, 构造不关联微信的url
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
);
redirectNormalUrl
(
response
,
merchant
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
WechatUserInfo
userInfoInDb
=
wechatService
.
findWechatUserInfoFromDb
(
userInfo
.
getOpenId
());
...
...
@@ -373,17 +383,17 @@ public class WeChatController implements IBaseController {
userInfo
.
setNickName
(
nickName
);
}
userInfo
=
wechatService
.
saveWechatUserInfo
(
userInfo
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfo
,
Constants
.
Channel
.
WECHAT
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfo
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
if
(
userInfoInDb
.
getUserId
()
==
null
)
{
// 用户已经微信登录了,但是没有关联信用钱包,跳转到注册页面
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
User
user
=
userService
.
findById
(
userInfoInDb
.
getUserId
());
if
(
user
==
null
)
{
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
);
redirectWechatLoginUrlWithoutLogin
(
response
,
merchant
,
userInfoInDb
,
Constants
.
Channel
.
WECHAT
,
protocol
);
return
;
}
// 已经关联了用户
...
...
@@ -428,37 +438,58 @@ public class WeChatController implements IBaseController {
return
url
+
"/landing?token="
+
authBean
.
getToken
()
+
"®isterFrom="
+
registerFrom
+
"&channelId="
+
channelId
+
"&key="
+
merchant
.
getName
()
+
"&target="
+
target
;
}
private
void
redirectWechatLoginUrlWithoutLogin
(
HttpServletResponse
response
,
Merchant
merchant
,
WechatUserInfo
userInfo
,
Long
registerFrom
)
{
String
redirectUrl
=
assembleWechatRedirectUrl
(
merchant
,
userInfo
,
registerFrom
);
private
void
redirectWechatLoginUrlWithoutLogin
(
HttpServletResponse
response
,
Merchant
merchant
,
WechatUserInfo
userInfo
,
Long
registerFrom
,
String
protocol
)
{
String
redirectUrl
=
assembleWechatRedirectUrl
(
merchant
,
userInfo
,
registerFrom
,
protocol
);
LOGGER
.
info
(
"redirectWechatLoginUrlWithoutLogin redirectUrl:[{}]"
,
redirectUrl
);
response
.
setHeader
(
"Location"
,
redirectUrl
);
response
.
setStatus
(
301
);
}
private
void
redirectNormalUrl
(
HttpServletResponse
response
,
Merchant
merchant
,
Long
registerFrom
)
{
String
redirectUrl
=
assembleNormalRedirectUrl
(
merchant
,
registerFrom
);
private
void
redirectNormalUrl
(
HttpServletResponse
response
,
Merchant
merchant
,
Long
registerFrom
,
String
protocol
)
{
String
redirectUrl
=
assembleNormalRedirectUrl
(
merchant
,
registerFrom
,
protocol
);
LOGGER
.
info
(
"redirectNormalUrl redirectUrl:[{}]"
,
redirectUrl
);
response
.
setHeader
(
"Location"
,
redirectUrl
);
response
.
setStatus
(
301
);
}
private
String
assembleNormalRedirectUrl
(
Merchant
merchant
,
Long
registerFrom
)
{
private
String
assembleNormalRedirectUrl
(
Merchant
merchant
,
Long
registerFrom
,
String
protocol
)
{
String
domains
=
userUIAddr
;
if
(
protocol
!=
null
&&
protocol
.
equals
(
"https:"
)){
domains
=
userUIAddrS
;
}
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5&channelId=222®isterFrom=198"
;
if
(
registerFrom
==
58
l
||
registerFrom
==
198
l
){
return
domains
+
"/landing?key=baitiao&target=cashTarget5&channelId=222®isterFrom="
+
registerFrom
;
}
else
{
return
domains
+
"/landing?key=baitiao&target=cashTarget5&channelId=222®isterFrom=198"
;
}
}
else
if
(
"wechat-pay"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=wechat-pay&target=cashTarget5&channelId=1&page=landing/4®isterFrom"
+
registerFrom
;
return
domains
+
"/landing?key=wechat-pay&target=cashTarget5&channelId=1&page=landing/4®isterFrom"
+
registerFrom
;
}
else
{
return
userUIAddr
+
"/landing?key=xyqb&target=cashTarget4&channelId=1®isterFrom="
+
registerFrom
;
return
domains
+
"/landing?key=xyqb&target=cashTarget4&channelId=1®isterFrom="
+
registerFrom
;
}
}
private
String
assembleWechatRedirectUrl
(
Merchant
merchant
,
WechatUserInfo
userInfo
,
Long
registerFrom
)
{
private
String
assembleWechatRedirectUrl
(
Merchant
merchant
,
WechatUserInfo
userInfo
,
Long
registerFrom
,
String
protocol
)
{
String
domains
=
userUIAddr
;
if
(
protocol
!=
null
&&
protocol
.
equals
(
"https:"
)){
domains
=
userUIAddrS
;
}
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222&isWechat=true&openId="
+
userInfo
.
getOpenId
();
if
(
registerFrom
==
58
l
||
registerFrom
==
198
l
){
return
domains
+
"/landing?key=baitiao&target=cashTarget5®isterFrom="
+
registerFrom
+
"&channelId=222&isWechat=true&openId="
+
userInfo
.
getOpenId
();
}
else
{
return
domains
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222&isWechat=true&openId="
+
userInfo
.
getOpenId
();
}
}
else
if
(
"wechat-pay"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=wechat-pay&target=cashTarget5&page=landing/4®isterFrom= "
+
registerFrom
+
"&channelId=1&isWechat=true&openId="
+
userInfo
.
getOpenId
();
return
domains
+
"/landing?key=wechat-pay&target=cashTarget5&page=landing/4®isterFrom= "
+
registerFrom
+
"&channelId=1&isWechat=true&openId="
+
userInfo
.
getOpenId
();
}
else
{
return
userUIAddr
+
"/landing?key=xyqb&target=cashTarget4®isterFrom= "
+
registerFrom
+
"&channelId=1&isWechat=true&openId="
+
userInfo
.
getOpenId
();
return
domains
+
"/landing?key=xyqb&target=cashTarget4®isterFrom= "
+
registerFrom
+
"&channelId=1&isWechat=true&openId="
+
userInfo
.
getOpenId
();
}
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/login/AuthInfoController.java
View file @
b3e2d471
...
...
@@ -54,7 +54,7 @@ public class AuthInfoController implements IBaseController {
if
(
null
!=
sessionStruct
)
{
log
.
info
(
"从用户中心获取到了用户登录信息:phone:[{}]"
,
sessionStruct
.
getValues
().
getUser
().
getPhoneNo
());
LoginInfo
loginInfo
=
new
LoginInfo
();
loginInfo
.
setUser
(
UserRet
.
get
UserRet
(
sessionStruct
.
getValues
().
getUser
()));
loginInfo
.
setUser
(
new
UserRet
(
sessionStruct
.
getValues
().
getUser
()));
loginInfo
.
setToken
(
sessionStruct
.
getSid
());
LoginInfo
.
LoginContext
context
=
new
LoginInfo
.
LoginContext
();
context
.
setChannelId
(
sessionStruct
.
getValues
().
getLoginProperties
().
getChannelId
());
...
...
@@ -82,7 +82,7 @@ public class AuthInfoController implements IBaseController {
String
phoneNo
=
((
Map
<
String
,
String
>)
result
.
getData
()).
get
(
"phoneNo"
);
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
LoginInfo
loginInfo
=
new
LoginInfo
();
loginInfo
.
setUser
(
UserRet
.
get
UserRet
(
user
));
loginInfo
.
setUser
(
new
UserRet
(
user
));
loginInfo
.
setToken
(
token
);
LoginInfo
.
LoginContext
context
=
new
LoginInfo
.
LoginContext
();
context
.
setChannelId
(
null
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
b3e2d471
...
...
@@ -95,7 +95,7 @@ public class UserController implements IBaseController {
public
JsonResult
loginFast
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
createdFrom
,
String
key
,
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
,
HttpServletRequest
request
)
{
Map
<
String
,
JsonResult
>
validMap
=
getHeaderParam
(
request
);
Map
<
String
,
JsonResult
>
validMap
=
getHeaderParam
(
request
);
if
(
null
!=
validMap
.
get
(
"fail"
))
{
return
validMap
.
get
(
"fail"
);
}
...
...
@@ -129,6 +129,9 @@ public class UserController implements IBaseController {
if
(
null
==
registerFrom
)
{
registerFrom
=
1L
;
}
if
(
channelId
==
222L
)
{
registerFrom
=
222L
;
}
LOGGER
.
info
(
"用户快速注册成功, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
return
userService
.
registerAndReturn
(
phoneNo
,
password
,
registerFrom
,
btRegisterChannelId
);
...
...
src/main/java/cn/quantgroup/xyqb/model/UserRet.java
View file @
b3e2d471
...
...
@@ -35,18 +35,17 @@ public class UserRet implements Serializable {
//上一次修改时间
private
Long
updatedAt
;
public
static
UserRet
get
UserRet
(
User
user
)
{
public
UserRet
(
User
user
)
{
Long
createTimeStamp
=
user
.
getCreatedAt
().
getTime
();
Long
updateTimeStamp
=
user
.
getUpdatedAt
().
getTime
();
UserRet
userRet
=
new
UserRet
();
userRet
.
setId
(
user
.
getId
());
userRet
.
setPhoneNo
(
user
.
getPhoneNo
());
userRet
.
setEnable
(
user
.
getEnable
());
userRet
.
setPassword
(
StringUtils
.
defaultIfEmpty
(
user
.
getPassword
(),
""
));
userRet
.
setRegisteredFrom
(
user
.
getRegisteredFrom
());
userRet
.
setUuid
(
user
.
getUuid
());
userRet
.
setCreatedAt
(
createTimeStamp
);
userRet
.
setUpdatedAt
(
updateTimeStamp
);
return
userRet
;
this
.
setId
(
user
.
getId
());
this
.
setPhoneNo
(
user
.
getPhoneNo
());
this
.
setEnable
(
user
.
getEnable
());
this
.
setPassword
(
StringUtils
.
defaultIfEmpty
(
user
.
getPassword
(),
""
));
this
.
setRegisteredFrom
(
user
.
getRegisteredFrom
());
this
.
setUuid
(
user
.
getUuid
());
this
.
setCreatedAt
(
createTimeStamp
);
this
.
setUpdatedAt
(
updateTimeStamp
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
b3e2d471
...
...
@@ -81,6 +81,7 @@ public class UserServiceImpl implements IUserService {
private
final
static
Random
random
=
new
Random
();
@Override
@Cacheable
(
value
=
"usercache"
,
key
=
"'xyqbuser' + #phone"
,
unless
=
"#result == null"
,
cacheManager
=
"cacheManager"
)
public
User
findByPhoneInDb
(
String
phone
)
{
return
userRepository
.
findByPhoneNo
(
phone
);
}
...
...
src/main/resources/config/dev/xyqb.properties
View file @
b3e2d471
...
...
@@ -3,7 +3,7 @@ configserver.disable=1
configserver.system
=
xyqb-user
#xyqb.data.mysql.jdbc-url=jdbc:mysql://192.168.4.22:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8
xyqb.data.mysql.jdbc-url
=
jdbc:mysql://192.168.4.2
6
:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8
xyqb.data.mysql.jdbc-url
=
jdbc:mysql://192.168.4.2
3
:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8
xyqb.data.mysql.password
=
qatest
...
...
@@ -71,6 +71,7 @@ xyqb.auth.url=http://192.168.192.206:9001
usersys.url
=
http://localhost:9001
xyqb-user.ui
=
http://192.168.100.36:7043
xyqb-user.ui-s
=
https://192.168.100.36:7043
wechat.appid
=
wxcdf6077af8127559
wechat.secret
=
16eaec16084d0d9c52d4114f359cc72c
...
...
@@ -89,10 +90,4 @@ motan.application=xyqbUserMotan
#xyqb-user-域名
xyqb.user.domain
=
passport.xyqb.com
xyqb.user.query.url
=
http://192.168.11.40:8081
xyqb.domain
=
http://192.168.4.153:7003
xyqb.paycenter.url
=
http://192.168.4.26:7006
xyqb.paycenter.id
=
3
#运营系统认证地址
xyqb.yunying.url
=
http://192.168.4.50:7047
\ No newline at end of file
xyqb.domain
=
http://192.168.4.153:7003
\ No newline at end of file
src/main/resources/config/release01/xyqb.properties
View file @
b3e2d471
...
...
@@ -36,6 +36,7 @@ jr58.notify.userinfo=http://dk.58.com/customer/quantgroup_user_info
model.quantgroup.url
=
http://model.quantgroup.cn
xyqb.auth.url
=
http://auth.xyqb.com
xyqb-user.ui
=
http://passport.xyqb.com
xyqb-user.ui-s
=
https://passport.xyqb.com
#motan protocol
protocol.name
=
motan
protocol.contentLength
=
1048576
...
...
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