自动化立体仓库 - WMS系统
野心家
2023-06-17 70f6e26f42bce8feb887a55ab8e95fb92c175369
src/main/java/com/zy/common/web/WcsController.java
@@ -79,6 +79,15 @@
                    .eq("user_id",param.getBarcode())//查托盘码
                    .eq("status",4));   //完成测试
            logs=false;
        }else{
            LocDetl locDetl=locDetlService.selectOne(new EntityWrapper<LocDetl>()
                    .eq("matnr",param.getPackNo())
                    .or()
                    .eq("zpallet",param.getBarcode()));
            if(!Cools.isEmpty(locDetl)){
                return R.error("PACK码在库!!!!");
            }
        }
        Date now = new Date();
        if (true){
@@ -166,7 +175,7 @@
    }
    /**
     * 全板入库
         * 全板入库
     */
    @Transactional
    public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, List<WaitPakin> waitPakins) {
@@ -206,7 +215,7 @@
        LocMast locMast = locMastService.selectById(dto.getLocNo());
        // 生成工作档明细
        waitPakins.forEach(waitPakin -> {
        for (WaitPakin waitPakin: waitPakins) {
            WrkDetl wrkDetl = new WrkDetl();
            wrkDetl.sync(waitPakin);
            wrkDetl.setWrkNo(wrkMast.getWrkNo());
@@ -217,31 +226,49 @@
            if (!wrkDetlService.insert(wrkDetl)) {
                throw new CoolException("保存工作明细失败");
            }
            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(wrkMast.getBarcode());//托盘码
                testMast.setStatus(1);
                testMast.setBarcode(wrkDetl.getMatnr());
                testMast.setLocNo(locMast.getLocNo());
                testMast.setModiTime(now);
                testMast.setAppeTime(now);
                if (!testMastService.insert(testMast)){
                    throw new CoolException(wrkDetl.getMatnr()+"生成测试档失败");
                TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                        .eq("barcode", wrkDetl.getMatnr()));//pack码
                if (Cools.isEmpty(testMast)){
                    //生成测试档
                    testMast=new TestMast();
                    //入待测库位通道设为0
                    if(locMast.getChannel()==null) {
                        testMast.setChannel(0);//通道设为0
                    }else{
                        testMast.setChannel(locMast.getChannel());
                    }
                    testMast.setUserId(wrkMast.getBarcode());//托盘码
                    testMast.setStatus(1);
                    testMast.setBarcode(wrkDetl.getMatnr());
                    testMast.setLocNo(locMast.getLocNo());
                    testMast.setModiTime(now);
                    testMast.setAppeTime(now);
                    if (!testMastService.insert(testMast)){
                        throw new CoolException(wrkDetl.getMatnr()+"生成测试档失败");
                    }
                }else if(wrkMast.getStaNo()==209){
                    testMast.setBarcode(wrkDetl.getMatnr());
                    testMast.setLocNo(locMast.getLocNo());
                    testMast.setUserId(wrkMast.getBarcode());//托盘码
                    testMast.setAppeTime(now);
                    if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){
                        throw new CoolException(wrkDetl.getMatnr()+"更新测试档失败");
                    }
                }else {
                    testMast.setBarcode(wrkDetl.getMatnr());
                    testMast.setChannel(locMast.getChannel());
                    testMast.setLocNo(locMast.getLocNo());
                    testMast.setStatus(1);
                    testMast.setUserId(wrkMast.getBarcode());//托盘码
                    testMast.setAppeTime(now);
                    if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){
                        throw new CoolException(wrkDetl.getMatnr()+"更新测试档失败");
                    }
                }
            }else {
                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
        Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
                .eq("zpallet", barcode);
@@ -265,16 +292,16 @@
            if (!locMastService.updateById(locMast)){
                throw new CoolException("改变库位状态失败");
            }else{
                if (locMast.getRow1()<3){
                    //1.扫码上报
                    CombParam combParam = new CombParam();
                    combParam.setPackNo(wrkMast.getBarcode());
                    combParam.setLocNo(wrkMast.getLocNo());
                    combParam.setPackSts(0);
                    combParam.setStepSts(1);
                    combParam.setRequestTime(DateUtils.convert(now));
                    new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                }
//                if (locMast.getRow1()<3){
//                    //1.扫码上报
//                    CombParam combParam = new CombParam();
//                    combParam.setPackNo(wrkMast.getBarcode());
//                    combParam.setLocNo(wrkMast.getLocNo());
//                    combParam.setPackSts(0);
//                    combParam.setStepSts(1);
//                    combParam.setRequestTime(DateUtils.convert(now));
//                    new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
//                }
            }
        } else {
            throw new CoolException(dto.getLocNo()+"目标库位已被占用");