| | |
| | | package com.dy.aceMw.web.com; |
| | | |
| | | import com.dy.aceMw.server.ServerProperties; |
| | | import com.dy.aceMw.server.forTcp.TcpSessionCache; |
| | | import com.dy.aceMw.server.local.CommandInnerDeaLer; |
| | | import com.dy.aceMw.server.local.ReturnCommand; |
| | |
| | | if(onLine == null){ |
| | | return BaseResponseUtils.buildError(ReturnCommand.errored("出错,RTU(地址=" + rtuAddr + ")未上线!", command.getId(), command.getCode())) ; |
| | | }else if(!onLine.booleanValue()){ |
| | | return BaseResponseUtils.buildError(ReturnCommand.errored("出错,RTU(地址=" + rtuAddr + ")离线!", command.getId(), command.getCode())) ; |
| | | if(!ServerProperties.isLowPower){ |
| | | return BaseResponseUtils.buildError(ReturnCommand.errored("出错,RTU(地址=" + rtuAddr + ")离线!", command.getId(), command.getCode())) ; |
| | | } |
| | | } |
| | | |
| | | //生成异步任务 |
| | |
| | | return BaseResponseUtils.buildSuccess(ReturnCommand.successed("命令已接受,即将构造并下发命令。", command.getId(), command.getCode())); |
| | | } |
| | | |
| | | /** |
| | | * 收到命令结果 |
| | | * @param command |
| | | private void dealCommandResult(String jgSenderName, Command command){ |
| | | Object obj = command.getParam() ; |
| | | if(obj != null){ |
| | | CommandBackParam p = (CommandBackParam)obj ; |
| | | if(p.getSuccess()){ |
| | | log.info("命令" + (command.getId().equals(Command.defaultId)?"":("(id=" + command.getId() + ")")) + "执行成功" |
| | | + (p.getMessage() == null?"":(p.getMessage().equals("")?"":("," + p.getMessage())))); |
| | | }else{ |
| | | log.error("命令" + (command.getId().equals(Command.defaultId)?"":("(id=" + command.getId() + ")")) + "执行失败" |
| | | + (p.getMessage() == null?"":(p.getMessage().equals("")?"":("," + p.getMessage())))); |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | } |