自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-07-07 dc078dbd74d0028cdedb4210f0b892f88c86e41c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.zy.asrs.task;
 
import com.zy.asrs.task.handler.WorkLogHandler;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
/**
 * Created by vincent on 2020/7/7
 */
@Component
public class WorkLogScheduler {
 
    @Autowired
    private WorkLogHandler workLogHandler;
    @Autowired
    private ConfigService configService;
 
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
        ReturnT<Config> result = workLogHandler.start();
        if (!result.isSuccess()) {
            configService.insert(result.getContent());
        }
    }
 
}