zjj
2 天以前 540a50281d9995653f3a4541eefec56648a79f2c
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -316,7 +316,11 @@
        if (Cools.isEmpty(deviceSites)) {
            throw new CoolException("未找到站点路径信息");
        }
        WarehouseAreas warehouseArea = warehouseAreasService.getById(param.getArea());
        DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(param.getSourceStaNo()));
        if (Cools.isEmpty(deviceBind)) {
            throw new CoolException("数据异常,请联系管理员===>库位规则未知");
        }
        WarehouseAreas warehouseArea = warehouseAreasService.getById(deviceBind.getTypeId());
        if (Cools.isEmpty(warehouseArea)) {
            throw new CoolException("未找到所属库区信息");
        }
@@ -324,18 +328,18 @@
        InTaskMsgDto dto = null;
        switch (warehouseArea.getType()) {
            case "CRN": //堆垛机
                dto = getLocNoCrn(param.getArea(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType());
                dto = getLocNoCrn(deviceBind,warehouseArea.getId(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType());
                break;
            case "SXC": //四向库
                break;
            case "CTU": //ctu
                dto = getLocNoCtu(param.getArea(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType());
                dto = getLocNoCtu(deviceBind,warehouseArea.getId(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType());
                break;
        }
        return dto;
    }
    private InTaskMsgDto getLocNoCrn(Integer area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){
    private InTaskMsgDto getLocNoCrn(DeviceBind deviceBind,Long area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){
        if (Cools.isEmpty(matnr)) {  //物料号
            matnr = "";
        }
@@ -350,10 +354,7 @@
        Loc loc = null;     // 目标库位
        InTaskMsgDto inTaskMsgDto = new InTaskMsgDto();
        DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(sourceStaNo));
        if (Cools.isEmpty(deviceBind)) {
            throw new CoolException("数据异常,请联系管理员===>库位规则未知");
        }
        int sRow = deviceBind.getStartRow();
        int eRow = deviceBind.getEndRow();
        int deviceQty = deviceBind.getDeviceQty();
@@ -540,14 +541,14 @@
            // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归
            if (times < rowCount * 2) {
                times = times + 1;
                return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,times, ioType);
                return getLocNoCrn(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,times, ioType);
            }
            // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位
            if (locTypeDto.getLocType1() < 3) {
                int i = locTypeDto.getLocType1() + 1;
                locTypeDto.setLocType1(i);
                return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,0, ioType);
                return getLocNoCrn(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,0, ioType);
            }
            throw new CoolException("没有空库位");
        }
@@ -561,7 +562,7 @@
        return inTaskMsgDto;
    }
    private InTaskMsgDto getLocNoCtu(Integer area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){
    private InTaskMsgDto getLocNoCtu(DeviceBind deviceBind,Long area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){
        if (Cools.isEmpty(matnr)) {  //物料号
            matnr = "";
        }
@@ -571,11 +572,6 @@
        int deviceNo = 0;
        Loc loc = new Loc();
        InTaskMsgDto inTaskMsgDto = new InTaskMsgDto();
        DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(sourceStaNo));
        if (Cools.isEmpty(deviceBind)) {
            throw new CoolException("数据异常,请联系管理员===>库位规则未知");
        }
        List<Loc> loc1 = locService.list(new LambdaQueryWrapper<Loc>()
                .eq(Loc::getAreaId, area)
                .eq(Loc::getUseStatus, LocUseStatusType.Empty_Slot.type)
@@ -608,14 +604,14 @@
            // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归
            if (times < 5) {
                times = times + 1;
                return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,times, ioType);
                return getLocNoCtu(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,times, ioType);
            }
            // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位
            if (locTypeDto.getLocType1() < 3) {
                int i = locTypeDto.getLocType1() + 1;
                locTypeDto.setLocType1(i);
                return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,0, ioType);
                return getLocNoCtu(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,0, ioType);
            }
            throw new CoolException("没有空库位");
        }