package com.cim.idm.wmsextend.generic.wmsmail;


import com.cim.idm.wmsextend.generic.wmsmail.MailUtil;
import org.springframework.beans.factory.annotation.Autowired;


public class MailTask {
	@Autowired
	private com.cim.idm.wmsextend.generic.wmsmail.MailUtil MailUtil;
	
	public MailTask(){
		if( MailUtil == null ){
			MailUtil = new MailUtil();
		}
	}
	public void doJob2() {
		System.out.println("dojob2:不继承QuartzJobBean方式-调度进行中...");

		//	new MailUtil().SendSimpleMail();
	}


	public void doJobMail() {

	}

	//30分钟刷新
	public void fiv(){
//		MaterialPackingServiceImpl msImpl = null;
		try {
//			msImpl = new MaterialPackingServiceImpl();
//
//			msImpl.OQAPreInspect();//品质待检
			Thread.sleep(5000);
			//msImpl.unReturned();//品质未归还
			Thread.sleep(5000);
			//msImpl.materialLife();//寿命管理
			Thread.sleep(5000);
			//msImpl.preStocked();//带入库
			Thread.sleep(5000);
			//msImpl.MESReserve();//MES预留单看板
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
//			msImpl = null;
		}
	}
	/**
	 * 待检每天8点刷新，超过两天的物料发邮件。
	 */
	public void OQADailyTask(){
  			MailUtil.scheduleMethodQIP();
	}
	
	/**
	 * 寿命管理每天8点刷新，超过两天的物料发邮件。
	 */
	public void LifeManagementTask(){
			MailUtil.SendLifeManagementMail();	 
	}
	/**
	 * 物料变成长期库存发送邮件
	 */	
	public void LongTimeStorageTask(){
		MailUtil.SendLongTimeStorageMail();	 
}
	/*
	 * 发送安全库存信息
	 * */
	public void SafetyStockInfoTask(){
		MailUtil.SendSafetyStockInfoMail();
	}
	
	/**
	 * 过期和长期库存自动hold功能
	 */	
	public void HoldAbnormalBox(){
		MailUtil.HoldAbnormalBox();	 
	}
	/**
	 * 货位绑定报表，每天定时查询
	 */
	public void AssignLocationReport(){
		MailUtil.AssignLocReport();
	}
	
	/**
	 * 材料库存为质检状态的
	 */	
	public void SendPreOQAReport(){
		MailUtil.sendPreOQAReport();	 
	}
	
	/**
	 * 寿命资材
	 */
	public void SendMaterialLifeReport(){
		MailUtil.sendMaterialLifeReport();
	}
	
	/**
	 * 堆场设备入库、在库、出库List
	 */
	public void SendYardStockInList(){
		MailUtil.sendYardStockInListMail();
	}
	public void SendYardStockList(){
		MailUtil.sendYardStockedListMail();
	}
	public void SendYardStockOutList(){
		MailUtil.sendYardStockOutListMail();
	}
	/**
	 * 6点库存查询，每天6定时同步
	 */
	public void GetSixClockStorage(){
		MailUtil.GetStorageForSixClock();
	}
	public void GetYardSixClockStorage(){
		MailUtil.GetYardStorageForSixClock();
	}
	
}
