mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
package com.panzhihua.service_community.message;
 
import com.panzhihua.service_community.dao.McsOrderDao;
import com.panzhihua.service_community.entity.McsOrder;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/**
 * @author zzj
 */
@Component
public class McsOrderMessage {
    public static final String DELAYED_QUEUE="huacheng.mcsOrder.queue";
    @Resource
    private McsOrderDao mcsOrderDao;
    @RabbitListener(queues=DELAYED_QUEUE)
    public void cancelOrder(McsOrder mcsOrder){
       McsOrder nowOrder=mcsOrderDao.selectById(mcsOrder.getId());
       if(nowOrder.getStatus()==0){
           mcsOrder.setStatus(2);
           mcsOrderDao.updateById(mcsOrder);
       }
    }
}