Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
haoban3.0
haoban-manage3.0
Commits
04aa3317
Commit
04aa3317
authored
Nov 14, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 账号列表
parent
86e8a9fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
5 deletions
+72
-5
ContentAccountController.java
...nage/web/controller/content/ContentAccountController.java
+27
-5
ClerkStoreAdaptor.java
...age/web/controller/content/adaptor/ClerkStoreAdaptor.java
+22
-0
AccountInfoQo.java
...c/haoban/manage/web/qo/content/account/AccountInfoQo.java
+23
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentAccountController.java
View file @
04aa3317
...
...
@@ -13,6 +13,8 @@ import com.gic.content.api.qdto.account.AccountGenerateQrCodeQDTO;
import
com.gic.content.api.qdto.account.AccountScanQrCodeResultQDTO
;
import
com.gic.content.api.qdto.account.ContentAccountQDTO
;
import
com.gic.content.api.service.ContentAccountApiService
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor
;
import
com.gic.haoban.manage.web.qo.content.account.AccountGenerateQrCodeQo
;
import
com.gic.haoban.manage.web.qo.content.account.AccountInfoQo
;
...
...
@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -55,15 +58,34 @@ public class ContentAccountController {
@RequestMapping
(
path
=
"/list"
)
private
RestResponse
<
List
<
ContentAccountInfoVo
>>
queryAccountList
(
AccountInfoQo
accountInfoQo
)
{
ClerkDTO
clerkDTO
=
clerkStoreAdaptor
.
queryClerkInfo
(
accountInfoQo
.
getEnterpriseId
(),
accountInfoQo
.
getClerkId
());
if
(
clerkDTO
==
null
)
{
return
RestResponse
.
successResult
(
Collections
.
emptyList
());
// 查询成员
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
clerkStoreAdaptor
.
queryStaffClerkRelationInfo
(
accountInfoQo
.
getEnterpriseId
(),
accountInfoQo
.
getStaffId
());
if
(
CollectionUtils
.
isEmpty
(
staffClerkRelationDTOS
))
{
return
RestResponse
.
successResult
();
}
List
<
String
>
clerkIds
=
staffClerkRelationDTOS
.
stream
()
.
map
(
StaffClerkRelationDTO:
:
getClerkId
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
List
<
String
>
storeIds
=
new
ArrayList
<>();
List
<
String
>
clerkCodes
=
new
ArrayList
<>();
List
<
ClerkDTO
>
clerkDTOS
=
clerkStoreAdaptor
.
queryClerkInfos
(
clerkIds
);
if
(
CollectionUtils
.
isEmpty
(
clerkDTOS
))
{
return
RestResponse
.
successResult
();
}
for
(
ClerkDTO
clerkDTO
:
clerkDTOS
)
{
clerkCodes
.
add
(
clerkDTO
.
getClerkCode
());
if
(
new
Integer
(
1
).
equals
(
clerkDTO
.
getClerkType
()))
{
storeIds
.
add
(
clerkDTO
.
getStoreId
());
}
}
ContentAccountQDTO
contentAccountQDTO
=
new
ContentAccountQDTO
();
contentAccountQDTO
.
setEnterpriseId
(
accountInfoQo
.
getEnterpriseId
());
contentAccountQDTO
.
setQueryForClerk
(
Boolean
.
TRUE
);
contentAccountQDTO
.
setUserCodes
(
Collections
.
singletonList
(
clerkDTO
.
getClerkCode
())
);
contentAccountQDTO
.
setStoreIds
(
Collections
.
singletonList
(
clerkDTO
.
getStoreId
())
);
contentAccountQDTO
.
setUserCodes
(
clerkCodes
);
contentAccountQDTO
.
setStoreIds
(
storeIds
);
ServiceResponse
<
Page
<
ContentAccountInfoDTO
>>
serviceResponse
=
contentAccountApiService
.
queryAccountList
(
contentAccountQDTO
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getResult
()))
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/adaptor/ClerkStoreAdaptor.java
View file @
04aa3317
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller.content.adaptor;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.role.StoreRoleDTO
;
...
...
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.List
;
/**
...
...
@@ -81,4 +83,24 @@ public class ClerkStoreAdaptor {
return
clerkService
.
getClerkByClerkId
(
clerkId
);
}
public
List
<
StaffClerkRelationDTO
>
queryStaffClerkRelationInfo
(
String
enterpriseId
,
String
staffId
)
{
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationApiService
.
listBindCodeByStaffId
(
Collections
.
singletonList
(
enterpriseId
),
staffId
);
if
(
CollectionUtils
.
isEmpty
(
staffClerkRelationDTOS
))
{
return
Collections
.
emptyList
();
}
return
staffClerkRelationDTOS
;
}
public
List
<
ClerkDTO
>
queryClerkInfos
(
List
<
String
>
clerkIds
)
{
if
(
CollectionUtils
.
isEmpty
(
clerkIds
))
{
return
Collections
.
emptyList
();
}
List
<
ClerkDTO
>
clerkDTOS
=
clerkService
.
getClerkByClerkIds
(
new
HashSet
<>(
clerkIds
));
if
(
CollectionUtils
.
isEmpty
(
clerkDTOS
))
{
return
Collections
.
emptyList
();
}
return
clerkDTOS
;
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/content/account/AccountInfoQo.java
View file @
04aa3317
...
...
@@ -24,6 +24,13 @@ public class AccountInfoQo implements Serializable {
*/
private
String
storeId
;
/**
* 成员id
*/
private
String
staffId
;
private
String
wxEnterpriseId
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
...
...
@@ -47,4 +54,20 @@ public class AccountInfoQo implements Serializable {
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
}
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