自动化立体仓库 - WMS系统
pang.jiabao
4 天以前 d18505cc87fa30a5b202057bbcc4236986efc80a
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -562,22 +562,22 @@
            throw new CoolException(BaseRes.PARAM);
        }
        Integer suplus = null;
        if (loadingConfigTimer.getZpalletManage()) {
            BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
            if (Objects.isNull(container)) {
                throw new CoolException("数据错误:容器码不存在!!");
            }
            if (container.getMixMax() < param.getCombMats().size()) {
                throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!");
            }
            Set<String> matnrs = param.getCombMats().stream().map(CombParam.CombMat::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());
            if (tagIds.size() > 1) {
                throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
            }
            suplus = container.getMixMax();
        }
//        if (loadingConfigTimer.getZpalletManage()) {
//            BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
//            if (Objects.isNull(container)) {
//                throw new CoolException("数据错误:容器码不存在!!");
//            }
//            if (container.getMixMax() < param.getCombMats().size()) {
//                throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!");
//            }
//            Set<String> matnrs = param.getCombMats().stream().map(CombParam.CombMat::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());
//            if (tagIds.size() > 1) {
//                throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
//            }
//            suplus = container.getMixMax();
//        }
        // 判断是否有相同条码的数据
        if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
@@ -599,7 +599,7 @@
        Date now = new Date();
        // 无单组托
        if (Cools.isEmpty(param.getOrderNo())) {
        if (Cools.isEmpty(param.getCombMats().get(0).getOrderNo())) {
            // 生成入库通知档
            List<DetlDto> detlDtos = new ArrayList<>();
            param.getCombMats().forEach(elem -> {
@@ -619,9 +619,9 @@
                if (Cools.isEmpty(mat)) {
                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
                }
                if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) {
                    throw new CoolException("物料:" + detlDto.getMatnr() + "单次最大组托上限为:" + mat.getUpQty());
                }
//                if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) {
//                    throw new CoolException("物料:" + detlDto.getMatnr() + "单次最大组托上限为:" + mat.getUpQty());
//                }
                WaitPakin waitPakin = new WaitPakin();
                BeanUtils.copyProperties(mat, waitPakin);
                waitPakin.setBatch(detlDto.getBatch());
@@ -646,10 +646,14 @@
                if (Cools.isEmpty(order) || order.getSettle() > 2) {
                    throw new CoolException("单据编号已过期");
                }
                // 订单明细数量校验
                OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                Wrapper<OrderDetlPakin> wrapper = new EntityWrapper<OrderDetlPakin>()
                        .eq("order_id", order.getId())
                        .eq("matnr", elem.getMatnr()));
                        .eq("matnr", elem.getMatnr());
                if(!Cools.isEmpty(elem.getBatch())) {
                    wrapper.eq("batch",elem.getBatch());
                }
                // 订单明细数量校验
                OrderDetlPakin detls = orderDetlPakinService.selectOne(wrapper);
                if (Objects.isNull(detls)) {
                    throw new CoolException("数据错误:单据明细不存在!!");