Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
customer-service
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
QG
customer-service
Commits
33050e19
Commit
33050e19
authored
Jun 02, 2020
by
xiaozhe.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客服系统对接中台接口,用户修改、修改密码、修改账户状态
parent
7ed01169
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
32 deletions
+48
-32
UserRest.java
src/main/java/cn/quantgroup/customer/rest/UserRest.java
+22
-9
JsonResult.java
src/main/java/cn/quantgroup/customer/rest/vo/JsonResult.java
+0
-3
IUserService.java
...ain/java/cn/quantgroup/customer/service/IUserService.java
+5
-4
UserServiceImpl.java
.../cn/quantgroup/customer/service/impl/UserServiceImpl.java
+21
-16
No files found.
src/main/java/cn/quantgroup/customer/rest/UserRest.java
View file @
33050e19
...
...
@@ -11,6 +11,7 @@ import cn.quantgroup.customer.rest.param.phone.ModifyPhoneFeedback;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneQuery
;
import
cn.quantgroup.customer.rest.param.user.UserCombinationParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.MoResult
;
import
cn.quantgroup.customer.service.IUserService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -139,8 +140,11 @@ public class UserRest {
public
JsonResult
modifyUserDetail
(
@RequestParam
(
required
=
true
)
Long
userId
,
@RequestParam
(
required
=
true
)
String
realName
,
@RequestParam
(
required
=
true
)
String
idNO
)
{
String
response
=
userService
.
modifyUserDetail
(
userId
,
realName
,
idNO
);
return
GSON
.
fromJson
(
response
,
JsonResult
.
class
);
MoResult
<
String
>
result
=
userService
.
modifyUserDetail
(
userId
,
realName
,
idNO
);
if
(!
result
.
isSuccess
()){
return
JsonResult
.
buildErrorStateResult
(
result
.
getMsg
(),
result
.
getData
());
}
return
JsonResult
.
buildSuccessResult
(
result
.
getMsg
(),
result
.
getData
());
}
/**
...
...
@@ -149,9 +153,12 @@ public class UserRest {
* @return
*/
@PostMapping
(
value
=
"/pwd/reset"
)
public
JsonResult
passwordReset
(
@RequestParam
(
required
=
true
)
String
phoneNo
)
{
String
response
=
userService
.
passwordRest
(
phoneNo
);
return
GSON
.
fromJson
(
response
,
JsonResult
.
class
);
public
JsonResult
passwordReset
(
@RequestParam
(
required
=
true
)
String
phone
)
{
MoResult
<
String
>
result
=
userService
.
passwordRest
(
phone
);
if
(!
result
.
isSuccess
()){
return
JsonResult
.
buildErrorStateResult
(
result
.
getMsg
(),
result
.
getData
());
}
return
JsonResult
.
buildSuccessResult
(
result
.
getMsg
(),
result
.
getData
());
}
/**
...
...
@@ -161,8 +168,11 @@ public class UserRest {
*/
@PostMapping
(
value
=
"/modify/account/status/disable"
)
public
JsonResult
modifyAccountStatusDisable
(
@RequestParam
(
required
=
true
)
Long
userId
)
{
String
response
=
userService
.
modifyAccountStatusDisable
(
userId
);
return
GSON
.
fromJson
(
response
,
JsonResult
.
class
);
MoResult
<
Boolean
>
result
=
userService
.
modifyAccountStatusDisable
(
userId
);
if
(!
result
.
isSuccess
()){
return
JsonResult
.
buildErrorStateResult
(
result
.
getMsg
(),
result
.
getData
());
}
return
JsonResult
.
buildSuccessResult
(
result
.
getMsg
(),
result
.
getData
());
}
/**
...
...
@@ -172,8 +182,11 @@ public class UserRest {
*/
@PostMapping
(
value
=
"/modify/account/status/active"
)
public
JsonResult
modifyAccountStatusActive
(
@RequestParam
(
required
=
true
)
Long
userId
)
{
String
response
=
userService
.
modifyAccountStatusActive
(
userId
);
return
GSON
.
fromJson
(
response
,
JsonResult
.
class
);
MoResult
<
Boolean
>
result
=
userService
.
modifyAccountStatusActive
(
userId
);
if
(!
result
.
isSuccess
()){
return
JsonResult
.
buildErrorStateResult
(
result
.
getMsg
(),
result
.
getData
());
}
return
JsonResult
.
buildSuccessResult
(
result
.
getMsg
(),
result
.
getData
());
}
...
...
src/main/java/cn/quantgroup/customer/rest/vo/JsonResult.java
View file @
33050e19
...
...
@@ -88,7 +88,4 @@ public class JsonResult<T> implements Serializable {
return
"0000"
.
equals
(
code
)
&&
"0000"
.
equals
(
businessCode
);
}
public
boolean
isSuccess2
()
{
return
"0"
.
equals
(
code
);
}
}
src/main/java/cn/quantgroup/customer/service/IUserService.java
View file @
33050e19
...
...
@@ -8,6 +8,7 @@ import cn.quantgroup.customer.rest.param.phone.ModifyPhoneQuery;
import
cn.quantgroup.customer.rest.param.user.UserCombinationParam
;
import
cn.quantgroup.customer.rest.param.user.UserQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.MoResult
;
import
org.springframework.security.core.userdetails.UserDetailsService
;
import
org.springframework.stereotype.Service
;
...
...
@@ -40,21 +41,21 @@ public interface IUserService extends UserDetailsService {
* @param phoneNo
* @return
*/
String
passwordRest
(
String
phoneNo
);
MoResult
<
String
>
passwordRest
(
String
phoneNo
);
/**
* 注销账户
* @param userId
* @return
*/
String
modifyAccountStatusDisable
(
Long
userId
);
MoResult
<
Boolean
>
modifyAccountStatusDisable
(
Long
userId
);
/**
* 激活账户
* @param userId
* @return
*/
String
modifyAccountStatusActive
(
Long
userId
);
MoResult
<
Boolean
>
modifyAccountStatusActive
(
Long
userId
);
/**
* 修改用户姓名、身份证
...
...
@@ -63,6 +64,6 @@ public interface IUserService extends UserDetailsService {
* @param idNO
* @return
*/
String
modifyUserDetail
(
Long
userId
,
String
realName
,
String
idNO
);
MoResult
<
String
>
modifyUserDetail
(
Long
userId
,
String
realName
,
String
idNO
);
}
src/main/java/cn/quantgroup/customer/service/impl/UserServiceImpl.java
View file @
33050e19
...
...
@@ -19,6 +19,7 @@ import cn.quantgroup.customer.rest.param.phone.ModifyPhoneQuery;
import
cn.quantgroup.customer.rest.param.user.UserCombinationParam
;
import
cn.quantgroup.customer.rest.param.user.UserQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.MoResult
;
import
cn.quantgroup.customer.service.IKaService
;
import
cn.quantgroup.customer.service.IUserService
;
import
cn.quantgroup.customer.service.IXyqbService
;
...
...
@@ -572,16 +573,17 @@ public class UserServiceImpl implements IUserService {
@Override
public
String
passwordRest
(
String
phoneNo
)
{
String
url
=
sidecarUrl
+
"/middle_office/
middle_office/
kefu/password/reset"
;
public
MoResult
<
String
>
passwordRest
(
String
phoneNo
)
{
String
url
=
sidecarUrl
+
"/middle_office/kefu/password/reset"
;
try
{
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
Map
param
=
Maps
.
newHashMap
();
param
.
put
(
"phone
No
"
,
phoneNo
);
param
.
put
(
"phone"
,
phoneNo
);
String
result
=
httpService
.
post
(
url
,
header
,
param
);
MoResult
moResult
=
GSON
.
fromJson
(
result
,
MoResult
.
class
);
log
.
info
(
"[user][passwordRest] 请求业务系统返回值:{}"
,
result
);
return
r
esult
;
return
moR
esult
;
}
catch
(
Exception
e
)
{
log
.
error
(
"[user][passwordRest] 网络通讯异常,phoneNo:{},ex:{}"
,
phoneNo
,
ExceptionUtils
.
getStackTrace
(
e
));
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
...
...
@@ -589,16 +591,17 @@ public class UserServiceImpl implements IUserService {
}
@Override
public
String
modifyAccountStatusDisable
(
Long
userId
)
{
String
url
=
sidecarUrl
+
"/middle_office/
middle_office/
kefu/user/disable"
;
public
MoResult
<
Boolean
>
modifyAccountStatusDisable
(
Long
userId
)
{
String
url
=
sidecarUrl
+
"/middle_office/kefu/user/disable"
;
try
{
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
Map
param
=
Maps
.
newHashMap
();
param
.
put
(
"userId"
,
userId
);
param
.
put
(
"userId"
,
String
.
valueOf
(
userId
)
);
String
result
=
httpService
.
post
(
url
,
header
,
param
);
MoResult
moResult
=
GSON
.
fromJson
(
result
,
MoResult
.
class
);
log
.
info
(
"[user][modifyAccountStatus] 请求业务系统返回值:{}"
,
result
);
return
r
esult
;
return
moR
esult
;
}
catch
(
Exception
e
)
{
log
.
error
(
"[user][modifyAccountStatus] 网络通讯异常,userId:{},ex:{}"
,
userId
,
ExceptionUtils
.
getStackTrace
(
e
));
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
...
...
@@ -606,16 +609,17 @@ public class UserServiceImpl implements IUserService {
}
@Override
public
String
modifyAccountStatusActive
(
Long
userId
)
{
String
url
=
sidecarUrl
+
"/middle_office/
middle_office/
kefu/user/active"
;
public
MoResult
<
Boolean
>
modifyAccountStatusActive
(
Long
userId
)
{
String
url
=
sidecarUrl
+
"/middle_office/kefu/user/active"
;
try
{
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
Map
param
=
Maps
.
newHashMap
();
param
.
put
(
"userId"
,
userId
);
param
.
put
(
"userId"
,
String
.
valueOf
(
userId
)
);
String
result
=
httpService
.
post
(
url
,
header
,
param
);
MoResult
moResult
=
GSON
.
fromJson
(
result
,
MoResult
.
class
);
log
.
info
(
"[user][modifyAccountStatusActive] 请求业务系统返回值:{}"
,
result
);
return
r
esult
;
return
moR
esult
;
}
catch
(
Exception
e
)
{
log
.
error
(
"[user][modifyAccountStatusActive] 网络通讯异常,userId:{},ex:{}"
,
userId
,
ExceptionUtils
.
getStackTrace
(
e
));
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
...
...
@@ -623,18 +627,19 @@ public class UserServiceImpl implements IUserService {
}
@Override
public
String
modifyUserDetail
(
Long
userId
,
String
realName
,
String
idNO
)
{
String
url
=
sidecarUrl
+
"/middle_office/
middle_office/
kefu/userDetail/reset"
;
public
MoResult
<
String
>
modifyUserDetail
(
Long
userId
,
String
realName
,
String
idNO
)
{
String
url
=
sidecarUrl
+
"/middle_office/kefu/userDetail/reset"
;
try
{
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
Map
param
=
Maps
.
newHashMap
();
param
.
put
(
"userId"
,
userId
);
param
.
put
(
"userId"
,
String
.
valueOf
(
userId
)
);
param
.
put
(
"realName"
,
realName
);
param
.
put
(
"idNO"
,
idNO
);
String
result
=
httpService
.
post
(
url
,
header
,
param
);
MoResult
moResult
=
GSON
.
fromJson
(
result
,
MoResult
.
class
);
log
.
info
(
"[user][modifyUserDetail] 请求业务系统返回值:{}"
,
result
);
return
r
esult
;
return
moR
esult
;
}
catch
(
Exception
e
)
{
log
.
error
(
"[user][modifyUserDetail] 网络通讯异常,userId:{},ex:{}"
,
userId
,
ExceptionUtils
.
getStackTrace
(
e
));
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
...
...
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