自动化立体仓库 - WMS系统
*
lsh
昨天 3c992dd950b539f03cdf64898f8bfba65c2313b8
src/main/java/com/zy/asrs/utils/OrderOutBatchUtil.java
@@ -11,6 +11,7 @@
import com.zy.asrs.entity.param.StockOutParam;
import com.zy.asrs.service.LocDetlService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.WorkService;
import com.zy.common.model.LocDto;
import com.zy.common.properties.SlaveProperties;
@@ -78,7 +79,6 @@
    public R setOrderOutBatch() {
        return R.ok();
    }
    public R setOrderOutBatch(List<OrderOutLocBoxCsUtilParam>  OutLocBoxCs) {
        int total = OutLocBoxCs.size();
@@ -239,7 +239,8 @@
        }
        return R.error(requert);
    }
    public R setOrderOutBatchCargoBookingNote(List<String[]> OutLocBoxCs) {
    public R setOrderOutBatchCargoBookingNote(List<OrderOutLocBoxCsUtilParam>  OutLocBoxCs) {
        int total = OutLocBoxCs.size();
        if (!Cools.isEmpty(OutLocBoxCs) && !OutLocBoxCs.isEmpty()) {
            LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class);
@@ -247,77 +248,107 @@
            SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class);
            WorkService workService = SpringUtils.getBean(WorkService.class);
            List<LocDto> locDtos = new ArrayList<>();
            List<String[]> outLocBoxCList = new ArrayList<>();
            List<OrderOutLocBoxCsUtilParam> outLocBoxCList = new ArrayList<>();
            List<String> outLocBoxCNew = new ArrayList<>();
            for (String[] outLocBoxC : OutLocBoxCs) {
            List<String> outLocRollListOld = new ArrayList<>();
            List<String> outLocRollListNew = new ArrayList<>();
            for (OrderOutLocBoxCsUtilParam outLocBoxC : OutLocBoxCs) {
                if (!outLocRollListOld.contains(outLocBoxC.getRoll())) {
                    outLocRollListOld.add(outLocBoxC.getRoll());
                }
            }
            for (OrderOutLocBoxCsUtilParam outLocBoxC : OutLocBoxCs) {
                total--;
                if (!outLocBoxCNew.contains(outLocBoxC[0])) {
                    LocDetl locDetlSou = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC[0]));
                    if (Cools.isEmpty(locDetlSou)) {
                LocDetl locDetlSou = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC.getBoxNo()).eq("model",outLocBoxC.getRoll()));
                if (Cools.isEmpty(locDetlSou)) {
                    locDetlSou = new LocDetl();
                    locDetlSou.setBatch(outLocBoxC.getBoxNo());
                    locDetlSou.setModel(outLocBoxC.getRoll());
                    locDetlSou.setLocNo("无库存");
//                    sign = false;
                    errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() + " 未查询到数据!!!《===]";
//                    continue;
                }
                if (signDanger){
                    if (!locDetlSou.getDanger$().equals(outLocBoxC.getDanger())) {
                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 未查询到数据!!!《===]";
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() +  " ==》出库输入待判状态:" + outLocBoxC.getDanger() + "、库存状态:" + locDetlSou.getDanger$() + "。状态不匹配《===]";
                        continue;
//                        throw new CoolException("箱号:"+outLocBoxC[0]+" 未查询到数据!!!");
                    }
                    if (signDanger){
                        if (!locDetlSou.getDanger$().equals(outLocBoxC[4])) {
                            sign = false;
                            errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " ==》出库输入待判状态:" + outLocBoxC[4] + "、库存状态:" + locDetlSou.getDanger$() + "。状态不匹配《===]";
                            continue;
                        }
                    }
                }
                if (!outLocBoxCNew.contains(outLocBoxC.getBoxNo()) && !locDetlSou.getLocNo().equals("无库存")) {
                    LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlSou.getLocNo()));
                    if (Cools.isEmpty(locMast)) {
                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 所在库位不满足出库条件!!!未查询到此箱号所在库位" + "《===]";
                        continue;
                    }
                    if (!locMast.getLocSts().equals("F")) {
                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 所在库位不满足出库条件!!!库位状态不为F!!!库位状态:" + locMast.getLocSts$() + "《===]";
                        continue;
                    }
                    // 目标库位 ===>> 浅库位
                    if (Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) {
                        String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast.getLocNo());
                        LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc));
                        if (!Cools.isEmpty(locMast2)) {
                            if (locMast2.getLocSts().equals("P") || locMast2.getLocSts().equals("R")) {
                                errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 所在库位满足出库条件!!!但是深库位在出库中!!!因此会夹杂在前边订单执行!!!" + "《===]";
//                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() +  " 所在库位不满足出库条件!!!未查询到此箱号所在库位" + "《===]";
//                        continue;
                    } else if (!locMast.getLocSts().equals("F")) {
//                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() +  " 所在库位不满足出库条件!!!库位状态不为F!!!库位状态:" + locMast.getLocSts$() + "《===]";
//                        continue;
                    } else {
                        // 目标库位 ===>> 浅库位
                        if (Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) {
                            String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast.getLocNo());
                            LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc));
                            if (!Cools.isEmpty(locMast2)) {
                                if (locMast2.getLocSts().equals("P") || locMast2.getLocSts().equals("R")) {
                                    errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() +  "卷号:" + outLocBoxC.getRoll() + " 所在库位满足出库条件!!!但是相邻库位在出库中!!!因此会夹杂在前边订单执行!!!" + "《===]";
                                }
                            }
                        }
                    }
                    if (sign) {
                        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                                .eq("loc_no", locDetlSou.getLocNo()).eq("origin", locDetlSou.getOrigin()));
                        for (LocDetl locDetl : locDetls) {
                            total++;
                            String[] locDetlNow = new String[5];
                            locDetlNow[0] = locDetl.getBatch();
                            locDetlNow[1] = outLocBoxC[1];
                            locDetlNow[2] = outLocBoxC[2];
                            locDetlNow[3] = outLocBoxC[3];
                            locDetlNow[4] = outLocBoxC[4];
                            outLocBoxCList.add(locDetlNow);
                            outLocBoxCNew.add(outLocBoxC[0]);
                }
                if (sign && !outLocRollListNew.contains(outLocBoxC.getRoll()) && !locDetlSou.getLocNo().equals("无库存")) {
                    List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                            .eq("loc_no", locDetlSou.getLocNo()).eq("origin", locDetlSou.getOrigin()));
                    for (LocDetl locDetl : locDetls) {
                        if (!outLocRollListNew.contains(locDetl.getModel())){
                            if (!outLocRollListOld.contains(locDetl.getModel())){
                                total++;
                                OrderOutLocBoxCsUtilParam orderOutLocBoxCsUtilParam = new OrderOutLocBoxCsUtilParam(locDetl.getBatch(),locDetl.getModel(), outLocBoxC);
                                orderOutLocBoxCsUtilParam.setMemo("附带出库");
                                orderOutLocBoxCsUtilParam.setDanger(locDetl.getDanger$());
                                outLocBoxCList.add(orderOutLocBoxCsUtilParam);
                                outLocBoxCNew.add(outLocBoxC.getBoxNo());
                                outLocRollListNew.add(outLocBoxC.getRoll());
                            } else {
                                if (locDetlSou.getBatch().equals(locDetl.getBatch()) && locDetlSou.getModel().equals(locDetl.getModel())) {
                                    total++;
                                    outLocBoxCList.add(outLocBoxC);
                                    outLocBoxCNew.add(outLocBoxC.getBoxNo());
                                    outLocRollListNew.add(outLocBoxC.getRoll());
                                }
                            }
                        }
                    }
                } else if (sign && !outLocRollListNew.contains(outLocBoxC.getRoll()) && locDetlSou.getLocNo().equals("无库存")) {
                    if (!outLocRollListNew.contains(locDetlSou.getModel())){
                        total++;
                        outLocBoxCList.add(outLocBoxC);
                        outLocBoxCNew.add(outLocBoxC.getBoxNo());
                        outLocRollListNew.add(outLocBoxC.getRoll());
                    }
                }
            }
            for (String[] outLocBoxC : outLocBoxCList) {
                LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC[0]));
            for (OrderOutLocBoxCsUtilParam outLocBoxC : outLocBoxCList) {
                LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC.getBoxNo()).eq("model", outLocBoxC.getRoll()));
                if (Cools.isEmpty(locDetl)) {
                    total--;
                    continue;
//                    total--;
//                    continue;
                    locDetl = new LocDetl();
                    locDetl.setBatch(outLocBoxC.getBoxNo());
                    locDetl.setModel(outLocBoxC.getRoll());
                    locDetl.setLocNo("无库存");
                }
                if (!Cools.isEmpty(outLocBoxC[3])) {
                    String memo = Cools.isEmpty(locDetl.getMemo()) ? "" : locDetl.getMemo() + ",";
                    locDetl.setMemo(memo + DateUtils.convert(new Date(), DateUtils.yyyyMMdd_C) + "备注:" + outLocBoxC[3]);
                } else if (Cools.isEmpty(locDetl.getMemo())) {
                    locDetl.setMemo(outLocBoxC[3]);
                if (!Cools.isEmpty(outLocBoxC.getMemo())) {
                    if (Cools.isEmpty(locDetl.getMemo())) {
                        locDetl.setMemo(DateUtils.convert(new Date(), DateUtils.yyyyMMdd_C) + "备注:" + outLocBoxC.getMemo());
                    } else {
                        String memo = Cools.isEmpty(locDetl.getMemo()) ? "" : locDetl.getMemo() + ",";
                        locDetl.setMemo(memo + DateUtils.convert(new Date(), DateUtils.yyyyMMdd_C) + "备注:" + outLocBoxC.getMemo());
                    }
                }
                LocDto locDto = new LocDto(locDetl);
                locDtos.add(locDto);