| | |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg)); |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | | if (wrkMast != null) { |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo()); |
| | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | |
| | | barcodeThread.setBarcode(""); |
| | |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库请求失败"+jsonObject.getInteger("code")); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | public synchronized void generateStoreWrkFile464() { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devp.getInSta464()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | if (!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | |
| | | // 获取入库站信息 |
| | | // SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = "异常:"; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = errMsg+"前超限;"; |
| | | back = true; |
| | | } |
| | | if (staProtocol.isBackErr()) { |
| | | errMsg = errMsg+"后超限"; |
| | | back = true; |
| | | } |
| | | if (staProtocol.isHighErr()) { |
| | | errMsg = errMsg+"高超限"; |
| | | back = true; |
| | | } |
| | | if (staProtocol.isLeftErr()) { |
| | | errMsg = errMsg+"左超限"; |
| | | back = true; |
| | | } |
| | | if (staProtocol.isRightErr()) { |
| | | errMsg = errMsg+"右超限"; |
| | | back = true; |
| | | } |
| | | if (staProtocol.isWeightErr()) { |
| | | errMsg = errMsg+"超重"; |
| | | back = true; |
| | | } |
| | | if (staProtocol.isBarcodeErr()) { |
| | | errMsg = errMsg+"扫码失败"; |
| | | back = true; |
| | | } |
| | | // 退回 |
| | | if (back) { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | // 入出库模式判断 |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | // if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | // continue; |
| | | // } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() |
| | | && staProtocol.getWorkNo() == 0 |
| | | && staProtocol.isPakMk()) {// && !Cools.isEmpty(barcode)) { |
| | | |
| | | // if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | // //条码为空或者不符合,退库到172站点 |
| | | // staProtocol.setWorkNo((short)32222); |
| | | // 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; |
| | | // } |
| | | |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | | if (wrkMast != null) { |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | | } |
| | | // // 获取入库通知档 |
| | | // List<WaitPakin> waitPakins = waitPakinMapper.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N")); |
| | | // if (waitPakins.isEmpty()) { |
| | | // log.error("无此入库条码数据。条码号={}", barcode); |
| | | // continue; |
| | | // } |
| | | |
| | | try { |
| | | |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setBarcode(barcode); |
| | | param.setIoType(1); |
| | | param.setSourceStaNo(inSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | |
| | | if(Cools.isEmpty(dto.getRgvNo()) || dto.getRgvNo() <= 0) { |
| | | staProtocol.setStaNo(607);//607 |
| | | } else {//如果存在RGV编号,说明需要RGV接驳,先下发任务到RGV源站 |
| | | staProtocol.setStaNo(dto.getRgvSstaNo()); |
| | | } |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else if (jsonObject.getInteger("code").equals(700)){ |
| | | SearchLocParam param2 = new SearchLocParam(); |
| | | param2.setBarcode(barcode); |
| | | param2.setSourceStaNo(inSta.getStaNo()); |
| | | param2.setLocType1(locTypeDto.getLocType1()); |
| | | String response2 = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/yx/loc/v464") |
| | | .setJson(JSON.toJSONString(param2)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject2 = JSON.parseObject(response2); |
| | | if (jsonObject2.getInteger("code").equals(200)) { |
| | | log.info("464紧急站点自动组托成功!!"); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/yx/loc/v464", JSON.toJSONString(param), response); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | } |
| | | } else { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库请求失败"+jsonObject.getInteger("code")); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | | |
| | |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg)); |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else { |
| | |
| | | if ("00000000".equals(barcode)){ |
| | | log.error(inSta+"站点,扫码失败,barcode:"+barcode); |
| | | // led 异常显示 |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | // if (ledThread != null) { |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, inSta+"站点,扫码失败,barcode:"+barcode)); |
| | | // } |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(inSta+"站点,扫码失败,barcode:"+barcode); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | continue; |
| | | } |
| | | } else { |
| | |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg)); |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else { |
| | | } else if (jsonObject.getInteger("code").equals(700)){ |
| | | SearchLocParam param2 = new SearchLocParam(); |
| | | param2.setBarcode(barcode); |
| | | param2.setSourceStaNo(inSta.getStaNo()); |
| | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, "入库失败!")); |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | } |
| | | |
| | |
| | | && jarProtocol.leftDoorOpen!=1 && jarProtocol.leftDoorOpen!=3 |
| | | && jarProtocol.rightDoorOpen!=1 && jarProtocol.rightDoorOpen!=3 |
| | | && (jarProtocol.leftDoorOpen==2 || jarProtocol.rightDoorOpen==2)){ |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | | log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | // if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | | // log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo()); |
| | | // return false; |
| | | // } |
| | | WrkMastExecute wrkMastExecuteSou = new WrkMastExecute(); |
| | | wrkMastExecuteSou.setWrkSts(3); |
| | | List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou); |
| | |
| | | staProtocol607.setStaNo(staNo1); |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(5, staProtocol607)); |
| | | } |
| | | } else { |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, 1); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("分配硫化罐===>目标站点号:"+staNo1); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, 1, new Task(5, errMsg1)); |
| | | } try { |
| | | Thread.sleep(500); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | public synchronized Integer jarGetStartStaNo(Integer staNo) { |
| | | try { |