package com.emato.cus.supervise.schedule; import com.emato.cus.supervise.biz.acqGoodsMoveSchedule.up.AcqGoodsMoveUpBiz; 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 15:18 */ @Configuration @EnableScheduling public class AcqGoodsMoveSchedule { private static final Logger logger = LoggerFactory.getLogger(AcqGoodsMoveSchedule.class); @Autowired private AcqGoodsMoveUpBiz acqGoodsMoveUpBiz; /** * 货物库位移动数据 */ //每月1号开始,每天12,18点执行各1次,共2次 //@Scheduled(cron = "0 0 12,18 1/1 * ?") @Scheduled(cron = "0/10 * * * * ? ") public void timerUp() { logger.info("==================== 货物库位移动数据:上架:监控数据读取开始 ===================="); String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN); logger.info("--- 任务开始时间: {}", begDateTime); acqGoodsMoveUpBiz.task(); String endDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN); logger.info("--- 任务结束时间: {}", endDateTime); logger.info("==================== 货物库位移动数据:上架:监控数据读取结束 ===================="); } }