Exemplo n.º 1
0
  public String getCommandResult() {
    TerminalCommand tc = getTerminalCommand(commandId);
    if (TerminalCommand.STATUS_NEW.equals(tc.getStatus()) == false
        && TerminalCommand.STATUS_PROCESSING.equals(tc.getStatus()) == false) {
      BasicData bd = getBasicDataService().getBasicDataByCode(tc.getStatus(), "TCommandStatus");
      String status = bd != null ? bd.getName() : "";
      return json(true, status);
    }

    return json(false, "");
  }
Exemplo n.º 2
0
  /**
   * 查询拍照指令的执行状态 如果消息不为空,就代表出错,指令停止执行
   *
   * @return
   */
  public String queryPhotoCommandResult() {
    TerminalCommand tc = getTerminalCommand(commandId);
    if (TerminalCommand.STATUS_SUCCESS.equals(tc.getStatus())) {
      String hsql = "from MediaItem where commandId = ?";
      MediaItem mi = (MediaItem) this.getBaseService().find(hsql, commandId);
      if (mi != null) return json(true, mi.getFileName());
      else return json(false, "");
    }

    if (TerminalCommand.STATUS_NEW.equals(tc.getStatus()) == false
        && TerminalCommand.STATUS_PROCESSING.equals(tc.getStatus()) == false) {
      BasicData bd = getBasicDataService().getBasicDataByCode(tc.getStatus(), "TCommandStatus");
      String status = bd != null ? bd.getName() : "";
      return json(false, status);
    } else return json(false, "");
  }