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
ac7b1113
Commit
ac7b1113
authored
Dec 07, 2022
by
赵浩琳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户提交修改手机号申请及客服审核,不在调用金融校验是否在贷,改为调用金融同步修改手机号(其中包含校验在贷逻辑)
parent
8d7c8ab9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
ModifyPhoneNoServiceImpl.java
...roup/xyqb/service/user/impl/ModifyPhoneNoServiceImpl.java
+25
-5
No files found.
src/main/java/cn/quantgroup/xyqb/service/user/impl/ModifyPhoneNoServiceImpl.java
View file @
ac7b1113
...
@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
...
@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
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.entity.UserModifyPhoneRecord
;
import
cn.quantgroup.xyqb.entity.UserModifyPhoneRecord
;
import
cn.quantgroup.xyqb.entity.enums.Reason
;
import
cn.quantgroup.xyqb.exception.AppletException
;
import
cn.quantgroup.xyqb.exception.AppletException
;
import
cn.quantgroup.xyqb.exception.DataException
;
import
cn.quantgroup.xyqb.exception.DataException
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
...
@@ -239,10 +240,27 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -239,10 +240,27 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
if
(
userRepository
.
findByPhoneNo
(
modifyPhoneNo
.
getCurPhoneNo
())
!=
null
)
{
if
(
userRepository
.
findByPhoneNo
(
modifyPhoneNo
.
getCurPhoneNo
())
!=
null
)
{
throw
new
DataException
(
"新手机号已存在,不支持更换。"
);
throw
new
DataException
(
"新手机号已存在,不支持更换。"
);
}
}
checkLoanStatus
(
modifyPhoneNo
.
getUserId
());
// 请求其他系统信息
userService
.
modifyPhoneNo
(
modifyPhoneNo
.
getPrevPhoneNo
(),
modifyPhoneNo
.
getCurPhoneNo
());
HashMap
<
String
,
String
>
parameters
=
new
HashMap
<>();
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
DONE
.
ordinal
());
HashMap
<
String
,
String
>
headers
=
new
HashMap
<>();
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
WAIT_4_USER_FEEDBACK
.
ordinal
());
headers
.
put
(
"qg-tenant-id"
,
TenantUtil
.
TENANT_DEFAULT
.
toString
());
parameters
.
put
(
"oldPhoneNo"
,
modifyPhoneNo
.
getPrevPhoneNo
());
parameters
.
put
(
"phoneNo"
,
modifyPhoneNo
.
getCurPhoneNo
());
parameters
.
put
(
"exUserId"
,
String
.
valueOf
(
modifyPhoneNo
.
getUserId
()));
// parameters.put("remark", modifyPhoneNo.getApplyStatusReason());
parameters
.
put
(
"changeRecord"
,
Reason
.
SYNCHRONOUSCHANGE
.
toString
());
String
resultStr
=
httpService
.
postJson
(
userHost
+
"/api/finance-gateway/finance-user/shop/notify/changePhoneNo"
,
headers
,
parameters
);
JsonResult
resultStrJson
=
JSONObject
.
parseObject
(
resultStr
,
JsonResult
.
class
);
// 如果有返回值
if
(
"0000"
.
equals
(
resultStrJson
.
getBusinessCode
())
||
"4014"
.
equals
(
resultStrJson
.
getBusinessCode
()))
{
// 同步金融修改电商
userService
.
modifyPhoneNo
(
modifyPhoneNo
.
getPrevPhoneNo
(),
modifyPhoneNo
.
getCurPhoneNo
());
modifyPhoneNo
.
setApplyStatus
(
ModifyPhoneNoApplyStatusEnum
.
DONE
.
ordinal
());
modifyPhoneNo
.
setProcessingStatus
(
ModifyPhoneNoProcessingStatusEnum
.
WAIT_4_USER_FEEDBACK
.
ordinal
());
}
else
{
String
msg
=
resultStrJson
.
getMsg
();
throw
new
DataException
(
"金融返回失败"
+
(
StringUtils
.
isNotBlank
(
msg
)
?
":"
+
msg
:
""
));
}
}
}
}
}
...
@@ -393,12 +411,14 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
...
@@ -393,12 +411,14 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
if
(
userService
.
findByPhoneInDb
(
curPhoneNo
)
!=
null
)
{
if
(
userService
.
findByPhoneInDb
(
curPhoneNo
)
!=
null
)
{
throw
new
DataException
(
"填写信息有误,新手机号已注册。"
);
throw
new
DataException
(
"填写信息有误,新手机号已注册。"
);
}
}
checkLoanStatus
(
userId
);
// checkLoanStatus(userId); 调用金融接口方式是错误的,改为同步金融一起修改手机号
}
}
/**
/**
* @param userId user.id
* @param userId user.id
* 弃用,这里调金融传的是电商userId,结果不可信
*/
*/
@Deprecated
public
void
checkLoanStatus
(
Long
userId
)
{
public
void
checkLoanStatus
(
Long
userId
)
{
log
.
info
(
"allowModify userId = 【{}】"
,
userId
);
log
.
info
(
"allowModify userId = 【{}】"
,
userId
);
String
res
=
httpService
.
get
(
apiHttps
+
"/ex/loan/user/loan_status.json?userId="
+
userId
);
String
res
=
httpService
.
get
(
apiHttps
+
"/ex/loan/user/loan_status.json?userId="
+
userId
);
...
...
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