DataMaterial.java
1.85 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
package com.huaheng.api.wmsinfo2.domain;
import com.huaheng.common.utils.DataUtils;
import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
public class DataMaterial {
static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public int Row;
public int Column;
public int Layer;
public boolean HasGoods = true;
public String Type;
public String PalletID;
public String locCode;
public List<DataMaterialItem> matinfos = new ArrayList<>();
public DataMaterial(String containerCode, String locCode) {
this.PalletID = containerCode;
this.locCode = locCode;
try {
if (containerCode.toUpperCase().startsWith("M")) {
Type = "L";
Row = Integer.parseInt(locCode.substring(1, 3));
Column = Integer.parseInt(locCode.substring(3, 5));
Layer = Integer.parseInt(locCode.substring(5));
} else {
Type = "C";
Row = Integer.parseInt(locCode.substring(5, 7));
Column = Integer.parseInt(locCode.substring(7));
Layer = Integer.parseInt(locCode.substring(2, 4));
}
} catch (Exception e) {
}
}
public void add(InventoryDetail detail) {
DataMaterialItem item = new DataMaterialItem();
item.name = detail.getMaterialName();
item.container_no = detail.getContainerCode();
item.instoretime = format.format(detail.getCreated());
item.count = detail.getQty();
item.supply = detail.getSupplierCode();
item.instoredays = (System.currentTimeMillis() - detail.getCreated().getTime()) / 24 / 3600 / 1000;
matinfos.add(item);
}
}