jyy
2021-03-17 4e35547a189a77525b270f7a5ae6d425e71765ee
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
31
32
33
34
35
36
37
38
39
40
41
package com.matrix.system.shopXcx.mqTask;
 
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.matrix.core.tools.LogUtil;
import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanOrder;
import com.rabbitmq.client.DeliverCallback;
import com.rabbitmq.client.Delivery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.io.IOException;
 
/**
 * 分销订单退款
 */
@Component
public class SalesOrderRefundTask implements DeliverCallback {
 
 
    @Autowired
    private ShopSalesmanOrderDao shopSalesmanOrderDao;
 
 
 
    @Override
    public void handle(String consumerTag, Delivery message) throws IOException {
 
        String orderId = new String(message.getBody(), "UTF-8");
        LogUtil.debug("收到分销订单退款任务orderId={}", orderId);
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("order_id",orderId);
        ShopSalesmanOrder shopSalesmanOrder = shopSalesmanOrderDao.selectOne(queryWrapper);
        if(shopSalesmanOrder!=null){
            shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YTK);
            shopSalesmanOrderDao.updateById(shopSalesmanOrder);
        }
    }
 
}