自动化立体仓库 - WMS系统
1
zhang
3 天以前 40254eb1fc7ad9bef6e820c0ffc0cc5a63e9e53e
src/main/java/com/zy/asrs/task/OverYearLogScheduler.java
@@ -2,6 +2,8 @@
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.OverYearLogHandler;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,15 +18,28 @@
    private static final Logger log = LoggerFactory.getLogger(OverYearLogScheduler.class);
    public static Integer days = 60;
    @Autowired
    private OverYearLogHandler overYearLogHandler;
    @Autowired
    private ConfigService configService;
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
    private void execute() {
        ReturnT<String> returnT = overYearLogHandler.start();
        if (!returnT.isSuccess()) {
            log.error(returnT.getMsg());
        }
    }
    @Scheduled(cron = "0/2 * * * * ? ")
    private void execute2() {
        Config config = configService.selectConfigByCode("AlarmDays");
        if (config != null && config.getValue() != null && config.getStatus() == 1) {
            days = Integer.parseInt(config.getValue());
        }
    }
}