|
|
@@ -181,27 +181,28 @@ public class OutServiceImpl implements OutService {
|
|
181
|
181
|
int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
|
|
182
|
182
|
int min = listStore.get(0).getLayer();
|
|
183
|
183
|
int max = listStore.get(listStore.size() - 1).getLayer();
|
|
184
|
|
- if (currentLayer != max) {
|
|
185
|
|
- throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
|
|
186
|
|
- // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须选择最上层出库!");
|
|
187
|
|
- } else if (!WareTools.checkOrder(listStore)) {
|
|
188
|
|
- throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
|
|
189
|
|
- // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据移动!");
|
|
190
|
|
- } else {
|
|
191
|
|
- for (int i = 0; i < listStore.size(); i++) {
|
|
192
|
|
- OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
|
|
193
|
|
- num += outRecordMapper.insert(outRecord);
|
|
|
184
|
+// if (currentLayer != max) {
|
|
|
185
|
+// throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
|
|
|
186
|
+// // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须选择最上层出库!");
|
|
|
187
|
+// } else if (!WareTools.checkOrder(listStore)) {
|
|
|
188
|
+// throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
|
|
|
189
|
+// // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据移动!");
|
|
|
190
|
+// } else {
|
|
|
191
|
+//
|
|
|
192
|
+// }
|
|
|
193
|
+ for (int i = 0; i < listStore.size(); i++) {
|
|
|
194
|
+ OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
|
|
|
195
|
+ num += outRecordMapper.insert(outRecord);
|
|
194
|
196
|
|
|
195
|
|
- AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
|
|
196
|
|
- num += accountDetailMapper.insert(accountDetail);
|
|
|
197
|
+ AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
|
|
|
198
|
+ num += accountDetailMapper.insert(accountDetail);
|
|
197
|
199
|
|
|
198
|
|
- listStore.get(i).setOutId(outRecord.getId());
|
|
199
|
|
- listStore.get(i).setOutFlag("1");
|
|
200
|
|
- num += storeMapper.updateByPrimaryKey(listStore.get(i));
|
|
|
200
|
+ listStore.get(i).setOutId(outRecord.getId());
|
|
|
201
|
+ listStore.get(i).setOutFlag("1");
|
|
|
202
|
+ num += storeMapper.updateByPrimaryKey(listStore.get(i));
|
|
201
|
203
|
|
|
202
|
|
- }
|
|
203
|
|
- result = Tools.moreThanZeroResultJSON(num);
|
|
204
|
204
|
}
|
|
|
205
|
+ result = Tools.moreThanZeroResultJSON(num);
|
|
205
|
206
|
}
|
|
206
|
207
|
}
|
|
207
|
208
|
return result;
|