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
96816ead
Commit
96816ead
authored
Dec 28, 2021
by
killer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改文案
parent
95a41a02
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
25 deletions
+53
-25
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+31
-20
UserRegisterServiceImpl.java
...p/xyqb/service/register/impl/UserRegisterServiceImpl.java
+2
-2
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+20
-3
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
96816ead
...
...
@@ -23,10 +23,7 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.session.XyqbSessionContextHolder
;
import
cn.quantgroup.xyqb.util.IpUtil
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.TenantUtil
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
cn.quantgroup.xyqb.util.*
;
import
com.alibaba.fastjson.JSON
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -101,7 +98,7 @@ public class UserController implements IBaseController {
* @return
* @yapi unknown
*/
@ApiOperation
(
value
=
"登录(账号 + 密码)"
,
httpMethod
=
"POST"
,
notes
=
"登录(账号 + 密码)"
)
@ApiOperation
(
value
=
"登录(账号 + 密码)"
,
httpMethod
=
"POST"
,
notes
=
"登录(账号 + 密码)"
)
@LoginInterceptor
@CaptchaFiniteValidator
@RequestMapping
(
"/loginV1"
)
...
...
@@ -122,7 +119,7 @@ public class UserController implements IBaseController {
*
* @yapi http://yapi.quantgroups.com/project/17/interface/api/7310
*/
@ApiOperation
(
value
=
"慢速登陆"
,
httpMethod
=
"POST"
,
notes
=
"慢速登陆"
)
@ApiOperation
(
value
=
"慢速登陆"
,
httpMethod
=
"POST"
,
notes
=
"慢速登陆"
)
@PasswordErrorFiniteValidator
@RequestMapping
(
"/login"
)
public
JsonResult
login
(
...
...
@@ -159,7 +156,7 @@ public class UserController implements IBaseController {
* @return
* @yapi http://yapi.quantgroups.com/project/17/interface/api/1786
*/
@ApiOperation
(
value
=
"快速登录(手机号 + 短信验证码),H5专用入口"
,
httpMethod
=
"POST"
,
notes
=
"快速登录(手机号 + 短信验证码),H5专用入口"
)
@ApiOperation
(
value
=
"快速登录(手机号 + 短信验证码),H5专用入口"
,
httpMethod
=
"POST"
,
notes
=
"快速登录(手机号 + 短信验证码),H5专用入口"
)
@RequestMapping
(
"/login/fastV1"
)
public
JsonResult
loginFastV1
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
...
...
@@ -179,7 +176,7 @@ public class UserController implements IBaseController {
*
* @yapi http://yapi.quantgroups.com/project/17/interface/api/2066
*/
@ApiOperation
(
value
=
"快速登陆 - 同h5login代码实现一致"
,
httpMethod
=
"POST"
,
notes
=
"快速登陆 - 同h5login代码实现一致"
)
@ApiOperation
(
value
=
"快速登陆 - 同h5login代码实现一致"
,
httpMethod
=
"POST"
,
notes
=
"快速登陆 - 同h5login代码实现一致"
)
@LoginInterceptor
@RequestMapping
(
"/login/fast"
)
public
JsonResult
loginFast
(
...
...
@@ -264,7 +261,7 @@ public class UserController implements IBaseController {
* @return
* @yapi unknown
*/
@ApiOperation
(
value
=
"用户注册"
,
httpMethod
=
"POST"
,
notes
=
"用户注册"
)
@ApiOperation
(
value
=
"用户注册"
,
httpMethod
=
"POST"
,
notes
=
"用户注册"
)
@RequestMapping
(
"/register"
)
public
JsonResult
register
(
@RequestParam
String
phoneNo
,
@RequestParam
String
password
,
@RequestParam
String
verificationCode
,
@RequestParam
(
required
=
false
)
Long
channelId
,
...
...
@@ -289,6 +286,20 @@ public class UserController implements IBaseController {
verifyPhoneAndCode
(
phoneNo
,
verificationCode
);
User
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
if
(
user
!=
null
)
{
/* 销户用户 */
if
(
UserStatusEnum
.
DELETE
.
ordinal
()
==
user
.
getEnable
())
{
long
deleteDays
=
DateUtils
.
diffDayByTimestamp
(
user
.
getUpdatedAt
());
/* 如果用户销户时间大于90天 用户状态修改为可用 不在执行后续业务逻辑 */
if
(
Constants
.
DELETE_USER_AGAIN_REGISTER_INTERVAL
<
deleteDays
)
{
log
.
info
(
"用户[{}]为历史销户用户, 销户时间大于90天, 直接修改状态为启用"
,
phoneNo
);
userRegisterService
.
onceAgainRegister
(
user
);
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
log
.
info
(
"用户[{}]已销户"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"用户已经销户90天内不允许注册"
,
null
);
}
user
.
setPassword
(
PasswordUtil
.
MD5WithSalt
(
password
));
userService
.
saveUser
(
user
);
log
.
info
(
"用户注册失败,该手机号已经被注册:register -> registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
...
...
@@ -311,7 +322,7 @@ public class UserController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/2388
* @Deprecated 20210318
*/
@ApiOperation
(
value
=
"检查用户是否存在"
,
httpMethod
=
"POST"
,
notes
=
"检查用户是否存在"
)
@ApiOperation
(
value
=
"检查用户是否存在"
,
httpMethod
=
"POST"
,
notes
=
"检查用户是否存在"
)
@IpValidator
@RequestMapping
(
"/exist"
)
@Deprecated
...
...
@@ -332,7 +343,7 @@ public class UserController implements IBaseController {
* @yapi unknown
* @Deprecated 20210318
*/
@ApiOperation
(
value
=
"检查用户是否存在"
,
httpMethod
=
"POST"
,
notes
=
"检查用户是否存在"
)
@ApiOperation
(
value
=
"检查用户是否存在"
,
httpMethod
=
"POST"
,
notes
=
"检查用户是否存在"
)
@IpValidator
@RequestMapping
(
"/exist_check"
)
@Deprecated
...
...
@@ -350,7 +361,7 @@ public class UserController implements IBaseController {
* @return
* @yapi http://yapi.quantgroups.com/project/17/interface/api/3263
*/
@ApiOperation
(
value
=
"重置密码"
,
httpMethod
=
"POST"
,
notes
=
"重置密码"
)
@ApiOperation
(
value
=
"重置密码"
,
httpMethod
=
"POST"
,
notes
=
"重置密码"
)
@RequestMapping
(
"/reset_password"
)
public
JsonResult
resetPassword
(
@RequestParam
String
phoneNo
,
@RequestParam
String
password
,
...
...
@@ -387,7 +398,7 @@ public class UserController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/3263
* @Deprecated 20210318, 仅有一次调用2021-03-15 00:38:57.752
*/
@ApiOperation
(
value
=
"重置密码"
,
httpMethod
=
"POST"
,
notes
=
"重置密码"
)
@ApiOperation
(
value
=
"重置密码"
,
httpMethod
=
"POST"
,
notes
=
"重置密码"
)
@Deprecated
@PasswordFreeAccessValidator
@RequestMapping
(
path
=
"/resetPassword"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -431,7 +442,7 @@ public class UserController implements IBaseController {
* @return
* @yapi http://yapi.quantgroups.com/project/17/interface/api/4012
*/
@ApiOperation
(
value
=
"检查token是否已经过期不存在了"
,
httpMethod
=
"POST"
,
notes
=
"检查token是否已经过期不存在了"
)
@ApiOperation
(
value
=
"检查token是否已经过期不存在了"
,
httpMethod
=
"POST"
,
notes
=
"检查token是否已经过期不存在了"
)
@IpValidator
@RequestMapping
(
"/exists_token"
)
public
JsonResult
checkToken
(
@RequestParam
String
token
)
{
...
...
@@ -453,7 +464,7 @@ public class UserController implements IBaseController {
*
* @yapi http://yapi.quantgroups.com/project/17/interface/api/9191
*/
@ApiOperation
(
value
=
"获取 token 信息"
,
httpMethod
=
"POST"
,
notes
=
"获取 token 信息"
)
@ApiOperation
(
value
=
"获取 token 信息"
,
httpMethod
=
"POST"
,
notes
=
"获取 token 信息"
)
@RequestMapping
(
"/token"
)
public
JsonResult
token
(
@RequestParam
String
token
,
@RequestParam
(
required
=
false
)
Integer
tenantId
)
{
...
...
@@ -482,7 +493,7 @@ public class UserController implements IBaseController {
if
(
user
==
null
)
{
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
}
}
else
{
}
else
{
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
}
}
...
...
@@ -532,7 +543,7 @@ public class UserController implements IBaseController {
* @yapi unknown
* @Deprecated 20210318, 20210201-20210203有集中调用274次,其他时间没有
*/
@ApiOperation
(
value
=
"获取用户信息"
,
httpMethod
=
"GET"
,
notes
=
"获取用户信息"
)
@ApiOperation
(
value
=
"获取用户信息"
,
httpMethod
=
"GET"
,
notes
=
"获取用户信息"
)
@Deprecated
@RequestMapping
(
"/syncUserInfo"
)
public
JsonResult
syncUserInfo
(
HttpServletRequest
request
)
{
...
...
@@ -551,7 +562,7 @@ public class UserController implements IBaseController {
*
* @yapi http://yapi.quantgroups.com/project/17/interface/api/23661
*/
@ApiOperation
(
value
=
"登出接口"
,
httpMethod
=
"GET"
,
notes
=
"登出接口"
)
@ApiOperation
(
value
=
"登出接口"
,
httpMethod
=
"GET"
,
notes
=
"登出接口"
)
@RequestMapping
(
value
=
"/logout"
,
method
=
RequestMethod
.
GET
)
public
JsonResult
logout
(
HttpServletRequest
request
)
{
...
...
@@ -579,8 +590,8 @@ public class UserController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"登录时微信关联失败"
,
null
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
1
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
null
);
AuthBean
authBean
=
sessionService
.
createSession
(
user
,
loginProperties
);
if
(
authBean
!=
null
)
{
AuthBean
authBean
=
sessionService
.
createSession
(
user
,
loginProperties
);
if
(
authBean
!=
null
)
{
authBean
.
setRegister
(
false
);
}
return
new
JsonResult
(
authBean
);
...
...
src/main/java/cn/quantgroup/xyqb/service/register/impl/UserRegisterServiceImpl.java
View file @
96816ead
...
...
@@ -28,7 +28,7 @@ import java.util.UUID;
*/
@Service
(
"userRegisterService"
)
@Slf4j
public
class
UserRegisterServiceImpl
implements
IUserRegisterService
{
public
class
UserRegisterServiceImpl
implements
IUserRegisterService
{
@Resource
private
ApplicationEventPublisher
applicationEventPublisher
;
...
...
@@ -38,7 +38,7 @@ import java.util.UUID;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
User
onceAgainRegister
(
User
user
){
public
User
onceAgainRegister
(
User
user
)
{
user
.
setEnable
(
UserStatusEnum
.
NORMAL
.
ordinal
());
userService
.
saveUser
(
user
);
return
user
;
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
96816ead
...
...
@@ -340,10 +340,27 @@ public class UserServiceImpl implements IUserService, IBaseController {
Boolean
register
=
false
;
User
user
=
findByPhoneWithCache
(
phoneNo
);
/* 用户已冻结或销户 */
if
(
user
!=
null
&&
UserStatusEnum
.
isDisable
(
user
).
getKey
())
{
log
.
info
(
"用户已经冻结或销户, 登录失败, phoneNo:{}"
,
phoneNo
);
if
(
user
!=
null
)
{
/* 冻结用户 */
if
(
UserStatusEnum
.
FREEZE
.
ordinal
()
==
user
.
getEnable
())
{
log
.
info
(
"用户已经冻结登录失败,phoneNo:{}"
,
phoneNo
);
return
UserStatusEnum
.
isDisable
(
user
).
getValue
();
}
/* 销户用户 */
if
(
UserStatusEnum
.
DELETE
.
ordinal
()
==
user
.
getEnable
())
{
long
deleteDays
=
DateUtils
.
diffDayByTimestamp
(
user
.
getUpdatedAt
());
/* 如果用户销户时间大于90天 用户状态修改为可用 不在执行后续业务逻辑 */
if
(
Constants
.
DELETE_USER_AGAIN_REGISTER_INTERVAL
<
deleteDays
)
{
log
.
info
(
"用户[{}]为历史销户用户, 销户时间大于90天, 直接修改状态为启用"
,
phoneNo
);
user
=
userRegisterService
.
onceAgainRegister
(
user
);
}
else
{
log
.
info
(
"用户[{}]已销户"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"用户已经销户"
,
null
);
}
}
}
if
(
user
==
null
)
{
// Service层会负责发送注册消息到LoanVest
user
=
userRegisterService
.
register
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
,
dimension
);
...
...
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