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
a03fd0a9
Commit
a03fd0a9
authored
Jun 23, 2017
by
Java—红包—徐 然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
5b3ad19f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+3
-7
IUserService.java
...in/java/cn/quantgroup/xyqb/service/user/IUserService.java
+1
-1
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+13
-2
MqUtils.java
src/main/java/cn/quantgroup/xyqb/util/MqUtils.java
+1
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
a03fd0a9
...
@@ -222,8 +222,7 @@ public class UserController implements IBaseController {
...
@@ -222,8 +222,7 @@ public class UserController implements IBaseController {
LOGGER
.
info
(
"用户快速注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}"
,
registerFrom
,
phoneNo
,
verificationCode
);
LOGGER
.
info
(
"用户快速注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}"
,
registerFrom
,
phoneNo
,
verificationCode
);
return
JsonResult
.
buildErrorStateResult
(
"短信验证码错误"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"短信验证码错误"
,
null
);
}
}
User
user
=
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
);
if
(!
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
))
{
if
(
null
==
user
)
{
LOGGER
.
info
(
"用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
LOGGER
.
info
(
"用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"注册失败,请稍后重试"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"注册失败,请稍后重试"
,
null
);
}
}
...
@@ -272,14 +271,11 @@ public class UserController implements IBaseController {
...
@@ -272,14 +271,11 @@ public class UserController implements IBaseController {
LOGGER
.
info
(
"用户注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}"
,
registerFrom
,
phoneNo
,
verificationCode
);
LOGGER
.
info
(
"用户注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}"
,
registerFrom
,
phoneNo
,
verificationCode
);
return
JsonResult
.
buildErrorStateResult
(
"短信验证码错误"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"短信验证码错误"
,
null
);
}
}
User
user
=
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
);
if
(!
userService
.
register
(
phoneNo
,
password
,
registerFrom
,
getIp
(),
channelId
,
btRegisterChannelId
))
{
if
(
null
==
user
)
{
LOGGER
.
info
(
"用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
LOGGER
.
info
(
"用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"注册失败,请稍后重试"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"注册失败,请稍后重试"
,
null
);
}
}
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
null
,
3
);
MqUtils
.
sendLoanVest
(
statistics
);
LOGGER
.
info
(
"用户注册成功, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
LOGGER
.
info
(
"用户注册成功, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IUserService.java
View file @
a03fd0a9
...
@@ -32,7 +32,7 @@ public interface IUserService {
...
@@ -32,7 +32,7 @@ public interface IUserService {
User
findById
(
Long
userId
);
User
findById
(
Long
userId
);
User
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
);
List
<
User
>
findByPhones
(
List
<
String
>
phones
);
List
<
User
>
findByPhones
(
List
<
String
>
phones
);
User
registerAndReturn
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
Long
btRegisterChannelId
);
User
registerAndReturn
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
Long
btRegisterChannelId
);
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
a03fd0a9
...
@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.entity.*;
...
@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.entity.*;
import
cn.quantgroup.xyqb.model.IdCardInfo
;
import
cn.quantgroup.xyqb.model.IdCardInfo
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.UserStatistics
;
import
cn.quantgroup.xyqb.repository.IAddressRepository
;
import
cn.quantgroup.xyqb.repository.IAddressRepository
;
import
cn.quantgroup.xyqb.repository.IContactRepository
;
import
cn.quantgroup.xyqb.repository.IContactRepository
;
import
cn.quantgroup.xyqb.repository.IUserBtRegisterRepository
;
import
cn.quantgroup.xyqb.repository.IUserBtRegisterRepository
;
...
@@ -16,6 +17,7 @@ import cn.quantgroup.xyqb.service.user.ILkbUserService;
...
@@ -16,6 +17,7 @@ import cn.quantgroup.xyqb.service.user.ILkbUserService;
import
cn.quantgroup.xyqb.service.user.IUserBtRegisterService
;
import
cn.quantgroup.xyqb.service.user.IUserBtRegisterService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.util.MqUtils
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
...
@@ -150,7 +152,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -150,7 +152,7 @@ public class UserServiceImpl implements IUserService {
@Override
@Override
public
User
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
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
password
);
String
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
password
);
Timestamp
currentTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
Timestamp
currentTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
...
@@ -170,15 +172,24 @@ public class UserServiceImpl implements IUserService {
...
@@ -170,15 +172,24 @@ public class UserServiceImpl implements IUserService {
//user.setRegisteredFrom(registerFrom);
//user.setRegisteredFrom(registerFrom);
user
=
userRepository
.
save
(
user
);
user
=
userRepository
.
save
(
user
);
boolean
registerSuccess
=
false
;
if
(
null
!=
user
){
if
(
null
!=
user
){
UserBtRegister
userBtRegister
=
new
UserBtRegister
();
UserBtRegister
userBtRegister
=
new
UserBtRegister
();
userBtRegister
.
setUserId
(
user
.
getId
());
userBtRegister
.
setUserId
(
user
.
getId
());
userBtRegister
.
setRegisterBtMerchantId
(
btRegisterChannelId
);
userBtRegister
.
setRegisterBtMerchantId
(
btRegisterChannelId
);
userBtRegisterService
.
save
(
userBtRegister
);
userBtRegisterService
.
save
(
userBtRegister
);
log
.
info
(
"白条注册渠道信息保存完成"
);
log
.
info
(
"白条注册渠道信息保存完成"
);
registerSuccess
=
true
;
}
}
smsService
.
sendAfterRegister
(
phoneNo
);
smsService
.
sendAfterRegister
(
phoneNo
);
return
user
;
if
(
registerSuccess
){
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
null
,
3
);
MqUtils
.
sendLoanVest
(
statistics
);
}
return
registerSuccess
;
}
}
...
...
src/main/java/cn/quantgroup/xyqb/util/MqUtils.java
View file @
a03fd0a9
...
@@ -18,7 +18,7 @@ public class MqUtils {
...
@@ -18,7 +18,7 @@ public class MqUtils {
IVestService
mqService
=
ApplicationContextHolder
.
getBean
(
"loanVestMQService"
);
IVestService
mqService
=
ApplicationContextHolder
.
getBean
(
"loanVestMQService"
);
mqService
.
send
(
vest
);
mqService
.
send
(
vest
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"[MQUtils][MQUtils_exception]发送
马甲
信息,vest={},error={}"
,
log
.
error
(
"[MQUtils][MQUtils_exception]发送
用户统计
信息,vest={},error={}"
,
vest
,
e
);
vest
,
e
);
}
}
}
}
...
...
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