Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 23f29706
authored
Aug 08, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]新增权限功能
1 parent
6cbeeb2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
View file @
23f2970
...
...
@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.response.AccountTypeTreeRopResponse
;
import
cn.com.glsx.merchants.response.MerchantRopResponse
;
...
...
@@ -162,6 +163,24 @@ public class MerchantController {
}
/**
* 获取账户类型下产品菜单功能树
*
* @param accountTypeSearchRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.merchant.accountTypeSearchRequest"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"获取账户类型下产品菜单功能树"
)
public
RopResponse
<
List
<
AccountTypeTreeRopResponse
>>
accountTypeSearchRequest
(
AccountTypeSearchRequest
accountTypeSearchRequest
)
{
try
{
List
<
AccountTypeTreeRopResponse
>
merchantResponse
=
merchantService
.
findMenuFunTreeByAccountType
(
accountTypeSearchRequest
);
return
RopResponse
.
success
(
merchantResponse
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantController__invoke__accountTypeSearchRequest__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 查询商户的菜单权限树
*
* @param merchantDetailRequest 入参
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
23f2970
...
...
@@ -6,10 +6,12 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.response.AccountTreeResponse
;
import
cn.com.glsx.merchants.model.response.AccountTypeTreeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.MerchantTreeResponse
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.request.file.FileSaveRequest
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.response.*
;
...
...
@@ -21,6 +23,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -218,4 +221,18 @@ public class MerchantService {
}
throw
new
RpcServiceException
(
allMerchantRemote
.
getException
().
getErrId
(),
allMerchantRemote
.
getMessage
());
}
public
List
<
AccountTypeTreeRopResponse
>
findMenuFunTreeByAccountType
(
AccountTypeSearchRequest
accountTypeSearchRequest
)
{
String
[]
split
=
accountTypeSearchRequest
.
getIds
().
split
(
","
);
List
<
Integer
>
strings
=
new
ArrayList
<>();
for
(
String
s
:
split
)
{
strings
.
add
(
Integer
.
parseInt
(
s
));
}
RpcResponse
<
List
<
AccountTypeTreeResponse
>>
response
=
merchantRemote
.
findMenuFunTreeByAccountType
(
strings
,
accountTypeSearchRequest
.
getAccountLevel
(),
accountTypeSearchRequest
.
getMerchantId
());
if
(
response
.
isSuccess
())
{
return
ConvertResponse
.
convertList
(
response
.
getResult
(),
AccountTypeTreeRopResponse
.
class
);
}
throw
new
RpcServiceException
(
response
.
getException
().
getErrId
(),
response
.
getMessage
());
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment