cl
2026-04-21 fc634e5b62b85396196e2dd8f51bfe5ba7337522
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -1169,6 +1169,14 @@
                        .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type))) {
                    throw new CoolException("源库位状态修改失败!!");
                }
            } else if (task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type)) {
                // 空板出库:建单时 D→R,取消恢复为空板 D
                if (!locService.update(new LambdaUpdateWrapper<Loc>()
                        .eq(Loc::getCode, task.getOrgLoc())
                        .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_R.type)
                        .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_D.type))) {
                    throw new CoolException("空板出库源库位恢复空板失败!!");
                }
            }
            if (!Objects.isNull(task.getWarehType()) && task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.val)) {
@@ -2082,6 +2090,15 @@
                    log.error("站点不存在!!任务编码:{},目标站点:{}", task.getTaskCode(), task.getTargSite());
                    continue;
                }
                // 出库下发前校验站点状态与出库能力
                if (task.getTaskType() >= TaskType.TASK_TYPE_OUT.type) {
                    if (!Integer.valueOf(1).equals(station.getStatus()) || !Integer.valueOf(1).equals(station.getOutAble())) {
                        log.error("========== RCS任务下发失败 ==========");
                        log.error("站点不可出库下发!!任务编码:{},目标站点:{},站点状态(status):{},能出(outAble):{}",
                                task.getTaskCode(), task.getTargSite(), station.getStatus(), station.getOutAble());
                        continue;
                    }
                }
            }
            /**判断是否光电站点,非光店站点需管控站点状态*/
@@ -2800,9 +2817,21 @@
                    }
                }
            }
            // 出库仅云仓来源单据参与上报
            if (!isInbound) {
                boolean hasCloudSource = taskItems.stream().anyMatch(this::hasCloudOrderRef);
                if (!hasCloudSource) {
//                    log.info("入/出库结果上报待办跳过:无云仓来源单据,taskId={}", task.getId());
                    log.info("入/出库结果上报待办跳过:手动创建出库单据不通知云仓,taskId={}", task.getId());
                    return;
                }
            }
            ObjectMapper om = new ObjectMapper();
            Date now = new Date();
            for (TaskItem item : taskItems) {
                if (!isInbound && !hasCloudOrderRef(item)) {
                    continue;
                }
                String orderNo = isInbound ? sourceToOrderNo.get(item.getSource()) : (item.getPlatOrderCode() != null ? item.getPlatOrderCode() : item.getPlatWorkCode());
                if (orderNo == null && isInbound) {
                    orderNo = item.getPlatOrderCode() != null ? item.getPlatOrderCode() : item.getPlatWorkCode();
@@ -2841,4 +2870,12 @@
            log.warn("入/出库结果上报待办失败,taskId={},isInbound={}:{}", task.getId(), isInbound, e.getMessage());
        }
    }
    private boolean hasCloudOrderRef(TaskItem item) {
        if (item == null) {
            return false;
        }
        return StringUtils.isNotBlank(item.getPlatOrderCode())
                || StringUtils.isNotBlank(item.getPlatWorkCode());
    }
}