package market.thread.orderIsOverDelevery;

import market.Slm.OrderManagement.service.SlmOrderInfoService;

import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

class OrderIsOverDeleveryThread extends Thread implements Runnable {
	private static int runCopies = 0;
	WebApplicationContext _context;
	private SlmOrderInfoService _service1;
	  
	
	OrderIsOverDeleveryThread() {
		if (++runCopies == 1)
		{
			_context = ContextLoader.getCurrentWebApplicationContext();
			_service1 = (SlmOrderInfoService) _context.getBean("SlmOrderInfoService"); 
		}
	}

	public void run() {
		while (!OrderIsOverDeleveryMgt.getShouldStop()) {
			try {
				//_service1.doJudgeOrderIsOverDelevery();//超交货期判定
				
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				try {
					Thread.sleep(3*60*1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
