|  |  |  | 
|---|
|  |  |  | vo.setWorkNo(crnProtocol.getTaskNo());  //  任务号 | 
|---|
|  |  |  | vo.setStatusType(crnProtocol.modeType.desc);   //  模式状态 | 
|---|
|  |  |  | vo.setStatus(crnProtocol.getStatusType().desc);     //  状态 | 
|---|
|  |  |  | vo.setLoading(crnProtocol.getLoaded()==1?"有物":"无物");  //  有物 | 
|---|
|  |  |  | vo.setLoading(( Cools.isEmpty(crnProtocol.getLoaded()) && crnProtocol.getLoaded()==1)?"有物":"无物");  //  有物 | 
|---|
|  |  |  | vo.setBay(crnProtocol.getBay());    //  列 | 
|---|
|  |  |  | vo.setLev(crnProtocol.getLevel());  //  层 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | vo.setForkOffset(crnProtocol.getForkPosType().desc);    // 货叉位置 | 
|---|
|  |  |  | vo.setLiftPos(crnProtocol.getLiftPosType().desc); | 
|---|
|  |  |  | vo.setWalkPos(crnProtocol.getWalkPos()==1?"不在定位":"在定位"); | 
|---|
|  |  |  | vo.setWarnCode(String.valueOf(crnProtocol.getAlarm())); | 
|---|
|  |  |  | if (crnProtocol.getAlarm() > 0) { | 
|---|
|  |  |  | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); | 
|---|
|  |  |  | vo.setWarnCode(String.valueOf(crnProtocol.getAlarm1())); | 
|---|
|  |  |  | if (crnProtocol.getAlarm1() > 0) { | 
|---|
|  |  |  | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm1()); | 
|---|
|  |  |  | vo.setAlarm(crnError==null?"未知异常":crnError.getErrName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (param.getCrnNo() == null) { | 
|---|
|  |  |  | throw new CoolException("请选择堆垛机"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | MessageQueue.clear(SlaveType.Crn, param.getCrnNo()); | 
|---|
|  |  |  | return R.ok("清除命令成功"); | 
|---|
|  |  |  | CrnCommand command = new CrnCommand(); | 
|---|
|  |  |  | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 | 
|---|
|  |  |  | command.setTaskNo((short) 0); // 工作号 | 
|---|
|  |  |  | command.setAckFinish((short) 0);  // 任务完成确认位 | 
|---|
|  |  |  | command.setTaskMode(CrnTaskModeType.NONE); // 任务模式 | 
|---|
|  |  |  | command.setSourcePosX((short) 0);     // 源库位排 | 
|---|
|  |  |  | command.setSourcePosY((short) 0);     // 源库位列 | 
|---|
|  |  |  | command.setSourcePosZ((short) 0);     // 源库位层 | 
|---|
|  |  |  | command.setDestinationPosX((short) 0);     // 目标库位排 | 
|---|
|  |  |  | command.setDestinationPosY((short) 0);     // 目标库位列 | 
|---|
|  |  |  | command.setDestinationPosZ((short) 0);     // 目标库位层 | 
|---|
|  |  |  | return crnControl(command)?R.ok():R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ManagerAuth(memo = "手动复位") | 
|---|
|  |  |  | 
|---|
|  |  |  | crnCommand.setCrnNo(crn.getId()); // 堆垛机编号 | 
|---|
|  |  |  | crnCommand.setTaskMode(CrnTaskModeType.CLEAR); | 
|---|
|  |  |  | crnCommand.setAckFinish((short) 0);  // 任务完成确认位 | 
|---|
|  |  |  | crnCommand.setCommand((short) 0);  // 任务完成确认位 | 
|---|
|  |  |  | // 延时发送 | 
|---|
|  |  |  | Thread.sleep(1000L); | 
|---|
|  |  |  | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(2, crnCommand))) { | 
|---|