parent
82707c9d85
commit
7c0b958fee
@ -0,0 +1,38 @@
|
|||||||
|
package au.com.royalpay.payment.manage.task;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.mappers.bill.BillOrderMapper;
|
||||||
|
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by wangning on 2018/1/2.
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
||||||
|
public class BillOrderCheckTask {
|
||||||
|
@Resource
|
||||||
|
private BillOrderMapper billOrderMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderMapper orderMapper;
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0/3 * * * ?")
|
||||||
|
public void checkGreenChannel() {
|
||||||
|
List<String> orderIds = billOrderMapper.findOrderIdByStatus("0");
|
||||||
|
orderIds.forEach((p) -> {
|
||||||
|
JSONObject order = orderMapper.find(p);
|
||||||
|
if(order.getIntValue("status")==3||order.getIntValue("status")==1){
|
||||||
|
billOrderMapper.updateStatusByOrderId(p,"2");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue