| | |
| | | wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位 |
| | | wrkMast.setSourceLocNo(""); // 源库位清空 |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setUpdMk("");//允许再次移库 |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (System.currentTimeMillis() - crnProtocol.getLastCommandTime() < 1000 * 60 * 2) { |
| | | if (System.currentTimeMillis() - crnProtocol.getLastCommandTime() < 1000 * 60) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | 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()); // 堆垛机编号 |
| | |
| | | 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); |
| | |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | if(waitWrkMast.getWrkSts() < 5 && waitWrkMast.getIoType() < 100) { |
| | | continue;//有任务禁止搬运,有可能浅库位状态还未变更完成 |
| | | } |
| | | } |
| | | |
| | | } 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)){ |
| | |
| | | } |
| | | 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()); |
| | |
| | | } |
| | | } |
| | | } |
| | | 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()); |
| | | |
| | |
| | | */ |
| | | public synchronized void locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol,Integer mark) { |
| | | News.warnNoLog(""+mark+" - 2"+" - 0"+" - 堆垛机入出库作业下发:执行出库"); |
| | | |
| | | int devpTaskStackOver = 20; |
| | | Config config = configService.selectOne(new EntityWrapper<Config>() |
| | | .eq("code", "devpTaskStackOver")); |
| | | if(config != null) { |
| | | devpTaskStackOver = Integer.parseInt(config.getValue()); |
| | | } |
| | | |
| | | Integer devpWorkingCount = commonService.queryDevpWorkingCount(); |
| | | if (devpWorkingCount > devpTaskStackOver) { |
| | | News.warn("" + mark + " - 2" + " - 0" + " - 输送线任务过载,当前输送线承载数量:{}", devpWorkingCount); |
| | | return; |
| | | } |
| | | |
| | | for (CrnSlave.CrnStn crnStn : slave.getCrnOutStn()) { |
| | | // 获取工作状态为11(生成出库ID)的出库工作档 |
| | | // WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId(), crnStn.getStaNo()); |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } 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); |
| | |
| | | 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()); |