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
c901e5ce
Commit
c901e5ce
authored
Nov 07, 2019
by
杨锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review done。
parent
ab0ec175
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
38 deletions
+15
-38
ModifyPhoneNoApplyStatusEnum.java
...n/quantgroup/user/enums/ModifyPhoneNoApplyStatusEnum.java
+3
-12
ModifyPhoneNoProcessingStatusEnum.java
...ntgroup/user/enums/ModifyPhoneNoProcessingStatusEnum.java
+3
-12
ModifyPhoneNoController.java
...yqb/controller/modifyphoneno/ModifyPhoneNoController.java
+0
-5
ModifyPhoneNoServiceImpl.java
...roup/xyqb/service/user/impl/ModifyPhoneNoServiceImpl.java
+9
-9
No files found.
src/main/java/cn/quantgroup/user/enums/ModifyPhoneNoApplyStatusEnum.java
View file @
c901e5ce
...
@@ -28,24 +28,15 @@ public enum ModifyPhoneNoApplyStatusEnum {
...
@@ -28,24 +28,15 @@ public enum ModifyPhoneNoApplyStatusEnum {
/**
/**
* 类型
* 类型
*/
*/
private
int
type
;
private
int
ordinal
;
/**
/**
* 描述
* 描述
*/
*/
private
String
desc
;
private
String
desc
;
ModifyPhoneNoApplyStatusEnum
(
int
type
,
String
desc
)
{
ModifyPhoneNoApplyStatusEnum
(
int
ordinal
,
String
desc
)
{
this
.
type
=
type
;
this
.
ordinal
=
ordinal
;
this
.
desc
=
desc
;
this
.
desc
=
desc
;
}
}
public
static
String
getDesc
(
int
type
)
{
for
(
ModifyPhoneNoApplyStatusEnum
modifyPhoneNoApplyStatusEnum
:
ModifyPhoneNoApplyStatusEnum
.
values
())
{
if
(
modifyPhoneNoApplyStatusEnum
.
type
==
type
)
{
return
modifyPhoneNoApplyStatusEnum
.
desc
;
}
}
return
null
;
}
}
}
src/main/java/cn/quantgroup/user/enums/ModifyPhoneNoProcessingStatusEnum.java
View file @
c901e5ce
...
@@ -28,24 +28,15 @@ public enum ModifyPhoneNoProcessingStatusEnum {
...
@@ -28,24 +28,15 @@ public enum ModifyPhoneNoProcessingStatusEnum {
/**
/**
* 类型
* 类型
*/
*/
private
int
type
;
private
int
ordinal
;
/**
/**
* 描述
* 描述
*/
*/
private
String
desc
;
private
String
desc
;
ModifyPhoneNoProcessingStatusEnum
(
int
type
,
String
desc
)
{
ModifyPhoneNoProcessingStatusEnum
(
int
ordinal
,
String
desc
)
{
this
.
type
=
type
;
this
.
ordinal
=
ordinal
;
this
.
desc
=
desc
;
this
.
desc
=
desc
;
}
}
public
static
String
getDesc
(
int
type
)
{
for
(
ModifyPhoneNoProcessingStatusEnum
modifyPhoneNoProcessingStatusEnum
:
ModifyPhoneNoProcessingStatusEnum
.
values
())
{
if
(
modifyPhoneNoProcessingStatusEnum
.
type
==
type
)
{
return
modifyPhoneNoProcessingStatusEnum
.
desc
;
}
}
return
null
;
}
}
}
src/main/java/cn/quantgroup/xyqb/controller/modifyphoneno/ModifyPhoneNoController.java
View file @
c901e5ce
...
@@ -7,9 +7,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step1Req;
...
@@ -7,9 +7,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step1Req;
import
cn.quantgroup.xyqb.controller.modifyphoneno.req.Step2Req
;
import
cn.quantgroup.xyqb.controller.modifyphoneno.req.Step2Req
;
import
cn.quantgroup.xyqb.entity.ModifyPhoneNo
;
import
cn.quantgroup.xyqb.entity.ModifyPhoneNo
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.exception.DataException
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.user.IModifyPhoneNoService
;
import
cn.quantgroup.xyqb.service.user.IModifyPhoneNoService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -18,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
...
@@ -18,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.text.ParseException
;
/**
/**
* 用户手机号修改相关api
* 用户手机号修改相关api
...
@@ -35,8 +32,6 @@ public class ModifyPhoneNoController implements IBaseController {
...
@@ -35,8 +32,6 @@ public class ModifyPhoneNoController implements IBaseController {
@Resource
@Resource
private
IModifyPhoneNoService
modifyPhoneNoService
;
private
IModifyPhoneNoService
modifyPhoneNoService
;
@Resource
private
IIdCardService
iIdCardService
;
@ApiOperation
(
"app - 查询用户手机号修改进度"
)
@ApiOperation
(
"app - 查询用户手机号修改进度"
)
@GetMapping
(
"/progress"
)
@GetMapping
(
"/progress"
)
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/ModifyPhoneNoServiceImpl.java
View file @
c901e5ce
...
@@ -94,8 +94,8 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -94,8 +94,8 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
modifyPhoneNo
.
setIdCardFaceUrl
(
step2Req
.
getIdCardFaceUrl
());
modifyPhoneNo
.
setIdCardFaceUrl
(
step2Req
.
getIdCardFaceUrl
());
modifyPhoneNo
.
setIdCardRearUrl
(
step2Req
.
getIdCardRearUrl
());
modifyPhoneNo
.
setIdCardRearUrl
(
step2Req
.
getIdCardRearUrl
());
modifyPhoneNo
.
setIdCardHoldUrl
(
step2Req
.
getIdCardHoldUrl
());
modifyPhoneNo
.
setIdCardHoldUrl
(
step2Req
.
getIdCardHoldUrl
());
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
INIT
.
get
Type
());
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
INIT
.
get
Ordinal
());
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
INIT
.
get
Type
());
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
INIT
.
get
Ordinal
());
}
}
/**
/**
...
@@ -108,7 +108,7 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -108,7 +108,7 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
*/
*/
@Override
@Override
public
Integer
progress
(
Long
userId
)
{
public
Integer
progress
(
Long
userId
)
{
ModifyPhoneNo
modifyPhoneNo
=
modifyPhoneNoRepository
.
findFirstByUserIdAndApplyStatus
(
userId
,
ModifyPhoneNoApplyStatusEnum
.
INIT
.
get
Type
());
ModifyPhoneNo
modifyPhoneNo
=
modifyPhoneNoRepository
.
findFirstByUserIdAndApplyStatus
(
userId
,
ModifyPhoneNoApplyStatusEnum
.
INIT
.
get
Ordinal
());
if
(
modifyPhoneNo
==
null
)
{
if
(
modifyPhoneNo
==
null
)
{
return
0
;
return
0
;
}
}
...
@@ -141,10 +141,10 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -141,10 +141,10 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
list
.
add
(
criteriaBuilder
.
lessThanOrEqualTo
(
root
.
get
(
"createdAt"
),
DateUtils
.
strToDate
(
modifyPhoneNoQueryReq
.
getEndAt
(),
DateUtils
.
YMD_FORMAT
)));
list
.
add
(
criteriaBuilder
.
lessThanOrEqualTo
(
root
.
get
(
"createdAt"
),
DateUtils
.
strToDate
(
modifyPhoneNoQueryReq
.
getEndAt
(),
DateUtils
.
YMD_FORMAT
)));
}
}
if
(
modifyPhoneNoQueryReq
.
getApplyStatus
()
!=
null
)
{
if
(
modifyPhoneNoQueryReq
.
getApplyStatus
()
!=
null
)
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"applyStatus"
),
modifyPhoneNoQueryReq
.
getApplyStatus
().
get
Type
()));
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"applyStatus"
),
modifyPhoneNoQueryReq
.
getApplyStatus
().
get
Ordinal
()));
}
}
if
(
modifyPhoneNoQueryReq
.
getProcessingStatus
()
!=
null
)
{
if
(
modifyPhoneNoQueryReq
.
getProcessingStatus
()
!=
null
)
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"processingStatus"
),
modifyPhoneNoQueryReq
.
getProcessingStatus
().
get
Type
()));
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"processingStatus"
),
modifyPhoneNoQueryReq
.
getProcessingStatus
().
get
Ordinal
()));
}
}
Predicate
[]
arr
=
new
Predicate
[
list
.
size
()];
Predicate
[]
arr
=
new
Predicate
[
list
.
size
()];
return
criteriaBuilder
.
and
(
list
.
toArray
(
arr
));
return
criteriaBuilder
.
and
(
list
.
toArray
(
arr
));
...
@@ -180,7 +180,7 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -180,7 +180,7 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
if
(
modifyPhoneNo
==
null
)
{
if
(
modifyPhoneNo
==
null
)
{
throw
new
DataException
(
"数据不存在。"
);
throw
new
DataException
(
"数据不存在。"
);
}
}
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
DONE
.
get
Type
());
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
DONE
.
get
Ordinal
());
}
}
@Override
@Override
...
@@ -191,14 +191,14 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -191,14 +191,14 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
throw
new
DataException
(
"数据不存在。"
);
throw
new
DataException
(
"数据不存在。"
);
}
}
if
(
ModifyPhoneNoApplyStatusEnum
.
NO_ALLOW
==
auditReq
.
getApplyStatus
())
{
if
(
ModifyPhoneNoApplyStatusEnum
.
NO_ALLOW
==
auditReq
.
getApplyStatus
())
{
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
NO_ALLOW
.
get
Type
());
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
NO_ALLOW
.
get
Ordinal
());
modifyPhoneNo
.
setApplyStatusReason
(
auditReq
.
getApplyStatusReason
());
modifyPhoneNo
.
setApplyStatusReason
(
auditReq
.
getApplyStatusReason
());
}
}
if
(
ModifyPhoneNoApplyStatusEnum
.
DONE
==
auditReq
.
getApplyStatus
())
{
if
(
ModifyPhoneNoApplyStatusEnum
.
DONE
==
auditReq
.
getApplyStatus
())
{
allowModify4Audit
(
modifyPhoneNo
.
getUserId
(),
modifyPhoneNo
.
getName
(),
modifyPhoneNo
.
getIdCard
(),
allowModify4Audit
(
modifyPhoneNo
.
getUserId
(),
modifyPhoneNo
.
getName
(),
modifyPhoneNo
.
getIdCard
(),
modifyPhoneNo
.
getPrevPhoneNo
(),
modifyPhoneNo
.
getCurPhoneNo
());
modifyPhoneNo
.
getPrevPhoneNo
(),
modifyPhoneNo
.
getCurPhoneNo
());
userService
.
modifyPhoneNo
(
modifyPhoneNo
.
getPrevPhoneNo
(),
modifyPhoneNo
.
getCurPhoneNo
());
userService
.
modifyPhoneNo
(
modifyPhoneNo
.
getPrevPhoneNo
(),
modifyPhoneNo
.
getCurPhoneNo
());
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
DONE
.
get
Type
());
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
DONE
.
get
Ordinal
());
}
}
}
}
...
@@ -220,7 +220,7 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -220,7 +220,7 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
* @return
* @return
*/
*/
public
void
allowModify4Step1
(
Long
userId
,
String
name
,
String
idCard
,
String
prevPhoneNo
,
String
curPhoneNo
,
String
smsCode
)
{
public
void
allowModify4Step1
(
Long
userId
,
String
name
,
String
idCard
,
String
prevPhoneNo
,
String
curPhoneNo
,
String
smsCode
)
{
if
(
modifyPhoneNoRepository
.
findFirstByUserIdAndApplyStatus
(
userId
,
ModifyPhoneNoProcessingStatusEnum
.
INIT
.
get
Type
())
!=
null
)
{
if
(
modifyPhoneNoRepository
.
findFirstByUserIdAndApplyStatus
(
userId
,
ModifyPhoneNoProcessingStatusEnum
.
INIT
.
get
Ordinal
())
!=
null
)
{
throw
new
DataException
(
"已存在处理中的申请单,不支持再次更换。"
);
throw
new
DataException
(
"已存在处理中的申请单,不支持再次更换。"
);
}
}
if
(!
smsService
.
verifyPhoneAndCode
(
curPhoneNo
,
smsCode
))
{
if
(!
smsService
.
verifyPhoneAndCode
(
curPhoneNo
,
smsCode
))
{
...
...
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