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
67708870
Commit
67708870
authored
Jul 11, 2017
by
Java—红包—徐 然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
3fab6d29
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+8
-8
IUserService.java
...in/java/cn/quantgroup/xyqb/service/user/IUserService.java
+1
-1
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+2
-2
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
67708870
...
...
@@ -113,19 +113,19 @@ public class UserController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
}
if
(
user
==
null
)
{
user
=
registerFastWhenLogin
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
);
user
=
registerFastWhenLogin
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
,
dimension
);
if
(
user
==
null
)
{
throw
new
UserNotExistException
(
"用户未找到"
);
}
}
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
null
,
3
,
channelId
);
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
3
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
// return createSession(channelId, createdFrom, appChannel, user);
}
private
User
registerFastWhenLogin
(
String
phoneNo
,
Long
channelId
,
Long
registerFrom
,
String
appChannel
,
Long
btRegisterChannelId
)
{
private
User
registerFastWhenLogin
(
String
phoneNo
,
Long
channelId
,
Long
registerFrom
,
String
appChannel
,
Long
btRegisterChannelId
,
String
dimension
)
{
String
password
=
genRandomPwd
();
LOGGER
.
info
(
"用户快速注册, phoneNo:{}, verificationCode:{}, channelId:{}, registerFrom:{},appChannel:{},btRegisterChannelId"
,
phoneNo
,
channelId
,
registerFrom
,
appChannel
,
btRegisterChannelId
);
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
...
...
@@ -140,7 +140,7 @@ public class UserController implements IBaseController {
}
User
user
=
userService
.
registerAndReturn
(
phoneNo
,
password
,
registerFrom
,
btRegisterChannelId
);
LOGGER
.
info
(
"用户快速注册成功, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
UserStatistics
statistics
=
new
UserStatistics
(
user
,
null
,
2
,
channelId
);
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
2
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
return
user
;
}
...
...
@@ -198,7 +198,7 @@ public class UserController implements IBaseController {
@RequestMapping
(
"/register/fast"
)
public
JsonResult
registerFast
(
@RequestParam
String
phoneNo
,
@RequestParam
String
verificationCode
,
@RequestParam
(
required
=
false
)
Long
channelId
,
@RequestParam
(
required
=
false
)
Long
registerFrom
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
appChannel
,
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
)
{
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
,
@RequestParam
(
required
=
false
)
String
dimension
)
{
String
password
=
genRandomPwd
();
LOGGER
.
info
(
"用户快速注册, phoneNo:{}, verificationCode:{}, channelId:{}, registerFrom:{},appChannel:{}"
,
phoneNo
,
verificationCode
,
channelId
,
registerFrom
,
appChannel
);
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
...
...
@@ -224,7 +224,7 @@ public class UserController implements IBaseController {
LOGGER
.
info
(
"用户快速注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}"
,
registerFrom
,
phoneNo
,
verificationCode
);
return
JsonResult
.
buildErrorStateResult
(
"短信验证码错误"
,
null
);
}
if
(!
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
))
{
if
(!
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
,
dimension
))
{
LOGGER
.
info
(
"用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"注册失败,请稍后重试"
,
null
);
}
...
...
@@ -248,7 +248,7 @@ public class UserController implements IBaseController {
public
JsonResult
register
(
@RequestParam
String
phoneNo
,
@RequestParam
String
password
,
@RequestParam
String
verificationCode
,
@RequestParam
(
required
=
false
)
Long
channelId
,
@RequestParam
(
required
=
false
)
Long
registerFrom
,
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
)
{
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
,
@RequestParam
(
required
=
false
)
String
dimension
)
{
LOGGER
.
info
(
"用户注册, phoneNo:{}, verificationCode:{}, channelId:{}, registerFrom:{},btRegisterChannelId:{}"
,
phoneNo
,
verificationCode
,
channelId
,
registerFrom
,
btRegisterChannelId
);
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
LOGGER
.
info
(
"用户注册失败,手机号错误, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
...
...
@@ -273,7 +273,7 @@ public class UserController implements IBaseController {
LOGGER
.
info
(
"用户注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}"
,
registerFrom
,
phoneNo
,
verificationCode
);
return
JsonResult
.
buildErrorStateResult
(
"短信验证码错误"
,
null
);
}
if
(!
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
))
{
if
(!
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
,
dimension
))
{
LOGGER
.
info
(
"用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"注册失败,请稍后重试"
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IUserService.java
View file @
67708870
...
...
@@ -32,7 +32,7 @@ public interface IUserService {
User
findById
(
Long
userId
);
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
);
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
,
String
dimension
);
List
<
User
>
findByPhones
(
List
<
String
>
phones
);
User
registerAndReturn
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
Long
btRegisterChannelId
);
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
67708870
...
...
@@ -152,7 +152,7 @@ public class UserServiceImpl implements IUserService {
@Override
public
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
)
{
public
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
,
String
dimension
)
{
String
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
password
);
Timestamp
currentTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
...
...
@@ -185,7 +185,7 @@ public class UserServiceImpl implements IUserService {
if
(
registerSuccess
){
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
null
,
2
,
channelId
);
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
2
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
}
...
...
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