自动化立体仓库 - WMS系统
#
野心家
2023-06-01 3c38ed3606ecbaac693baff568f8f66e635abc8d
src/main/java/com/zy/common/web/WcsController.java
@@ -68,14 +68,28 @@
        if (Cools.isEmpty(param.getSourceStaNo())) {
            return R.error("源站编号不能为空");
        }
        if (Cools.isEmpty(param.getBarcode())) {
            return R.error("托盘码不能为空");
        }
        boolean logs=true;
        TestMast testMast11=new TestMast();
        //如果pack码为空,查测试表
        if (Cools.isEmpty(param.getPackNo())) {
            return R.error("packNo不能为空");
            testMast11= testMastService.selectOne(new EntityWrapper<TestMast>()
                    .eq("user_id",param.getBarcode())//查托盘码
                    .eq("status",4));   //完成测试
            logs=false;
        }
        Date now = new Date();
        if (true){
            try{
                Mat mat = matService.selectByMatnr(param.getPackNo());
                Mat mat=new Mat();
                if(logs){
                    mat = matService.selectByMatnr(param.getPackNo());
                }else {
                    mat = matService.selectByMatnr(testMast11.getBarcode());
                }
                if (Cools.isEmpty(mat)){
                    return R.error("商品信息档案未查询到pack信息"+param.getPackNo());
                }
@@ -203,13 +217,13 @@
            if (!wrkDetlService.insert(wrkDetl)) {
                throw new CoolException("保存工作明细失败");
            }
            TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>().eq("barcode", wrkMast.getBarcode()));
            TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                    .eq("barcode", wrkDetl.getMatnr()));//pack码
            if (Cools.isEmpty(testMast)){
                //生成测试档
                testMast=new TestMast();
                testMast.setChannel(locMast.getChannel());
                testMast.setUserId(locMast.getLocNo());
                testMast.setUserId(wrkMast.getBarcode());//托盘码
                testMast.setStatus(1);
                testMast.setBarcode(wrkDetl.getMatnr());
                testMast.setLocNo(locMast.getLocNo());
@@ -219,7 +233,13 @@
                    throw new CoolException(wrkDetl.getMatnr()+"生成测试档失败");
                }
            }else {
                throw new CoolException(wrkDetl.getMatnr()+"已存在测试档");
                testMast.setBarcode(wrkDetl.getMatnr());
                testMast.setChannel(locMast.getChannel());
                testMast.setLocNo(locMast.getLocNo());
                testMast.setAppeTime(now);
                if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){
                    throw new CoolException(wrkDetl.getMatnr()+"更新测试档失败");
                }
            }
        });
        // 更新入库通知档 ioStatus ===>> Y