| | |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | // 如果前工位有货 + 扫码器有条码 |
| | | if (staProtocolIn.getStamp() == 1 && barcode != null && !barcode.isEmpty()) { |
| | | if (staProtocolIn.getStamp() == 1 && !barcode.equals("00000000") && !barcode.isEmpty()) { |
| | | log.info("生成信号时间: {}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date())); |
| | | if (wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("barcode", barcode) |
| | |
| | | } |
| | | } else { |
| | | String msg = json.getString("msg"); |
| | | if (!"工作档已存在".equals(msg)) { |
| | | if (!"工作档已存在".equals(msg) && staProtocol.getWorkNo()<9999) { |
| | | staProtocol.setWorkNo(wrkNo++); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | |
| | | log.info("读取到工作号时间: {}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date())); |
| | | |
| | | } |
| | | // && staProtocol.getWorkNo() > 0 && staProtocol.getWorkNo() <9998 |
| | | if (staProtocol.isAutoing() && staProtocol.getWorkNo() > 0 && staProtocol.getWorkNo() <9998 |
| | | && staDetl.getCanining() != null && staDetl.getCanining().equals("Y")) { |
| | | log.info("可入时间: {}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date())); |
| | | log.info("任务满足下发时间: {}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date())); |
| | | |
| | | flag = true; |
| | | } |
| | |
| | | } |
| | | // 获取工作状态为2(设备上走)的入库工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep2(slave.getId(), staProtocol.getWorkNo(), crnStn.getStaNo()); |
| | | // wrkMast = wrkMast1; |
| | | if (null == wrkMast) { |
| | | log.info("" + mark + " - 1" + " - 4" + " - 查询无待入库数据--wrk_sts=2, 工作号={}", staProtocol.getWorkNo()); |
| | | News.infoNoLog("" + mark + " - 1" + " - 4" + " - 查询无待入库数据--wrk_sts=2, 工作号={}", staProtocol.getWorkNo()); |
| | |
| | | News.error("" + mark + " - 1" + " - 16" + " - 堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | |
| | | // long startTime = System.currentTimeMillis(); |
| | | // while ((System.currentTimeMillis() - startTime) < COMMAND_TIMEOUT) { |
| | | // |
| | | // if (true) { |
| | | // break; |
| | | // } |
| | | // |
| | | // try{ |
| | | // Thread.sleep(500); |
| | | // }catch(Exception ignore){} |
| | | // } |
| | | |
| | | // 修改工作档状态 2.设备上走 => 3.吊车入库中 |
| | | Date now = new Date(); |