自动化立体仓库 - WMS系统
skyouc
1 天以前 707d414c0e6a8baff3ce7affec820f0fc1a13c19
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -178,7 +178,9 @@
        wrkMastService.insert(wrkMast);
        for (OrderDetl orderDetl : param.getCombMats()) {
            Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", orderDetl.getMatnr()));
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                    .eq("supp_code", orderDetl.getStandby1())
                    .eq("matnr", orderDetl.getMatnr()));
            if (mat == null) {
                throw new CoolException("保存工作档失败,物料信息不存在:" + orderDetl.getMatnr());
            }
@@ -377,6 +379,7 @@
        for (CombParam.CombMat combMat : combParam.getCombMats()) {
            List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>()
                    .eq("loc_no", combParam.getLocNo())
                    .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1())
                    .eq("matnr", combMat.getMatnr()));
            if (locDetlList.isEmpty()) {
                return R.error("未查询到库存数据");
@@ -451,7 +454,9 @@
                wrkMast.setModiUser(userId);
                wrkMastService.insert(wrkMast);
                Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", combMat.getMatnr()));
                Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                        .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1())
                        .eq("matnr", combMat.getMatnr()));
                if (mat == null) {
                    throw new CoolException("保存工作档失败,物料信息不存在:" + combMat.getMatnr());
                }
@@ -713,6 +718,7 @@
                // elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3());
                OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                        .eq("order_id", order.getId())
                        .eq("supp_code", elem.getStandby1())
                        .eq("matnr", elem.getMatnr()));
                if (Objects.isNull(elem.getBoxType1())) {
                    throw new CoolException("格层编码不能为空!!");
@@ -743,9 +749,16 @@
                }
            });
            Set<String> matnrs = detlDtos.stream().map(DetlDto::getMatnr).collect(Collectors.toSet());
            List<Mat> mats = matService.selectList(new EntityWrapper<Mat>().in("matnr", matnrs));
            Set<Long> tagIds = mats.stream().map(Mat::getTagId).collect(Collectors.toSet());
            List<Mat> tempMats = new ArrayList<>();
            for (DetlDto detlDto : detlDtos) {
                Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                        .eq("matnr", detlDto.getMatnr())
                        .eq("supp_code", detlDto.getStandby1()));
                tempMats.add(mat);
            }
//            Set<String> matnrs = tempMats.stream().map(Mat::getMatnr).collect(Collectors.toSet());
            Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet());
            if (tagIds.size() > 1) {
                throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
            }
@@ -1191,6 +1204,7 @@
                orderDetl.setUpdateBy(userId);
                orderDetl.setUpdateTime(now);
                Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo)
                        .eq(!Cools.isEmpty(orderDetl.getStandby1()), "supp_code", orderDetl.getStandby1())
                        .eq("matnr", orderDetl.getMatnr());
                if (!Cools.isEmpty(orderDetl.getBatch())) {
                    wrapper.eq("batch", orderDetl.getBatch());
@@ -1308,7 +1322,6 @@
                .eq("area_id", basAreas.getId())
                .eq("frozen", 0)
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                // .eq("loc_no", params.getTarSite())
                .orderAsc(Arrays.asList("loc_no"))
                .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
        if (Objects.isNull(locCache)) {
@@ -1680,9 +1693,13 @@
        if (container.getMixMax() < detlDtos.size()) {
            throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!");
        }
        Set<String> matnrs = detlDtos.stream().map(DetlDto::getMatnr).collect(Collectors.toSet());
        List<Mat> mats = matService.selectList(new EntityWrapper<Mat>().in("matnr", matnrs));
        Set<Long> tagIds = mats.stream().map(Mat::getTagId).collect(Collectors.toSet());
        List<Mat> tempMats = new ArrayList<>();
        for (DetlDto detlDto : detlDtos) {
            Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", detlDto.getMatnr())
                    .eq("supp_code", detlDto.getStandby1()));
            tempMats.add(mat);
        }
        Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet());
        if (tagIds.size() > 1) {
            throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
        }
@@ -1894,7 +1911,7 @@
                    .eq("dev_no", basStation.getDevNo())
                    .eq("matnr", combMat.getMatnr())
                    .eq("batch", combMat.getBatch())
                    .eq("standby1", combMat.getStandby1()));
                    .eq(!Cools.isEmpty(combMat.getStandby1()), "standby1", combMat.getStandby1()));
            if (Cools.isEmpty(basStationDetl)) {
                basStationDetl = new BasStationDetl();
                Mat mat = matService.selectByMatnr(combMat.getMatnr());
@@ -1935,8 +1952,8 @@
        OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                .eq("order_id", orderPakin.getId())
                .eq("matnr", combMat.getMatnr())
                .eq("batch", combMat.getBatch())
                .eq("standby1", combMat.getStandby1()));
                .eq(!Cools.isEmpty(combMat.getBatch()),"batch", combMat.getBatch())
                .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1()));
        if (Cools.isEmpty(orderDetlPakin)) {
            throw new CoolException("检索单据明细数据失败");
        }
@@ -2118,6 +2135,7 @@
        // 更新入库通知档 ioStatus ===>> Y
        Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
                .eq("zpallet", pakin.getZpallet());
        WaitPakin setParam = new WaitPakin();
        setParam.setLocNo(locNo);
        setParam.setIoStatus("Y");
@@ -2226,7 +2244,9 @@
                        if (container.getMixMax() > sets.size()) {
                            //余下可混放种类
                            long suplus = Math.round((container.getMixMax() - sets.size()) * 10000) / 10000;
                            Mat mats = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr));
                            Mat mats = matService.selectOne(new EntityWrapper<Mat>()
                                    .eq("supp_code", supId)
                                    .eq("matnr", matnr));
                            if (Objects.isNull(mats)) {
                                throw new CoolException("物料不存在!!");
                            }
@@ -2520,7 +2540,6 @@
                if (!taskDetlService.insert(wrkDetl)) {
                    throw new CoolException("保存工作档明细失败");
                }
            }
            for (WaitPakin pakin : pakins) {