package com.emato.cus.supervise.schedule; import com.emato.cus.supervise.biz.acqGoodsSeat.AcqGoodsSeatBiz; import com.emato.cus.supervise.util.LocalDateTimeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; /** * 库位货物数据 计划任务 * @author zengjunlin * @version 1.0 * 2018-02-03 16:18 */ @Configuration @EnableScheduling public class AcqGoodsSeatSchedule { private static final Logger logger = LoggerFactory.getLogger(AcqGoodsSeatSchedule.class); @Autowired private AcqGoodsSeatBiz acqGoodsSeatBiz; /** * 库位货物数据 * 每30分钟1次 */ //每月1号开始,每天10,12,15,18,22点各1次,共5次 @Scheduled(cron = "0 0 10,12,15,18,22 1/1 * ?") // @Scheduled(cron = "0 0/1 * * * ? ") public void timerUp() { logger.info("==================== 库位货物数据::监控数据读取开始 ===================="); String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN); logger.info("--- 任务开始时间: {}", begDateTime); acqGoodsSeatBiz.task(); String endDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN); logger.info("--- 任务结束时间: {}", endDateTime); logger.info("==================== 库位货物数据::监控数据读取结束 ===================="); } }