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
b5823719
Commit
b5823719
authored
Apr 15, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
刷新绑定门店
parent
b6789a5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+11
-10
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+15
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
b5823719
...
...
@@ -285,7 +285,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
// 获取所有门店信息
List
<
StoreSimpleDTO
>
storeDtos
=
storeService
.
listSimpleStore
(
enterpriseId
,
null
,
null
);
Map
<
String
,
List
<
String
>>
storeMapByGroupId
=
storeDtos
.
stream
().
collect
(
Collectors
.
groupingBy
(
dto
->
dto
.
getStoreGroupId
(),
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toList
())));
Map
<
String
,
String
>
storeIdMap
=
storeDtos
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStoreId
(),
dto
->
dto
.
getStoreGroupId
()
));
Map
<
String
,
StoreSimpleDTO
>
storeIdMap
=
storeDtos
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStoreId
(),
dto
->
dto
));
//获取所有门店分组
List
<
PowerStoreGroupDTO
>
storeGroupList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
null
);
...
...
@@ -313,16 +313,17 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
//组装门店的id
List
<
TabStoreRelation
>
ret
=
new
ArrayList
<>();
relationMapByWxEid
.
forEach
((
wxEid
,
groupIds
)
->
{
List
<
TabStoreRelation
>
midRelations
=
groupIds
.
stream
().
filter
(
mid
->
storeGroupChainMap
.
containsKey
(
mid
))
.
flatMap
(
midGid
->
storeGroupChainMap
.
get
(
midGid
).
stream
())
.
map
(
storeId
->
{
//todo 销售线索 门店名称 企业id
TabStoreRelation
tabStoreRelation
=
new
TabStoreRelation
();
List
<
TabStoreRelation
>
midRelations
=
groupIds
.
stream
().
filter
(
mid
->
storeMapByGroupId
.
containsKey
(
mid
))
.
flatMap
(
midGid
->
storeMapByGroupId
.
get
(
midGid
).
stream
())
.
map
(
storeId
->
{
StoreSimpleDTO
simpleDTO
=
storeIdMap
.
get
(
storeId
);
TabStoreRelation
tabStoreRelation
=
new
TabStoreRelation
();
tabStoreRelation
.
setWxEnterpriseId
(
wxEid
);
tabStoreRelation
.
setStoreGroupId
(
storeIdMap
.
get
(
storeId
));
tabStoreRelation
.
setStatusFlag
(
1
);
tabStoreRelation
.
setStoreRelationId
(
ToolUtil
.
randomUUID
());
tabStoreRelation
.
setStoreGroupId
(
simpleDTO
.
getStoreGroupId
());
tabStoreRelation
.
setStatusFlag
(
1
);
tabStoreRelation
.
setStoreName
(
simpleDTO
.
getStoreName
());
tabStoreRelation
.
setEnterpriseId
(
simpleDTO
.
getEnterpriseId
());
tabStoreRelation
.
setStoreRelationId
(
ToolUtil
.
randomUUID
());
tabStoreRelation
.
setCreateTime
(
new
Date
());
tabStoreRelation
.
setUpdateTime
(
new
Date
());
return
tabStoreRelation
;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
b5823719
...
...
@@ -609,4 +609,19 @@ public class WxEnterpriseController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retPage
);
}
/**
* 绑定门店列表
*
* @param enterpriseId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"flush-bind-store-list"
)
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
,
login
.
getStaffDTO
().
getStaffId
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
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