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
QianQiXiang
haoban-manage3.0
Commits
1e3f78ae
Commit
1e3f78ae
authored
Apr 14, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权绑定,授权门店列表,binlog
parent
30bd2df8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
9 deletions
+30
-9
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+26
-6
TabHaobanStoreRangeMapper.xml
...e/src/main/resources/mapper/TabHaobanStoreRangeMapper.xml
+4
-3
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
1e3f78ae
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -284,13 +285,32 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
...
@@ -284,13 +285,32 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
Map
<
String
,
Set
<
String
>>
storeGroupChainMap
=
storeGroupList
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStoreGroupId
(),
Map
<
String
,
Set
<
String
>>
storeGroupChainMap
=
storeGroupList
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStoreGroupId
(),
dto
->
Arrays
.
stream
(
dto
.
getStoreGroupChain
().
split
(
"-"
)).
filter
(
str
->
StringUtils
.
isNotBlank
(
str
)).
collect
(
Collectors
.
toSet
())));
dto
->
Arrays
.
stream
(
dto
.
getStoreGroupChain
().
split
(
"-"
)).
filter
(
str
->
StringUtils
.
isNotBlank
(
str
)).
collect
(
Collectors
.
toSet
())));
storeMapByGroupId
.
forEach
((
groupId
,
storeIds
)
->
{
//获取集团门店的分组 然后根据分组来查询门店
Set
<
String
>
chainGroupIds
=
storeGroupChainMap
.
get
(
groupId
);
storeGroupChainMap
.
forEach
((
groupId
,
chainGroupIds
)
->
{
Sets
.
SetView
<
String
>
midGroupIds
=
Sets
.
intersection
(
chainGroupIds
,
rightGroupIds
);
Sets
.
SetView
<
String
>
midGroupIds
=
Sets
.
intersection
(
chainGroupIds
,
rightGroupIds
);
if
(
CollectionUtils
.
isEmpty
(
midGroupIds
))
{
if
(
CollectionUtils
.
isEmpty
(
midGroupIds
))
{
return
;
}
String
midGroupId
=
null
;
//如果是1的话 加入对应企业
if
(
midGroupIds
.
size
()
==
1
)
{
midGroupId
=
midGroupIds
.
iterator
().
next
();
}
else
{
//取交集层级最大 也就是冒泡最近的
midGroupId
=
midGroupIds
.
stream
().
sorted
(
Comparator
.
comparing
(
mid
->
storeGroupChainMap
.
get
(
mid
).
size
()).
reversed
()).
findFirst
().
get
();
}
relationMapByWxEid
.
get
(
groupMap
.
get
(
midGroupId
)).
add
(
groupId
);
});
//组装门店的id
Map
<
String
,
Set
<
String
>>
ret
=
new
HashMap
<>();
relationMapByWxEid
.
forEach
((
wxEid
,
groupIds
)
->
{
Set
<
String
>
storeIds
=
groupIds
.
stream
().
filter
(
mid
->
storeGroupChainMap
.
containsKey
(
mid
))
.
flatMap
(
midGid
->
storeGroupChainMap
.
get
(
midGid
).
stream
()).
collect
(
Collectors
.
toSet
());
ret
.
put
(
wxEid
,
storeIds
);
});
}
});
return
false
;
return
false
;
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStoreRangeMapper.xml
View file @
1e3f78ae
...
@@ -165,9 +165,10 @@
...
@@ -165,9 +165,10 @@
relation_id, relation_type, status_flag,
relation_id, relation_type, status_flag,
create_time, update_time)
create_time, update_time)
values
values
<foreach
collection=
"list"
item=
"item"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{storeRangeId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
(#{item.storeRangeId,jdbcType=VARCHAR}, #{item.wxEnterpriseId,jdbcType=VARCHAR},
#{relationId,jdbcType=VARCHAR}, #{relationType,jdbcType=INTEGER}, 1,
#{item.enterpriseId,jdbcType=VARCHAR},
#{item.relationId,jdbcType=VARCHAR}, #{item.relationType,jdbcType=INTEGER}, 1,
now(), now())
now(), now())
</foreach>
</foreach>
...
...
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