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())){
|
|
}
|
}
|
}
|