Commit f5f205cec6a7852ca39f1b1f8d4e04af8b37d1d7
1 parent
9b10c6af
限制移库任务只能在同巷道里进行
Showing
3 changed files
with
41 additions
and
14 deletions
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -178,9 +178,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
178 | 178 | taskDetail1.setCompanyCode(taskHeader.getCompanyCode()); |
179 | 179 | LambdaQueryWrapper<TaskDetail> td = Wrappers.lambdaQuery(taskDetail1); |
180 | 180 | List<TaskDetail> taskDetailList = taskDetailService.list(td); |
181 | - TaskDetail taskDetail = taskDetailList.get(0); | |
182 | - if (taskDetail == null) { | |
183 | - throw new ServiceException("任务明细条目错误"); | |
181 | + TaskDetail taskDetail = null; | |
182 | + if(taskDetailList != null && taskDetailList.size() > 0) { | |
183 | + taskDetail = taskDetailList.get(0); | |
184 | + if (taskDetail == null) { | |
185 | + throw new ServiceException("任务明细条目错误"); | |
186 | + } | |
184 | 187 | } |
185 | 188 | //删除子任务 |
186 | 189 | LambdaQueryWrapper<TaskDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
... | ... | @@ -231,6 +234,20 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
231 | 234 | //更新托盘、库位状态 |
232 | 235 | locationService.updateStatus(taskHeader.getToLocation(), "empty"); |
233 | 236 | } |
237 | + LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
238 | + inventoryHeaderLambdaQueryWrapper.eq(InventoryHeader::getContainerCode, taskHeader.getContainerCode()); | |
239 | + InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
240 | + Container container = new Container(); | |
241 | + container.setStatus("empty"); | |
242 | + if(inventoryHeader != null) { | |
243 | + if("some".equals(inventoryHeader.getContainerStatus())) { | |
244 | + container.setStatus("some"); | |
245 | + } | |
246 | + } | |
247 | + container.setLocationCode(taskHeader.getFromLocation()); | |
248 | + LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
249 | + containerUpdateWrapper.eq(Container::getCode, taskHeader.getContainerCode()); | |
250 | + containerService.update(container, containerUpdateWrapper); | |
234 | 251 | } |
235 | 252 | if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_WORK)) { |
236 | 253 | if (taskHeader.getFromLocation() != null) { |
... | ... | @@ -260,17 +277,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
260 | 277 | if (StringUtils.isNotEmpty(taskHeader.getToLocation())) { |
261 | 278 | //更新托盘、库位状态 |
262 | 279 | locationService.updateStatus(taskHeader.getToLocation(), "empty"); |
263 | - if(taskHeader.getTaskType().equals(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT)) { | |
264 | - LambdaQueryWrapper<ReceiptContainerHeader> lambda = Wrappers.lambdaQuery(); | |
265 | - lambda.eq(ReceiptContainerHeader::getContainerCode, taskHeader.getContainerCode()) | |
266 | - .ne(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_FINISHED) | |
267 | - .eq(ReceiptContainerHeader::getWarehouseCode, ShiroUtils.getWarehouseCode()); | |
268 | - ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getOne(lambda); | |
269 | - receiptContainerHeader.setToLocation(""); | |
270 | - receiptContainerHeaderService.update(receiptContainerHeader, lambda); | |
280 | + LambdaQueryWrapper<ReceiptContainerHeader> lambda = Wrappers.lambdaQuery(); | |
281 | + lambda.eq(ReceiptContainerHeader::getContainerCode, taskHeader.getContainerCode()) | |
282 | + .ne(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_FINISHED) | |
283 | + .eq(ReceiptContainerHeader::getWarehouseCode, ShiroUtils.getWarehouseCode()); | |
284 | + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getOne(lambda); | |
285 | + receiptContainerHeader.setToLocation(""); | |
286 | + receiptContainerHeaderService.update(receiptContainerHeader, lambda); | |
287 | + LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
288 | + receiptContainerDetailLambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId()); | |
289 | + List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.list(receiptContainerDetailLambdaQueryWrapper); | |
290 | + for(ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) { | |
291 | + LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper1 = Wrappers.lambdaQuery(); | |
292 | + receiptContainerDetailLambdaQueryWrapper1.eq(ReceiptContainerDetail::getId, receiptContainerDetail.getId()); | |
293 | + receiptContainerDetail.setLocationCode(""); | |
294 | + receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaQueryWrapper1); | |
271 | 295 | } |
272 | 296 | } |
273 | - if (taskHeader.getFromLocation() != null) { | |
297 | + if (StringUtils.isNotEmpty(taskHeader.getFromLocation())) { | |
274 | 298 | //更新托盘、库位状态 |
275 | 299 | locationService.updateStatus(taskHeader.getFromLocation(), "empty"); |
276 | 300 | } |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TransferTaskService.java
... | ... | @@ -94,6 +94,9 @@ public class TransferTaskService { |
94 | 94 | if (taskHeaderService.getUncompleteTaskInNear(desLocation) > 0) { |
95 | 95 | return AjaxResult.error("目标库位:" + desLocationCode + "旁边存在任务,请完成任务以后再分配"); |
96 | 96 | } |
97 | + if(!sourceLocation.getRoadway().equals(desLocation.getRoadway())) { | |
98 | + return AjaxResult.error("目标库位和源库位不在同一个巷道"); | |
99 | + } | |
97 | 100 | |
98 | 101 | if(sourceLocation.getRowFlag() == 1) { |
99 | 102 | Location location1 = locationService.getNear(sourceLocation); //内侧库位 |
... | ... |
src/main/resources/templates/monitor/locationstatus/locationstatus.html
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | <ul id="select_info"> |
53 | 53 | <li> |
54 | 54 | <select id="locationType" name="locationType" style="width: 100px"> |
55 | - <option value="L" selected>立库库位</option> | |
55 | + <option value="A" selected>立库库位</option> | |
56 | 56 | <option value="Q">钱柜库位</option> |
57 | 57 | <option value="PK">平面库位</option> |
58 | 58 | </select> |
... | ... | @@ -175,7 +175,7 @@ |
175 | 175 | var grid_num_11=0; |
176 | 176 | var grid_num_12=0; |
177 | 177 | $(function() { |
178 | - resetAjax("L"); | |
178 | + resetAjax("A"); | |
179 | 179 | |
180 | 180 | //库位类型和行列层选择 |
181 | 181 | $("#editable-select").change(function () { |
... | ... |