自动化立体仓库 - WMS系统
1
zhang
昨天 b2f1ff879839b5cd3fd093527a39ad73cb16a61c
src/main/java/com/zy/asrs/task/handler/GhjtHandler.java
@@ -24,6 +24,7 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -101,6 +102,7 @@
                    .setPath(MesConstant.GWCS_DCKK_URL)
                    .setHeaders(headers)
                    .setJson(body)
                    .setTimeout(30, TimeUnit.SECONDS) // 设置连接 + 读取超时为30秒
                    .build()
                    .doPost();
            if (!Cools.isEmpty(response)) {
@@ -390,12 +392,52 @@
        if (config == null) {
            throw new CoolException("理货获取备货区配置错误!!!");
        }
        Config chang = configMapper.selectConfigByCode("auto_tally_goods_chang");
        if (chang == null) {
            throw new CoolException("理货获取备货区长度配置错误!!!");
        }
        Config kuan = configMapper.selectConfigByCode("auto_tally_goods_kuan");
        if (kuan == null) {
            throw new CoolException("理货获取备货区宽度配置错误!!!");
        }
        Config gao = configMapper.selectConfigByCode("auto_tally_goods_gao");
        if (gao == null) {
            throw new CoolException("理货获取备货区高度配置错误!!!");
        }
        // 前几列是备货区
        int columnNum = Integer.parseInt(config.getValue());
        // 寻找一箱一卷的,没有理货的,不在备货区的物料明细
        List<LocDetl> tallyGoosList = locDetlMapper.selectTallyGoosList(columnNum);
        // 过滤掉木箱规格宽度大于600的(大于600一个托盘只能放一箱)
        tallyGoosList = tallyGoosList.stream().filter(locDetl -> {
            String[] split = locDetl.getColor().split("\\*");
            if (split.length == 3) {
                // 高度也要低于614才能理货
                //return Integer.parseInt(split[1]) <= 600 && Integer.parseInt(split[2]) <= 614;
                //新逻辑
                String[] changLimit = chang.getValue().split("-");
                if (changLimit.length == 2){
                    if (Integer.parseInt(split[0]) >= Integer.parseInt(changLimit[0]) && Integer.parseInt(split[0]) <= Integer.parseInt(changLimit[1])){
                        String[] kuanLimit = chang.getValue().split("-");
                        if (kuanLimit.length == 2){
                            if (Integer.parseInt(split[1]) >= Integer.parseInt(kuanLimit[0]) && Integer.parseInt(split[1]) <= Integer.parseInt(kuanLimit[1])){
                                String[] gaoLimit = gao.getValue().split("-");
                                if (gaoLimit.length == 2){
                                    if (Integer.parseInt(split[2]) >= Integer.parseInt(gaoLimit[0]) && Integer.parseInt(split[2]) <= Integer.parseInt(gaoLimit[1])){
                                        return true;
                                    }
                                }
                            }
                        }
                    }
                }
            }
                return false;
        }).collect(Collectors.toList());
        // 寻找满足理货条件的两个木箱
        LocDetl leftLocDetl = null;
        LocDetl rightLocDetl = null;