| | |
| | | public synchronized void locToCrnStn1(CrnSlave slave, CrnProtocol crnProtocol, Integer crnStation) { |
| | | List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep12(slave.getId()); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | break; |
| | | // return; |
| | | } |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==607 && staProtocol.getWorkNo()>20000 && staProtocol.isLoading() && staProtocol.isAutoing()){ |
| | | if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==0 && staProtocol.getWorkNo()==0 |
| | | && staProtocol.isLoading() && staProtocol.isAutoing() && staProtocol.isInEnable()){ |
| | | String barcode = staProtocol.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | try { |
| | | BasDevp basDevp = basDevpService.selectById(staProtocol.getStaNo()); |
| | | BasDevp basDevp = basDevpService.selectById(emptyInSta.getStaNo()); |
| | | if (basDevp.getReportSign()==0){ |
| | | WrkMast wrkMast = wrkMastMapper.selectByBarcodeTwo(barcode); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | | } |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | param.setBarcode(barcode); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | basDevp.setReportSign(1); |
| | | basDevpService.updateById(basDevp); |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol.setStaNo(607); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(5, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | // StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | // |
| | | // // 更新站点信息 且 下发plc命令 |
| | | // staProtocol.setWorkNo(dto.getWorkNo()); |
| | | // staProtocol.setStaNo(607); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(5, staProtocol)); |
| | | // if (!result) { |
| | | // throw new CoolException("更新plc站点信息失败"); |
| | | // } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | } else |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() && ((staProtocol.getWorkNo() > 32222 && staProtocol.getWorkNo() <= 63333) || staProtocol.getWorkNo()==0) && staProtocol.isPakMk()) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | //临时 |
| | | if (basJar.getJarCode()==1){ |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | |
| | | if (!jarOtherProtocol.isAutoing() || jarOtherProtocol.jarErr!=0 |
| | | || !jarOtherProtocol.isLeftDoor() || !jarOtherProtocol.isRightDoor() |
| | | || jarOtherProtocol.leftDoorOpen==1 || jarOtherProtocol.leftDoorClose==1 || jarOtherProtocol.rightDoorOpen==1 || jarOtherProtocol.rightDoorClose==1){ |
| | | log.error("{}号硫化罐查询设备不满足前往冷却池条件,代号2硫化罐门没开!!!",jarOtherProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | } |
| | | // //临时 |
| | | // if (basJar.getJarCode()==1){ |
| | | // JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | // JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | // if (jarOtherProtocol == null) { |
| | | // return false; |
| | | // } |
| | | // |
| | | // if (!jarOtherProtocol.isAutoing() || jarOtherProtocol.jarErr!=0 |
| | | // || !jarOtherProtocol.isLeftDoor() || !jarOtherProtocol.isRightDoor() |
| | | // || jarOtherProtocol.leftDoorOpen==1 || jarOtherProtocol.leftDoorClose==1 || jarOtherProtocol.rightDoorOpen==1 || jarOtherProtocol.rightDoorClose==1){ |
| | | // log.error("{}号硫化罐查询设备不满足前往冷却池条件,代号2硫化罐门没开!!!",jarOtherProtocol.getJarNo()); |
| | | // return false; |
| | | // } |
| | | // } |
| | | |
| | | //门作业 无 |
| | | // if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING4 && jarProtocol.jarErr==0 |
| | |
| | | if (staNo1!=0){ |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2); |
| | | StaProtocol staProtocol607 = devpThread.getStation().get(607); |
| | | if (staProtocol607.getWorkNo()<9001 && staProtocol607.getWorkNo()!=0 && staProtocol607.isLoading() && staProtocol607.isAutoing() && staProtocol607.getStaNo() == 607){ |
| | | staProtocol607.setStaNo(staNo1); |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(5, staProtocol607)); |
| | | String barcode = staProtocol607.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | return; |
| | | } |
| | | } else { |
| | | return; |
| | | } |
| | | if (staProtocol607.getWorkNo()==0 && staProtocol607.isLoading() && staProtocol607.isAutoing() |
| | | && staProtocol607.getStaNo() == 0 && staProtocol607.isInEnable()){ |
| | | WrkMast wrkMast = wrkMastMapper.selectByBarcodeTwo(barcode); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | staProtocol607.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol607.setStaNo(staNo1); |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(2, staProtocol607)); |
| | | } |
| | | } |
| | | } else { |
| | | |