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
ad7a072a
Commit
ad7a072a
authored
Jun 03, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
群导出加门店
parent
c79478e6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
9 deletions
+73
-9
GroupChatDTO.java
...java/com/gic/haoban/manage/api/dto/chat/GroupChatDTO.java
+21
-0
TabHaobanClerkMainStoreRelatedMapper.java
...vice/dao/mapper/TabHaobanClerkMainStoreRelatedMapper.java
+3
-0
GroupChatApiServiceImpl.java
...ervice/service/out/impl/chat/GroupChatApiServiceImpl.java
+35
-7
TabHaobanClerkMainStoreRelatedMapper.xml
...resources/mapper/TabHaobanClerkMainStoreRelatedMapper.xml
+12
-0
GroupChatController.java
...aoban/manage/web/controller/chat/GroupChatController.java
+2
-2
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/chat/GroupChatDTO.java
View file @
ad7a072a
...
...
@@ -78,6 +78,27 @@ public class GroupChatDTO implements Serializable {
}
return
clerkRelationExcel
;
}
// 群主关联门店
private
String
ownerStoreCode
;
private
String
ownerStoreName
;
public
String
getOwnerStoreCode
()
{
return
ownerStoreCode
;
}
public
void
setOwnerStoreCode
(
String
ownerStoreCode
)
{
this
.
ownerStoreCode
=
ownerStoreCode
;
}
public
String
getOwnerStoreName
()
{
return
ownerStoreName
;
}
public
void
setOwnerStoreName
(
String
ownerStoreName
)
{
this
.
ownerStoreName
=
ownerStoreName
;
}
public
void
setClerkRelationExcel
(
String
clerkRelationExcel
)
{
this
.
clerkRelationExcel
=
clerkRelationExcel
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanClerkMainStoreRelatedMapper.java
View file @
ad7a072a
...
...
@@ -43,4 +43,6 @@ public interface TabHaobanClerkMainStoreRelatedMapper {
* @return
*/
TabHaobanClerkMainStoreRelated
getLastNoStatusByStaffId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"staffId"
)
String
staffId
);
List
<
TabHaobanClerkMainStoreRelated
>
listByStaffIdList
(
@Param
(
"list"
)
List
<
String
>
staffIdList
)
;
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/chat/GroupChatApiServiceImpl.java
View file @
ad7a072a
...
...
@@ -8,6 +8,10 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanClerkMainStoreRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -61,6 +65,10 @@ public class GroupChatApiServiceImpl implements GroupChatApiService {
private
StaffClerkRelationService
staffClerkRelationService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
TabHaobanClerkMainStoreRelatedMapper
clerkMainStoreRelatedMapper
;
@Autowired
private
StoreService
storeService
;
@Override
public
ServiceResponse
<
Page
<
GroupChatDTO
>>
listPage
(
GroupChatSearchQDTO
qdto
,
BasePageInfo
basePageInfo
)
{
...
...
@@ -97,16 +105,36 @@ public class GroupChatApiServiceImpl implements GroupChatApiService {
one
.
setOwnerAddFlag
(
ownerAddFlag
);
});
// 处理关联关系
boolean
needClerkReltaion
=
(
qdto
.
getStatus
()
==
0
);
if
(
needClerkReltaion
)
{
List
<
String
>
staffIdList
=
dtoList
.
stream
().
filter
(
dto
->
StringUtils
.
isNotBlank
(
dto
.
getStaffId
()))
.
map
(
dto
->
dto
.
getStaffId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
relationStaffIdList
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
staffIdList
))
{
List
<
String
>
relationIdList
=
this
.
staffClerkRelationService
.
listRelationsStaffId
(
new
HashSet
<>(
staffIdList
));
dtoList
.
forEach
(
one
->
{
one
.
setClerkRelationFlag
(
relationIdList
.
contains
(
one
.
getStaffId
())
?
1
:
0
);
});
relationStaffIdList
=
this
.
staffClerkRelationService
.
listRelationsStaffId
(
new
HashSet
<>(
staffIdList
));
for
(
GroupChatDTO
one
:
dtoList
)
{
one
.
setClerkRelationFlag
(
relationStaffIdList
.
contains
(
one
.
getStaffId
())
?
1
:
0
);
}
if
(
CollectionUtils
.
isNotEmpty
(
relationStaffIdList
))
{
List
<
TabHaobanClerkMainStoreRelated
>
storeRelationList
=
this
.
clerkMainStoreRelatedMapper
.
listByStaffIdList
(
relationStaffIdList
);
if
(
CollectionUtils
.
isNotEmpty
(
storeRelationList
))
{
List
<
String
>
storeIdList
=
storeRelationList
.
stream
().
map
(
o
->
o
.
getStoreId
()).
collect
(
Collectors
.
toList
());
String
[]
arr
=
storeIdList
.
toArray
(
new
String
[
storeIdList
.
size
()])
;
List
<
StoreDTO
>
storeList
=
this
.
storeService
.
getStores
(
arr
)
;
if
(
CollectionUtils
.
isNotEmpty
(
storeList
))
{
Map
<
String
,
String
>
staffMap
=
storeRelationList
.
stream
().
collect
(
Collectors
.
toMap
(
TabHaobanClerkMainStoreRelated:
:
getStaffId
,
TabHaobanClerkMainStoreRelated:
:
getStoreId
,(
k1
,
k2
)->
k1
))
;
Map
<
String
,
StoreDTO
>
storeMap
=
storeList
.
stream
().
collect
(
Collectors
.
toMap
(
StoreDTO:
:
getStoreId
,
o
->
o
,(
k1
,
k2
)->
k1
))
;
for
(
GroupChatDTO
one
:
dtoList
)
{
String
staffId
=
one
.
getStaffId
()
;
String
storeId
=
staffMap
.
get
(
staffId
)
;
if
(
StringUtils
.
isNotBlank
(
storeId
))
{
StoreDTO
store
=
storeMap
.
get
(
storeId
)
;
if
(
null
!=
store
)
{
one
.
setOwnerStoreCode
(
store
.
getStoreCode
());
one
.
setOwnerStoreName
(
store
.
getStoreName
());
}
}
}
}
}
}
}
// 原群主
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanClerkMainStoreRelatedMapper.xml
View file @
ad7a072a
...
...
@@ -122,4 +122,15 @@
and staff_id = #{staffId}
order by create_time desc limit 1
</select>
<select
id=
"listByStaffIdList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_clerk_main_store_related
where staff_id in
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/chat/GroupChatController.java
View file @
ad7a072a
...
...
@@ -318,8 +318,8 @@ public class GroupChatController {
ServiceResponse
<
Page
<
GroupChatDTO
>>
page
=
this
.
groupChatApiService
.
listPage
(
qdto
,
basePageInfo
);
if
(
page
.
isSuccess
()
&&
CollUtil
.
isNotEmpty
(
page
.
getResult
().
getResult
())){
String
fileName
=
"客户群列表数据"
;
List
<
String
>
titleList
=
Arrays
.
asList
(
"客户群ID"
,
"客户群名称"
,
"群人数"
,
"群客户数"
,
"新增总数"
,
"流失总数"
,
"群主"
,
"群主在好办小程序关联状态"
,
"创建时间"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"groupChatId"
,
"name"
,
"totalCount"
,
"totalMemberCount"
,
"addCount"
,
"quitCount"
,
"staffName"
,
"clerkRelationExcel"
,
"createTime"
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"客户群ID"
,
"客户群名称"
,
"群人数"
,
"群客户数"
,
"新增总数"
,
"流失总数"
,
"群主"
,
"群主在好办小程序关联状态"
,
"
门店名称"
,
"门店code"
,
"
创建时间"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"groupChatId"
,
"name"
,
"totalCount"
,
"totalMemberCount"
,
"addCount"
,
"quitCount"
,
"staffName"
,
"clerkRelationExcel"
,
"
ownerStoreName"
,
"ownerStoreCode"
,
"
createTime"
);
try
{
ExcelUtils
.
xls
(
response
,
request
,
fileName
,
page
.
getResult
().
getResult
(),
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
...
...
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