*
lsh
2 天以前 23e81c5d24c37a87fbbbf67c68b17e8f78832148
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package com.zy.asrs.entity.param;
 
import com.zy.asrs.entity.LocMast;
import com.zy.core.model.CrnSlave;
import io.swagger.models.auth.In;
import lombok.Data;
 
@Data
public class TaskCreateParam {
 
    //任务号
    private String taskNo;
 
    //任务类型
    private Integer ioType;
 
    //起点
    private String startPoint;
    private Integer startPointSta;
 
    //优先级
    private Integer taskPriority;
 
    //终点
    private String targetPoint;
    private Integer targetPointSta;
 
    //是否空托盘            Y:是 N:否
    private String emptyContainer;
 
    //条码
    private String barcode;
 
    //备注
    private String memo;
    //堆垛机
    private Integer crn;
 
    public TaskCreateParam(){};
 
    public TaskCreateParam(String taskNo, Integer ioType, String barcode, String startPoint, Integer taskPriority, String targetPoint, String emptyContainer) {
        this.taskNo = taskNo;
        this.ioType = ioType;
        this.barcode = barcode;
        this.startPoint = startPoint;
        this.taskPriority = taskPriority;
        this.targetPoint = targetPoint;
        this.emptyContainer = emptyContainer;
    }
 
    public TaskCreateParam(String taskNo, Integer ioType, String startPoint, Integer taskPriority, String targetPoint, String emptyContainer, String barcode, String memo) {
        this.taskNo = taskNo;
        this.ioType = ioType;
        this.startPoint = startPoint;
        this.taskPriority = taskPriority;
        this.targetPoint = targetPoint;
        this.emptyContainer = emptyContainer;
        this.barcode = barcode;
        this.memo = memo;
    }
 
    public TaskCreateParam(WMSAndAGVInterfaceParam param){
        this.taskNo = param.getTaskNo();
        this.ioType = convertParamIoType(param.getTaskType());
        this.barcode = param.getContainerCode();
        this.taskPriority = param.getTaskPriority();
        this.startPoint = param.getSourceLocationCode();
        this.targetPoint = param.getTargetLocationCode();
        this.emptyContainer = param.getEmptyContainer();
        this.crn = param.getTaskTunnel();
    };
 
    public TaskCreateParam(CarryParam param, Integer crn){
        this.taskNo = param.getTaskNo();
        this.ioType = param.getIoType();
        this.barcode = param.getBarcode();
        this.taskPriority = param.getTaskPriority();
        this.startPoint = param.getStartPoint();
        this.targetPoint = param.getTargetPoint();
        this.emptyContainer = "N";
        this.crn = crn;
    };
 
    public TaskCreateParam(CarryParam param, Integer crn,Integer crnSta){
        this.taskNo = param.getTaskNo();
        this.ioType = param.getIoType();
        this.barcode = param.getBarcode();
        this.taskPriority = param.getTaskPriority();
        this.startPoint = param.getStartPoint();
        this.targetPoint = param.getTargetPoint();
        this.emptyContainer = "N";
        this.crn = crn;
        this.startPointSta = crnSta;
        this.targetPointSta = crnSta;
    };
 
    public TaskCreateParam(CrnSlave crnSlave, LocMast locMast){
        this.taskNo = locMast.getLocNo() + "-" + crnSlave.getId();
        this.ioType = 4;
        this.barcode = locMast.getBarcode();
        this.taskPriority = 1;
        this.startPoint = locMast.getLocNo();
        this.targetPoint = locMast.getLocNo();
        this.emptyContainer = "N";
        this.crn = locMast.getCrnNo();
        this.memo = "演示任务";
    };
 
 
    public static Integer convertParamIoType(String paramIoType){
        switch (paramIoType){
            case "RK":
                return 1;
            case "CK":
                return 2;
            case "YK":
                return 3;
            default:
                return 0;
        }
    }
 
    public void updateIoTyoe(Integer ioTypeOld){
        switch (ioTypeOld){
            case 1:
                this.ioType = 2;
                break;
            case 2:
                this.ioType = 3;
                break;
            case 3:
                this.ioType = 1;
                break;
            default:
                this.ioType = 3;
        }
    }
 
}