1
5 天以前 82374fe4b32d58956810f445b7889f1a370f1ab9
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
package com.zy.asrs.entity.param;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.SnowflakeIdWorker;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasAgvLocNo;
import com.zy.asrs.entity.BasAgvMast;
import com.zy.asrs.service.BasAgvLocNoService;
import lombok.Data;
 
import java.util.ArrayList;
 
/*
 *  Created by Monkey D. Luffy on 2025.09.09
 * */
@Data
public class AgvTaskAssignmentParam {
 
    private String reqCode;
    private String taskCode;
    private String taskTyp = "cs";
    private String ctnrTyp = "1";
    private ArrayList<PositionCodePathClass> positionCodePath = new ArrayList<PositionCodePathClass>();
 
    @Data
    public static class PositionCodePathClass {
        private String positionCode;
        private String type = "05";//放置位
    }
 
    public AgvTaskAssignmentParam() {
 
    }
    public AgvTaskAssignmentParam(BasAgvMast basAgvMast) {
        switch (basAgvMast.getIoType()){
            case 0:
                getAgvTaskAssignmentParam0(basAgvMast);
                return;
            case 1:
                getAgvTaskAssignmentParam1(basAgvMast);
                return;
            case 2:
                getAgvTaskAssignmentParam2(basAgvMast);
                return;
            case 3:
                getAgvTaskAssignmentParam3(basAgvMast);
                return;
            default:
                return;
        }
 
    }
 
    public void getAgvTaskAssignmentParam0(BasAgvMast basAgvMast) {
        BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class);
 
        this.reqCode = basAgvMast.getTaskNo()+"-"+basAgvMast.getTimestamp();
 
        SnowflakeIdWorker snowflakeIdWorker = SpringUtils.getBean(SnowflakeIdWorker.class);
        long nextId = snowflakeIdWorker.nextId();
        this.taskCode = String.valueOf(nextId);
        PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getSourceLocNo()));
        positionCodePathClassEnd.setPositionCode(basAgvLocNoSou.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassEnd);
 
        PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getStaNo()));
        positionCodePathClassSou.setPositionCode(basAgvLocNoEnd.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassSou);
 
 
    }
    public void getAgvTaskAssignmentParam1(BasAgvMast basAgvMast) {
        BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class);
 
        this.reqCode = basAgvMast.getTaskNo().toString();
        this.taskCode = basAgvMast.getTimestamp().toString();
        PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getSourceLocNo()));
        positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassSou);
        PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getLocNo()));
        positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassEnd);
 
    }
    public void getAgvTaskAssignmentParam2(BasAgvMast basAgvMast) {
        BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class);
 
        this.reqCode = basAgvMast.getTaskNo().toString();
        this.taskCode = basAgvMast.getTimestamp().toString();
        PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoSou= basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getSourceStaNo()));
        positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassSou);
        PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getLocNo()));
        positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassEnd);
 
    }
    public void getAgvTaskAssignmentParam3(BasAgvMast basAgvMast) {
        BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class);
 
        this.reqCode = basAgvMast.getTaskNo().toString();
        this.taskCode = basAgvMast.getTimestamp().toString();
        PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getSourceStaNo()));
        positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassSou);
        PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass();
        BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getStaNo()));
        positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo());
        this.positionCodePath.add(positionCodePathClassEnd);
 
    }
}