package com.zy.asrs.task;
|
|
import com.core.common.Cools;
|
import com.zy.asrs.task.core.ReturnT;
|
import com.zy.asrs.task.handler.AutoEmptyOutHandler;
|
import com.zy.system.entity.Config;
|
import com.zy.system.service.ConfigService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
@Slf4j
|
@Component
|
public class AutoEmptyOutScheduler {
|
|
|
@Autowired
|
private ConfigService configService;
|
@Autowired
|
private AutoEmptyOutHandler autoEmptyOutHandler;
|
|
//定时空库位预留,空轴出库
|
@Scheduled(cron = "0/3 * * * * ? ")
|
public void autoEmptyOut() {
|
|
Config config = configService.selectConfigByCode("AutoEmptyOut");
|
if (Cools.isEmpty(config) || config.getValue().equals("false")) {
|
return;
|
}
|
ReturnT<String> result = autoEmptyOutHandler.start();
|
if (!result.isSuccess()) {
|
log.error("自动出空轴失败{}", result.getMsg());
|
}
|
}
|
|
}
|