| | |
| | | import com.zy.common.utils.RgvUtils; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.*; |
| | |
| | | public class MainServiceImpl { |
| | | |
| | | public static final long COMMAND_TIMEOUT = 5 * 1000; |
| | | // private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{9,3},{10,4},{11,4}}; |
| | | |
| | | @Autowired |
| | | private CommonService commonService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Jar任务完成 //未完成 |
| | | * Jar任务完成 //完成 |
| | | */ |
| | | public synchronized boolean jarMastGenerateComplete(JarSlave jarSlave) { |
| | | public synchronized boolean jarMastGenerateComplete() { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | |
| | | for (int[] ex : execute){ |
| | | try{ |
| | | WrkMastExecute wrkMastExecuteSou = new WrkMastExecute(); |
| | | wrkMastExecuteSou.setIoType(ex[0]); |
| | | wrkMastExecuteSou.setWrkSts(ex[1]); |
| | | wrkMastExecuteSou.setWrkType(1); |
| | | List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou); |
| | | for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){ |
| | | BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo()); |
| | | jarMastByWrkNo.setStatus(jarMastByWrkNo.getStatusComplete()); |
| | | if (!basJarMastService.updateById(jarMastByWrkNo)){ |
| | | log.error("硫化区域分段任务完成异常,BasJarMast={},异常信息={}",JSON.toJSONString(jarMastByWrkNo),"更新basJarMast失败"); |
| | | } |
| | | wrkMastExecute.setWrkSts(wrkMastExecute.getWrkStsComplete()); |
| | | wrkMastExecute.setWrkType(2); |
| | | if (!wrkMastExecuteService.updateById(wrkMastExecute)){ |
| | | log.error("硫化区域分段任务完成异常,wrkMastExecute={},异常信息={}",JSON.toJSONString(wrkMastExecute),"更新wrkMastExecute失败"); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("硫化区域分段任务完成异常,execute={},异常信息={}",JSON.toJSONString(ex),e.getMessage()); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | log.error("硫化区域分段任务完成异常,异常信息={}",e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | |
| | | default: |
| | | jarWrkMastExecuteGenerateSte(signExecute,sign);//小车移动 |
| | | } |
| | | if (!signExecute[0] && !signExecute[1]){ |
| | | //Ste移动 |
| | | jarMastMove(); |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | log.error("硫化区域分段任务创建异常,异常信息={}",e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | public synchronized boolean[] jarWrkMastExecuteGenerateJar(boolean[] signExecute,Integer sign) { |
| | |
| | | add(2); |
| | | }}); |
| | | |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | // //判断小车状态 |
| | | // if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){ |
| | | // return false; |
| | | // } |
| | | |
| | | for (BasJarMast basJarMast : basJarMastList){ |
| | | JarSlave.StaStn staStn = null; |
| | |
| | | if (Cools.isEmpty(basJarMastSign)){ |
| | | return false; |
| | | } |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | // //判断小车状态 |
| | | // if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){ |
| | | // return false; |
| | | // } |
| | | |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarInRgv().get(0); |
| | | |
| | |
| | | if (Cools.isEmpty(basJarMastSign)){ |
| | | return false; |
| | | } |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),2,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | // //判断小车状态 |
| | | // if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),2,SteStatusType.IDLE)){ |
| | | // return false; |
| | | // } |
| | | |
| | | //判断RGV状态 |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0); |
| | |
| | | if (Cools.isEmpty(jarMastByJarIdMin)){ |
| | | return false; |
| | | } |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | // //判断小车状态 |
| | | // if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2,SteStatusType.IDLE)){ |
| | | // return false; |
| | | // } |
| | | |
| | | //判断RGV状态 |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0); |
| | |
| | | return false; |
| | | } |
| | | |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | // //判断小车状态 |
| | | // if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2,SteStatusType.IDLE)){ |
| | | // return false; |
| | | // } |
| | | |
| | | //判断RGV状态 |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0); |
| | |
| | | * JarWrkMastExecute任务创建===>执行 //完成 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerateExecute(BasJar basJar,BasJarMast basJarMast,Integer id,int[] digit) { |
| | | try { |
| | | WrkMastExecute wrkMastExecute = new WrkMastExecute(basJarMast); |
| | | wrkMastExecute.setJarId(id); |
| | | wrkMastExecute.setSteId(digit[0]);//穿梭板ID |
| | | wrkMastExecute.setRgvId(basJar.getEnterRgvNo());//RGV ID enter |
| | | wrkMastExecute.setRgvEndId(basJar.getOutRgvNo());//RGV ID out |
| | | wrkMastExecute.setIoType(digit[2]);//任务类型 0: 未知 1: 开进料门 2: 关进料门 3: 开出料门 4: 关出料门 5: 入硫化罐 6: 入冷却槽 7: 穿梭车进冷却槽 8: 穿梭车离开冷却槽 9: 出冷却槽 10:A=>B 11:B=>A |
| | | wrkMastExecute.setType(digit[3]);//设备 0: 未知 1: 硫化罐 2: 冷却槽 3: 硫化罐==>冷却槽 |
| | | return wrkMastExecuteService.insert(wrkMastExecute); |
| | | } catch (Exception e) { |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常原因:"+e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务创建===>执行 //完成 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerateExecuteMove(BasJar basJar,BasJarMast basJarMast,Integer id,int[] digit) { |
| | | try { |
| | | WrkMastExecute wrkMastExecute = new WrkMastExecute(basJarMast); |
| | | wrkMastExecute.setJarId(id); |
| | |
| | | return false; |
| | | } |
| | | |
| | | // //判断小车状态 |
| | | // if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1)){ |
| | | // return false; |
| | | // } |
| | | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2); |
| | | StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo()); |
| | | if (staProtocolRGV == null) { |
| | |
| | | //自动、空闲、 进料们打开需关闭 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){ |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | |
| | | //调车 == > 取货 |
| | | if (!jarRgvGetTake(wrkMastExecute |
| | | ,SteAndJarUtil.getRgvStaRow(wrkMastExecute.getJarEnterStaNo())==1 |
| | |
| | | return false; |
| | | } |
| | | |
| | | // //判断小车状态 |
| | | // if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1)){ |
| | | // return false; |
| | | // } |
| | | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2); |
| | | StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo()); |
| | | if (staProtocolRGV == null) { |
| | |
| | | //自动、空闲、 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | |
| | | if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){ |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | return false; |
| | | } |
| | | |
| | | //调车 == > 取货 |
| | | if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT21.id,SteTaskModeType.STE_WFQH_12,false)){ |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}", |
| | |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务==>下发 //完成 |
| | | * 7:穿梭车进冷却槽\8:穿梭车离开冷却槽 |
| | | * 7:穿梭车进冷却槽 7 B=>C |
| | | * 8:穿梭车离开冷却槽 8 C=>B |
| | | * 任务下发 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteActionExecute7(WrkMastExecute wrkMastExecute,Integer sign) { |
| | |
| | | |
| | | if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocolOther.getJarNo())){ |
| | | //判断小车状态 |
| | | if (wrkMastExecute.getIoType()==7){ |
| | | if (wrkMastExecute.getIoType()==7){ //7 B=>C |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){ |
| | | //调车 == > 移动 |
| | | if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT26.id,SteTaskModeType.STE_WFQH_12,false)){ |
| | | if (jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT26.id,SteTaskModeType.STE_WFQH_12,false)){ |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | |
| | | log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | | } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){ |
| | | } else if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){ |
| | | wrkMastExecute.setWrkType(1); |
| | | wrkMastExecute.setWrkSts(4); |
| | | if (!wrkMastExecuteService.updateById(wrkMastExecute)){ |
| | |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | | } |
| | | } else { |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){ |
| | | } else { //8 C=>B |
| | | if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){ |
| | | //调车 == > 移动 |
| | | if (!jarSteTake(wrkMastExecute,SteLocaType.POINT26.id,SteLocaType.POINT23.id,SteTaskModeType.STE_WFQH_12,false)){ |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}", |
| | |
| | | log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | | } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){ |
| | | } else if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){ |
| | | wrkMastExecute.setWrkType(1); |
| | | wrkMastExecute.setWrkSts(4); |
| | | if (!wrkMastExecuteService.updateById(wrkMastExecute)){ |
| | |
| | | |
| | | if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){ |
| | | //判断小车状态 |
| | | if (wrkMastExecute.getIoType()==10){ |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | if (wrkMastExecute.getIoType()==10){//10:A=>B |
| | | if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | //调车 == > 移动 |
| | | if (!jarSteTake(wrkMastExecute,SteLocaType.POINT20.id,SteLocaType.POINT23.id,SteTaskModeType.STE_WFQH_12,false)){ |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}", |
| | |
| | | log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | | } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){ |
| | | } else if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){ |
| | | wrkMastExecute.setWrkType(1); |
| | | wrkMastExecute.setWrkSts(4); |
| | | if (!wrkMastExecuteService.updateById(wrkMastExecute)){ |
| | |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | | } |
| | | } else { |
| | | if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){ |
| | | } else {//11:B=>A |
| | | if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){ |
| | | //调车 == > 移动 |
| | | if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT20.id,SteTaskModeType.STE_WFQH_12,false)){ |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}", |
| | |
| | | log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | | } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | } else if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){ |
| | | wrkMastExecute.setWrkType(1); |
| | | wrkMastExecute.setWrkSts(4); |
| | | if (!wrkMastExecuteService.updateById(wrkMastExecute)){ |
| | |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务完成 //未完成 |
| | | * JarWrkMastExecute任务完成 //完成 |
| | | */ |
| | | public synchronized void jarWrkMastExecuteGenerateComplete(Integer sign) { |
| | | try{ |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务 穿梭车移动任务 //完成 |
| | | */ |
| | | public synchronized boolean jarMastMove() { |
| | | try{ |
| | | for (SteSlave steSlave : slaveProperties.getSte()){ |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steSlave.getId()); |
| | | if (steThread == null) { |
| | | continue; |
| | | } |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | Integer integer = wrkMastExecuteService.selectNoStart(steSlave.getId()); |
| | | if (integer!=0){ |
| | | continue; |
| | | } |
| | | |
| | | try{ |
| | | if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),1,SteStatusType.IDLE)){ |
| | | List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null); |
| | | if (wrkMastExecutes.isEmpty()){ |
| | | List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null); |
| | | List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null); |
| | | |
| | | if (!wrkMastExecutesB.isEmpty() || !wrkMastExecutesC.isEmpty()){ |
| | | WrkMastExecute wrkMastExecute = !wrkMastExecutesB.isEmpty() ? wrkMastExecutesB.get(0) : wrkMastExecutesC.get(0); |
| | | BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId()); |
| | | return false; |
| | | } |
| | | BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo()); |
| | | //A==>B |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),10,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo)); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | } else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),2,SteStatusType.IDLE)){ |
| | | List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null); |
| | | if (wrkMastExecutes.isEmpty()){ |
| | | List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null); |
| | | List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null); |
| | | if (!wrkMastExecutesA.isEmpty()){ |
| | | WrkMastExecute wrkMastExecute = wrkMastExecutesA.get(0); |
| | | BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId()); |
| | | return false; |
| | | } |
| | | BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo()); |
| | | //B==>A |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),11,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo)); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | if (!wrkMastExecutesC.isEmpty()){ |
| | | WrkMastExecute wrkMastExecute = wrkMastExecutesC.get(0); |
| | | BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId()); |
| | | return false; |
| | | } |
| | | BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo()); |
| | | //B==>C |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),7,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo)); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | } else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),3,SteStatusType.IDLE)){ |
| | | List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null); |
| | | if (wrkMastExecutes.isEmpty()){ |
| | | List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null); |
| | | List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null); |
| | | if (!wrkMastExecutesB.isEmpty() || !wrkMastExecutesA.isEmpty()){ |
| | | WrkMastExecute wrkMastExecute = !wrkMastExecutesB.isEmpty() ? wrkMastExecutesB.get(0) : wrkMastExecutesA.get(0); |
| | | BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId()); |
| | | return false; |
| | | } |
| | | BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo()); |
| | | //C==>B |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),8,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo)); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("硫化区域分段任务完成异常,steProtocol={},异常信息={}",JSON.toJSONString(steProtocol),e.getMessage()); |
| | | } |
| | | |
| | | WrkMastExecute wrkMastExecute = wrkMastExecuteService.selectStart(steSlave.getId()); |
| | | |
| | | |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("硫化区域分段任务完成异常,异常信息={}",e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |