package com.uas.eis.task; import com.uas.eis.service.ScheduleTaskService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Date; /** * @author koul * @email koul@usoftchina.com * @date 2021-12-23 15:27 */ @Component("scheduleTask") public class ScheduleTask { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private ScheduleTaskService scheduleTaskService; /** * 同步物料资料 */ public void syncProducts() { logger.info("同步物料资料开始"); Date date = new Date(); scheduleTaskService.syncProducts(); logger.info("同步物料资料结束:用时" + ((System.currentTimeMillis() - date.getTime()) / 1000)); } /** * 同步工单 */ public void syncMakeBases() { logger.info("同步工单开始"); Date date = new Date(); scheduleTaskService.syncMakeBases(); logger.info("同步工单结束:用时" + ((System.currentTimeMillis() - date.getTime()) / 1000)); } /** * 同步工单BOM */ public void syncMakeBaseDetails() { logger.info("同步工单BOM开始"); Date date = new Date(); scheduleTaskService.syncMakeBaseDetails(); logger.info("同步工单BOM:用时" + ((System.currentTimeMillis() - date.getTime()) / 1000)); } /** * 同步替代料 */ public void syncMakematerialReplace() { logger.info("同步替代料开始"); Date date = new Date(); scheduleTaskService.syncMakematerialReplace(); logger.info("同步替代料:用时" + ((System.currentTimeMillis() - date.getTime()) / 1000)); } }