自动化立体仓库 - WMS系统
pang.jiabao
2025-02-08 f1c69821bfa7733daaa79a377dac45556946cf6b
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
41
42
43
44
45
46
47
48
49
package com.zy.asrs.task;
 
import com.core.common.Cools;
import com.zy.asrs.entity.Pla;
import com.zy.asrs.mapper.PlaMapper;
import com.zy.asrs.service.PlaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
import java.util.List;
 
@Slf4j
@Component
public class PlaDetlScheduler {
 
    @Autowired
    private PlaService plaService;
 
    @Resource
    private PlaMapper plaMapper;
 
    @Scheduled(cron = "0/60 * * * * ? ")
    private void execute(){
        List<Pla> plaList = plaService.selectToHistory();
        if(Cools.isEmpty(plaList)){
            return;
        }
 
        for (Pla pla : plaList){
 
        }
 
    }
 
    /**
     * 每隔一天扫描一次冻结的库存,超过三个月则自动解冻
     */
    @Scheduled(cron = "0 0 0 * * ?")
    private void autoThaw(){
 
        int i = plaMapper.autoThaw();
        log.info("---------------自动解冻库存{}个--------------------------", i);
 
    }
 
}