rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java
@@ -555,7 +555,9 @@ .or().eq(!Cools.isEmpty(matnrCode), WarehouseAreasItem::getMatnrCode, matnrCode) .or().eq(!Cools.isEmpty(asnCode), WarehouseAreasItem::getAsnCode, asnCode); List<WarehouseAreasItem> list = warehouseAreasItemService.list(queryWrapper); if (!list.isEmpty()) { list.removeIf(e -> e.getAnfme() <= e.getWorkQty()); } list.forEach(item -> { Map<String, String> fields = FieldsUtils.getFields(item.getFieldsIndex()); item.setExtendFields(fields); rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
@@ -478,16 +478,19 @@ CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); if (result.getCode() == 200) { tasks.forEach(task -> { BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite())); if (Objects.isNull(curSta)) { throw new CoolException("站点不存在!!"); } if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite())); if (Objects.isNull(curSta)) { throw new CoolException("站点不存在!!"); } if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_IN.id))) { throw new CoolException("任务状态修改失败!!"); @@ -507,6 +510,11 @@ || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type)) { BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getTargSite())); if (Objects.isNull(curSta)) { throw new CoolException("站点不存在!!"); } if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_OUT.id))) { throw new CoolException("任务状态修改失败!!"); rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java
@@ -68,7 +68,8 @@ if (!tasks.isEmpty()) { throw new CoolException("当前托盘已有任务档在执行,不能再次组托!!"); } List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, pakin.getId())); if (!Objects.isNull(pakin)) { List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(!Objects.isNull(pakin.getId()) ,WaitPakinItem::getPakinId, pakin.getId())); waitPakinItems.forEach(item -> { for (PakinItem pakinItem : waitPakin.getItems()) { WarehouseAreasItem warehouseAreasItems = warehouseAreasItemService.getById(pakinItem.getId()); @@ -80,6 +81,7 @@ } } }); } List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, waitPakin.getBarcode())); if (!locs.isEmpty()) { @@ -88,11 +90,6 @@ throw new CoolException("托盘码:" + waitPakin.getBarcode() + "已被库位:" + join + "使用!!"); } double sum = waitPakin.getItems().stream().mapToDouble(PakinItem::getReceiptQty).sum(); Double waitSum = 0.0; if (!waitPakinItems.isEmpty()) { waitSum = waitPakinItems.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); } Double total = Math.round((sum + waitSum) * 100) / 100.0; WaitPakin waitPakin1 = new WaitPakin(); if (Objects.isNull(pakin)) { @@ -162,7 +159,13 @@ if (!waitPakinItemService.saveBatch(items)) { throw new CoolException("组托明细保存失败!!"); } // Double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, waitPakin1.getId())); Double waitSum = 0.0; if (!pakinItems.isEmpty()) { waitSum = pakinItems.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); } // Double total = Math.round((sum + waitSum) * 100) / 100.0; for (WaitPakinItem pakinItem : items) { WarehouseAreasItem one = warehouseAreasItemService.getOne(new LambdaQueryWrapper<WarehouseAreasItem>() @@ -181,7 +184,7 @@ } } waitPakin1.setAnfme(total); waitPakin1.setAnfme(waitSum); if (!this.updateById(waitPakin1)) { throw new CoolException("组托数量修改失败!!"); }