Commit c8c80de7315b686c649caa218775d9ff17cca40d

Authored by 易文鹏
1 parent d09efe68

fix: 修复呼叫料盒,呼叫出空托盘时,完成补充入库后,原库位没有解锁的问题。

src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... ... @@ -328,25 +328,27 @@ public class ReceiptTaskService {
328 328 //如果是补充入库
329 329 if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT)) {
330 330 String fromLocationCode = task.getFromLocation();
  331 + //修改库位状态和对应的容器
  332 + Location updateLocation = new Location();
  333 + updateLocation.setContainerCode("");
  334 + updateLocation.setWarehouseCode(warehouseCode);
  335 + updateLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY);
  336 + LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  337 + locationLambdaUpdateWrapper.eq(Location::getCode, fromLocationCode);
  338 + if (!locationService.update(updateLocation, locationLambdaUpdateWrapper)) {
  339 + throw new ServiceException("补充入库,更新库位失败");
  340 + }
  341 +
  342 + //解除右侧库位禁用和对应4个库位标记
  343 + Container container = containerService.getContainerByCode(task.getContainerCode());
  344 + locationService.unbanRightLocationAndUnmark(container.getContainerType(), fromLocationCode);
  345 + Location toLocation = locationService.getLocationByCode(task.getToLocation());
  346 +
  347 +
331 348 inventoryHeader = inventoryHeaderService.getOne(new LambdaQueryWrapper<InventoryHeader>()
332 349 .eq(InventoryHeader::getLocationCode, fromLocationCode)
333 350 .eq(InventoryHeader::getContainerCode, task.getContainerCode()));
334 351 if (inventoryHeader != null) {
335   - //修改库位状态和对应的容器
336   - Location updateLocation = new Location();
337   - updateLocation.setContainerCode("");
338   - updateLocation.setWarehouseCode(warehouseCode);
339   - updateLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY);
340   - LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate();
341   - locationLambdaUpdateWrapper.eq(Location::getCode, fromLocationCode);
342   - locationLambdaUpdateWrapper.eq(Location::getWarehouseCode, warehouseCode);
343   - if (!locationService.update(updateLocation, locationLambdaUpdateWrapper)) {
344   - throw new ServiceException("补充入库,更新库位失败");
345   - }
346   - //解除右侧库位禁用和对应4个库位标记
347   - Container container = containerService.getContainerByCode(task.getContainerCode());
348   - locationService.unbanRightLocationAndUnmark(container.getContainerType(), fromLocationCode);
349   - Location toLocation = locationService.getLocationByCode(task.getToLocation());
350 352 inventoryHeader.setLocationCode(task.getToLocation());
351 353 if (!inventoryHeaderService.updateById(inventoryHeader)) {
352 354 throw new ServiceException("补充入库,更新库存头表失败");
... ...