自动化立体仓库 - WMS系统
zjj
2024-09-03 e1c7f150792a5085dd64e86e6af82820ab34dc05
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
30
31
32
33
34
35
36
37
38
39
40
package com.zy.asrs.task;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.mapper.LocMastMapper;
import com.zy.asrs.service.LocMastService;
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 ClearLiftLocNoScheduler {
 
    @Autowired
    private LocMastMapper locMastMapper;
    @Autowired
    private ConfigService configService;
 
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
        Config config = configService.selectOne(new EntityWrapper<Config>().eq("code","tmpSwitch"));
        if (config == null) {
            return;
        }
 
        if (!config.getValue().equals("true")) {
            return;
        }
 
        int clearLiftLocNo = locMastMapper.clearLiftLocNo();
        if (clearLiftLocNo > 0) {
            log.info("清理提升机附近库位:" + clearLiftLocNo + "个");
        }
 
    }
 
}