自动化立体仓库 - WMS系统
zwl
2 天以前 73f677ac03ebcf0f9d2e865dd60d3e4a6c2bc2c9
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
package com.zy.asrs.task;
 
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.InboundCameraCaptureService;
import com.zy.asrs.service.WrkMastService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import java.util.List;
 
@Slf4j
@Component
public class InboundCameraCaptureScheduler {
 
    @Autowired
    private WrkMastService wrkMastService;
 
    @Autowired
    private InboundCameraCaptureService inboundCameraCaptureService;
 
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute() {
        List<WrkMast> wrkMasts = wrkMastService.selectPendingInboundCameraCapture();
        if (wrkMasts == null || wrkMasts.isEmpty()) {
            return;
        }
        for (WrkMast wrkMast : wrkMasts) {
            try {
                inboundCameraCaptureService.processPendingCapture(wrkMast);
            } catch (Exception e) {
                log.warn("入库抓拍定时任务异常:workNo={}", wrkMast == null ? null : wrkMast.getWrkNo(), e);
            }
        }
    }
}