| | |
| | | throw new CoolException("编码规则错误: 编码规则「SYS_WAIT_PAKIN_CODE」规则是不存在"); |
| | | } |
| | | waitPakin1.setCode(ruleCode) |
| | | .setIoStatus(PakinIOStatus.PAKIN_IO_STATUS_HOLD.val) |
| | | .setIoStatus(PakinIOStatus.PAKIN_IO_STATUS_DONE.val) |
| | | .setAnfme(param.getTaskItemList().stream() |
| | | .map(TaskItem::getInputQty) |
| | | .filter(Objects::nonNull) |
| | |
| | | throw new CoolException("任务明细更新失败"); |
| | | } |
| | | |
| | | |
| | | //判断任务明细是否全部完成 |
| | | List<TaskItem> allTaskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>() |
| | | .eq(TaskItem::getTaskId, task.getId())); |
| | | if (Cools.isEmpty(allTaskItems)) { |
| | | throw new CoolException("未找到任务明细"); |
| | | } |
| | | boolean allTaskItemsFinished = allTaskItems.stream().allMatch(item -> { |
| | | BigDecimal workQty = BigDecimal.valueOf(Objects.isNull(item.getWorkQty()) ? 0D : item.getWorkQty()); |
| | | BigDecimal qty = BigDecimal.valueOf(Objects.isNull(item.getQty()) ? 0D : item.getQty()); |
| | | return workQty.compareTo(qty) == 0; |
| | | }); |
| | | if (allTaskItemsFinished) { |
| | | task.setTaskStatus(TaskStsType.COMPLETE_OUT.id) |
| | | .setUpdateBy(userId) |
| | | .setUpdateTime(new Date()); |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态更新失败"); |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(param.getContainerNo())) { |
| | | throw new CoolException("无容器号"); |
| | | } |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, param.getContainerNo())); |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getBarcode, param.getContainerNo()) |
| | | .eq(Task::getTaskStatus, TaskStsType.AWAIT.id) |
| | | ); |
| | | if (null == task) { |
| | | throw new CoolException("未找到任务"); |
| | | } |
| | |
| | | throw new CoolException("站点状态不为空闲"); |
| | | } |
| | | |
| | | List<Long> areaList = basStation.getCrossZoneArea(); |
| | | List<Long> areaList = basStation.getCrossZoneArea().stream() |
| | | .map(Integer::longValue) |
| | | .collect(Collectors.toList()); |
| | | if (Cools.isEmpty(areaList)) { |
| | | throw new CoolException("当前站点库区未配置"); |
| | | } |