Commit daeab66cfaa84fb6cad6d2365e7f5d8ee409a20d
1 parent
02bfde48
自动出库只能适配立库
Showing
1 changed file
with
23 additions
and
5 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
@@ -19,6 +19,8 @@ import org.jeecg.modules.wms.config.port.entity.Port; | @@ -19,6 +19,8 @@ import org.jeecg.modules.wms.config.port.entity.Port; | ||
19 | import org.jeecg.modules.wms.config.port.service.IPortService; | 19 | import org.jeecg.modules.wms.config.port.service.IPortService; |
20 | import org.jeecg.modules.wms.config.shipmentType.entity.ShipmentType; | 20 | import org.jeecg.modules.wms.config.shipmentType.entity.ShipmentType; |
21 | import org.jeecg.modules.wms.config.shipmentType.service.IShipmentTypeService; | 21 | import org.jeecg.modules.wms.config.shipmentType.service.IShipmentTypeService; |
22 | +import org.jeecg.modules.wms.config.zone.entity.Zone; | ||
23 | +import org.jeecg.modules.wms.config.zone.service.IZoneService; | ||
22 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; | 24 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
23 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 25 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
24 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; | 26 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; |
@@ -102,6 +104,8 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | @@ -102,6 +104,8 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | ||
102 | private IHuahengMultiHandlerService huahengMultiHandlerService; | 104 | private IHuahengMultiHandlerService huahengMultiHandlerService; |
103 | @Resource | 105 | @Resource |
104 | private IPortService portService; | 106 | private IPortService portService; |
107 | + @Resource | ||
108 | + private IZoneService zoneService; | ||
105 | 109 | ||
106 | @Override | 110 | @Override |
107 | @Transactional | 111 | @Transactional |
@@ -366,14 +370,29 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | @@ -366,14 +370,29 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | ||
366 | // if (type == QuantityConstant.PORT_TYPE_IN) { | 370 | // if (type == QuantityConstant.PORT_TYPE_IN) { |
367 | // return Result.error("自动出库, 不能选择入库口来出库"); | 371 | // return Result.error("自动出库, 不能选择入库口来出库"); |
368 | // } | 372 | // } |
369 | - Result result = shipmentCombinationService.autoCombination(shipmentCode, warehouseCode); | ||
370 | - if (!result.isSuccess()) { | ||
371 | - throw new JeecgBootException("自动出库," + result.getMessage()); | ||
372 | - } | ||
373 | ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode); | 373 | ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode); |
374 | if (shipmentHeader == null) { | 374 | if (shipmentHeader == null) { |
375 | throw new JeecgBootException("自动出库, 没有找到出库单"); | 375 | throw new JeecgBootException("自动出库, 没有找到出库单"); |
376 | } | 376 | } |
377 | + String zoneCode = shipmentHeader.getZoneCode(); | ||
378 | + if (StringUtils.isEmpty(zoneCode)) { | ||
379 | + throw new JeecgBootException("自动出库, 库区编码为空"); | ||
380 | + } | ||
381 | + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | ||
382 | + if (zone == null) { | ||
383 | + throw new JeecgBootException("自动出库, 库区为空"); | ||
384 | + } | ||
385 | + String zoneType = zone.getType(); | ||
386 | + if (StringUtils.isEmpty(zoneType)) { | ||
387 | + throw new JeecgBootException("自动出库, 库区类型编码为空"); | ||
388 | + } | ||
389 | + if (!zoneType.equals(QuantityConstant.ZONE_TYPE_STEREOSCOPIC)) { | ||
390 | + throw new JeecgBootException("自动出库, 库区类型必须为立库区类型"); | ||
391 | + } | ||
392 | + Result result = shipmentCombinationService.autoCombination(shipmentCode, warehouseCode); | ||
393 | + if (!result.isSuccess()) { | ||
394 | + throw new JeecgBootException("自动出库," + result.getMessage()); | ||
395 | + } | ||
377 | List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentCode); | 396 | List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentCode); |
378 | if (shipmentContainerDetailList == null) { | 397 | if (shipmentContainerDetailList == null) { |
379 | throw new JeecgBootException("自动出库, 没有找到出库配盘详情"); | 398 | throw new JeecgBootException("自动出库, 没有找到出库配盘详情"); |
@@ -389,7 +408,6 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | @@ -389,7 +408,6 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | ||
389 | if (shipmentContainerHeader == null) { | 408 | if (shipmentContainerHeader == null) { |
390 | throw new JeecgBootException("自动出库, 没有找到出库表头:" + shipmentContainerId); | 409 | throw new JeecgBootException("自动出库, 没有找到出库表头:" + shipmentContainerId); |
391 | } | 410 | } |
392 | - String zoneCode = shipmentHeader.getZoneCode(); | ||
393 | int taskType = shipmentContainerHeader.getTaskType(); | 411 | int taskType = shipmentContainerHeader.getTaskType(); |
394 | int type = QuantityConstant.PORT_TYPE_PICK; | 412 | int type = QuantityConstant.PORT_TYPE_PICK; |
395 | if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) { | 413 | if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) { |