自动化立体仓库 - WMS系统
pang.jiabao
4 天以前 b6e0bec71de45cad64e9de14977770053be7e010
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.zy.asrs.task;
 
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.WorkLogHandler;
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;
 
/**
 * Created by vincent on 2020/7/7
 */
@Slf4j
@Component
public class WorkLogScheduler {
 
    @Autowired
    private WorkLogHandler workLogHandler;
    @Autowired
    private WrkMastService wrkMastService;
 
    @Resource
    private LocMastService locMastService;
 
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
        List<WrkMast> wrkMasts = wrkMastService.selectToBeHistoryData();
        if (wrkMasts.isEmpty()) {
            return;
        }
        for (WrkMast wrkMast : wrkMasts) {
            ReturnT<String> result = workLogHandler.start(wrkMast);
            if (!result.isSuccess()) {
                log.error("工作档[workNo={}]历史档处理失败", wrkMast.getWrkNo());
            }
        }
    }
 
// 插入库位
//    @Scheduled(cron = "0 43 * * * ?")
//    private void execute1(){
//        for(int i = 5; i<= 6; i++)
//            for(int j = 41; j<= 56; j ++)
//                for(int k = 1; k <= 11; k++){
//                    LocMast locMast = new LocMast();
//                    locMast.setLocNo("0"+i+"0"+j +""+(k <= 9 ? "0"+k:k));
//                    locMast.setRow1(i);
//                    locMast.setBay1(j);
//                    locMast.setLev1(k);
//                    locMast.setLocSts("O");
//                    locMast.setCrnNo(2);
//                    locMast.setWhsType(1L);
//                    locMast.setLocType1((short)1);
//                    locMast.setLocType2((short)1);
//                    locMast.setLocType3((short)1);
//                    locMast.setFullPlt("N");
//                    locMastService.insert(locMast);
//                }
//        System.out.println("完成---");
//        for(int i = 7; i<= 8; i++)
//            for(int j = 41; j<= 56; j ++)
//                for(int k = 1; k <= 11; k++){
//                    LocMast locMast = new LocMast();
//                    locMast.setLocNo("0"+i+"0"+j +""+(k <= 9 ? "0"+k:k));
//                    locMast.setRow1(i);
//                    locMast.setBay1(j);
//                    locMast.setLev1(k);
//                    locMast.setLocSts("O");
//                    locMast.setCrnNo(3);
//                    locMast.setWhsType(1L);
//                    locMast.setLocType1((short)1);
//                    locMast.setLocType2((short)1);
//                    locMast.setLocType3((short)1);
//                    locMast.setFullPlt("N");
//                    locMastService.insert(locMast);
//                }
//        System.out.println("完成--完成-");
//
//    }
 
 
}