ZY
2024-08-21 2442466124d2e8a420cd6a1026ee04e61b0fc591
zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/LocUtils.java
@@ -6,6 +6,7 @@
import com.zy.asrs.wms.asrs.entity.*;
import com.zy.asrs.wms.asrs.entity.enums.LocStsType;
import com.zy.asrs.wms.asrs.entity.enums.LocTypeHeightType;
import com.zy.asrs.wms.asrs.entity.enums.ShelvesRuleType;
import com.zy.asrs.wms.asrs.mapper.ViewLocDetlMapper;
import com.zy.asrs.wms.asrs.mapper.ViewTaskDetlMapper;
import com.zy.asrs.wms.asrs.service.*;
@@ -80,7 +81,7 @@
    }
    //获取推荐库位(满托盘)
    public List<Loc> getSuggestLoc(Long taskType, Long matId, String batch, Integer locTypeHeight) {
    public List<Loc> getSuggestLoc(Long taskType, Long matId, String batch, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
        //满托盘
        List<Loc> locs = new ArrayList<>();
        LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locTypeHeight);
@@ -109,6 +110,15 @@
            queryWrapper.le(Loc::getLev1, suggestLocRule.getTargetLev());
            queryWrapper.eq(Loc::getLocStsId, LocStsType.O.val());
            queryWrapper.in(Loc::getId, locIdList);
            if (laneRowList != null && !laneRowList.isEmpty()) {
                queryWrapper.in(Loc::getRow1, laneRowList);
            }
            if (currentLev != null) {
                queryWrapper.eq(Loc::getLev1, currentLev);
            }
            List<Loc> list = locService.list(queryWrapper);
            if (!list.isEmpty()) {
                locs.addAll(list);
@@ -118,7 +128,7 @@
    }
    //获取全局库位(完整巷道)
    public List<Loc> getGlobalLoc(Long taskType, Integer locTypeHeight) {
    public List<Loc> getGlobalLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
        List<Loc> locs = new ArrayList<>();
        LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locTypeHeight);
        if (locTypeHeightType == null) {
@@ -132,6 +142,15 @@
        LambdaQueryWrapper<Loc> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Loc::getLocStsId, LocStsType.O.val());
        queryWrapper.in(Loc::getId, locIdList);
        if (laneRowList != null && !laneRowList.isEmpty()) {
            queryWrapper.in(Loc::getRow1, laneRowList);
        }
        if (currentLev != null) {
            queryWrapper.eq(Loc::getLev1, currentLev);
        }
        List<Loc> list = locService.list(queryWrapper);
        if (!list.isEmpty()) {
            locs.addAll(list);
@@ -270,7 +289,7 @@
    }
    //获取推荐库位(空托盘)
    public List<Loc> getSuggestEmptyLoc(Long taskType, Integer locTypeHeight) {
    public List<Loc> getSuggestEmptyLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
        List<Loc> locs = new ArrayList<>();
        //空托盘
        List<SuggestLocRule> suggestLocRules = suggestLocRuleService.list(new LambdaQueryWrapper<SuggestLocRule>().eq(SuggestLocRule::getLocType, 0));
@@ -283,6 +302,15 @@
            queryWrapper.ge(Loc::getLev1, suggestLocRule.getStartLev());
            queryWrapper.le(Loc::getLev1, suggestLocRule.getTargetLev());
            queryWrapper.eq(Loc::getLocStsId, LocStsType.O.val());
            if (laneRowList != null && !laneRowList.isEmpty()) {
                queryWrapper.in(Loc::getRow1, laneRowList);
            }
            if (currentLev != null) {
                queryWrapper.eq(Loc::getLev1, currentLev);
            }
            List<Loc> list = locService.list(queryWrapper);
            if (!list.isEmpty()) {
                locs.addAll(list);
@@ -292,7 +320,7 @@
    }
    //获取全局库位(完整巷道)
    public List<Loc> getGlobalEmptyLoc(Long taskType, Integer locTypeHeight) {
    public List<Loc> getGlobalEmptyLoc(Long taskType, Integer locTypeHeight, List<Integer> laneRowList, Integer currentLev) {
        List<Loc> locs = new ArrayList<>();
        LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locTypeHeight);
        if (locTypeHeightType == null) {
@@ -306,6 +334,15 @@
        LambdaQueryWrapper<Loc> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Loc::getLocStsId, LocStsType.O.val());
        queryWrapper.in(Loc::getId, locIdList);
        if (laneRowList != null && !laneRowList.isEmpty()) {
            queryWrapper.in(Loc::getRow1, laneRowList);
        }
        if (currentLev != null) {
            queryWrapper.eq(Loc::getLev1, currentLev);
        }
        List<Loc> list = locService.list(queryWrapper);
        if (!list.isEmpty()) {
            locs.addAll(list);