admin
2025-02-20 f537abe9f3646c739beaf15076246a2f71a347e9
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
package com.yeshi.buwan.job;
 
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yeshi.buwan.domain.vip.OrderRecord;
import com.yeshi.buwan.service.inter.order.OrderService;
import org.springframework.stereotype.Component;
import org.yeshi.utils.StringUtil;
 
import javax.annotation.Resource;
import java.util.List;
 
//10409568
@Component
public class OrderJob {
    @Resource
    private OrderService orderService;
 
 
    //取消订单
    @XxlJob("order-cancel")
    public ReturnT<String> cancelOrder(String params) throws Exception {
 
        if (!StringUtil.isNullOrEmpty(params)) {
            orderService.cancelOrder(params, "");
        } else {
            List<OrderRecord> orderRecords = orderService.getCanCancelOrderList(1, 100);
            if (orderRecords != null)
                for (OrderRecord record : orderRecords) {
                    orderService.cancelOrder(record.getId(),"超时未付款,系统自动取消");
                }
        }
 
 
        return ReturnT.SUCCESS;
    }
 
 
}