自动化立体仓库 - WMS系统
#
18516761980
2021-12-06 d4633ae0282a7a3f8af135fc2a1d6a6c7b656dbb
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.ints.task;
 
import com.zy.asrs.task.core.ReturnT;
import com.zy.ints.task.handler.ErpreqLogHandler;
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;
 
/**
 * ERP请求日志删除
 * Created by vincent on 2021/9/19
 */
@Component
public class ErpreqLogScheduler {
    private static final Logger log = LoggerFactory.getLogger(ErpreqLogScheduler.class);
 
    @Autowired
    private ErpreqLogHandler erpreqLogHandler;
 
    /**
     * ERP接口是否启用
     */
    @Value("${erp.enabled}")
    private Boolean erpEnabled;
 
    @Scheduled(cron = "0/10 * * * * ? ")
    private void execute(){
        if(!erpEnabled) return;
        ReturnT<String> returnT = erpreqLogHandler.start();
        if (!returnT.isSuccess()) {
            log.error(returnT.getMsg());
        }
    }
}