From 68d35f850f161b4395cdee365ae162cdf1c47a53 Mon Sep 17 00:00:00 2001
From: pengyongcheng <pyc_1215@163.com>
Date: Sat, 25 May 2024 14:39:33 +0800
Subject: [PATCH] fix: 仓位分配BUG修复

---
 src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
index 00f44bd..6817626 100644
--- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
+++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
@@ -132,12 +132,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
         String area = wcsTask.getArea();
         String locationCode = null;
         String height =  wcsTask.getHeight();
-        if("1".equals(height)){
-            height = QuantityConstant.LOCATION_HEIGHT_LOW;
-        }
-        String width =  wcsTask.getWidth();
-        String weight =  wcsTask.getWeight();
-        String length =  wcsTask.getLength();
+        //String length =  wcsTask.getLength();
         if(height == null) {
             return AjaxResult.error("分配库位时,高度为空");
         }
@@ -159,7 +154,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
         ContainerType containerType = containerTypeService.getContainerTypeByCode( container.getContainerType(),QuantityConstant.DEFAULT_WAREHOUSE);
         String locationType = containerType.getLocationType();
         String code = containerType.getCode();
-        switch (length){
+       /* switch (length){
             case "1" :
                 if(!QuantityConstant.CONTAINER_TYPE_S.equals(code)){
                     return AjaxResult.error(containerCode+"容器号:电控检测托盘宽度与,托盘类型宽度不匹配。");
@@ -170,7 +165,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
                     return AjaxResult.error(containerCode+"容器号:电控检测托盘宽度与,托盘类型宽度不匹配。");
                 }
                 break;
-        }
+        }*/
         if(container == null) {
             return AjaxResult.error("分配库位时,任务托盘为空");
         }
@@ -183,7 +178,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
             return AjaxResult.error("分配库位时,没有找到库位类型");
         }
         List<String> locationTypeCodeList = locationTypeList.stream().
-                map(t -> t.getCode()).collect(Collectors.toList());
+                map(LocationType::getCode).collect(Collectors.toList());
         int highHeight = Float.valueOf(height).intValue();
         LambdaQueryWrapper<LocationHigh> locationHighLambdaQueryWrapper = Wrappers.lambdaQuery();
         locationHighLambdaQueryWrapper.eq(LocationHigh::getHighLevel, highHeight)
@@ -211,7 +206,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
         }
         //去重
         receiptContainerDetailList = receiptContainerDetailList.stream().distinct().collect(Collectors.toList());
-        if(receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) {
+        if(receiptContainerDetailList.size() > 0) {
             String materialCode = receiptContainerDetailList.get(0).getMaterialCode();
             Material material = materialService.findAllByCode(materialCode, warehouseCode);
             materialAreaCode = material.getMaterialAreaCode();
@@ -230,7 +225,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
                     QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
         }
 
-        if (receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) {
+        if (receiptContainerDetailList.size() > 0) {
             //更新库位编码到组盘头表
             ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailList.get(0);
             if (receiptContainerDetail != null) {
@@ -263,7 +258,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
 
         //修改任务明细目标库位
         Location location = locationService.getLocationByCode(locationCode, warehouseCode);
-        int rowFlag = location.getRowFlag().intValue();
+        int rowFlag = location.getRowFlag();
         Integer preTaskNo = 0;
         //如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘
         if (rowFlag == QuantityConstant.ROW_OUT) {
@@ -276,7 +271,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService 
                 AjaxResult ajaxResult = transferTaskService.createTransferTask(insideLocation.getCode(),
                         destinationLocation.getCode(), warehouseCode);
                 preTaskNo = (Integer) ajaxResult.getData();
-                if (ajaxResult.hasErr()) {
+                if (Boolean.TRUE.equals(ajaxResult.hasErr())) {
                     throw new ServiceException("创建移库任务失败");
                 }
                 taskHeaderService.sendTaskToWcs(Convert.toIntArray(String.valueOf(preTaskNo)));
--
libgit2 0.22.2