自动化立体仓库 - WMS系统
#1
czkh
1 天以前 4715b1787c85a2186b9c0c43222b64b63c58459b
src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java
@@ -41,13 +41,14 @@
    public void deleteMatBarcode(List<MatBarcode> list) {
        for (MatBarcode matBarcode : list) {
            //对于已经有库存 组托档 工作档的数据 不允许解绑
            Integer locCount = locDetlService.selectCountByMatNr(matBarcode.getMatnr());
            Integer waitCount = waitPakinService.selectCountByMatNr(matBarcode.getMatnr());
//            Integer locCount = locDetlService.selectCountByMatNr(matBarcode.getMatnr());
//            Integer waitCount = waitPakinService.selectCountByMatNr(matBarcode.getMatnr());
            //Integer wrkCount = wrkDetlService.selectCountByMatNr(matBarcode.getMatnr());
            if (locCount > 0 || waitCount > 0){
                throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet());
            }
//            if (locCount > 0 || waitCount > 0){
//                throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet());
//            }
            Integer wrkNo = wrkDetlService.selectWrkNoByMatnr(matBarcode.getMatnr());
            if (wrkNo != null){
            WrkMast wrkMast = wrkMastService.selectById(wrkNo);
            if (wrkMast == null){
                throw new CoolException("工作档异常,有工作明细档无工作档");
@@ -58,6 +59,13 @@
            if (wrkMast.getWrkSts() != 14 && wrkMast.getWrkSts() != 15){
                throw new CoolException("工作档未完成");
            }
            }
            //对于已经有库存 组托档 工作档的数据 不允许解绑
            Integer locCount = locDetlService.selectCountByMatNr(matBarcode.getMatnr());
            Integer waitCount = waitPakinService.selectCountByMatNr(matBarcode.getMatnr());
            if (locCount > 0 || waitCount > 0){
                throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet());
            }
            //对模具的规格做处理得到厚度
            Integer thickness = 0;
            if (!Cools.isEmpty(matBarcode.getSpecs())){
@@ -65,11 +73,13 @@
                thickness = Integer.parseInt(split[1]);
            }
            HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(matBarcode.getZpallet());
            if (halfBarcode != null){
            halfBarcode.setAnfme(halfBarcode.getAnfme() - 1);
            halfBarcode.setPrice(halfBarcode.getPrice() + thickness);
            if (!halfBarcodeService.half(halfBarcode)){
                throw new CoolException("更新半托信息失败");
            }
            }
            matBarcodeMapper.deleteByMatnr(matBarcode.getMatnr());
        }
    }