ShelfLoc.java
2.5 KB
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
package com.myproject.bean.qisda;
import com.myproject.util.StorageConstants;
/**
* Created by sunke on 2019/12/25.
*/
public class ShelfLoc {
/**
* 料架号
*/
private String rfid;
/**
* 架位号
*/
private int loc;
/**
* 物料编码
*/
private String barcode;
/**
* 物料类型:小料,大料或者包装料
*/
private int reelType;
/**
* 是否为空(即物料是否已经放入)
*/
private boolean empty = true;
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public boolean isEmpty() {
return empty;
}
public void setEmpty(boolean empty) {
this.empty = empty;
}
public int getLoc() {
return loc;
}
public void setLoc(int loc) {
this.loc = loc;
}
public int getReelType() {
return reelType;
}
public void setReelType(int reelType) {
this.reelType = reelType;
}
public boolean putIn(String barcode){
boolean canPut = false;
//库位未锁定或条码与锁定barcode一样,可放入
if(!isLock()){
canPut = true;
}else if(this.getBarcode().equals(barcode)){
canPut = true;
}
if(canPut){
this.setBarcode(barcode);
setEmpty(false);
}
return canPut;
}
public boolean isCutLoc(){
return reelType == StorageConstants.REEL_TYPE.CUT;
}
/**
* 是否是包装料料格
*/
public boolean isPackageLoc(){
return reelType == StorageConstants.REEL_TYPE.PACKAGE;
}
/**
* 是否是大料料格
*/
public boolean isBigLoc(){
return reelType == StorageConstants.REEL_TYPE.BIG;
}
/**
* 是否是大料料格
*/
public boolean isSmallLoc(){
return reelType == StorageConstants.REEL_TYPE.SMALL;
}
/**
* 库位是否被锁定
*/
public boolean isLock(){
return this.barcode != null && !this.barcode.isEmpty();
}
public String getRfid() {
return rfid;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
/**
* 判断该架位锁定的条码是否与给定的条码一样
* @param barcode
* @return
*/
public boolean isInThisLoc(String barcode){
if(this.isLock()){
return this.getBarcode().equals(barcode);
}
return false;
}
}