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
daac5109
Commit
daac5109
authored
May 25, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量处理关联关系优化
parent
d09671d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+2
-2
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
View file @
daac5109
...
@@ -109,7 +109,7 @@ public class StoreRangeServiceImpl implements StoreRangeService {
...
@@ -109,7 +109,7 @@ public class StoreRangeServiceImpl implements StoreRangeService {
@Override
@Override
public
boolean
saveStoreRelations
(
List
<
TabStoreRelation
>
list
,
String
optStaffId
,
int
channelCode
)
{
public
boolean
saveStoreRelations
(
List
<
TabStoreRelation
>
list
,
String
optStaffId
,
int
channelCode
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
logger
.
info
(
"没有需要保存的"
);
logger
.
info
(
"没有需要保存的
: 有问题的授权
"
);
return
true
;
return
true
;
}
}
String
enterpriseId
=
list
.
get
(
0
).
getEnterpriseId
();
String
enterpriseId
=
list
.
get
(
0
).
getEnterpriseId
();
...
@@ -128,13 +128,13 @@ public class StoreRangeServiceImpl implements StoreRangeService {
...
@@ -128,13 +128,13 @@ public class StoreRangeServiceImpl implements StoreRangeService {
Set
<
String
>
needAddStoreIds
=
new
HashSet
<>();
Set
<
String
>
needAddStoreIds
=
new
HashSet
<>();
oldStoreIdBywxEnterpriseMap
.
forEach
((
wxEid
,
oldStoreIds
)
->
{
oldStoreIdBywxEnterpriseMap
.
forEach
((
wxEid
,
oldStoreIds
)
->
{
Set
<
String
>
newStoreIds
=
newStoreIdBywxEnterpriseMap
.
get
(
wxEid
);
Set
<
String
>
newStoreIds
=
newStoreIdBywxEnterpriseMap
.
get
(
wxEid
);
logger
.
info
(
"wxEnterpriseId-difference-"
+
wxEid
+
":{},{}"
,
JSONObject
.
toJSONString
(
oldStoreIds
),
JSONObject
.
toJSONString
(
newStoreIds
));
if
(
CollectionUtils
.
isEmpty
(
newStoreIds
))
{
if
(
CollectionUtils
.
isEmpty
(
newStoreIds
))
{
//没有新的 老的都需要删除
//没有新的 老的都需要删除
needUnBindStoreIds
.
addAll
(
oldStoreIds
);
needUnBindStoreIds
.
addAll
(
oldStoreIds
);
return
;
return
;
}
}
Sets
.
SetView
<
String
>
needDelStoreIds
=
Sets
.
difference
(
oldStoreIds
,
newStoreIds
);
Sets
.
SetView
<
String
>
needDelStoreIds
=
Sets
.
difference
(
oldStoreIds
,
newStoreIds
);
logger
.
info
(
"wxEnterpriseId-difference-"
+
wxEid
+
":{},{}"
,
JSONObject
.
toJSONString
(
oldStoreIds
),
JSONObject
.
toJSONString
(
newStoreIds
));
logger
.
info
(
"wxEnterpriseId:{},{}"
,
wxEid
,
JSONObject
.
toJSONString
(
needDelStoreIds
));
logger
.
info
(
"wxEnterpriseId:{},{}"
,
wxEid
,
JSONObject
.
toJSONString
(
needDelStoreIds
));
Set
<
String
>
mid
=
needDelStoreIds
.
stream
().
collect
(
Collectors
.
toSet
());
Set
<
String
>
mid
=
needDelStoreIds
.
stream
().
collect
(
Collectors
.
toSet
());
needUnBindStoreIds
.
addAll
(
mid
);
needUnBindStoreIds
.
addAll
(
mid
);
...
...
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