自动化立体仓库 - WMS系统
野心家
19 小时以前 9ac70efe81c1909d63b89f9b18c4f367c0584ceb
src/main/java/com/zy/asrs/task/handler/MoveLocHandler.java
@@ -68,6 +68,7 @@
                    .eq("row1", equipmentRow)
                    .eq("loc_type1", (short) 1)
                    .eq("fire_status", 0)
                    .eq("ctn_kind",1)
            );
            if (!Cools.isEmpty(locMasts2)) {
                for (LocMast locMast : locMasts2) {
@@ -79,11 +80,11 @@
                    TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                            .eq("loc_no", locMast.getLocNo())
                            .eq("barcode", locDetl.getMatnr())
                            .eq("status", 4)
                            .eq("status", 3)
                    );
                    boolean sign = false;
                    if (!Cools.isEmpty(testMast)) {
                        if (testMast.getStatus() == 4) {
                        if (testMast.getStatus() == 3) {
                            //移库开始,查询目标库位
                            LocMast targetLocNo = locMastService.queryFreeLocMast(3, (short) 2);
                            if (Cools.isEmpty(targetLocNo)) {
@@ -109,7 +110,7 @@
                    } else {
                        log.error("测试库位:" + locMast.getLocNo() + "所属测试档为空或者不状态为4");
                    }
                    if (sign) {
                    if (false) {
                        //4.测试完成上报
                        CombParam combParam = new CombParam();
                        combParam.setPackNo(locDetl.getMatnr());
@@ -117,7 +118,7 @@
                        combParam.setPackSts(1);
                        combParam.setStepSts(4);
                        combParam.setRequestTime(DateUtils.convert(new Date()));
                        new PostMesDataUtils().postMesData("MES系统", mesUrl, inpath, combParam);
//                        new PostMesDataUtils().postMesData("MES系统", mesUrl, inpath, combParam);
                        return SUCCESS;
                    }
                }
@@ -125,6 +126,74 @@
        } catch (Exception e) {
            log.error("" + e);
        }
        //测试失败,移库
        try {
            List<LocMast> locMasts2 = locMastService.selectList(new EntityWrapper<LocMast>()
                    .eq("loc_sts", "F")
                    .eq("pack_status", 4)//测试失败
                    .eq("row1", equipmentRow)
                    .eq("loc_type1", (short) 1)
                    .eq("fire_status", 0)
                    .eq("ctn_kind",1)
            );
            if (!Cools.isEmpty(locMasts2)) {
                for (LocMast locMast : locMasts2) {
                    LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
                    if (Cools.isEmpty(locDetl)) {
                        log.error("测试失败 出库、移库==>库存明细查询失败!库位号:" + locMast.getLocNo());
                        continue;
                    }
                    TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                            .eq("loc_no", locMast.getLocNo())
                            .eq("barcode", locDetl.getMatnr())
                            .eq("status", 4)
                    );
                    boolean sign = false;
                    if (!Cools.isEmpty(testMast)) {
                        if (testMast.getStatus() == 4) {
                            //移库开始,查询目标库位
                            LocMast targetLocNo = locMastService.queryFreeLocMast(3, (short) 4);
                            if (Cools.isEmpty(targetLocNo)) {
                                targetLocNo = locMastService.queryFreeLocMast(2, (short) 4);
                                if (Cools.isEmpty(targetLocNo)) {
                                    targetLocNo = locMastService.queryFreeLocMast(1, (short) 4);
                                    if (Cools.isEmpty(targetLocNo)) {
                                        return FAIL.setMsg("没有中转库位");
                                    }
                                }
                            }
                            if (targetLocNo != null) {
                                workService.locMove(locMast.getLocNo(), targetLocNo.getLocNo(), (long) 9935);
                                sign = true;
                            } else {
                                log.error("测试失败自动移库--->没有空库位!");
                            }
                        } else if (testMast.getStatus() != 4) {
                            log.error("测试状态异常,库位号为:" + testMast.getLocNo());
                        }
                    } else {
                        log.error("测试库位:" + locMast.getLocNo() + "所属测试档为空或者不状态为4");
                    }
                    if (false) {
                        //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;
                    }
                }
            }
        } catch (Exception e) {
            log.error("" + e);
        }
        //测试有空库位 移库
        try {
            List<LocMast> locMasts3 = locMastService.selectList(new EntityWrapper<LocMast>()