自动化立体仓库 - WMS系统
Junjie
2023-03-20 9f1da5a5ad0cdc826ca8dcbb5b9690a6a17208ee
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -92,23 +92,24 @@
        }
        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
        int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
        if (countLoc > 0 || countWrk > 0) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode());
        if (wrkMast != null && wrkMast.getIoType() < 100){
            throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode());
        }
        if (countLoc > 0 ) {
            throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode());
        }
        //设置非null批号,
        for (CombParam.CombMat combMat : param.getCombMats()) {
            if (combMat.getBatch() == null){
                combMat.setBatch("");
            }
        }
        for (CombParam.CombMat combMat : param.getCombMats()) {
            Integer sum = orderDetlService.sameOrderComb(param.getOrderNo(), combMat.getMatnr(),combMat.getBatch());
            OrderDetl orderDetl = orderDetlService.selectItem(param.getOrderNo(), combMat.getMatnr(), combMat.getBatch());
            if ( combMat.getAnfme() > (orderDetl.getAnfme() - sum)) {
                throw new CoolException("组托数量已超出订单需求量,请检查是否有其他的组托已完成");
            }
        }
        Date now = new Date();
@@ -152,6 +153,18 @@
            }
        // 关联组托
        } else {
            for (CombParam.CombMat combMat : param.getCombMats()) {
                Integer sum = orderDetlService.sameOrderComb(param.getOrderNo(), combMat.getMatnr(),combMat.getBatch());
                OrderDetl orderDetl = orderDetlService.selectItem(param.getOrderNo(), combMat.getMatnr(), combMat.getBatch());
                if (orderDetl == null) {
                    throw new CoolException("找不到组托的单据明细");
                }
                Double anfme = orderDetl.getAnfme();
                if ( anfme > (anfme - sum)) {
                    throw new CoolException("组托数量已超出订单需求量,请检查是否有其他的组托已完成");
                }
            }
            Order order = orderService.selectByNo(param.getOrderNo());
            if (order.getSettle() > 2) {
                throw new CoolException("单据编号已过期");