Commit 68d35f850f161b4395cdee365ae162cdf1c47a53
1 parent
f44abe31
fix: 仓位分配BUG修复
Showing
1 changed file
with
8 additions
and
13 deletions
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
... | ... | @@ -132,12 +132,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
132 | 132 | String area = wcsTask.getArea(); |
133 | 133 | String locationCode = null; |
134 | 134 | String height = wcsTask.getHeight(); |
135 | - if("1".equals(height)){ | |
136 | - height = QuantityConstant.LOCATION_HEIGHT_LOW; | |
137 | - } | |
138 | - String width = wcsTask.getWidth(); | |
139 | - String weight = wcsTask.getWeight(); | |
140 | - String length = wcsTask.getLength(); | |
135 | + //String length = wcsTask.getLength(); | |
141 | 136 | if(height == null) { |
142 | 137 | return AjaxResult.error("分配库位时,高度为空"); |
143 | 138 | } |
... | ... | @@ -159,7 +154,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
159 | 154 | ContainerType containerType = containerTypeService.getContainerTypeByCode( container.getContainerType(),QuantityConstant.DEFAULT_WAREHOUSE); |
160 | 155 | String locationType = containerType.getLocationType(); |
161 | 156 | String code = containerType.getCode(); |
162 | - switch (length){ | |
157 | + /* switch (length){ | |
163 | 158 | case "1" : |
164 | 159 | if(!QuantityConstant.CONTAINER_TYPE_S.equals(code)){ |
165 | 160 | return AjaxResult.error(containerCode+"容器号:电控检测托盘宽度与,托盘类型宽度不匹配。"); |
... | ... | @@ -170,7 +165,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
170 | 165 | return AjaxResult.error(containerCode+"容器号:电控检测托盘宽度与,托盘类型宽度不匹配。"); |
171 | 166 | } |
172 | 167 | break; |
173 | - } | |
168 | + }*/ | |
174 | 169 | if(container == null) { |
175 | 170 | return AjaxResult.error("分配库位时,任务托盘为空"); |
176 | 171 | } |
... | ... | @@ -183,7 +178,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
183 | 178 | return AjaxResult.error("分配库位时,没有找到库位类型"); |
184 | 179 | } |
185 | 180 | List<String> locationTypeCodeList = locationTypeList.stream(). |
186 | - map(t -> t.getCode()).collect(Collectors.toList()); | |
181 | + map(LocationType::getCode).collect(Collectors.toList()); | |
187 | 182 | int highHeight = Float.valueOf(height).intValue(); |
188 | 183 | LambdaQueryWrapper<LocationHigh> locationHighLambdaQueryWrapper = Wrappers.lambdaQuery(); |
189 | 184 | locationHighLambdaQueryWrapper.eq(LocationHigh::getHighLevel, highHeight) |
... | ... | @@ -211,7 +206,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
211 | 206 | } |
212 | 207 | //去重 |
213 | 208 | receiptContainerDetailList = receiptContainerDetailList.stream().distinct().collect(Collectors.toList()); |
214 | - if(receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) { | |
209 | + if(receiptContainerDetailList.size() > 0) { | |
215 | 210 | String materialCode = receiptContainerDetailList.get(0).getMaterialCode(); |
216 | 211 | Material material = materialService.findAllByCode(materialCode, warehouseCode); |
217 | 212 | materialAreaCode = material.getMaterialAreaCode(); |
... | ... | @@ -230,7 +225,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
230 | 225 | QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
231 | 226 | } |
232 | 227 | |
233 | - if (receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) { | |
228 | + if (receiptContainerDetailList.size() > 0) { | |
234 | 229 | //更新库位编码到组盘头表 |
235 | 230 | ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailList.get(0); |
236 | 231 | if (receiptContainerDetail != null) { |
... | ... | @@ -263,7 +258,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
263 | 258 | |
264 | 259 | //修改任务明细目标库位 |
265 | 260 | Location location = locationService.getLocationByCode(locationCode, warehouseCode); |
266 | - int rowFlag = location.getRowFlag().intValue(); | |
261 | + int rowFlag = location.getRowFlag(); | |
267 | 262 | Integer preTaskNo = 0; |
268 | 263 | //如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘 |
269 | 264 | if (rowFlag == QuantityConstant.ROW_OUT) { |
... | ... | @@ -276,7 +271,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
276 | 271 | AjaxResult ajaxResult = transferTaskService.createTransferTask(insideLocation.getCode(), |
277 | 272 | destinationLocation.getCode(), warehouseCode); |
278 | 273 | preTaskNo = (Integer) ajaxResult.getData(); |
279 | - if (ajaxResult.hasErr()) { | |
274 | + if (Boolean.TRUE.equals(ajaxResult.hasErr())) { | |
280 | 275 | throw new ServiceException("创建移库任务失败"); |
281 | 276 | } |
282 | 277 | taskHeaderService.sendTaskToWcs(Convert.toIntArray(String.valueOf(preTaskNo))); |
... | ... |