Commit 6d98502c by HlQ

[add] 关注 mall 列表接口添加 mall 绑定事件列表

1 parent 1d3f1149
......@@ -116,6 +116,8 @@ public class MallServiceImpl extends MPJBaseServiceImpl<MallMapper, Mall> implem
return null;
}
var mallUidList = eventRecordList.stream().map(EventRecord::getMallUid).toList();
var agentEventList = agentEventService.lambdaQuery().in(RAgentEvent::getMallUid, mallUidList).list();
var mallUid2AgentEventMap = agentEventList.stream().collect(Collectors.groupingBy(RAgentEvent::getMallUid));
var wrapper = new MPJLambdaWrapper<>(converter.convert(dto, Mall.class))
.selectAll(Mall.class)
......@@ -129,7 +131,10 @@ public class MallServiceImpl extends MPJBaseServiceImpl<MallMapper, Mall> implem
Opt.ofEmptyAble(mallVOPage.getRecords())
.ifPresent(r -> {
var mallUid2SelfMap = eventRecordList.stream().collect(Collectors.groupingBy(EventRecord::getMallUid));
r.forEach(tmp -> tmp.setEventRecordList(mallUid2SelfMap.get(tmp.getUid())));
r.forEach(tmp -> {
tmp.setEventRecordList(mallUid2SelfMap.getOrDefault(tmp.getUid(), List.of()));
tmp.setAgentEventList(mallUid2AgentEventMap.getOrDefault(tmp.getUid(), List.of()));
});
});
return mallVOPage;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!