Commit daeab66cfaa84fb6cad6d2365e7f5d8ee409a20d

Authored by 肖超群
1 parent 02bfde48

自动出库只能适配立库

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 19 import org.jeecg.modules.wms.config.port.service.IPortService;
20 20 import org.jeecg.modules.wms.config.shipmentType.entity.ShipmentType;
21 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 24 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
23 25 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
24 26 import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService;
... ... @@ -102,6 +104,8 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper,
102 104 private IHuahengMultiHandlerService huahengMultiHandlerService;
103 105 @Resource
104 106 private IPortService portService;
  107 + @Resource
  108 + private IZoneService zoneService;
105 109  
106 110 @Override
107 111 @Transactional
... ... @@ -366,14 +370,29 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper,
366 370 // if (type == QuantityConstant.PORT_TYPE_IN) {
367 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 373 ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode);
374 374 if (shipmentHeader == null) {
375 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 396 List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentCode);
378 397 if (shipmentContainerDetailList == null) {
379 398 throw new JeecgBootException("自动出库, 没有找到出库配盘详情");
... ... @@ -389,7 +408,6 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
389 408 if (shipmentContainerHeader == null) {
390 409 throw new JeecgBootException("自动出库, 没有找到出库表头:" + shipmentContainerId);
391 410 }
392   - String zoneCode = shipmentHeader.getZoneCode();
393 411 int taskType = shipmentContainerHeader.getTaskType();
394 412 int type = QuantityConstant.PORT_TYPE_PICK;
395 413 if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) {
... ...