LocationInfo.java
1.76 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
package com.huaheng.api.wmsinfo.domain;
import com.huaheng.pc.config.location.domain.CscLocation;
import com.huaheng.pc.config.location.domain.Location;
/**
* 库位信息
* BinId,int值,库位Id
* BinNo,string值,库位编号
* BinStatus,int值,库位状态,1正常2锁定3禁用
* Layer,int值,库位所在的层数
* X,int值,库位坐标x
* Y,int值,库位坐标y
* Z,int值,库位坐标z
* Capacity,int值,库位容量
* FreeSpace,int值,库位空闲容量
*/
public class LocationInfo {
public String BinId;
public String BinNo;
public int BinStatus;
public int Layer;
public int X;
public int Y;
public int Z;
public int Capacity = 0;
public int FreeSpace = 0;
public static LocationInfo parse(Location location) {
LocationInfo info = new LocationInfo();
info.BinId = location.getCode();
info.BinNo = location.getCode();
if ("empty".equals(location.getStatus())) {
info.BinStatus = 1;
} else if ("lock".equals(location.getStatus())) {
info.BinStatus = 2;
} else {
info.BinStatus = 3;
}
info.Layer = location.getILayer();
info.X = location.getIRow();
info.Y = location.getIColumn();
info.Z = location.getILayer();
return info;
}
public static LocationInfo parse(CscLocation location) {
LocationInfo info = new LocationInfo();
info.BinId = location.getViewLocationCode();
info.BinNo = location.getViewLocationCode();
info.BinStatus = 1;
info.Layer = location.getILayer();
info.X = location.getIRow();
info.Y = location.getIColumn();
info.Z = location.getILayer();
return info;
}
}