zc
3 天以前 e4a2bc817e830611f7187ba8cb62875842b79d3f
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -49,6 +49,8 @@
    private OutStockService outStockService;
    @Autowired
    private WaveService waveService;
    @Autowired
    private BasStationService basStationService;
    /**
@@ -70,7 +72,6 @@
        if (Objects.isNull(map.getItems()) || map.getItems().isEmpty()) {
            throw new CoolException("明细不能为空!");
        }
        String siteNo = map.getSiteNo();
        List<LocItem> items = map.getItems();
        Map<Long, List<LocItem>> listMap = items.stream().collect(Collectors.groupingBy(LocItem::getLocId));
@@ -136,7 +137,7 @@
                    //拣料出库 -- 盘点出库
                    DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                            .eq(DeviceSite::getSite, siteNo)
                            .eq(DeviceSite::getChannel, loc.getChannel())
                            .eq(!Objects.isNull(loc.getChannel()),DeviceSite::getChannel, loc.getChannel())
                            .eq(DeviceSite::getType, TaskType.TASK_TYPE_PICK_AGAIN_OUT.type));
                    if (Objects.isNull(deviceSite)) {
                        throw new CoolException("站点不支持拣料出库!!");
@@ -145,7 +146,7 @@
                } else {
                    //全板出库
                    DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                            .eq(DeviceSite::getChannel, loc.getChannel())
                            .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
                            .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_OUT.type));
                    if (Objects.isNull(deviceSite)) {
                        throw new CoolException("站点不支持全板出库!!");
@@ -156,7 +157,7 @@
            } else if (map.getType().equals(Constants.TASK_TYPE_OUT_CHECK)) {
                //盘点出库
                DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                        .eq(DeviceSite::getChannel, loc.getChannel())
                        .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
                        .eq(DeviceSite::getSite, siteNo)
                        .eq(DeviceSite::getType, TaskType.TASK_TYPE_CHECK_OUT.type));
                if (Objects.isNull(deviceSite)) {
@@ -169,27 +170,27 @@
                throw new CoolException("任务创建失败!!");
            }
            if (!LocUtils.isShallowLoc(loc.getCode())) {
                //获取深库位对应浅库位
                String shallowLoc = LocUtils.getShallowLoc(loc.getCode());
                Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc));
                if (Objects.isNull(one)) {
                    throw new CoolException("对应库位不存在!!");
                }
                Task workTask = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, one.getBarcode()));
                if (Objects.isNull(workTask)) {
                    map.setOrgLoc(one.getCode());
                    //优先生成移库任务
                    if (one.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) {
                        moveTask = genMoveTask(map, loginUserId);
                    }
                } else {
                    workTask.setSort(task.getSort() + 1).setParentId(task.getId());
                    if (!taskService.updateById(workTask)) {
                        throw new CoolException("优先级修改失败!!");
                    }
                }
            }
//            if (!LocUtils.isShallowLoc(loc.getCode())) {
//                //获取深库位对应浅库位
//                String shallowLoc = LocUtils.getShallowLoc(loc.getCode());
//                Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc));
//                if (Objects.isNull(one)) {
//                    throw new CoolException("对应库位不存在!!");
//                }
//                Task workTask = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, one.getBarcode()));
//                if (Objects.isNull(workTask)) {
//                    map.setOrgLoc(one.getCode());
//                    //优先生成移库任务
//                    if (one.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) {
//                        moveTask = genMoveTask(map, loginUserId);
//                    }
//                } else {
//                    workTask.setSort(task.getSort() + 1).setParentId(task.getId());
//                    if (!taskService.updateById(workTask)) {
//                        throw new CoolException("优先级修改失败!!");
//                    }
//                }
//            }
            if (!Objects.isNull(moveTask.getId())) {
                moveTask.setParentId(task.getId()).setSort(moveTask.getSort() + 1);
@@ -293,14 +294,14 @@
            //目标库位为空,自动获取新库位
            DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                    .eq(DeviceSite::getType, TaskType.TASK_TYPE_LOC_MOVE.type)
                    .eq(DeviceSite::getChannel, orgLoc.getChannel()), false);
                    .eq(!Objects.isNull(orgLoc.getChannel()), DeviceSite::getChannel, orgLoc.getChannel()), false);
            if (Objects.isNull(deviceSite)) {
                throw new CoolException("站点信息不存在!!");
            }
            TaskInParam param = new TaskInParam();
            param.setIoType(TaskType.TASK_TYPE_OUT.type)
                    .setOrgLoc(map.getOrgLoc())
                    .setSourceStaNo(Integer.parseInt(deviceSite.getSite()))
                    .setSourceStaNo(deviceSite.getSite())
                    .setLocType1(Integer.parseInt(orgLoc.getType())
                    );
            InTaskMsgDto locNo;