Authored by bblu

查询排队列表,如果活动尚未开始,返回空列表

... ... @@ -114,11 +114,23 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
throw new ServiceException(900001002, "请传参activityId");
}
// (3)查询条件下,总记录数
// (3)判断活动是否存在,是否过期
DrawlineActivity drawlineActivity = drawlineActivityDAO.selectByPrimaryKey(activityId);
if (null == drawlineActivity) {
logger.warn("addDrawlineUserQueue: drawlineActivity is not exists");
throw new ServiceException(900001003, "活动已不存在");
}
int beginTime = null == drawlineActivity.getBeginTime() ? 0 : drawlineActivity.getBeginTime().intValue();
int currentTime = (int) (System.currentTimeMillis() / 1000);
if (0 < beginTime && currentTime < beginTime) {
return new ArrayList<DrawlineUserQueueRespBO>();
}
// (4)查询条件下,总记录数
int total = drawlineUserQueueDAO.selectCountBy(activityId, sort);
logger.debug("getDrawlineUserQueueList: drawlineUserQueueDAO.selectCountBy. activityId is {}, sort is {}, total is {}", activityId, sort, total);
// (4)查询排队信息,如果条件记录总数小于分页数需补齐记录
// (5)查询排队信息,如果条件记录总数小于分页数需补齐记录
if (0 < sort && total < limit) {
sort += limit - total;
}
... ... @@ -129,22 +141,22 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
throw new ServiceException(900001008, "无人参与活动排队");
}
// (5)组装uids
// (6)组装uids
List<Integer> uidList = getUidList(drawlineUserQueueList);
// (6)调用查询用户信息服务
// (7)调用查询用户信息服务
AsyncFuture<UserBaseRspBO[]> userBaseRspBOArrAsync = drawlineList2MapService.postForUserBaseInfo(uidList);
// (7)查询用户中奖信息
// (8)查询用户中奖信息
Map<String, DrawlineLuckyUser> drawlineLuckyUserMap = drawlineList2MapService.getDrawlineLuckyUserMap(activityId, uidList);
// (8)查询马甲信息
// (9)查询马甲信息
Map<Integer, DrawlineVirtualUser> drawlineVirtualUserMap = drawlineList2MapService.getDrawlineVirtualUserMap(uidList);
// (9)获取用户信息
// (10)获取用户信息
Map<Integer, UserBaseRspBO> userBaseRspBOMap = drawlineList2MapService.getUserBaseRspBOMap(userBaseRspBOArrAsync);
// (10)组装返回
// (11)组装返回
List<DrawlineUserQueueRespBO> drawlineUserQueueRespBOList = DrawlineUserQueueConvert.toBOListByDOList(drawlineUserQueueList, drawlineLuckyUserMap, userBaseRspBOMap, drawlineVirtualUserMap);
return drawlineUserQueueRespBOList;
}
... ...