package com.emato.cus.supervise.schedule; import com.emato.cus.supervise.biz.acqInventoryInfo.AcqInventoryInfoBiz; 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-01 16:24 */ @Configuration @EnableScheduling public class AcqInventoryInfoSchedule { private static final Logger logger = LoggerFactory.getLogger(AcqInventoryInfoSchedule.class); @Autowired private AcqInventoryInfoBiz acqInventoryInfoBiz; /** * 货物库存数据 */ //每月1号开始,每天12,22点各1次,共2次 @Scheduled(cron = "0 0 12,22 1/1 * ?") // @Scheduled(cron = "0 0/1 * * * ? ") public void timer() { logger.info("==================== 货物库存数据::监控数据读取开始 ===================="); String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN); logger.info("--- 任务开始时间: {}", begDateTime); acqInventoryInfoBiz.task(); String endDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN); logger.info("--- 任务结束时间: {}", endDateTime); logger.info("==================== 货物库存数据::监控数据读取结束 ===================="); } }