| | |
| | | |
| | | // private static final Integer jarMaxLoc1 = 7; |
| | | private static Integer jarMaxLoc = 0; |
| | | // private static Integer signBigTurn = 0; |
| | | // private static Integer signSmallTurn = 0; |
| | | private static final Float jarTemperature = 50F; |
| | | @Autowired |
| | | private CommonService commonService; |
| | |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | // if (wrkMast.getStaNoSign().equals(signBigTurn)){ |
| | | // continue; |
| | | // } |
| | | |
| | | |
| | | crnStation = crnStation1; |
| | | |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (wrkMast.getStaNo()>309){ |
| | | int wrkCount = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("io_type", 110).gt("sta_no", 309).lt("sta_no", 314).gt("wrk_sts",11L)); |
| | | if (wrkCount>=12){ |
| | | if (wrkMast.booleanStaNoSign()){ |
| | | RgvOneSign rgvOneSign = rgvOneSignMapper.selectOneSign("LineUp"+wrkMast.getStaNo()); |
| | | if (Cools.isEmpty(rgvOneSign)){ |
| | | continue; |
| | | } |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocolEnt = devpThread.getStation().get(212); |
| | | if (staProtocolEnt.isLoading() || staProtocolEnt.getWorkNo()!=0){ |
| | | if (rgvOneSign.getRgvOneSign()>=2){ |
| | | continue; |
| | | } |
| | | // int wrkCount = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("io_type", 110).gt("sta_no", 309).lt("sta_no", 314).gt("wrk_sts",11L)); |
| | | // if (wrkCount>=12){ |
| | | // continue; |
| | | // } |
| | | // RgvOneSign bigTurn = rgvOneSignMapper.selectOneSign("bigTurn"); |
| | | // if (Cools.isEmpty(bigTurn)){ |
| | | // continue; |
| | | // } |
| | | // if (bigTurn.getRgvOneSign()>13){ |
| | | // continue; |
| | | // } |
| | | // DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | // StaProtocol staProtocolEnt = devpThread.getStation().get(wrkMast.getStaNoBying()); |
| | | // if (staProtocolEnt.isLoading() || staProtocolEnt.getWorkNo()!=0){ |
| | | // continue; |
| | | // } |
| | | } |
| | | |
| | | // 工作档状态判断 |
| | |
| | | // } |
| | | } |
| | | } |
| | | // signBigTurn++; |
| | | // if (signBigTurn > 2){ |
| | | // signBigTurn = 0; |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | BasJar basJar = basJarMapper.selectById(jarSlave.getId()); |
| | | BasJar basJarOther = basJarMapper.selectById(jarSlave.getJarOtherId()); |
| | | jarMaxLoc = basJar.getJarCount(); |
| | | if (jarMaxLoc == 0 || basJarOther.getJarCount() != 0) { |
| | | if (jarMaxLoc == 0 || basJarOther.getJarCount() == 0) { |
| | | break; |
| | | } |
| | | int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 11)); |
| | | int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 6)); |
| | | if (count>0){ |
| | | break; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | if (jarProtocol.statusType != JarStatusType.SOS){ |
| | | if (jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType != JarStatusType.SOS2){ |
| | | log.error("Jar任务创建===》执行===>行={}",4537); |
| | | BasJarMast basJarMast = new BasJarMast(basJar, wrkMast, jarLocDigit); |
| | | basJarMast.setJarEnterStaNo(staNo);//入硫化罐站点 |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | //门作业 无 |
| | | if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.jarErr==0 |
| | | if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType!= JarStatusType.SOS2 && jarProtocol.jarErr==0 |
| | | && jarProtocol.isRightDoor() && jarProtocol.isLeftDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | //关进料门 |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMastSign)); |
| | | } |
| | | return true; |
| | | } else if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType != JarStatusType.SOS2 |
| | | && jarProtocol.statusType != JarStatusType.WAITING2 && jarProtocol.jarErr==0 |
| | | && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | Integer integer = basJarMastService.updateStatus(jarProtocol.getJarNo(), 6, 8); |
| | | if (basJarMastList.size()!=integer){ |
| | | log.error("{}号硫化罐硫化完成后开门完成修改硫化档案状态结果数量不一致!!!查询资料数量={},更新返回数量={}",jarProtocol.getJarNo(),basJarMastList.size(),integer); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } else { |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | if (basJarOther.getJarCount() == 0) { |
| | | return false; |
| | | } |
| | | |
| | | List<BasJarMast> basJarMastListOther = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getJarOtherId(), new ArrayList<Integer>() {{ |
| | | add(8); |
| | | }}); |
| | | if (!basJarMastListOther.isEmpty() && basJarMastListOther.size() < basJarOther.getJarCount()){ |
| | | return false; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && !basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 4).equals(basJarOther.getJarCount() )){ |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (jarProtocolOther.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocolOther.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | // log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | continue; |
| | | } |
| | |
| | | try{ |
| | | switch (sign){ |
| | | case 1: |
| | | case 5: |
| | | case 9: |
| | | if (jarWrkMastExecuteGenerateSteComplete(sign)){ |
| | | break; |
| | | } |
| | | case 2: |
| | | case 6: |
| | | case 10: |
| | | if (jarWrkMastExecuteGenerateJarComplete(sign)){ |
| | | break; |
| | | } |
| | | case 3: |
| | | case 7: |
| | | case 11: |
| | | if (jarWrkMastExecuteGenerateRgvComplete1(sign)){ |
| | | break; |
| | | } |
| | | case 4: |
| | | case 8: |
| | | case 12: |
| | | if (jarWrkMastExecuteGenerateRgvComplete2(sign)){ |
| | | break; |
| | | } |
| | |
| | | && (jarProtocol.leftDoorClose==2 || jarProtocol.rightDoorClose==2)){ |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | | log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | continue; |
| | | } |
| | | WrkMastExecute wrkMastExecuteSou = new WrkMastExecute(); |
| | | wrkMastExecuteSou.setWrkSts(3); |
| | |
| | | add(5); |
| | | add(11); |
| | | add(17); |
| | | add(99); |
| | | add(100); |
| | | add(999); |
| | | }}); |
| | | if(!basJarMastList.isEmpty()){ |
| | | continue; |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | add(5); |
| | | add(11); |
| | | add(17); |
| | | add(99); |
| | | add(100); |
| | | add(999); |
| | | }}); |
| | | if(basJarMastList.isEmpty()){ |
| | | if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){ |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | if (!jarSteTake(wrkMastExecuteByCharge,SteLocaType.POINT20.id,SteLocaType.POINT20.id,SteTaskModeType.CLOSE_CHARGE,true,wrkMastExecuteByCharge.getJarId())){ |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={}", |
| | | wrkMastExecuteByCharge.getSteId(), JSON.toJSONString(wrkMastExecuteByCharge)); |
| | | } |
| | | try{ |
| | | Thread.sleep(1000); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | wrkMastExecuteByCharge.setWrkType(2); |
| | | wrkMastExecuteByCharge.setWrkSts(100); |
| | |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | try{ |
| | | for (int idi = 1;idi<5;idi++){ |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, idi); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("测试:"+idi); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, idi, new Task(5, errMsg1)); |
| | | } try { |
| | | Thread.sleep(500); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | LedThread ledThread3 = (LedThread) SlaveConnection.get(SlaveType.Led, 3); |
| | | |
| | | if (ledThread3 != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("测试测试测试测试测试测试测试测试测试测试测试测试测试:"+3); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, 3, new Task(5, errMsg1)); |
| | | } try { |
| | | Thread.sleep(500); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |