| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package com.fdkankan.contro.schedule;
- import com.fdkankan.contro.service.IRelocationBatchService;
- import com.fdkankan.contro.service.IRelocationBindService;
- import com.fdkankan.contro.service.IRelocationInitService;
- import com.fdkankan.contro.service.IScene3dNumService;
- import lombok.extern.log4j.Log4j2;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.scheduling.annotation.Scheduled;
- import org.springframework.stereotype.Component;
- @Log4j2
- @Component
- public class ScheduleJob {
- @Autowired
- private IScene3dNumService scene3dNumService;
- @Autowired
- private IRelocationBatchService relocationBatchService;
- @Autowired
- private IRelocationInitService relocationInitService;
- @Autowired
- private IRelocationBindService relocationBindService;
- /**
- * 定时生成场景码,间隔1小时执行一次,项目启动一秒后执行一次
- */
- @Scheduled(fixedDelay = 60*60*1000, initialDelay = 1000)
- public void generateSceneNum() {
- scene3dNumService.generateSceneNumHandler();
- }
- /**
- * 重定位调度
- */
- @Scheduled(fixedDelay = 5*60*1000, initialDelay = 1000)
- public void relocationControl() {
- log.info("重定位调度开始");
- relocationBatchService.relocationControl();
- log.info("重定位调度结束");
- }
- /**
- * 重定位调度
- */
- @Scheduled(fixedDelay = 5*60*1000, initialDelay = 1000)
- public void relocationInit() {
- log.info("重定位初始化调度开始");
- relocationInitService.relocationInit();
- log.info("重定位初始化调度结束");
- }
- /**
- * 重定位绑定关系初始化
- */
- @Scheduled(fixedDelay = 5*60*1000, initialDelay = 1000)
- public void relocationBind() {
- log.info("重定位绑定关系开始");
- relocationBindService.relocationBind();
- log.info("重定位绑定关系结束");
- }
- }
|