101captain
2022-02-22 c83cf9d2d82a0a29a15e38f4566eb470b9a3517b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.panzhihua.service_community.message;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO;
import com.panzhihua.service_community.dao.ComActRaffleDao;
import com.panzhihua.service_community.entity.ComActRaffle;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
import java.util.Date;
 
/**
 * @author zzj
 */
@Component
public class RaffleMessage {
    public static final String DELAYED_QUEUE="raffle.queue";
 
    @Resource
    private ComActRaffleDao comActRaffleDao;
 
    @RabbitListener(queues=DELAYED_QUEUE)
    public void doRaffle(ComActRaffleVO comActRaffleVO){
        ComActRaffle comActRaffle=comActRaffleDao.selectOne(new QueryWrapper<ComActRaffle>().lambda().eq(ComActRaffle::getId,comActRaffleVO.getId()));
        if(comActRaffle!=null&&comActRaffle.getStatus()==0&&comActRaffle.getLotteryTime().before(new Date())){
 
        }
    }
}