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
9d2570fe
Commit
9d2570fe
authored
Mar 14, 2022
by
吴琼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xiugai
parent
1ea75692
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
3 deletions
+63
-3
UserRest.java
src/main/java/cn/quantgroup/customer/rest/UserRest.java
+2
-1
IUserService.java
...ain/java/cn/quantgroup/customer/service/IUserService.java
+6
-0
UserServiceImpl.java
.../cn/quantgroup/customer/service/impl/UserServiceImpl.java
+54
-1
FileToZip.java
src/main/java/cn/quantgroup/customer/util/FileToZip.java
+1
-1
No files found.
src/main/java/cn/quantgroup/customer/rest/UserRest.java
View file @
9d2570fe
...
@@ -184,7 +184,8 @@ public class UserRest {
...
@@ -184,7 +184,8 @@ public class UserRest {
*/
*/
@PostMapping
(
value
=
"/modify/account/status/disable"
)
@PostMapping
(
value
=
"/modify/account/status/disable"
)
public
JsonResult
modifyAccountStatusDisable
(
@RequestParam
(
required
=
true
)
Long
userId
)
{
public
JsonResult
modifyAccountStatusDisable
(
@RequestParam
(
required
=
true
)
Long
userId
)
{
MoResult
<
Boolean
>
result
=
userService
.
modifyAccountStatusDisable
(
userId
);
//MoResult<Boolean> result = userService.modifyAccountStatusDisable(userId);
MoResult
<
Boolean
>
result
=
userService
.
modifyAccountStatusDisableNew
(
userId
);
if
(!
result
.
isSuccess
()){
if
(!
result
.
isSuccess
()){
return
JsonResult
.
buildErrorStateResult
(
result
.
getMsg
(),
result
.
getData
());
return
JsonResult
.
buildErrorStateResult
(
result
.
getMsg
(),
result
.
getData
());
}
}
...
...
src/main/java/cn/quantgroup/customer/service/IUserService.java
View file @
9d2570fe
...
@@ -51,6 +51,12 @@ public interface IUserService extends UserDetailsService {
...
@@ -51,6 +51,12 @@ public interface IUserService extends UserDetailsService {
* @return
* @return
*/
*/
MoResult
<
Boolean
>
modifyAccountStatusDisable
(
Long
userId
);
MoResult
<
Boolean
>
modifyAccountStatusDisable
(
Long
userId
);
/**
* 注销账户新逻辑
* @param userId
* @return
*/
MoResult
<
Boolean
>
modifyAccountStatusDisableNew
(
Long
userId
);
/**
/**
* 激活账户
* 激活账户
...
...
src/main/java/cn/quantgroup/customer/service/impl/UserServiceImpl.java
View file @
9d2570fe
...
@@ -50,6 +50,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
...
@@ -50,6 +50,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
javax.lang.model.type.ErrorType
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.List
;
...
@@ -72,6 +73,10 @@ public class UserServiceImpl implements IUserService {
...
@@ -72,6 +73,10 @@ public class UserServiceImpl implements IUserService {
private
String
kdspUrl
;
private
String
kdspUrl
;
@Value
(
"${kdsp-operation}"
)
@Value
(
"${kdsp-operation}"
)
private
String
kdspOperationUrl
;
private
String
kdspOperationUrl
;
//新修改注销账户逻辑
@Value
(
"${vcc-talos.tjzimu.http}"
)
private
String
talosHttp
;
...
@@ -712,7 +717,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -712,7 +717,7 @@ public class UserServiceImpl implements IUserService {
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
}
}
}
}
//旧逻辑
@Override
@Override
public
MoResult
<
Boolean
>
modifyAccountStatusDisable
(
Long
userId
)
{
public
MoResult
<
Boolean
>
modifyAccountStatusDisable
(
Long
userId
)
{
String
url
=
sidecarUrl
+
"/middle_office/kefu/user/disable"
;
String
url
=
sidecarUrl
+
"/middle_office/kefu/user/disable"
;
...
@@ -730,6 +735,54 @@ public class UserServiceImpl implements IUserService {
...
@@ -730,6 +735,54 @@ public class UserServiceImpl implements IUserService {
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
}
}
}
}
//新逻辑
@Override
public
MoResult
<
Boolean
>
modifyAccountStatusDisableNew
(
Long
userId
)
{
//String url = sidecarUrl + "/middle_office/kefu/user/disable";
//修改为调用vcc_talos
//判断是否有在途业务
MoResult
moResult
=
null
;
try
{
String
url
=
talosHttp
+
"/api/inner/kdsp/hasBusiness"
;
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
Map
param
=
Maps
.
newHashMap
();
param
.
put
(
"userId"
,
userId
);
String
result
=
httpService
.
get
(
url
,
header
,
param
);
if
(
result
!=
null
){
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
);
//String dataStr = jsonObject.getString("data");
String
businessCode
=
jsonObject
.
getString
(
"businessCode"
);
//返回信息c
String
msg
=
jsonObject
.
getString
(
"msg"
);
if
(
"0000"
.
equals
(
businessCode
)
&&
StringUtils
.
isBlank
(
msg
)){
//如果不存在则调用用户中心去注销
//调用用户中心
Map
param1
=
Maps
.
newHashMap
();
param1
.
put
(
"userId"
,
userId
.
toString
());
String
userUrl
=
userSysUrl
+
"/innerapi/user/disable"
;
String
userResult
=
httpService
.
post
(
userUrl
,
header
,
param1
);
JSONObject
userJsonObject
=
JSONObject
.
parseObject
(
userResult
);
//String userDataStr = userJsonObject.getString("data");
String
userBusinessCode
=
userJsonObject
.
getString
(
"businessCode"
);
if
(
"0000"
.
equals
(
userBusinessCode
)){
moResult
=
GSON
.
fromJson
(
result
,
MoResult
.
class
);
}
}
else
{
//如果存在则不能注销
moResult
=
GSON
.
fromJson
(
result
,
MoResult
.
class
);
}
}
else
{
moResult
=
GSON
.
fromJson
(
"调用第三方接口报错"
,
MoResult
.
class
);
}
log
.
info
(
"[user][modifyAccountStatusDisableNew] 请求业务系统返回值:{}"
,
result
);
return
moResult
;
}
catch
(
Exception
e
)
{
log
.
error
(
"[user][modifyAccountStatusDisableNew] 网络通讯异常,userId:{},ex:{}"
,
userId
,
ExceptionUtils
.
getStackTrace
(
e
));
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
}
}
@Override
@Override
public
MoResult
<
Boolean
>
modifyAccountStatusActive
(
Long
userId
)
{
public
MoResult
<
Boolean
>
modifyAccountStatusActive
(
Long
userId
)
{
...
...
src/main/java/cn/quantgroup/customer/util/FileToZip.java
View file @
9d2570fe
...
@@ -186,7 +186,7 @@ public final class FileToZip {
...
@@ -186,7 +186,7 @@ public final class FileToZip {
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
deleteFile
=
new
File
(
"D:/tmp1
/交易凭证\n
"
);
File
deleteFile
=
new
File
(
"D:/tmp1"
);
deleteDirectory
(
deleteFile
);
deleteDirectory
(
deleteFile
);
/* *//** 测试压缩方法1 *//*
/* *//** 测试压缩方法1 *//*
FileOutputStream fos1 = new FileOutputStream(new File("D:/交易凭证.zip"));
FileOutputStream fos1 = new FileOutputStream(new File("D:/交易凭证.zip"));
...
...
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