package com.palmnest.webapp.quartz;

import com.palmnest.application.dto.output.enterprise.GoodsReleaseVo;
import com.palmnest.dao.release.GoodsCompanyDao;
import com.palmnest.service.estateserve.airconditioner.ConditionerAddTimeService;
import com.palmnest.service.estateserve.release.GoodsReleaseService;
import com.palmnest.service.estateserve.release.impl.GoodsReleaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Slf4j
@Component("airConditionerAddTimeTimerTask")
public class AirConditionerAddTimeTimerTask {


	@Autowired
	private ConditionerAddTimeService conditionerAddTimeService;
	public void run() {

		log.info("quartz into AirConditionerAddTimeTimerTask start ...");
		try {
			/**
			 * 加时单 申请时间大于当前时间  把状态改为已完成
			 * 条件:待使用状态
			 */
			conditionerAddTimeService.airAddTimeDoTimerTask();

			/**
			 *  #加时审批过时间
			 *	#当前时间>空调申请开始时间
			 *	#且状态为21 22 23状态
			 *	#将状态 改为:35(无效
			 *	#且
			 *	#cancelReason='管理员审批超时'
			 *	#cancelUser='系统自动'
			 *	#cancelTime=NOW()
			 */
			conditionerAddTimeService.airAddTimeAuditOverTimeTask();

		} catch (Exception e) {
			e.printStackTrace();
			log.error(e.getMessage());
		}
		log.info("quartz into AirConditionerAddTimeTimerTask end ...");


	}

}
