zyx
2024-07-16 a44e66e91a00405d4651a9b9dd395c35708df5b9
zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/CommonService.java
@@ -46,6 +46,8 @@
    @Autowired
    private LocDirectionService locDirectionService;
    private Long WHS_TYPE = 0L;//默认立库
    /**
     * 生成工作号
     *
@@ -91,6 +93,11 @@
     */
    @Transactional
    public StartupDto getLocNo(Integer staDescId, Integer sourceStaNo, List<String> matnrs, String batch, Long hostId, LocTypeDto locTypeDto, int times) {
        if (sourceStaNo==999){//平库内置判断站点(临时解决方案)
            WHS_TYPE = 1L;//平库
        } else {
            WHS_TYPE = 0L;//立库
        }
        // 目标库位
        LocMast locMast = null;
@@ -150,7 +157,7 @@
                continue;
            }
            List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd(), hostId);
            List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd(), hostId,WHS_TYPE);
            for (LocMast locMast0 : locMasts) {
                //预留空库位
                if (locMastService.checkEmptyCount(locMast0, 10, hostId)) {
@@ -237,12 +244,14 @@
                    .eq(LocMast::getLocSts, "D")
                    .eq(LocMast::getLocType1, locTypeDto.getLocType1())
                    .eq(LocMast::getCrnNo, staDesc.getDeviceNo())
                    .eq(LocMast::getWhsType, WHS_TYPE)
                    .eq(LocMast::getHostId, hostId);
            LambdaQueryWrapper<LocMast> wrapper1 = new LambdaQueryWrapper<LocMast>()
                    .eq(LocMast::getLocSts, "O")
                    .eq(LocMast::getLocType1, locTypeDto.getLocType1())
                    .eq(LocMast::getCrnNo, staDesc.getDeviceNo())
                    .eq(LocMast::getWhsType, WHS_TYPE)
                    .eq(LocMast::getHostId, hostId);
            //库位搜索范围
@@ -313,8 +322,9 @@
                .eq(LocMast::getLocSts, "O")
                .eq(LocMast::getHostId, hostId)
                .in(LocMast::getRow1, curRow)
                .orderByDesc(LocMast::getLev1)
                .orderByDesc(LocMast::getBay1);
                .orderByAsc(LocMast::getLev1)
                .orderByAsc(LocMast::getBay1);
        //库位搜索范围
        LocRangeDto locRangeDto = locTypeDto.getLocRangeDto();