liujie
2025-08-04 ddba15cfd1d654dc41de5dfdc587e12d96d84f4f
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
42
43
package com.stylefeng.guns.modular.shunfeng.task.jobs;
 
import com.stylefeng.guns.modular.shunfeng.model.OrderRide;
import com.stylefeng.guns.modular.shunfeng.model.TimeTask;
import com.stylefeng.guns.modular.shunfeng.task.base.AbstractJob;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
 
/**
 *  支付倒计时
 *  @author lvxue
 *  @date 2019年01月22日
 *  @version 1.0
 */
public class CourseExamineRide extends AbstractJob {
 
    public static final String DSCE = "orderRide";
 
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDataMap maps = context.getMergedJobDataMap();
        Integer orderId = maps.getInt("orderId");
        Integer timeTaskId = maps.getInt("timeTaskId");
        try {
            System.out.println("----当id为:"+orderId+"的订单未支付,自动取消支付,释放");
 
            OrderRide order = this.orderRideService.selectById(orderId);
            if(order.getState().equals(1) || order.getState() ==1 ){
                //自动取消
                order.setState(6);
                this.orderRideService.updateById(order);
            }
            //修改定时任务数据状态
            TimeTask timeTask=timeTaskService.selectById(timeTaskId);
            //0有效,1无效
            timeTask.setState(1);
            timeTaskService.updateById(timeTask);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}