自动化立体仓库 - WMS系统
#
18516761980
2022-02-08 19c13db8d30d1c2aeb9250ed218c110e1290d05f
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
package com.zy.ints.task;
 
import com.zy.asrs.task.core.ReturnT;
import com.zy.ints.entity.WaitMatin;
import com.zy.ints.service.WaitMatinService;
import com.zy.ints.task.handler.WaitMatinLogHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import java.util.List;
 
/**
 * 入库通知档转历史档
 * Created by TQS on 2021/8/31
 */
@Component
public class WaitMatinLogScheduler {
 
    private static final Logger log = LoggerFactory.getLogger(WaitMatinLogScheduler.class);
 
    @Autowired
    private WaitMatinLogHandler waitMatinLogHandler;
 
    @Autowired
    private WaitMatinService waitMatinService;
 
    /**
     * ERP接口是否启用
     */
    @Value("${erp.enabled}")
    private Boolean erpEnabled;
 
    @Scheduled(cron = "0/4 * * * * ? ")
    private void execute(){
        if(!erpEnabled) return;
        List<WaitMatin> WaitMatins = waitMatinService.selectWaitMatinBySts();
        for (WaitMatin waitMatin : WaitMatins) {
            ReturnT<String> result = waitMatinLogHandler.start(waitMatin);
            if (!result.isSuccess()) {
                log.error("入库通知档[billNo={}],[seqNo={}]历史档处理失败", waitMatin.getBillNo(),waitMatin.getSeqNo());
            }
        }
    }
}