| | |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | |
| | | //101站有3个扫码器,当0扫码器没有数据时,获取9、10两个扫码器数据 |
| | | if((inSta.getStaNo().equals(101) || inSta.getStaNo().equals(104)) && ( "NoRead".equals(barcode) || Cools.isEmpty(barcode) )){ |
| | | BarcodeThread barcodeThread1 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode1()); |
| | | if (barcodeThread1 != null) { |
| | | barcode = barcodeThread1.getBarcode(); |
| | | } |
| | | |
| | | if("NoRead".equals(barcode) || Cools.isEmpty(barcode)) { |
| | | BarcodeThread barcodeThread2 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode2()); |
| | | if (barcodeThread2 != null) { |
| | | barcode = barcodeThread2.getBarcode(); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | ////判断101和104是否是拣料、并板、盘点再入库 |
| | | //WrkMast wrkMast1=wrkMastMapper.selectpj(inSta.getStaNo(),barcode); |
| | | //if((inSta.getStaNo().equals(101) || inSta.getStaNo().equals(104)) &&!Cools.isEmpty(barcode)&&!Cools.isEmpty(wrkMast1)){ |
| | | // log.error("101或104拣料、并板、盘点再入库", wrkMast1.getWrkNo()); |
| | | // continue; |
| | | //} |
| | | |
| | | if (!Cools.isEmpty(barcode)) { |
| | | log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 104 && devpThread.ioModeOf1F2 == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 111 && devpThread.ioModeOf1F3 == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 114 && devpThread.ioModeOf1F4 == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 201 && devpThread.ioModeOf2F1 == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 204 && devpThread.ioModeOf2F2 == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 301 && devpThread.ioModeOf3F1 == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 304 && devpThread.ioModeOf3F2 == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | param.setFull(staProtocol.isFull()); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | | .setPath("/rpc/ ") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | // Integer code = jsonObject.getInteger("code"); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | |
| | | staProtocol.setWorkNo(dto.getWorkNo().shortValue()); |
| | | staProtocol.setStaNo(dto.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | |
| | | ledThread.errorReset(); |
| | | |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else if(code == 500){ |
| | | if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } else if (code == 700) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = barcode + "托盘识别异常,请先进行组托!"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | // StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | // |
| | | // barcodeThread.setBarcode(""); |
| | | // staProtocol.setWorkNo(dto.getWorkNo().shortValue()); |
| | | // staProtocol.setStaNo(dto.getStaNo().shortValue()); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // |
| | | // ledThread.errorReset(); |
| | | // |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // if (!result) { |
| | | // throw new CoolException("更新plc站点信息失败"); |
| | | // } |
| | | // } else if(code == 500){ |
| | | // if (ledThread != null) { |
| | | // String errorMsg = jsonObject.getString("msg"); |
| | | // if (!Cools.isEmpty(errorMsg)) { |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | // } |
| | | // } |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // } else if (code == 700) { |
| | | // staProtocol.setWorkNo((short) 9995); |
| | | // staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // |
| | | // // led 异常显示 |
| | | // if (ledThread != null) { |
| | | // String errorMsg = barcode + "托盘识别异常,请先进行组托!"; |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // // 检索库位 |
| | |
| | | if (inSta.getStaNo() == 101 && devpThread.ioModeOf1F2 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 114 && devpThread.ioModeOf1F3 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 111 && devpThread.ioModeOf1F4 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 204 && devpThread.ioModeOf2F1 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 201 && devpThread.ioModeOf2F2 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 301 && devpThread.ioModeOf3F1 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 304 && devpThread.ioModeOf3F2 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | |
| | | //101站有3个扫码器,当0扫码器没有数据时,获取9、10两个扫码器数据 |
| | | if((pickSta.getStaNo().equals(101) || pickSta.getStaNo().equals(104)) && ( "NoRead".equals(barcode) || Cools.isEmpty(barcode) )){ |
| | | BarcodeThread barcodeThread1 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode1()); |
| | | if (barcodeThread1 != null) { |
| | | barcode = barcodeThread1.getBarcode(); |
| | | } |
| | | |
| | | if("NoRead".equals(barcode) || Cools.isEmpty(barcode)) { |
| | | BarcodeThread barcodeThread2 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode2()); |
| | | if (barcodeThread2 != null) { |
| | | barcode = barcodeThread2.getBarcode(); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!Cools.isEmpty(barcode) && "NoRead".equals(barcode)) { |
| | | if (!Cools.isEmpty(barcode)) { |
| | | log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | // if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | // continue; |
| | | // } |
| | | } else { |
| | | continue; |
| | | } |
| | |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57 |
| | | wrkMast.setWrkSts(2L); // 工作状态: 2.设备上走 |
| | | wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 源站 |
| | | |
| | | Integer sourceStaNo = 0; |
| | | switch (wrkMast.getStaNo()){ |
| | | case 100: |
| | | sourceStaNo = 101; |
| | | break; |
| | | case 103: |
| | | sourceStaNo = 104; |
| | | break; |
| | | } |
| | | |
| | | wrkMast.setSourceStaNo(sourceStaNo); // 源站 |
| | | // wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 源站 |
| | | wrkMast.setStaNo(staNo); // 目标站 |
| | | wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位 |
| | | wrkMast.setSourceLocNo(""); // 源库位清空 |
| | |
| | | List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep11(slave.getId(), crnStn.getStaNo()); |
| | | // 获取工作状态为14的工作档 |
| | | WrkMast wrkMast1 = wrkMastMapper.selectPakOutStep14(slave.getId(), crnStn.getStaNo()); |
| | | if (wrkMast1.getIoType().equals(103) || wrkMast1.getIoType().equals(107) ) { |
| | | if ( wrkMast1 !=null) { |
| | | continue; |
| | | } |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 103 && devpThread.ioModeOf1F2 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 110 && devpThread.ioModeOf1F3 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 113 && devpThread.ioModeOf1F4 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 200 && devpThread.ioModeOf2F1 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 203 && devpThread.ioModeOf2F2 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 300 && devpThread.ioModeOf3F1 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 303 && devpThread.ioModeOf3F2 != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | continue; |
| | | } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")) { |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) { |
| | | if (null != waitWrkMast && (waitWrkMast.getWrkSts() == 4 || waitWrkMast.getWrkSts() == 5)) { |
| | | continue; |
| | | } |
| | | } |
| | |
| | | |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() > 9990 |
| | | && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() >= 9990 |
| | | && staProtocol.getWorkNo() <= 9999) && staProtocol.isPakMk()) { |
| | | |
| | | try { |
| | |
| | | } |
| | | |
| | | LocMast sourceLoc = locMastService.queryDemoSourceLoc(crn.getId()); |
| | | LocMast loc = locMastService.queryDemoLoc(crn.getId()); |
| | | if (null == sourceLoc || null == loc) { |
| | | if (null == sourceLoc ) { |
| | | continue; |
| | | } |
| | | LocMast loc = locMastService.queryDemoLoc0(crn.getId(),sourceLoc.getLocType1()); |
| | | if ( null == loc) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | loc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(loc)) { |
| | | throw new CoolException("更新目标库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("移转失败"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("堆垛机演示 ===>> 库位移转失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | /** |
| | | * 堆垛机演示 ===>> 所有库位轮询 |
| | | */ |
| | | public synchronized void crnDemoOfLocMove2() { |
| | | try { |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | if (!crn.getDemo()) { |
| | | continue; |
| | | } // 必须为演示状态 |
| | | |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | // 只有当堆垛机空闲 并且 无任务时才继续执行 |
| | | if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO) { |
| | | // 获取移库工作档信息 |
| | | WrkMast wrkMast = wrkMastMapper.selectLocMove(crn.getId()); |
| | | if (null != wrkMast) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | LocMast sourceLoc = locMastService.queryDemoSourceLoc1(crn.getId()); |
| | | if (null == sourceLoc ) { |
| | | continue; |
| | | } |
| | | LocMast loc = locMastService.queryDemoLoc2(crn.getId(),sourceLoc.getLocType1()); |
| | | if ( null == loc) { |
| | | continue; |
| | | } |
| | | |
| | | String sourceLocNo = sourceLoc.getLocNo(); |
| | | String locNo = loc.getLocNo(); |
| | | |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(0); |
| | | // 保存工作档 |
| | | wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(11); // 入出库状态: 11.库格移载 |
| | | wrkMast.setIoPri(13D); |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(sourceLocNo); // 源库位 |
| | | wrkMast.setLocNo(locNo); // 目标库位 |
| | | wrkMast.setFullPlt("N"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiTime(new Date()); |
| | | int res = wrkMastMapper.insert(wrkMast); |
| | | if (res == 0) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 工作档明细保存 |
| | | // List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo)); |
| | | // for (LocDetl locDetl : locDetls) { |
| | | // WrkDetl wrkDetl = new WrkDetl(); |
| | | // wrkDetl.setWrkNo(workNo); |
| | | // wrkDetl.setIoTime(new Date()); |
| | | // wrkDetl.setAnfme(locDetl.getAnfme()); |
| | | // VersionUtils.setWrkDetl(wrkDetl, locDetl); // 版本控制 |
| | | // wrkDetl.setAppeTime(new Date()); |
| | | // wrkDetl.setModiTime(new Date()); |
| | | // if (!wrkDetlService.insert(wrkDetl)) { |
| | | // throw new CoolException("保存工作档明细失败"); |
| | | // } |
| | | // } |
| | | // 修改源库位状态 |
| | | if (sourceLoc.getLocSts().equals("D")) { |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | throw new CoolException("更新源库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("源库位出库失败"); |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | loc.setCtnKind(1); |
| | | loc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(loc)) { |
| | | throw new CoolException("更新目标库位状态失败"); |
| | |
| | | case 104: |
| | | staNo = 106; |
| | | break; |
| | | case 111: |
| | | staNo = 112; |
| | | break; |
| | | case 114: |
| | | staNo = 116; |
| | | break; |
| | | case 201: |
| | | staNo = 202; |
| | | break; |
| | | case 204: |
| | | staNo = 205; |
| | | break; |
| | | case 301: |
| | | staNo = 302; |
| | | break; |
| | | case 304: |
| | | staNo = 305; |
| | | break; |
| | | } |
| | | WrkMast pakout = wrkMastMapper.selectWorkingPakout(staNo); |
| | | switch (inSta.getStaNo()) { |
| | |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf1F2 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 111: // 1F3 |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf1F3 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf1F3 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | && !devpThread.getStation().get(inSta.getStaNo() - 1).isLoading() |
| | | && devpThread.getStation().get(inSta.getStaNo() - 1).getWorkNo() == 0) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf1F3 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf1F3 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 114: // 1F4 |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf1F4 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf1F4 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | && !devpThread.getStation().get(inSta.getStaNo() - 1).isLoading() |
| | | && devpThread.getStation().get(inSta.getStaNo() - 1).getWorkNo() == 0) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf1F4 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf1F4 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 201: // 2F1 |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf2F1 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf2F1 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | && !devpThread.getStation().get(inSta.getStaNo() - 1).isLoading() |
| | | && devpThread.getStation().get(inSta.getStaNo() - 1).getWorkNo() == 0) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf2F1 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf2F1 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 204: // 2F2 |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf2F2 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf2F2 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | && !devpThread.getStation().get(inSta.getStaNo() - 1).isLoading() |
| | | && devpThread.getStation().get(inSta.getStaNo() - 1).getWorkNo() == 0) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf2F2 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf2F2 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 301: // 3F1 |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf3F1 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf3F1 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | && !devpThread.getStation().get(inSta.getStaNo() - 1).isLoading() |
| | | && devpThread.getStation().get(inSta.getStaNo() - 1).getWorkNo() == 0) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf3F1 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf3F1 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 304: // 3F2 |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf3F2 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf3F2 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | && !devpThread.getStation().get(inSta.getStaNo() - 1).isLoading() |
| | | && devpThread.getStation().get(inSta.getStaNo() - 1).getWorkNo() == 0) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf3F2 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf3F2 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | } |