#
ytfl
2025-07-18 0ed16b3a5acb9d45cc3a88c14202584914ceaf3f
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -462,6 +462,7 @@
                        wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位
                        wrkMast.setSourceLocNo(""); // 源库位清空
                        wrkMast.setModiTime(now);
                        wrkMast.setUpdMk("");//允许再次移库
                        if (wrkMastMapper.updateById(wrkMast) == 0) {
                            throw new CoolException("更新工作档数据状态失败");
                        }
@@ -675,7 +676,7 @@
                List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
                        .eq("crn_no", crn.getId())
                        .eq("wrk_sts", 2)
                        .notIn("wrk_sts", 5, 14, 15)
                );
                if (!wrkMasts.isEmpty()) {
                    continue;
@@ -736,7 +737,7 @@
                    continue;
                }
                if (System.currentTimeMillis() - crnProtocol.getLastCommandTime() < 1000 * 60 * 2) {
                if (System.currentTimeMillis() - crnProtocol.getLastCommandTime() < 1000 * 60) {
                    continue;
                }
@@ -747,15 +748,15 @@
                List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
                        .eq("crn_no", crn.getId())
                        .notIn("wrk_sts", 5, 14, 15)
                        .eq("wrk_sts", 2)
                );
                if (!wrkMasts.isEmpty()) {
                if (wrkMasts.isEmpty()) {
                    continue;
                }
                CrnSlave.CrnStn crnStn = crn.getCrnInStn().get(0);
                News.info("堆垛机无任务自动回入库口待机==>>" + crnProtocol.getCrnNo() + "号堆垛机");
                News.info("堆垛机有入库任务时,回入库口待机==>>" + crnProtocol.getCrnNo() + "号堆垛机");
                // 命令下发区 --------------------------------------------------------------------------
                CrnCommand crnCommand = new CrnCommand();
                crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号
@@ -862,7 +863,7 @@
                LocMast shallowLoc = locMastService.selectById(shallowLocNo);
                // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!
                if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) {
                    News.warnNoLog(""+mark+" - 1"+" - 9"+" - // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!库位状态={}",shallowLoc.getLocSts());
                    News.warn(""+mark+" - 1"+" - 9"+" - // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!库位={},库位状态={}",shallowLoc.getLocNo(),shallowLoc.getLocSts());
                    WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo);
                    if (null == waitWrkMast) {
                        News.error(""+mark+" - 1"+" - 10"+" - {}库位异常,未检索到相应工作档!", shallowLocNo);
@@ -878,7 +879,7 @@
                    }
                } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
                    News.warnNoLog(""+mark+" - 1"+" - 12"+" - // F、D  库位状态={}",shallowLoc.getLocSts());
                    News.warn(""+mark+" - 1"+" - 12"+" - // F、D  库位={},库位状态={}",shallowLoc.getLocNo(),shallowLoc.getLocSts());
                    // 此标记避免多次执行移库任务
                    if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) {
                        if (moveLocForDeepLoc(slave, shallowLoc,mark)){
@@ -896,7 +897,7 @@
                    }
                    continue;
                } else if (shallowLoc.getLocSts().equals("Q")) {
                    News.warnNoLog(""+mark+" - 1"+" - 13"+" - // Q  库位状态={}",shallowLoc.getLocSts());
                    News.warn(""+mark+" - 1"+" - 13"+" - // Q  库位={},库位状态={}",shallowLoc.getLocNo(),shallowLoc.getLocSts());
                    WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo);
                    if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) {
                        News.infoNoLog(""+mark+" - 1"+" - 14"+" - // F、D  工作状态(判断条件为==4)={}",waitWrkMast.getWrkSts());
@@ -904,7 +905,7 @@
                    }
                }
            }
            News.warnNoLog(""+mark+" - 1"+" - 15"+" - 命令下发 : 工作号={},源排={},源列={},源层={},目标排={},目标列={},目标层={}",wrkMast.getWrkNo().shortValue()
            News.info(""+mark+" - 1"+" - 15"+" - 命令下发 : 工作号={},源排={},源列={},源层={},目标排={},目标列={},目标层={}",wrkMast.getWrkNo().shortValue()
                    ,crnStn.getRow().shortValue(),crnStn.getBay().shortValue(),crnStn.getLev().shortValue()
                    ,locMast.getRow1().shortValue(),locMast.getBay1().shortValue(),locMast.getLev1().shortValue());
@@ -1056,7 +1057,7 @@
                        LocMast shallowLoc = locMastService.selectById(shallowLocNo);
                        // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!
                        if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) {
                            News.warnNoLog(""+mark+" - 2"+" - 7"+" - // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!库位状态={}",shallowLoc.getLocSts());
                            News.warnNoLog(""+mark+" - 2"+" - 7"+" - // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!库位={},库位状态={}",shallowLoc.getLocNo(),shallowLoc.getLocSts());
                            WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo);
                            if (null == waitWrkMast) {
                                News.error("{}库位异常,未检索到相应工作档!", shallowLocNo);
@@ -1073,7 +1074,7 @@
                                }
                            }
                        } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
                            News.warnNoLog(""+mark+" - 2"+" - 9"+" - // F、D  库位状态={}",shallowLoc.getLocSts());
                            News.warnNoLog(""+mark+" - 2"+" - 9"+" - // F、D  库位={},库位状态={}",shallowLoc.getLocNo(),shallowLoc.getLocSts());
//                            WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo);
                            //2022-08-16 modify,不根据updmk标记移库任务(容易被取消导致堵塞),查询工作档是否存在任务
                            WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo);
@@ -1094,7 +1095,7 @@
                            News.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo);
                            continue;
                        } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")) {
                            News.warnNoLog(""+mark+" - 2"+" - 10"+" - // Q、S  库位状态={}",shallowLoc.getLocSts());
                            News.warnNoLog(""+mark+" - 2"+" - 10"+" - // Q、S  库位={},库位状态={}",shallowLoc.getLocNo(),shallowLoc.getLocSts());
                            WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo);
                            if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) {
                                News.infoNoLog(""+mark+" - 2"+" - 11"+" - // F、D  工作状态(判断条件为==4)={}",waitWrkMast.getWrkSts());