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
baccac7b
Commit
baccac7b
authored
Apr 25, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业绑定门店
parent
6fe92404
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
3 deletions
+51
-3
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+3
-0
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+48
-3
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
baccac7b
...
...
@@ -288,6 +288,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override
public
List
<
StaffClerkRelationDTO
>
listBindStoreIdByEnterpriseId
(
String
enterpriseId
)
{
List
<
TabHaobanStaffClerkRelation
>
clerkRelations
=
mapper
.
listBindStoreIdByEnterpriseId
(
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
clerkRelations
))
{
return
new
ArrayList
<>();
}
return
EntityUtil
.
changeEntityListNew
(
StaffClerkRelationDTO
.
class
,
clerkRelations
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
View file @
baccac7b
...
...
@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.commons.util.ToolUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StoreOrGroupInfoDTO
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStoreRangeMapper
;
...
...
@@ -113,9 +114,8 @@ public class StoreRangeServiceImpl implements StoreRangeService {
String
enterpriseId
=
list
.
get
(
0
).
getEnterpriseId
();
//根据wxEnterpriseId 分组
Map
<
String
,
Set
<
String
>>
newStoreIdBywxEnterpriseMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabStoreRelation:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
List
<
TabStoreRelation
>
storeRelations
=
tabHaobanStoreRelationMapper
.
listStoreRange
(
enterpriseId
);
Map
<
String
,
Set
<
String
>>
oldStoreIdBywxEnterpriseMap
=
storeRelations
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabStoreRelation:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
//所有就的门店old绑定列表
Map
<
String
,
Set
<
String
>>
oldStoreIdBywxEnterpriseMap
=
getOldStoreIdsByWxEnterpriseId
(
enterpriseId
);
Set
<
String
>
needUnBindStoreIds
=
new
HashSet
<>();
oldStoreIdBywxEnterpriseMap
.
forEach
((
wxEid
,
oldStoreIds
)
->
{
...
...
@@ -135,6 +135,51 @@ public class StoreRangeServiceImpl implements StoreRangeService {
return
true
;
}
/**
* 获取企业下的老的绑定门店
*
* @param enterpriseId
* @return
*/
private
Map
<
String
,
Set
<
String
>>
getOldStoreIdsByWxEnterpriseId
(
String
enterpriseId
)
{
Map
<
String
,
Set
<
String
>>
ret
=
new
HashMap
<>();
Set
<
String
>
wxEnterpriseIds
=
new
HashSet
<>();
//更新前绑定门店列表
List
<
TabStoreRelation
>
storeRelations
=
tabHaobanStoreRelationMapper
.
listStoreRange
(
enterpriseId
);
Map
<
String
,
Set
<
String
>>
oldStoreIdBywxEnterpriseMap
=
storeRelations
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabStoreRelation:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
if
(
CollectionUtils
.
isNotEmpty
(
storeRelations
))
{
wxEnterpriseIds
.
addAll
(
oldStoreIdBywxEnterpriseMap
.
keySet
());
}
//导购绑定列表
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listBindStoreIdByEnterpriseId
(
enterpriseId
);
Map
<
String
,
Set
<
String
>>
oldStaffStoreIdByWxEidMap
=
staffClerkRelationDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
StaffClerkRelationDTO:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
if
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
))
{
wxEnterpriseIds
.
addAll
(
oldStaffStoreIdByWxEidMap
.
keySet
());
}
if
(
CollectionUtils
.
isEmpty
(
wxEnterpriseIds
))
{
return
ret
;
}
//聚合两者就是总门店了
wxEnterpriseIds
.
forEach
(
wxid
->
{
if
(!
ret
.
containsKey
(
wxid
))
{
ret
.
put
(
wxid
,
new
HashSet
<>());
}
Set
<
String
>
storeIds
=
oldStaffStoreIdByWxEidMap
.
get
(
wxid
);
if
(
CollectionUtils
.
isNotEmpty
(
storeIds
))
{
ret
.
get
(
wxid
).
addAll
(
storeIds
);
}
Set
<
String
>
staffStoreIds
=
oldStoreIdBywxEnterpriseMap
.
get
(
wxid
);
if
(
CollectionUtils
.
isNotEmpty
(
staffStoreIds
))
{
ret
.
get
(
wxid
).
addAll
(
staffStoreIds
);
}
});
return
ret
;
}
@Override
public
List
<
TabStoreRange
>
queryStoreRangeByRelationId
(
String
enterpriseId
,
List
<
String
>
relationIds
)
{
return
tabHaobanStoreRangeMapper
.
listStoreRangeByRelationId
(
relationIds
,
enterpriseId
);
...
...
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