自动化立体仓库 - WMS系统
skyouc
3 天以前 19feb4af89f6e5e67c3dc97cbbcf6cfc40350781
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.zy.asrs.task;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.zy.asrs.entity.*;
import com.zy.asrs.service.*;
import com.zy.asrs.task.handler.AutoLocMoveHandler;
import com.zy.asrs.utils.OrderInAndOutUtil;
import com.zy.common.properties.SlaveWmsParameterProperties;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
@Slf4j
@Component
public class AutoLocMoveScheduler {
 
 
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private WorkService workService;
    @Autowired
    private AutoLocMoveHandler autoLocMoveHandler;
    @Autowired
    private BasCrnpService basCrnpService;
    @Autowired
    private ConfigService configService;
    @Autowired
    private SlaveWmsParameterProperties slaveWmsParameterProperties;
    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderPakoutService orderPakoutService;
    @Autowired
    private OrderDetlService orderDetlService;
 
 
//    //定时出库   经典双伸
//    @Scheduled(cron = "0/3 * * * * ? ")
//    public void locToLocAutoLocMove() {
//        if (slaveWmsParameterProperties.isAutoLocMoveBoolean()) {
//            Config config = configService.selectConfigByCode("AutoLocMove");
//            if (Cools.isEmpty(config) || config.getValue().equals("false")) {
//                return;
//            }
//            OrderPakout orderPakout = orderPakoutService.selectOrderMoveStatus();
//            if (!Cools.isEmpty(orderPakout)) {
////                autoMoveService.selectList()
//            } else {
//                orderPakout = orderPakoutService.selectOrderMoveStatusInitial();
//                if (Cools.isEmpty(orderPakout)) {
//                    return;
//                }
//                orderPakout.setMoveStatus(2);
//                orderPakoutService.updateById(orderPakout);
//            }
//        }
//    }
 
@Scheduled(cron = "0/10 * * * * ? ")
public void locToLoc12() {
//        if (slaveWmsParameterProperties.isAutoLocMoveUnilateralBoolean()){
    Config config = configService.selectConfigByCode("AutoLocMoveUnilateral");
    if (Cools.isEmpty(config) || config.getValue().equals("false")) {
        return;
    }
    int crnCount = basCrnpService.selectCount(new EntityWrapper<>());
    for (int crnNo = 6; crnNo <= 6; crnNo++) {
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 11).eq("crn_no", crnNo));
//        WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 111).eq("crn_no", crnNo));
        if (Cools.isEmpty(wrkMast)) {
            autoLocMoveHandler.start(crnNo, 12);
        }
    }
//        }
}
 
    //定时出库
//    @Scheduled(cron = "0/10 * * * * ? ")
    public void locToLoc11() {
//        if (slaveWmsParameterProperties.isAutoLocMoveUnilateralBoolean()){
        Config config = configService.selectConfigByCode("AutoLocMoveUnilateral");
        if (Cools.isEmpty(config) || config.getValue().equals("false")) {
            return;
        }
        int crnCount = basCrnpService.selectCount(new EntityWrapper<>());
        for (int crnNo = 1; crnNo <= 2; crnNo++) {
            WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 11).eq("crn_no", crnNo));
            WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 111).eq("crn_no", crnNo));
            if (Cools.isEmpty(wrkMast) && Cools.isEmpty(wrkMast1)) {
                autoLocMoveHandler.start(crnNo, 11);
            }
        }
//        }
    }
 
    //定时入库
//    @Scheduled(cron = "0/3 * * * * ? ")
//    public void locToLoc111() {
//        if (slaveWmsParameterProperties.isAutoLocMoveUnilateralBoolean()){
//            Config config = configService.selectConfigByCode("AutoLocMoveUnilateral");
//            if (Cools.isEmpty(config) || config.getValue().equals("false")) {
//                return;
//            }
//            int crnCount = basCrnpService.selectCount(new EntityWrapper<>());
//            for (int crnNo = 1;crnNo < crnCount;crnNo++){
//                BasCrnp basCrnp = basCrnpService.selectById(crnNo);
//                if (basCrnp == null) {
//                    continue;
//                }
//                WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 111).eq("crn_no", crnNo));
//                WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 11).eq("crn_no", crnNo));
//                if (Cools.isEmpty(wrkMast)  && Cools.isEmpty(wrkMast1)){
//                    autoLocMoveHandler.start(crnNo,111);
//                }
//            }
//        }
//    }
}