| | |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | BarcodeThread barcodeThreadMat = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcodeMat()); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (barcodeThreadMat == null) { |
| | | continue; |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.stateType == DevpStateType.AUTO //自动 |
| | | && staProtocol.workType == DevpWorkType.BUSY //忙碌 |
| | |
| | | } |
| | | continue; |
| | | } |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(RouteUtils.SouStaEnd(null,wrkMast.getSourceStaNo())); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol.setStaNo(RouteUtils.SouStaEnd(dto.getStaNo(),dto.getSourceStaNo())); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | }else { |
| | | staProtocol.setWorkNo(wrkNo); |
| | | wrkNo++; |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // |
| | | // if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | |
| | | } |
| | | |
| | | // 更新工作档状态为14失败 |
| | | wrkMast.setWrkSts(14L); |
| | | wrkMast.setWrkSts(13L); |
| | | wrkMast.setCrnEndTime(new Date()); |
| | | if (wrkMastMapper.updateById(wrkMast) != 0) { |
| | | // 复位堆垛机 |
| | |
| | | getAgvTaskParam(forwardAGVTaskParam,wrkMast,staProtocol.getSiteId()); |
| | | String request = forwardAGVHttpRequest(forwardAGVTaskParam, "10.0.100.110:8182", "/rcms/services/rest/hikRpcService/genAgvSchedulingTask"); |
| | | if ("SUCCESS".equals(request)) { |
| | | wrkMast.setWrkSts(101L); |
| | | wrkMast.setWrkSts(14L); |
| | | boolean update = wrkMastService.updateById(wrkMast); |
| | | if (update){ |
| | | log.info("入库转发AGV任务完成,任务号:"+wrkMast.getWrkNo()); |