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 767ce28e
authored
Sep 26, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码提交
1 parent
c6df71b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
src/main/java/cn/com/glsx/merchants/controller/OpenController.java
src/main/java/cn/com/glsx/merchants/service/OpenService.java
src/main/java/cn/com/glsx/merchants/controller/OpenController.java
View file @
767ce28
...
...
@@ -10,6 +10,7 @@ import cn.com.glsx.merchants.request.user.OpenUserRequest;
import
cn.com.glsx.merchants.response.AccountTypeTreeRopResponse
;
import
cn.com.glsx.merchants.response.MerchantRopResponse
;
import
cn.com.glsx.merchants.response.OpenUserResponse
;
import
cn.com.glsx.merchants.response.StaffResponse
;
import
cn.com.glsx.merchants.service.OpenService
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.rop.annotation.NeedInSessionType
;
...
...
@@ -223,4 +224,39 @@ public class OpenController {
}
}
/**
* 根据账户类型,层级查询商户列表
*
* @param merchantListOpenRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.open.findMerchantListByPage"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"根据账户类型,层级查询商户列表"
)
public
RopResponse
<
Pagination
<
MerchantRopResponse
>>
findMerchantListByPage
(
MerchantListOpenRequest
merchantListOpenRequest
)
{
try
{
Pagination
<
MerchantRopResponse
>
subordinateListByPage
=
openService
.
findMerchantListByPage
(
merchantListOpenRequest
);
return
RopResponse
.
success
(
subordinateListByPage
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke__findMerchantListByPage__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 根据登录号查询员工详情
*
* @param staffSearchOpenRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.open.findStaffByAccount"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"根据登录号查询员工详情"
)
public
RopResponse
<
StaffResponse
>
findStaffByAccount
(
StaffSearchOpenRequest
staffSearchOpenRequest
)
{
try
{
StaffResponse
staffResponse
=
openService
.
findStaffByAccount
(
staffSearchOpenRequest
);
return
RopResponse
.
success
(
staffResponse
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke_findStaffByAccount__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/service/OpenService.java
View file @
767ce28
...
...
@@ -8,6 +8,7 @@ import cn.com.glsx.merchants.convert.ConvertResponse;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.response.AccountTypeTreeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.MerchantStaffResponse
;
import
cn.com.glsx.merchants.model.response.MerchantUserResponse
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.remote.MerchantStaffRemote
;
...
...
@@ -17,10 +18,12 @@ import cn.com.glsx.merchants.request.merchant.MerchantSaveRequest;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantRequest
;
import
cn.com.glsx.merchants.request.open.*
;
import
cn.com.glsx.merchants.request.open.MerchantListOpenRequest
;
import
cn.com.glsx.merchants.request.user.OpenUserRequest
;
import
cn.com.glsx.merchants.response.AccountTypeTreeRopResponse
;
import
cn.com.glsx.merchants.response.MerchantRopResponse
;
import
cn.com.glsx.merchants.response.OpenUserResponse
;
import
cn.com.glsx.merchants.response.StaffResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -155,4 +158,20 @@ public class OpenService {
}
throw
new
RpcServiceException
(
subordinateListByPageRemote
.
getException
().
getErrId
(),
subordinateListByPageRemote
.
getMessage
());
}
public
Pagination
<
MerchantRopResponse
>
findMerchantListByPage
(
MerchantListOpenRequest
merchantListOpenRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantResponse
>>
merchantListByPageRemote
=
merchantRemote
.
findMerchantListByPageRemote
(
ConvertRequest
.
convertPage
(
merchantListOpenRequest
,
new
cn
.
com
.
glsx
.
merchants
.
model
.
request
.
MerchantListOpenRequest
()));
if
(
merchantListByPageRemote
.
isSuccess
())
{
return
ConvertResponse
.
convertPage
(
merchantListByPageRemote
.
getResult
(),
MerchantRopResponse
.
class
);
}
throw
new
RpcServiceException
(
merchantListByPageRemote
.
getException
().
getErrId
(),
merchantListByPageRemote
.
getMessage
());
}
public
StaffResponse
findStaffByAccount
(
StaffSearchOpenRequest
staffSearchOpenRequest
)
{
RpcResponse
<
MerchantStaffResponse
>
staffByAccount
=
merchantStaffRemote
.
findStaffByAccount
(
ConvertRequest
.
convertRequest
(
staffSearchOpenRequest
,
new
StaffOpenRequest
()));
if
(
staffByAccount
.
isSuccess
())
{
return
ConvertResponse
.
convertObject
(
staffByAccount
.
getResult
(),
StaffResponse
.
class
);
}
throw
new
RpcServiceException
(
staffByAccount
.
getException
().
getErrId
(),
staffByAccount
.
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