Commit a17145c35df80266a71368ab8eb5fa01d6f2b565

Authored by 肖超群
1 parent 416f0a7e

完善出库任务接口

jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
@@ -284,9 +284,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi @@ -284,9 +284,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
284 if(shipmentDetailTaskQty.compareTo(shipmentDetailQty) > 0) { 284 if(shipmentDetailTaskQty.compareTo(shipmentDetailQty) > 0) {
285 return Result.error("配盘时, 出库详情的任务数量不能超过单据数量"); 285 return Result.error("配盘时, 出库详情的任务数量不能超过单据数量");
286 } else if(inventoryDetailTaskQty.compareTo(inventoryDetailQty) == 0) { 286 } else if(inventoryDetailTaskQty.compareTo(inventoryDetailQty) == 0) {
287 - shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); 287 + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAITING_OFF_SHELF);
288 } else if(inventoryDetailTaskQty.compareTo(inventoryDetailQty) < 0) { 288 } else if(inventoryDetailTaskQty.compareTo(inventoryDetailQty) < 0) {
289 - shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_OFF_SHELF); 289 + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAITING_OFF_SHELF);
290 } 290 }
291 shipmentDetail.setTaskQty(shipmentDetailTaskQty); 291 shipmentDetail.setTaskQty(shipmentDetailTaskQty);
292 success = shipmentDetailService.updateById(shipmentDetail); 292 success = shipmentDetailService.updateById(shipmentDetail);
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -26,6 +26,8 @@ import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentCon @@ -26,6 +26,8 @@ import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentCon
26 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; 26 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
27 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; 27 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService;
28 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; 28 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService;
  29 +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
  30 +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
29 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; 31 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService;
30 import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; 32 import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
31 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; 33 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
@@ -89,6 +91,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -89,6 +91,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
89 @Resource 91 @Resource
90 private IShipmentHeaderService shipmentHeaderService; 92 private IShipmentHeaderService shipmentHeaderService;
91 @Resource 93 @Resource
  94 + private IShipmentDetailService shipmentDetailService;
  95 + @Resource
92 private IMaterialService materialService; 96 private IMaterialService materialService;
93 @Resource 97 @Resource
94 private WcsService wcsService; 98 private WcsService wcsService;
@@ -624,6 +628,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -624,6 +628,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
624 if(shipmentContainerDetail == null) { 628 if(shipmentContainerDetail == null) {
625 throw new ServiceException("完成出库任务, 出库任务没有找到出库组盘详情" + taskDetail.getShipmentContainerDetailId()); 629 throw new ServiceException("完成出库任务, 出库任务没有找到出库组盘详情" + taskDetail.getShipmentContainerDetailId());
626 } 630 }
  631 + ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getShipmentDetailId());
  632 + if(shipmentDetail == null) {
  633 + throw new ServiceException("完成出库任务, 出库任务没有找到出库详情" + taskDetail.getShipmentDetailId());
  634 + }
  635 + if(shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) == 0) {
  636 + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED);
  637 + } else if(shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) > 0) {
  638 + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_OFF_SHELF);
  639 + } else if(shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) < 0) {
  640 + throw new ServiceException("完成出库任务时, 出库单 单据数量不能小于配盘数量");
  641 + }
627 InventoryDetail inventoryDetail = 642 InventoryDetail inventoryDetail =
628 inventoryDetailService.getById(taskDetail.getFromInventoryDetailId()); 643 inventoryDetailService.getById(taskDetail.getFromInventoryDetailId());
629 if(inventoryDetail == null) { 644 if(inventoryDetail == null) {