Commit 12b0c522eba4bc5704675aca4fbc71581462796b
1 parent
2552fae6
update
Showing
2 changed files
with
9 additions
and
79 deletions
src/main/java/com/huaheng/pc/config/address/domain/Address.java
... | ... | @@ -44,6 +44,7 @@ public class Address implements Serializable { |
44 | 44 | /** |
45 | 45 | @TableField(value = "param") |
46 | 46 | @ApiModelProperty(value="参数") |
47 | + */ | |
47 | 48 | private String param; |
48 | 49 | |
49 | 50 | /** |
... | ... | @@ -84,4 +85,12 @@ public class Address implements Serializable { |
84 | 85 | public void setUrl(String url) { |
85 | 86 | this.url = url; |
86 | 87 | } |
88 | + | |
89 | + public Integer getArea() { | |
90 | + return area; | |
91 | + } | |
92 | + | |
93 | + public void setArea(Integer area) { | |
94 | + this.area = area; | |
95 | + } | |
87 | 96 | } |
88 | 97 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
7 | 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
8 | 8 | import com.huaheng.api.wcs.domain.WcsTask; |
9 | 9 | import com.huaheng.api.wcs.service.taskAssignService.TaskAssignService; |
10 | -import com.huaheng.api.wcs.service.taskAssignService.TaskAssignServiceImpl; | |
11 | 10 | import com.huaheng.common.constant.HttpConstant; |
12 | 11 | import com.huaheng.common.constant.QuantityConstant; |
13 | 12 | import com.huaheng.common.exception.service.ServiceException; |
... | ... | @@ -18,56 +17,37 @@ import com.huaheng.common.utils.security.ShiroUtils; |
18 | 17 | import com.huaheng.framework.web.domain.AjaxResult; |
19 | 18 | import com.huaheng.framework.web.service.ConfigService; |
20 | 19 | import com.huaheng.pc.config.address.service.AddressService; |
21 | -import com.huaheng.pc.config.configValue.domain.ConfigValue; | |
22 | -import com.huaheng.pc.config.configValue.service.ConfigValueService; | |
23 | -import com.huaheng.pc.config.configWarning.service.ConfigWarningService; | |
24 | 20 | import com.huaheng.pc.config.container.domain.Container; |
25 | 21 | import com.huaheng.pc.config.container.service.ContainerService; |
26 | -import com.huaheng.pc.config.containerCapacity.service.ContainerCapacityService; | |
27 | 22 | import com.huaheng.pc.config.cycleCountPreference.domain.CycleCountPreference; |
28 | 23 | import com.huaheng.pc.config.cycleCountPreference.service.CycleCountPreferenceService; |
29 | 24 | import com.huaheng.pc.config.location.domain.Location; |
30 | 25 | import com.huaheng.pc.config.location.service.LocationService; |
31 | 26 | import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; |
32 | 27 | import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService; |
33 | -import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderService; | |
34 | 28 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
35 | 29 | import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; |
36 | 30 | import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader; |
37 | 31 | import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; |
38 | -import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService; | |
39 | 32 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; |
40 | 33 | import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; |
41 | 34 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; |
42 | 35 | import com.huaheng.pc.receipt.receiptContainerHeader.service.ReceiptContainerHeaderService; |
43 | -import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService; | |
44 | -import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService; | |
45 | 36 | import com.huaheng.pc.receipt.receiving.service.ReceivingService; |
46 | -import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; | |
47 | 37 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
48 | 38 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; |
49 | -import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; | |
50 | -import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; | |
51 | 39 | import com.huaheng.pc.task.taskDetail.domain.TaskDetail; |
52 | 40 | import com.huaheng.pc.task.taskDetail.service.TaskDetailService; |
53 | 41 | import com.huaheng.pc.task.taskHeader.domain.MobileTask; |
54 | 42 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
55 | 43 | import com.huaheng.pc.task.taskHeader.mapper.TaskHeaderMapper; |
56 | -import org.apache.http.client.HttpClient; | |
57 | -import org.apache.http.client.methods.HttpPost; | |
58 | -import org.apache.http.entity.StringEntity; | |
59 | -import org.apache.http.impl.client.BasicResponseHandler; | |
60 | -import org.apache.http.impl.client.DefaultHttpClient; | |
61 | 44 | import org.springframework.beans.factory.annotation.Autowired; |
62 | 45 | import org.springframework.stereotype.Service; |
63 | 46 | import org.springframework.transaction.annotation.Transactional; |
64 | 47 | |
65 | 48 | import javax.annotation.Resource; |
66 | -import java.io.IOException; | |
67 | -import java.io.UnsupportedEncodingException; | |
68 | 49 | import java.math.BigDecimal; |
69 | 50 | import java.util.*; |
70 | -import java.util.concurrent.CopyOnWriteArrayList; | |
71 | 51 | import java.util.stream.Collectors; |
72 | 52 | |
73 | 53 | @Service |
... | ... | @@ -117,7 +97,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
117 | 97 | private ConfigService configService; |
118 | 98 | |
119 | 99 | |
120 | - | |
121 | 100 | @Override |
122 | 101 | public List<TaskHeader> getTasksStatus(Short lastStatus) { |
123 | 102 | return taskHeaderMapper.getTasksStatus(lastStatus); |
... | ... | @@ -143,7 +122,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
143 | 122 | public List<TaskHeader> preferenceRealize(List<TaskHeader> taskHeaderList) { |
144 | 123 | //盘点任务头,默认不显示库位,容器。 |
145 | 124 | List<TaskHeader> taskHeaders = new ArrayList<>(); |
146 | - for (TaskHeader item:taskHeaderList){ | |
147 | 125 | for (TaskHeader item : taskHeaderList) { |
148 | 126 | //盘点明细 |
149 | 127 | CycleCountDetail cycleCountDetailtemp = new CycleCountDetail(); |
... | ... | @@ -152,7 +130,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
152 | 130 | cycleCountDetailtemp.setId(item.getAllocationHeadId()); //明细ID |
153 | 131 | LambdaQueryWrapper<CycleCountDetail> detailLambdaQueryWrapper = Wrappers.lambdaQuery(cycleCountDetailtemp); |
154 | 132 | CycleCountDetail cycleCountDetail = cycleCountDetailService.getOne(detailLambdaQueryWrapper); |
155 | - if(StringUtils.isNull(cycleCountDetail)){ | |
156 | 133 | if (StringUtils.isNull(cycleCountDetail)) { |
157 | 134 | throw new SecurityException("没有找到子任务对应的盘点明细!"); |
158 | 135 | } |
... | ... | @@ -162,18 +139,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
162 | 139 | cycleCountPreferenceTemp.setWarehouseCode(cycleCountDetail.getWarehouseCode()); |
163 | 140 | LambdaQueryWrapper<CycleCountPreference> preferenceLambdaQueryWrapper = Wrappers.lambdaQuery(cycleCountPreferenceTemp); |
164 | 141 | CycleCountPreference cycleCountPreference = cycleCountPreferenceService.getOne(preferenceLambdaQueryWrapper); |
165 | - if(StringUtils.isNull(cycleCountPreference)){ | |
166 | 142 | if (StringUtils.isNull(cycleCountPreference)) { |
167 | 143 | throw new SecurityException("没有找到盘点首选项!"); |
168 | 144 | } |
169 | 145 | //根据首选项判断数据 |
170 | - if(!cycleCountPreference.getPromptLocation()){ | |
171 | 146 | if (!cycleCountPreference.getPromptLocation()) { |
172 | 147 | //库位 |
173 | 148 | item.setFromLocation(""); |
174 | 149 | item.setToLocation(""); |
175 | 150 | } |
176 | - if(!cycleCountPreference.getPromptLpn()){ | |
177 | 151 | if (!cycleCountPreference.getPromptLpn()) { |
178 | 152 | //容器 |
179 | 153 | item.setContainerCode(""); |
... | ... | @@ -205,7 +179,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
205 | 179 | LambdaQueryWrapper<TaskDetail> td = Wrappers.lambdaQuery(taskDetail1); |
206 | 180 | List<TaskDetail> taskDetailList = taskDetailService.list(td); |
207 | 181 | TaskDetail taskDetail = null; |
208 | - if(taskDetailList != null && taskDetailList.size() > 0) { | |
209 | 182 | if (taskDetailList != null && taskDetailList.size() > 0) { |
210 | 183 | taskDetail = taskDetailList.get(0); |
211 | 184 | if (taskDetail == null) { |
... | ... | @@ -250,7 +223,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
250 | 223 | LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
251 | 224 | receiptContainerDetailLambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId()); |
252 | 225 | List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.list(receiptContainerDetailLambdaQueryWrapper); |
253 | - for(ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) { | |
254 | 226 | for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) { |
255 | 227 | LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper1 = Wrappers.lambdaQuery(); |
256 | 228 | receiptContainerDetailLambdaQueryWrapper1.eq(ReceiptContainerDetail::getId, receiptContainerDetail.getId()); |
... | ... | @@ -303,8 +275,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
303 | 275 | InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); |
304 | 276 | Container container = new Container(); |
305 | 277 | container.setStatus(QuantityConstant.STATUS_CONTAINER_EMPTY); |
306 | - if(inventoryHeader != null) { | |
307 | - if(QuantityConstant.STATUS_CONTAINER_SOME.equals(inventoryHeader.getContainerStatus())) { | |
308 | 278 | if (inventoryHeader != null) { |
309 | 279 | if (QuantityConstant.STATUS_CONTAINER_SOME.equals(inventoryHeader.getContainerStatus())) { |
310 | 280 | container.setStatus(QuantityConstant.STATUS_CONTAINER_SOME); |
... | ... | @@ -333,7 +303,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
333 | 303 | |
334 | 304 | String value = configService.getKey(QuantityConstant.RULE_CONNECT_WCS); |
335 | 305 | int connectWCS = Integer.parseInt(value); |
336 | - if(connectWCS == QuantityConstant.RULE_WCS_CONNECT) { | |
337 | 306 | if (connectWCS == QuantityConstant.RULE_WCS_CONNECT) { |
338 | 307 | // 给wcs传递任务 |
339 | 308 | AjaxResult ajaxResult = taskAssignService.wcsTaskAssign(task); |
... | ... | @@ -364,7 +333,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
364 | 333 | cycleCountDetailService.updataDetailStatus(item.getBillDetailId(), QuantityConstant.CYCLECOUNT_STATUS_EXECUTING); |
365 | 334 | } |
366 | 335 | } |
367 | - if(taskDetails != null && taskDetails.size() > 0) { | |
368 | 336 | if (taskDetails != null && taskDetails.size() > 0) { |
369 | 337 | if (!taskDetailService.saveOrUpdateBatch(taskDetails)) { |
370 | 338 | throw new ServiceException("更新任务明细失败"); |
... | ... | @@ -380,7 +348,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
380 | 348 | @Override |
381 | 349 | @Transactional(rollbackFor = Exception.class) |
382 | 350 | public AjaxResult completeTaskByWMS(Integer[] taskIds, String[] weightConvert) { |
383 | - for (int i = 0;i<taskIds.length;i++) { | |
384 | 351 | for (int i = 0; i < taskIds.length; i++) { |
385 | 352 | TaskHeader task = taskHeaderService.getById(taskIds[i]); |
386 | 353 | |
... | ... | @@ -400,13 +367,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
400 | 367 | } |
401 | 368 | //整盘入库,空托入库库位自动分配 |
402 | 369 | //整盘入库手动完成分配库位,已分配则略过 |
403 | - if(task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)){ | |
404 | - if(StringUtils.isEmpty(task.getToLocation())){ | |
405 | 370 | if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)) { |
406 | 371 | if (StringUtils.isEmpty(task.getToLocation())) { |
407 | 372 | //自动分配库位 |
408 | - AjaxResult ajaxResult = this.setLocationCode(task.getId(),0 ); | |
409 | - task.setToLocation((String)ajaxResult.getData()); | |
410 | 373 | AjaxResult ajaxResult = this.setLocationCode(task.getId(), 0); |
411 | 374 | task.setToLocation((String) ajaxResult.getData()); |
412 | 375 | } |
... | ... | @@ -429,7 +392,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
429 | 392 | public void completeTask(TaskHeader task) { |
430 | 393 | int taskType = task.getTaskType().intValue(); |
431 | 394 | //区分任务类型 |
432 | - switch(taskType) { | |
433 | 395 | switch (taskType) { |
434 | 396 | //整盘入库、补充入库 |
435 | 397 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: |
... | ... | @@ -481,15 +443,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
481 | 443 | List<TaskHeader> list = this.list(taskQueryWrapper); |
482 | 444 | if (list.isEmpty()) { |
483 | 445 | throw new ServiceException("库位(" + locationCode + ")没有任务!"); |
484 | - } else if(list.get(0).getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { | |
485 | 446 | } else if (list.get(0).getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { |
486 | 447 | //如果已完成则不管 |
487 | 448 | throw new ServiceException("库位(" + locationCode + ")任务已经完成!"); |
488 | 449 | } |
489 | 450 | TaskHeader taskHeader = list.get(0); |
490 | 451 | int taskType = taskHeader.getTaskType().intValue(); |
491 | - if(taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT | |
492 | - || taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT){ | |
493 | 452 | if (taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT |
494 | 453 | || taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { |
495 | 454 | //入库任务 |
... | ... | @@ -510,7 +469,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
510 | 469 | if (receiptContainerHeaderList.isEmpty()) { |
511 | 470 | throw new ServiceException("该容器没有任务!"); |
512 | 471 | } |
513 | - if (receiptContainerHeaderList.size() > 1){ | |
514 | 472 | if (receiptContainerHeaderList.size() > 1) { |
515 | 473 | throw new ServiceException("该容器存在多条任务"); |
516 | 474 | } |
... | ... | @@ -521,7 +479,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
521 | 479 | lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeaderList.get(0).getId()); |
522 | 480 | List<ReceiptContainerDetail> containerDetailList = receiptContainerDetailService.list(lambdaQueryWrapper); |
523 | 481 | ReceiptContainerHeader containerHeader = receiptContainerHeaderList.get(0); |
524 | - if (containerDetailList.isEmpty()){ | |
525 | 482 | if (containerDetailList.isEmpty()) { |
526 | 483 | throw new ServiceException("没有组盘明细,请先组盘!"); |
527 | 484 | } |
... | ... | @@ -600,12 +557,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
600 | 557 | } |
601 | 558 | if (receiptContainerHeader.getStatus() == QuantityConstant.RECEIPT_HEADER_BUILD.shortValue()) { |
602 | 559 | String ids = String.valueOf(receiptContainerHeader.getId()); |
603 | - if (StringUtils.isEmpty(ids)){ | |
604 | 560 | if (StringUtils.isEmpty(ids)) { |
605 | 561 | return AjaxResult.error("id不能为空"); |
606 | 562 | } |
607 | 563 | List<Integer> idList = Arrays.asList(Convert.toIntArray(ids)); |
608 | - if (StringUtils.isEmpty(ids)){ | |
609 | 564 | if (StringUtils.isEmpty(ids)) { |
610 | 565 | return AjaxResult.error("id不能为空"); |
611 | 566 | } |
... | ... | @@ -622,8 +577,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
622 | 577 | } |
623 | 578 | |
624 | 579 | |
625 | - | |
626 | - | |
627 | 580 | @Transactional(rollbackFor = Exception.class) |
628 | 581 | public void combineInventory(TaskHeader task) { |
629 | 582 | LambdaQueryWrapper<InventoryHeader> inventoryHeaderErapper = Wrappers.lambdaQuery(); |
... | ... | @@ -631,20 +584,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
631 | 584 | .eq(InventoryHeader::getLocationCode, task.getToLocation()) |
632 | 585 | .eq(InventoryHeader::getContainerCode, task.getContainerCode()); |
633 | 586 | InventoryHeader header = inventoryHeaderService.getOne(inventoryHeaderErapper); |
634 | - if(header != null) { | |
635 | 587 | if (header != null) { |
636 | 588 | LambdaQueryWrapper<InventoryDetail> inventory = Wrappers.lambdaQuery(); |
637 | 589 | inventory.eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
638 | 590 | .eq(InventoryDetail::getLocationCode, task.getToLocation()) |
639 | 591 | .eq(InventoryDetail::getContainerCode, task.getContainerCode()); |
640 | 592 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventory); |
641 | - for(int i=0; i < inventoryDetailList.size() -1; i++) { | |
642 | - for(int j = inventoryDetailList.size() - 1; j > i; j--) { | |
643 | 593 | for (int i = 0; i < inventoryDetailList.size() - 1; i++) { |
644 | 594 | for (int j = inventoryDetailList.size() - 1; j > i; j--) { |
645 | 595 | InventoryDetail inventoryDetail = inventoryDetailList.get(i); |
646 | 596 | InventoryDetail inventoryDetail2 = inventoryDetailList.get(j); |
647 | - if(inventoryDetail.getMaterialCode().equals(inventoryDetail2.getMaterialCode()) | |
648 | 597 | if (inventoryDetail.getMaterialCode().equals(inventoryDetail2.getMaterialCode()) |
649 | 598 | && inventoryDetail.getBatch().equals(inventoryDetail2.getBatch()) |
650 | 599 | && inventoryDetail.getLot().equals(inventoryDetail2.getLot()) |
... | ... | @@ -663,7 +612,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
663 | 612 | } |
664 | 613 | BigDecimal totalQty = new BigDecimal(0); |
665 | 614 | int totalLines = 0; |
666 | - for(InventoryDetail inventoryDetail : inventoryDetailList) { | |
667 | 615 | for (InventoryDetail inventoryDetail : inventoryDetailList) { |
668 | 616 | totalQty = totalQty.add(inventoryDetail.getQty()); |
669 | 617 | totalLines++; |
... | ... | @@ -706,16 +654,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
706 | 654 | |
707 | 655 | /** |
708 | 656 | * 自动空托出库 |
709 | - * */ | |
710 | 657 | */ |
711 | 658 | @Override |
712 | 659 | @Transactional(rollbackFor = Exception.class) |
713 | - public AjaxResult createAutoEmptyOut(String warehouseCode){ | |
714 | 660 | public AjaxResult createAutoEmptyOut(String warehouseCode) { |
715 | 661 | /*先查询容器表,选中空托盘,再查询库存核实*/ |
716 | 662 | //该容器中有库位信息,并且状态是空 |
717 | 663 | List<Location> locationsList = locationService.selectContainerEmpty(warehouseCode); |
718 | - if(locationsList.size() == 0){ | |
719 | 664 | if (locationsList.size() == 0) { |
720 | 665 | throw new ServiceException("立库中没有空容器!"); |
721 | 666 | } |
... | ... | @@ -727,20 +672,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
727 | 672 | containerTmp.setCode(location.getContainerCode()); |
728 | 673 | LambdaQueryWrapper<Container> containerLambda = Wrappers.lambdaQuery(containerTmp); |
729 | 674 | Container container = containerService.getOne(containerLambda); |
730 | - if(container == null){ | |
731 | 675 | if (container == null) { |
732 | 676 | throw new ServiceException("选中的库位容器错误,请确认库位和容器!"); |
733 | 677 | } |
734 | 678 | //生成空容器出库任务 |
735 | 679 | inventoryHeaderService.createEmptyOut(container.getCode(), location.getCode()); |
736 | - return AjaxResult.success("空容器出库任务已下发!",container.getCode()); | |
737 | 680 | return AjaxResult.success("空容器出库任务已下发!", container.getCode()); |
738 | 681 | } |
739 | 682 | |
740 | 683 | /** |
741 | 684 | * 自动分配库位 |
742 | - * @param taskId 任务号 | |
743 | - * @param high 1是高库位,否则低库位 | |
744 | 685 | * |
745 | 686 | * @param taskId 任务号 |
746 | 687 | * @param high 1是高库位,否则低库位 |
... | ... | @@ -748,11 +689,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
748 | 689 | */ |
749 | 690 | @Override |
750 | 691 | @Transactional(rollbackFor = Exception.class) |
751 | - public AjaxResult setLocationCode(Integer taskId, Integer high) { | |
752 | 692 | public AjaxResult setLocationCode(Integer taskId, Integer high) { |
753 | 693 | TaskHeader taskHeader = this.getById(taskId); |
754 | 694 | if (taskHeader == null) { |
755 | - throw new ServiceException("找不到id为"+ taskId +"的任务!"); | |
756 | 695 | throw new ServiceException("找不到id为" + taskId + "的任务!"); |
757 | 696 | } |
758 | 697 | if (StringUtils.isNotEmpty(taskHeader.getToLocation())) { |
... | ... | @@ -760,10 +699,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
760 | 699 | } |
761 | 700 | |
762 | 701 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); |
763 | - locationLambdaQueryWrapper.eq(Location::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
764 | - .eq(Location::getContainerCode,"") | |
765 | - .eq(Location::getStatus,QuantityConstant.STATUS_LOCATION_EMPTY) | |
766 | - .eq(Location::getDeleted,false); | |
767 | 702 | locationLambdaQueryWrapper.eq(Location::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
768 | 703 | .eq(Location::getContainerCode, "") |
769 | 704 | .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) |
... | ... | @@ -784,7 +719,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
784 | 719 | //给组盘分配库位 |
785 | 720 | |
786 | 721 | int internalTaskType = taskHeader.getInternalTaskType(); |
787 | - if(internalTaskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT || internalTaskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { | |
788 | 722 | if (internalTaskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT || internalTaskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { |
789 | 723 | ReceiptContainerHeader receiptContainerHeader = new ReceiptContainerHeader(); |
790 | 724 | receiptContainerHeader.setId(taskHeader.getAllocationHeadId()); |
... | ... | @@ -797,8 +731,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
797 | 731 | condition.setTaskId(taskHeader.getId()); |
798 | 732 | LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(condition); |
799 | 733 | List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper); |
800 | - if(taskDetailList != null && taskDetailList.size() > 0) { | |
801 | - for(TaskDetail taskDetail : taskDetailList) { | |
802 | 734 | if (taskDetailList != null && taskDetailList.size() > 0) { |
803 | 735 | for (TaskDetail taskDetail : taskDetailList) { |
804 | 736 | if (taskDetail != null) { |
... | ... | @@ -812,7 +744,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
812 | 744 | taskHeader.setToLocation(location.getCode()); |
813 | 745 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(taskHeader); |
814 | 746 | this.update(taskHeader, taskHeaderLambdaQueryWrapper); |
815 | - return AjaxResult.success("生成库位成功",location.getCode()); | |
816 | 747 | return AjaxResult.success("生成库位成功", location.getCode()); |
817 | 748 | |
818 | 749 | } |
... | ... | @@ -820,24 +751,19 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
820 | 751 | @Override |
821 | 752 | public int getUncompleteTaskInNear(Location location) { |
822 | 753 | Location location1 = locationService.getNear(location); |
823 | - if(location1 == null) { | |
824 | - return 0; | |
825 | 754 | if (location1 == null) { |
826 | 755 | return 0; |
827 | 756 | } |
828 | 757 | String locationCode = location1.getCode(); |
829 | 758 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
830 | 759 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getToLocation, locationCode) |
831 | - .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED); | |
832 | 760 | .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED); |
833 | 761 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
834 | - if(taskHeaderList == null || taskHeaderList.size() == 0) { | |
835 | 762 | if (taskHeaderList == null || taskHeaderList.size() == 0) { |
836 | 763 | taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
837 | 764 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getFromLocation, locationCode) |
838 | 765 | .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED); |
839 | 766 | taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
840 | - if(taskHeaderList == null || taskHeaderList.size() == 0) { | |
841 | 767 | if (taskHeaderList == null || taskHeaderList.size() == 0) { |
842 | 768 | return 0; |
843 | 769 | } |
... | ... | @@ -846,18 +772,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
846 | 772 | } |
847 | 773 | |
848 | 774 | @Override |
849 | - public List<TaskHeader> remoteList(){ | |
850 | 775 | public List<TaskHeader> remoteList() { |
851 | 776 | LambdaQueryWrapper<TaskHeader> wrapper = Wrappers.lambdaQuery(); |
852 | - wrapper.ge(TaskHeader::getStatus,QuantityConstant.TASK_STATUS_RELEASE) | |
853 | - .lt(TaskHeader::getStatus,QuantityConstant.TASK_STATUS_COMPLETED); | |
854 | 777 | wrapper.ge(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_RELEASE) |
855 | 778 | .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED); |
856 | 779 | return list(wrapper); |
857 | 780 | } |
858 | 781 | |
859 | - | |
860 | - | |
861 | 782 | @Override |
862 | 783 | public List<TaskHeader> getUnCompleteTaskList() { |
863 | 784 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
... | ... |