Commit daac5109 by fudahua

批量处理关联关系优化

parent d09671d6
......@@ -109,7 +109,7 @@ public class StoreRangeServiceImpl implements StoreRangeService {
@Override
public boolean saveStoreRelations(List<TabStoreRelation> list, String optStaffId, int channelCode) {
if (CollectionUtils.isEmpty(list)) {
logger.info("没有需要保存的");
logger.info("没有需要保存的: 有问题的授权");
return true;
}
String enterpriseId = list.get(0).getEnterpriseId();
......@@ -128,13 +128,13 @@ public class StoreRangeServiceImpl implements StoreRangeService {
Set<String> needAddStoreIds = new HashSet<>();
oldStoreIdBywxEnterpriseMap.forEach((wxEid, oldStoreIds) -> {
Set<String> newStoreIds = newStoreIdBywxEnterpriseMap.get(wxEid);
logger.info("wxEnterpriseId-difference-" + wxEid + ":{},{}", JSONObject.toJSONString(oldStoreIds), JSONObject.toJSONString(newStoreIds));
if (CollectionUtils.isEmpty(newStoreIds)) {
//没有新的 老的都需要删除
needUnBindStoreIds.addAll(oldStoreIds);
return;
}
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));
Set<String> mid = needDelStoreIds.stream().collect(Collectors.toSet());
needUnBindStoreIds.addAll(mid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment