| | |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if(!Cools.isEmpty(barcode)) { |
| | | log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 获取入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | // 入出库模式判断 |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | if ( inSta.getStaNo()==101 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( inSta.getStaNo()==103 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( inSta.getStaNo()==105 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( inSta.getStaNo()==107 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; } |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = "前超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBackErr()) { |
| | | errMsg = "后超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isHighErr()) { |
| | | errMsg = "高超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isLeftErr()) { |
| | | errMsg = "左超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isRightErr()) { |
| | | errMsg = "右超限"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isWeightErr()) { |
| | | errMsg = "超重"; |
| | | back = true; |
| | | } |
| | | if (!back && staProtocol.isBarcodeErr()) { |
| | | errMsg = "扫码失败"; |
| | | back = true; |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | |
| | | && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) |
| | | && staProtocol.isPakMk()){// && !Cools.isEmpty(barcode)) { |
| | | |
| | | // if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | // //条码为空或者不符合,退库到172站点 |
| | | // staProtocol.setWorkNo((short)9999); |
| | | // staProtocol.setStaNo((short)172); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // if (!result) { |
| | | // throw new CoolException("更新plc站点信息失败"); |
| | | // } |
| | | // continue; |
| | | // } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if(back ||barcode.equals(99999999)){ |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)(inSta.getStaNo()-1)); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | if(!Cools.isEmpty(ledThread)){ |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | |
| | | log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); |
| | | continue; |
| | | } |
| | | // // 获取入库通知档 |
| | | // List<WaitPakin> waitPakins = waitPakinMapper.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N")); |
| | | // if (waitPakins.isEmpty()) { |
| | | // log.error("无此入库条码数据。条码号={}", barcode); |
| | | // continue; |
| | | // } |
| | | |
| | | try { |
| | | |
| | |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if (code == 200) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | // 入出库模式判断 |
| | | //if (devpThread.ioMode != IoModeType.PAKOUT_MODE) { continue; } |
| | | if (wrkMast.getStaNo() == 101 && devpThread.ioModeOf1F != IoModeType.PAKOUT_MODE) {continue;} |
| | | if (wrkMast.getStaNo() == 103 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {continue;} |
| | | if (wrkMast.getStaNo() == 105 && devpThread.ioModeOf3F != IoModeType.PAKOUT_MODE) {continue;} |
| | | if (wrkMast.getStaNo() == 107 && devpThread.ioModeOf4F != IoModeType.PAKOUT_MODE) {continue;} |
| | | |
| | | // 查询站点详细信息 |
| | | BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); |
| | | if (staDetl == null) { |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | // 入出库模式判断 |
| | | if ( emptyInSta.getStaNo()==101 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( emptyInSta.getStaNo()==103 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( emptyInSta.getStaNo()==105 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( emptyInSta.getStaNo()==107 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; } |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() > 9990 && staProtocol.getWorkNo() <= 9999) && staProtocol.isPakMk()) { |
| | | && staProtocol.isEmptyMk() && staProtocol.getWorkNo() == 9990 && staProtocol.isPakMk()) { |
| | | |
| | | try { |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |