1.排队取号 排号列表修改

This commit is contained in:
2024-09-19 16:07:35 +08:00
parent 7d6ac6e33d
commit 41bf053fad

View File

@@ -25,8 +25,10 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
@Service
@@ -113,7 +115,20 @@ public class TbCallServiceImpl implements TbCallService {
@Override
public Object getAllInfo(Integer shopId) {
return callTableService.lambdaQuery().eq(TbCallTable::getShopId, shopId).eq(TbCallTable::getState, 1).list();
ArrayList<Map<String, Object>> infoList = new ArrayList<>();
List<TbCallTable> list = callTableService.lambdaQuery()
.eq(TbCallTable::getShopId, shopId).list();
list.forEach(item -> {
Map<String, Object> map = BeanUtil.beanToMap(item, false, false);
Integer count = callQueueService.lambdaQuery()
.eq(TbCallQueue::getCallTableId, item.getId())
.eq(TbCallQueue::getShopId, shopId)
.in(TbCallQueue::getState, 0, 1).count();
map.put("waitingCount", count);
map.put("waitTime", count * item.getWaitTime());
infoList.add(map);
});
return infoList;
}
@Override