自动化立体仓库 - WMS系统
野心家
2023-06-20 5ce6bfb2e237b9fbf092a03cf80e86d928ac7ca6
src/main/java/com/zy/asrs/task/handler/MoveLocHandler.java
@@ -61,17 +61,18 @@
        try {
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                    .eq("loc_sts", "F")
                    .eq("pack_status", 4)
                    .eq("pack_status", 4)//测试失败
                    .eq("row1", equipmentRow)
                    .eq("loc_type1", (short) 1)
                    .eq("fire_status",0)
            );
            if (!Cools.isEmpty(locMasts)){
                for (LocMast locMast:locMasts){
                    LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
                    TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                            .eq("loc_no",locMast.getLocNo())
                            .eq("barcode",locMast.getBarcode())
                            .eq("status",4)
                            .eq("barcode",locDetl.getMatnr())
                            .eq("status",4)//完成测试
                    );
                    if (!Cools.isEmpty(testMast)){
                        if (testMast.getStatus()==4){
@@ -81,10 +82,10 @@
                                targetLocNo=locMastService.queryFreeLocMast(1,(short)4);
                            }
                            if (targetLocNo != null){
                                workService.locMove(locMast.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(testMast.getUserId()));
                                workService.locMove(locMast.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt("9935"));
                                //4.测试完成上报
                                CombParam combParam = new CombParam();
                                combParam.setPackNo(locMast.getBarcode());
                                combParam.setPackNo(locDetl.getMatnr());
                                combParam.setLocNo(locMast.getLocNo());
                                combParam.setPackSts(2);
                                combParam.setStepSts(4);
@@ -112,18 +113,20 @@
        try {
            List<LocMast> locMasts2 = locMastService.selectList(new EntityWrapper<LocMast>()
                    .eq("loc_sts", "F")
                    .eq("pack_status", 4)
                    .eq("pack_status", 3)//测试完成
                    .eq("row1", equipmentRow)
                    .eq("loc_type1", (short) 1)
                    .eq("fire_status",0)
            );
            if (!Cools.isEmpty(locMasts2)){
                for (LocMast locMast:locMasts2){
                    LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
                    TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                            .eq("loc_no",locMast.getLocNo())
                            .eq("barcode",locMast.getBarcode())
                            .eq("barcode",locDetl.getMatnr())
                            .eq("status",4)
                    );
                    boolean sign=false;
                    if (!Cools.isEmpty(testMast)){
                        if (testMast.getStatus()==4){
                            //移库开始,查询目标库位
@@ -134,15 +137,7 @@
                            if (targetLocNo != null){
                                //生成出库任务
                                if (outLoc(locMast)){
                                    //4.测试完成上报
                                    CombParam combParam = new CombParam();
                                    combParam.setPackNo(locMast.getBarcode());
                                    combParam.setLocNo(locMast.getLocNo());
                                    combParam.setPackSts(1);
                                    combParam.setStepSts(4);
                                    combParam.setRequestTime(DateUtils.convert(new Date()));
                                    new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                                    return SUCCESS;
                                    sign=true;
                                }
                            }else {
                                //3\4排满  向2排移库,查询目标库位
@@ -151,16 +146,8 @@
                                    targetLocNo=locMastService.queryFreeLocMast(1,(short)2);
                                }
                                if (targetLocNo != null){
                                    workService.locMove(locMast.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(testMast.getUserId()));
                                    //4.测试完成上报
                                    CombParam combParam = new CombParam();
                                    combParam.setPackNo(locMast.getBarcode());
                                    combParam.setLocNo(locMast.getLocNo());
                                    combParam.setPackSts(1);
                                    combParam.setStepSts(4);
                                    combParam.setRequestTime(DateUtils.convert(new Date()));
                                    new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                                    return SUCCESS;
                                    workService.locMove(locMast.getLocNo(),targetLocNo.getLocNo(),(long)9935);
                                    sign=true;
                                }else {
                                    log.error("测试完成自动移库--->没有空库位!");
                                }
@@ -168,8 +155,20 @@
                        }else if (testMast.getStatus()!=4) {
                            log.error("测试状态异常,库位号为:" + testMast.getLocNo());
                        }
                    }else {
                        log.error("测试库位:"+locMast.getLocNo()+"所属测试档为空或者不状态为4");
                    }
                    if (sign){
                        //4.测试完成上报
                        CombParam combParam = new CombParam();
                        combParam.setPackNo(locDetl.getMatnr());
                        combParam.setLocNo(locMast.getLocNo());
                        combParam.setPackSts(1);
                        combParam.setStepSts(4);
                        combParam.setRequestTime(DateUtils.convert(new Date()));
                        new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam);
                        return SUCCESS;
                    }
                }
            }
@@ -218,7 +217,7 @@
            } else if (Cools.isEmpty(locMast.getModiTime())){
                log.error("库位:"+locMast.getLocNo()+"modiTime为空");
            } else if (Cools.isEmpty(locMast.getBarcode())){
                log.error("库位:"+locMast.getLocNo()+"Pack码为空");
                log.error("库位:"+locMast.getLocNo()+"托盘码为空");
            } else {
                // 生成工作号
                int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));
@@ -231,7 +230,7 @@
                wrkMast.setIoPri(13D); // 优先级:13
                wrkMast.setCrnNo(1);
                wrkMast.setSourceStaNo(203); // 源站
                wrkMast.setStaNo(205); // 目标站  2号堆垛机入库站
                wrkMast.setStaNo(206); // 目标站  2号堆垛机入库站
                wrkMast.setSourceLocNo(locMast.getLocNo()); // 源库位
                wrkMast.setFullPlt("Y"); // 满板:Y
                wrkMast.setPicking("N"); // 拣料
@@ -264,7 +263,7 @@
//                    locMast.setPackStatus(5); //5:开始静置
                    CombParam combParam = new CombParam();
                    combParam.setPackNo(locMast.getBarcode());
                    combParam.setPackNo(wrkDetl.getMatnr());
                    combParam.setLocNo(locMast.getLocNo());
                    combParam.setPackSts(locMast.getPackStatus());
                    combParam.setRequestTime(DateUtils.convert(new Date()));