|  |  | 
 |  |  |                                 newSingle = 0;//测试完成,寄存器地址清零,3===>>0 | 
 |  |  |                                 break; | 
 |  |  |                             case 5://暂停信号 | 
 |  |  |                                 olsStatus = 5;//plc给出暂停信号 | 
 |  |  |                                 olsStatus = 99;//plc给出暂停信号 | 
 |  |  |                                 newStatus = 0;//WCS收到暂停信号后,更新testMast | 
 |  |  |                                 newSingle = 6;//暂停测试,寄存器地址,5===>>6 | 
 |  |  |                                 break; | 
 |  |  |                             case 7://紧急出库确认充电线已经拔出 | 
 |  |  |                                 olsStatus = 99;//plc给出暂停信号 | 
 |  |  |                                 newStatus = 0;//WCS收到暂停信号后,更新testMast | 
 |  |  |                                 newSingle = 6;//暂停测试,寄存器地址,7===>>6 | 
 |  |  |                                 break; | 
 |  |  |                             case 8://解除暂停 | 
 |  |  |                                 olsStatus = 99; | 
 |  |  |                                 newStatus = 0; | 
 |  |  |                                 newSingle = 0;//测试复核,寄存器地址,6===>>0 | 
 |  |  |                                 break; | 
 |  |  |                         } | 
 |  |  |  | 
 |  |  |                         TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() | 
 |  |  |                                 .eq("channel",(i+1)).eq("status",olsStatus));//查找原来的状态 | 
 |  |  |                         if(null != testMast && | 
 |  |  |                                 (devpThread.startSignal[i] == 1 || devpThread.startSignal[i] == 3 || devpThread.startSignal[i] == 5)){ | 
 |  |  |                                 (devpThread.startSignal[i] == 1 || devpThread.startSignal[i] == 3)){ | 
 |  |  |                             testMast.setStatus(newStatus); | 
 |  |  |                             testMast.setModiTime(new Date()); | 
 |  |  |                             if(!testMastService.update(testMast,new EntityWrapper<TestMast>() | 
 |  |  | 
 |  |  |                             staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,1==>2或3==>0,5==>6 | 
 |  |  |                             boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); | 
 |  |  |                             if(!result){ | 
 |  |  |                                 log.error("更新测试信号失败===>>[channel:{},locNo:{},barcode:{}]", i, testMast.getLocNo(), testMast.getBarcode()); | 
 |  |  |                                 log.error("更新测试信号失败===>>[channel:{},locNo:{},barcode:{}]", i+1, testMast.getLocNo(), testMast.getBarcode()); | 
 |  |  | //                                throw new CoolException("更新测试信号失败===>>" + i); | 
 |  |  |                             } else { | 
 |  |  |                                 devpThread.startSignal[i] = newSingle; | 
 |  |  |                             } | 
 |  |  |                         }else if (testMast == null && devpThread.startSignal[i] == 5){ | 
 |  |  |  | 
 |  |  |                         }else if (testMast == null && devpThread.startSignal[i] == 7){ | 
 |  |  |                             LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() | 
 |  |  |                                     .eq("channel",(i+1))); | 
 |  |  |                             if (locMast.getLocSts().equals("F")){ | 
 |  |  |                                 locMast.setPackStatus(7); //7.紧急出库 | 
 |  |  |                                 locMastService.update(locMast,new EntityWrapper<LocMast>() | 
 |  |  |                                         .eq("channel",(i+1))); | 
 |  |  |                             } | 
 |  |  |                             //复位PLC信号,借用输送站点实体类 | 
 |  |  |                             StaProtocol staProtocol = new StaProtocol(); | 
 |  |  |                             staProtocol.setSiteId(i*2);//寄存器地址 | 
 |  |  |                             staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,7==>6 | 
 |  |  |                             boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); | 
 |  |  |                             if(!result){ | 
 |  |  |                                 log.error("更新库位紧急出库信号失败===>>[channel:{},locNo:{},barcode:{}]", i+1, locMast.getLocNo(), locMast.getBarcode()); | 
 |  |  | //                                throw new CoolException("更新测试信号失败===>>" + i); | 
 |  |  |                             } else { | 
 |  |  |                                 devpThread.startSignal[i] = newSingle; | 
 |  |  |                             } | 
 |  |  |                         }else if (testMast == null && devpThread.startSignal[i] == 8){ | 
 |  |  |  | 
 |  |  |                         } | 
 |  |  |  | 
 |  |  |                     } |