1
1 天以前 6c3cc6842009f3897c3fb18bef8a6634fe653818
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -494,12 +494,12 @@
            throw new CoolException("站点状态不为空闲");
        }
        List<String> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), String.class);
        if (!areaList.contains(area)) {
        List<Integer> areaList = basStation.getCrossZoneArea();
        if (!areaList.contains(Integer.parseInt(area))) {
            throw new CoolException("当前站点不支持目标库区");
        }
        if (!Cools.isEmpty(basStation.getContainerType())) {
            List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class);
            List<Integer> longs1 = basStation.getContainerType();
            List<BasContainer> containers = basContainerService.list(
                    new LambdaQueryWrapper<BasContainer>()
                            .in(BasContainer::getContainerType, longs1)
@@ -988,8 +988,14 @@
                    //110.空板出库
                    complateOutStockEmpty(task, loginUserId);
                } else if (task.getTaskType().equals(TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type)) {
                    //110.空板出库
                    //109.备货
                    complateOutStockDocking(task, loginUserId);
                } else if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)) {
                    //107.盘
                    pickOrCheckTask(task.getId(), Constants.TASK_TYPE_OUT_CHECK);
                } else if (task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type)) {
                    //103.拣选
                    pickOrCheckTask(task.getId(), Constants.TASK_TYPE_OUT_PICK);
                } else {
                    complateOutStock(task, loginUserId);
                }
@@ -1093,10 +1099,23 @@
            throw new CoolException("库位信息更新失败!!");
        }
        List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()));
        if (taskItems.isEmpty()) {
            throw new CoolException("任务明细不存在!!");
        }
        List<LocItem> list = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, loc.getId()));
        list.forEach(item -> {
            item.setOrderId(taskItems.get(0).getSourceId());
            item.setType(taskItems.get(0).getOrderType());
            item.setOrderItemId(taskItems.get(0).getSource());
            item.setPlatOrderCode(taskItems.get(0).getSourceCode());
            item.setWkType(taskItems.get(0).getWkType());
        });
        locItemService.updateBatchById(list);
        TaskItem taskItem = taskItems.stream().findFirst().get();
        //保存入出库流水
@@ -1331,7 +1350,7 @@
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Task pickOrCheckTask(Long id, String oType) throws Exception {
    public synchronized Task pickOrCheckTask(Long id, String oType) throws Exception {
        Task task = this.getById(id);
        if (Objects.isNull(task)) {
            throw new CoolException("当前任务不存在!!");
@@ -1362,14 +1381,19 @@
        task.setTaskCode(ruleCode)
                .setTaskType(type)
                .setBarcode(task.getBarcode())
                .setTaskStatus(TaskStsType.GENERATE_IN.id);
                .setTaskStatus(TaskStsType.MISSION_INITIAL.id);
        TaskInParam param = new TaskInParam();
        param.setSourceStaNo(task.getTargSite())
                .setIoType(type)
                .setLocType1(Integer.parseInt(loc.getType()));
        //获取新库位
        InTaskMsgDto locInfo = wcsService.getLocNo(param);
        InTaskMsgDto locInfo = null;
        try{
            locInfo = wcsService.getLocNo(param);
        } catch (Exception e) {
            throw new CoolException("获取库位失败!!"+e.getMessage());
        }
        if (Objects.isNull(locInfo)) {
            throw new CoolException("获取库位失败!!");
@@ -1586,7 +1610,7 @@
                .eq(Task::getId, task.getId())
                .set(Task::getUpdateBy, loginUserId)
                .set(Task::getUpdateTime, new Date())
                .set(Task::getTaskStatus, TaskStsType.WAVE_SEED.id))) {
                .set(Task::getTaskStatus, TaskStsType.UPDATED_OUT.id))) {
            throw new CoolException("库存状态更新失败!!");
        }
@@ -1617,7 +1641,7 @@
    /**
     * @author Ryan
     * @date 2025/5/20
     * @description: 完成出库任务,更新出库库存信息
     * @description: 完成越库任务,更新出库库存信息
     * @version 1.0
     */
    @Synchronized
@@ -1674,7 +1698,7 @@
                        throw new CoolException("单据明细不存在!!");
                    }
                    try {
                        saveOutStockItem(maps.get(key), orderItem,  loginUserId);
                        saveOutStockItem(taskItems, orderItem, null, null, loginUserId);
                    } catch (Exception e) {
                        throw new CoolException(e.getMessage());
                    }
@@ -1742,7 +1766,7 @@
                .eq(Task::getId, task.getId())
                .set(Task::getUpdateBy, loginUserId)
                .set(Task::getUpdateTime, new Date())
                .set(Task::getTaskStatus, TaskStsType.WAVE_SEED.id))) {
                .set(Task::getTaskStatus, TaskStsType.UPDATED_OUT.id))) {
            throw new CoolException("库存状态更新失败!!");
        }
    }