|  |  |  | 
|---|
|  |  |  | public BaseResult<?> executeAgvActionCmd(AgvAction agvAction) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // todo 1: 记录日志 2:发送任务  3:同步响应 | 
|---|
|  |  |  | log.info(JSON.toJSONString(agvAction)); | 
|---|
|  |  |  | //        log.info(JSON.toJSONString(agvAction)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String serialNo = agvAction.getSerialNo(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | AgvProtocol protocol = AgvProtocol.build(agvAction.getAgvNo()).setMessageBody(agvAction.beMesBody(serialNo)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // fake | 
|---|
|  |  |  | if (configService.getVal("fakeSign", Boolean.class)) { | 
|---|
|  |  |  | return BaseResult.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return this.requestProcess(serialNo, protocol | 
|---|
|  |  |  | , (RequestSupport<AGV_01_UP>) result -> result.getSerialNo().equals(serialNo)); | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return BaseResult.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (TimeoutException ex){ | 
|---|
|  |  |  | } catch (TimeoutException e){ | 
|---|
|  |  |  | log.error("AgvCmdService.requestProcess", e); | 
|---|
|  |  |  | return BaseResult.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return messageBody; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | Thread.sleep(10); | 
|---|
|  |  |  | }catch(Exception ex){ | 
|---|
|  |  |  | ex.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|