排号桌型列表返回总人数

This commit is contained in:
SongZhang 2024-09-14 15:01:34 +08:00
parent 8f2303d1bf
commit 077222c9b7
1 changed files with 16 additions and 1 deletions

View File

@ -253,7 +253,22 @@ public class TbCallServiceImpl implements TbCallService {
if (state != null) {
query.eq(TbCallTable::getState, state);
}
return callTableService.page(new Page<>(page, size), query);
Page<TbCallTable> pageInfo = callTableService.page(new Page<>(page, size), query);
ArrayList<Map<String, Object>> info = new ArrayList<>();
pageInfo.getRecords().forEach(item -> {
Long count = callQueueService.lambdaQuery()
.eq(TbCallQueue::getCallTableId, item.getId())
.in(TbCallQueue::getState, 0, 1)
.count();
Map<String, Object> map = BeanUtil.beanToMap(item, false, false);
map.put("totalCount", count);
info.add(map);
});
Map<String, Object> toMap = BeanUtil.beanToMap(pageInfo);
toMap.put("records", info);
return toMap;
}
@Override