BoxData.java
4.7 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
package com.neotel.webbox.capacity.bean;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class BoxData {
/**
* 料仓名称
*/
@ExcelProperty("料仓名称")
private String boxName;
/**
* 料仓高度
*/
@ExcelProperty("料仓高度")
private int boxHeight;
/**
* 料仓不可用高度655
*/
@ExcelProperty("不可用高度")
private int boxInvalidHeight = 655;
/**
* 料仓口高度
*/
@ExcelProperty("仓门高度")
private int doorHeight = 1160;
/**
* 进口下部可用高度
*/
@ExcelProperty("进口下部")
private int doorDownHeight;
/**
* 列数
*/
@ExcelProperty("列数")
private int columnCount;
/**
* 纯放此规格料盘的容量
* @return
*/
public int getBoxPureSizeCapacity(ReelData reelData){
//每一列可放料盘数量
int columnPureSizeCapacity = getColumnPureSizeCapacity(reelData.getPressHeight(),reelData);
//入料口下部可放料盘数量
int entranceUpCapacity = getDoorUpCapacity(reelData.getPressHeight(),reelData);
//入料口下部可放料盘数量
int entranceDownCapacity = getDoorDownCapacity(reelData.getPressHeight(),reelData);
int total = 6 * columnPureSizeCapacity + entranceUpCapacity + entranceDownCapacity;
return total;
}
/**
* 料仓列可用高度,总高-不可用高度(下方电气板) - 压紧轴占用高度
*/
public int getColumnValidHeight(int pressHeight){
return getBoxHeight() - getBoxInvalidHeight() - pressHeight;
}
/**
* 入料口上方可用空间(总高度 - 门高度 - 下方高度 - 压紧高度)
*/
public int getDoorUpValidHeight(int pressHeight){
int columnValidHeight = getBoxHeight() - this.getDoorHeight() -getBoxInvalidHeight() - pressHeight;
return columnValidHeight;
}
/**
* 入料口下方可用空间(下方高度 - 压紧高度)
*/
public int getDoorDownValidHeight(int pressHeight){
int columnValidHeight = getDoorDownHeight()/* - pressHeight*/;
return columnValidHeight;
}
/**
* 整列可放料盘数
*/
public int getColumnPureSizeCapacity(int pressHeight, ReelData reelData){
int columnValidHeight = getColumnValidHeight(pressHeight);
//每一列可放料盘数量
int columnPureSizeCapacity = getColumnPureSizeCapacity(columnValidHeight, reelData.getReelSize(), reelData.getReelSlotHeight(), false);
return columnPureSizeCapacity;
}
/**
* 入料口上方可放料盘数
*/
public int getDoorUpCapacity(int pressHeight, ReelData reelData){
return getColumnPureSizeCapacity(getDoorUpValidHeight(pressHeight),reelData.getReelSize(), reelData.getReelSlotHeight(), false);
}
/**
* 入料口下方可放料盘数
*/
public int getDoorDownCapacity(int pressHeight, ReelData reelData){
return getColumnPureSizeCapacity(this.getDoorDownValidHeight(pressHeight),reelData.getReelSize(), reelData.getReelSlotHeight(), true);
}
/**
* 根据可用空间和料盘尺寸计算料盘容量
* @param reelSize 料盘尺寸
* @param validHeight 可用高度
* @param reelSpaceHeight 单个格子占用高度
* @param isDoorDown 是否是入口下方空间
* @return 容量
*/
private int getColumnPureSizeCapacity(int validHeight, int reelSize, int reelSpaceHeight, boolean isDoorDown){
int countPerColumn = validHeight / reelSpaceHeight;
//如果不是入料口下方,每一列上部可多放一盘
if(!isDoorDown){
if(reelSize == 7 || validHeight % reelSpaceHeight != 0){
//如果有空余可以再放一盘,7寸盘可以多放一盘
countPerColumn = countPerColumn + 1;
}
}
//每个格子可放料盘数,7寸盘为2盘,其他为1
int countPerUnit = 1;
if(reelSize == 7){
countPerUnit = 2;
}
int capacity = countPerColumn * countPerUnit;
return capacity;
}
public int getTotalValidHeight(int pressHeight){
return this.getColumnCount() * getColumnValidHeight(pressHeight) + getDoorUpValidHeight(pressHeight) + this.getDoorDownValidHeight(pressHeight);
}
/**
* 是否有效
* @return
*/
public boolean isValid() {
return !boxName.isEmpty()
&& boxHeight >= 1000
&& boxInvalidHeight >= 100
&& doorHeight >=100
&& doorDownHeight >=100
&& columnCount >= 1;
}
}