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
3c5e07ff
Commit
3c5e07ff
authored
Apr 14, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店binlog
parent
1e3f78ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
6 deletions
+44
-6
StoreRangeService.java
.../gic/haoban/manage/service/service/StoreRangeService.java
+8
-0
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+9
-0
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+27
-6
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StoreRangeService.java
View file @
3c5e07ff
...
...
@@ -70,5 +70,13 @@ public interface StoreRangeService {
*/
public
Page
<
TabStoreRelation
>
pageStoreRelation
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
search
,
BasePageInfo
pageInfo
);
/**
* 保存门店的绑定关联关系
*
* @param list
* @return
*/
public
boolean
saveStoreRelations
(
List
<
TabStoreRelation
>
list
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
View file @
3c5e07ff
...
...
@@ -93,4 +93,13 @@ public class StoreRangeServiceImpl implements StoreRangeService {
Page
<
TabStoreRelation
>
retPage
=
PageUtil
.
changePageHelperToCurrentPage
(
new
PageInfo
<>(
storeRelations
));
return
retPage
;
}
@Override
public
boolean
saveStoreRelations
(
List
<
TabStoreRelation
>
list
)
{
//todo 销售线索 批量操作
list
.
forEach
(
tab
->
{
tabHaobanStoreRelationMapper
.
insertSelective
(
tab
);
});
return
true
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
3c5e07ff
...
...
@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.ToolUtil
;
import
com.gic.enterprise.api.dto.*
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
...
@@ -240,6 +241,12 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
tab
.
setUpdateTime
(
new
Date
());
tab
.
setWxEnterpriseRelatedId
(
UuidUtil
.
randomUUID
());
wxEnterpriseRelatedMapper
.
insertSelective
(
tab
);
}
else
{
tab
.
setMemberOpenCardFlag
(
detailDTO
.
getMemberOpenCardFlag
());
tab
.
setWxEnterpriseType
(
detailDTO
.
getWxEnterpriseType
());
tab
.
setRangeType
(
1
);
tab
.
setUpdateTime
(
new
Date
());
wxEnterpriseRelatedMapper
.
updateByPrimaryKeySelective
(
tab
);
}
//保存门店范围
...
...
@@ -278,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
()));
//获取所有门店分组
List
<
PowerStoreGroupDTO
>
storeGroupList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
null
);
...
...
@@ -304,14 +311,26 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
});
//组装门店的id
Map
<
String
,
Set
<
String
>>
ret
=
new
HashMap
<>();
List
<
TabStoreRelation
>
ret
=
new
ArrayList
<>();
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
);
List
<
TabStoreRelation
>
midRelations
=
groupIds
.
stream
().
filter
(
mid
->
storeGroupChainMap
.
containsKey
(
mid
))
.
flatMap
(
midGid
->
storeGroupChainMap
.
get
(
midGid
).
stream
())
.
map
(
storeId
->
{
//todo 销售线索 门店名称 企业id
TabStoreRelation
tabStoreRelation
=
new
TabStoreRelation
();
tabStoreRelation
.
setWxEnterpriseId
(
wxEid
);
tabStoreRelation
.
setStoreGroupId
(
storeIdMap
.
get
(
storeId
));
tabStoreRelation
.
setStatusFlag
(
1
);
tabStoreRelation
.
setStoreRelationId
(
ToolUtil
.
randomUUID
());
tabStoreRelation
.
setCreateTime
(
new
Date
());
tabStoreRelation
.
setUpdateTime
(
new
Date
());
return
tabStoreRelation
;
}).
collect
(
Collectors
.
toList
());
ret
.
addAll
(
midRelations
);
});
storeRangeService
.
saveStoreRelations
(
ret
);
return
false
;
}
...
...
@@ -358,4 +377,6 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
retPage
.
setResult
(
EntityUtil
.
changeEntityListNew
(
BindStoreInfoDTO
.
class
,
dtoList
));
return
retPage
;
}
}
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