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
89a4bd77
Commit
89a4bd77
authored
Nov 05, 2019
by
杨锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app - 查询用户手机号修改进度 DONE.
parent
097be491
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
2 deletions
+39
-2
ModifyPhoneNoController.java
...yqb/controller/modifyphoneno/ModifyPhoneNoController.java
+13
-2
IModifyPhoneNoService.java
...n/quantgroup/xyqb/service/user/IModifyPhoneNoService.java
+2
-0
ModifyPhoneNoServiceImpl.java
...roup/xyqb/service/user/impl/ModifyPhoneNoServiceImpl.java
+24
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/modifyphoneno/ModifyPhoneNoController.java
View file @
89a4bd77
...
@@ -32,13 +32,24 @@ public class ModifyPhoneNoController implements IBaseController {
...
@@ -32,13 +32,24 @@ public class ModifyPhoneNoController implements IBaseController {
@Resource
@Resource
private
IModifyPhoneNoService
modifyPhoneNoService
;
private
IModifyPhoneNoService
modifyPhoneNoService
;
@ApiOperation
(
"app - 查询用户手机号修改进度"
)
@GetMapping
(
"/progress"
)
public
JsonResult
progress
()
{
User
user
=
getCurrentUserFromRedis
();
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"系统错误"
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
modifyPhoneNoService
.
progress
(
user
.
getId
()));
}
/**
/**
* step_1
* step_1
*
*
* @param step1Req
* @param step1Req
* @return
* @return
*/
*/
@ApiOperation
(
"
s
tep_1"
)
@ApiOperation
(
"
app - 申请修改手机号S
tep_1"
)
@PostMapping
(
"/step_1"
)
@PostMapping
(
"/step_1"
)
public
JsonResult
step1
(
@Valid
@RequestBody
Step1Req
step1Req
)
{
public
JsonResult
step1
(
@Valid
@RequestBody
Step1Req
step1Req
)
{
User
user
=
getCurrentUserFromRedis
();
User
user
=
getCurrentUserFromRedis
();
...
@@ -54,7 +65,7 @@ public class ModifyPhoneNoController implements IBaseController {
...
@@ -54,7 +65,7 @@ public class ModifyPhoneNoController implements IBaseController {
* @param step2Req
* @param step2Req
* @return
* @return
*/
*/
@ApiOperation
(
"
s
tep_2"
)
@ApiOperation
(
"
app - 申请修改手机号S
tep_2"
)
@PostMapping
(
"/step_2"
)
@PostMapping
(
"/step_2"
)
public
JsonResult
step2
(
@Valid
@RequestBody
Step2Req
step2Req
)
{
public
JsonResult
step2
(
@Valid
@RequestBody
Step2Req
step2Req
)
{
modifyPhoneNoService
.
saveStep2
(
step2Req
);
modifyPhoneNoService
.
saveStep2
(
step2Req
);
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IModifyPhoneNoService.java
View file @
89a4bd77
...
@@ -20,4 +20,6 @@ public interface IModifyPhoneNoService {
...
@@ -20,4 +20,6 @@ public interface IModifyPhoneNoService {
*
*
*/
*/
void
saveStep2
(
Step2Req
step2Req
);
void
saveStep2
(
Step2Req
step2Req
);
Integer
progress
(
Long
id
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/ModifyPhoneNoServiceImpl.java
View file @
89a4bd77
...
@@ -12,6 +12,7 @@ import cn.quantgroup.xyqb.repository.IUserDetailRepository;
...
@@ -12,6 +12,7 @@ import cn.quantgroup.xyqb.repository.IUserDetailRepository;
import
cn.quantgroup.xyqb.service.sms.ISmsService
;
import
cn.quantgroup.xyqb.service.sms.ISmsService
;
import
cn.quantgroup.xyqb.service.user.IModifyPhoneNoService
;
import
cn.quantgroup.xyqb.service.user.IModifyPhoneNoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -73,6 +74,29 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -73,6 +74,29 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
INIT
.
getType
());
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
INIT
.
getType
());
}
}
/**
* 查询用户手机号修改进度
*
* @param id user.id
* @return 进度 0初始化(用户未填写过申请单或提交过的申请单均已处理完成且反馈);
* 1已填写基本信息,未上传身份证图片;
* 2已填写基本信息,且已上传身份证图片
*/
@Override
public
Integer
progress
(
Long
id
)
{
ModifyPhoneNo
modifyPhoneNo
=
modifyPhoneNoRepository
.
findFirstByUserIdAndProcessingStatusNot
(
id
,
ModifyPhoneNoProcessingStatusEnum
.
DONE
.
getType
());
if
(
modifyPhoneNo
==
null
)
{
return
0
;
}
if
(
StringUtils
.
isBlank
(
modifyPhoneNo
.
getIdCardFaceUrl
())
&&
StringUtils
.
isBlank
(
modifyPhoneNo
.
getIdCardRearUrl
())
&&
StringUtils
.
isBlank
(
modifyPhoneNo
.
getIdCardHoldUrl
()))
{
return
1
;
}
if
(
StringUtils
.
isNotBlank
(
modifyPhoneNo
.
getIdCardFaceUrl
())
&&
StringUtils
.
isNotBlank
(
modifyPhoneNo
.
getIdCardRearUrl
())
&&
StringUtils
.
isNotBlank
(
modifyPhoneNo
.
getIdCardHoldUrl
()))
{
return
2
;
}
return
-
1
;
}
/**
/**
* 验证用户是否允许修改手机号
* 验证用户是否允许修改手机号
* <p>
* <p>
...
...
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