自动化立体仓库 - WCS系统
Junjie
2023-12-25 2dc3f0507d6e883d16b1c3c095ca06455a6fa1a7
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
package com.zy.asrs.task;
 
import com.zy.asrs.service.BasLiftOptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
 
/**
 * 定时清理提升机命令
 * 每天晚上23点执行
 */
@Component
@Slf4j
public class ClearLiftOptScheduler {
 
    @Autowired
    private BasLiftOptService basLiftOptService;
 
    @Scheduled(cron = "0 0 23 * * ? ")
    @Transactional
    public void clear() {
        int count = basLiftOptService.saveToStorage(15);
        int count2 = basLiftOptService.deleteByDay(15);
    }
 
}