boom后台分区支持
This commit is contained in:
@@ -73,34 +73,33 @@ public class RoomBoomAwardRecordAdminController extends BaseController {
|
||||
|
||||
//1 创建IPage分页对象,设置分页参数
|
||||
IPage<RoomBoomSign> page=new Page<>(params.getPageNo(),params.getPageSize());
|
||||
LambdaQueryWrapper<RoomBoomSign> wrapper = new LambdaQueryWrapper<>();
|
||||
Long uid = null;
|
||||
Long roomUid = null;
|
||||
if (params.getRoomErbanNo() != null){
|
||||
Users erbanNo = usersService.getUserByErbanNo(params.getRoomErbanNo());
|
||||
if (erbanNo == null) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERERROR, "房间id不存在");
|
||||
}
|
||||
wrapper.eq(RoomBoomSign::getRoomUid,erbanNo.getUid());
|
||||
roomUid = erbanNo.getUid();
|
||||
}
|
||||
if (params.getErbanNo() != null){
|
||||
Users erbanNo = usersService.getUserByErbanNo(params.getErbanNo());
|
||||
if (erbanNo == null) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERERROR, "触发者id不存在");
|
||||
}
|
||||
wrapper.eq(RoomBoomSign::getUid,erbanNo.getUid());
|
||||
}
|
||||
if (params.getLevel() != null){
|
||||
wrapper.eq(RoomBoomSign::getLevel,params.getLevel());
|
||||
uid = erbanNo.getUid();
|
||||
}
|
||||
Date startTime = null, endTime = null;
|
||||
if (StringUtils.isNotEmpty(params.getStartTime())) {
|
||||
wrapper.ge(RoomBoomSign::getCreateTime, (Date)DateUtil.parseDateTime(params.getStartTime()));
|
||||
startTime = DateUtil.parseDateTime(params.getStartTime());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.getEndTime())) {
|
||||
wrapper.le(RoomBoomSign::getCreateTime, (Date)DateUtil.parseDateTime(params.getEndTime()));
|
||||
endTime = DateUtil.parseDateTime(params.getEndTime());
|
||||
}
|
||||
wrapper.eq(RoomBoomSign::getStatus,2);
|
||||
wrapper.orderByDesc(RoomBoomSign::getId);
|
||||
//2 执行分页查询
|
||||
IPage<RoomBoomSign> boomSignIPage = roomBoomSignService.page(page, wrapper);
|
||||
IPage<RoomBoomSign> boomSignIPage = roomBoomSignService.list(page, uid, roomUid, params.getLevel(),
|
||||
startTime, endTime, params.getPartitionId());
|
||||
|
||||
Page<RoomBoomSignVO> resultVo = new Page<>();
|
||||
resultVo.setTotal(boomSignIPage.getTotal());
|
||||
List<RoomBoomSignVO> roomBoomSignVOS = new ArrayList<>();
|
||||
|
@@ -2,8 +2,10 @@ package com.accompany.business.mybatismapper.room;
|
||||
|
||||
import com.accompany.business.model.room.RoomBoomSign;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -34,4 +36,8 @@ public interface RoomBoomSignMapper extends BaseMapper<RoomBoomSign> {
|
||||
* @return 开奖情况
|
||||
*/
|
||||
RoomBoomSign getOneByRecordIdAndLevel(@Param("recordId") Long recordId, @Param("level") Integer level);
|
||||
|
||||
IPage<RoomBoomSign> list(@Param("page") IPage<RoomBoomSign> page, @Param("roomUid") Long roomUid, @Param("uid") Long uid,
|
||||
@Param("level") Integer level, @Param("startTime") Date startTime, @Param("endTime") Date endTime,
|
||||
@Param("partitionId") Integer partitionId);
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.accompany.business.constant.RoomBoomConstant;
|
||||
import com.accompany.business.dto.room.RoomBoomPrizeMsgDTO;
|
||||
import com.accompany.business.message.GiftMessage;
|
||||
import com.accompany.business.message.SuperLuckyGiftDiamondIncomeMessage;
|
||||
import com.accompany.business.model.room.RoomBoomLevel;
|
||||
import com.accompany.business.model.room.RoomBoomLevelAward;
|
||||
import com.accompany.business.model.room.RoomBoomSign;
|
||||
@@ -27,7 +26,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.redisson.api.*;
|
||||
@@ -44,7 +42,6 @@ import org.springframework.util.CollectionUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@@ -1,8 +1,10 @@
|
||||
package com.accompany.business.service.room;
|
||||
|
||||
import com.accompany.business.model.room.RoomBoomSign;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -41,5 +43,7 @@ public interface RoomBoomSignService extends IService<RoomBoomSign> {
|
||||
* @return 记录
|
||||
*/
|
||||
RoomBoomSign getOneByRecordIdAndLevel(Long recordId, Integer level);
|
||||
|
||||
IPage<RoomBoomSign> list(IPage<RoomBoomSign> page, Long roomUid, Long uid, Integer level, Date startTime, Date endTime, Integer partitionId);
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@ import com.accompany.core.model.Users;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.api.RList;
|
||||
@@ -382,6 +383,11 @@ public class RoomBoomSignServiceImpl extends ServiceImpl<RoomBoomSignMapper, Roo
|
||||
return roomBoomSignMapper.getOneByRecordIdAndLevel(recordId, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<RoomBoomSign> list(IPage<RoomBoomSign> page, Long roomUid, Long uid, Integer level, Date startTime, Date endTime, Integer partitionId) {
|
||||
return baseMapper.list(page, roomUid, uid, level, startTime, endTime, partitionId);
|
||||
}
|
||||
|
||||
private void sendAward(RoomBoomLevelAward award, Long uid, Long roomUid) {
|
||||
try {
|
||||
RewardDto rewardDto = new RewardDto();
|
||||
|
@@ -33,4 +33,32 @@
|
||||
select * from room_boom_sign where record_id = #{recordId} and level = #{level} order by id limit 1
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.accompany.business.model.room.RoomBoomSign">
|
||||
select r.*
|
||||
from room_boom_sign r
|
||||
left join users u on u.uid = r.room_uid
|
||||
<where>
|
||||
<if test="startTime != null">
|
||||
and r.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and r.create_time <= #{endTime}
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and u.partition_id = #{partitionId}
|
||||
</if>
|
||||
<if test="level != null">
|
||||
and r.level = #{level}
|
||||
</if>
|
||||
<if test="roomUid != null">
|
||||
and r.room_uid = #{roomUid}
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
and r.uid = #{uid}
|
||||
</if>
|
||||
and r.`status` = 2
|
||||
</where>
|
||||
order by r.id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user