| | |
| | | |
| | | 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; |
| | |
| | | |
| | | 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()); |
| | | } |
| | | } |
| | | } |