Exemple #1
0
  /**
   * 获取事故信息
   *
   * @param start 定位开始时间
   */
  private Object[][] getAcc(String start) {
    StringBuffer sb = new StringBuffer();
    Object acc[][] = null;

    sb.append(
        "SELECT ACC.GLS,ACC.MS,ACC.XZQH,ACC.SGBH,ACC.SGFSSJ,ACC.SGLX,ACC.SWRS,ACC.SSRS,ACC.SWRSQ,ACC.SZRS,ACC.SGDD,ACC.JYAQ,ACC.LH,ACC.LM,ACC.XQ");
    sb.append(" FROM ACC_FILE ACC,T_OA_ROADDEPARTMENT ROAD");
    sb.append(" WHERE ACC.XZQH = ROAD.XZQH AND ACC.LH = ROAD.LH AND (ACC.GLS!=0 OR ACC.MS!=0)");

    if ("".equals(start)) {
      // 默认查询48小时内上报事故
      sb.append(" AND ACC.SGFSSJ>=(SYSDATE-2)");
    } else {
      sb.append(
          " AND ACC.SGFSSJ>=TO_DATE('"
              + StringHelper.obj2str(start, "")
              + "','YYYY-MM-DD HH24:MI:SS')");
    }
    try {
      acc = DBHandler.getMultiResult(sb.toString());
    } catch (Exception e) {
      loger.error("从事故表获取未定位事故信息失败!" + e);
    }
    return acc;
  }
 // 获取指令指示基本信息
 public String getDictateDetailById(String dictateId, String userCountyCode) {
   if (null == dictateId
       || 0 >= dictateId.length()
       || null == userCountyCode
       || 0 >= userCountyCode.length()) {
     return null;
   }
   DictateDisposal dbDictate = new DictateDisposal(); // 通过ID获取基本信息
   Object[][] dictateData = dbDictate.getDictateDataById(dictateId, userCountyCode);
   if (null == dictateData) {
     return null;
   }
   String fullfillId = StringHelper.obj2str(dictateData[0][9], ""); // 更新接收时间,和落实状态
   if (ConstDefine.DICTATE_DILIVER_CODE.equals(StringHelper.obj2str(dictateData[0][10], ""))) {
     dbDictate.inceptDictate(fullfillId, DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm"));
   }
   return XmlDataCreator.buildXmlDocument(dictateData, "row"); // 构造xml数据
 }
  /**
   * @author LChQ 2008-10-18 <b>生成XML行</b>
   * @param originString
   * @return
   */
  public static String buildXmlRows(Object[][] rowData, String rowName) {
    StringBuilder xmlRow = new StringBuilder();
    if (null == rowData || null == rowName || "".equals(rowName)) {
      return null;
    }

    for (int i = 0; i < rowData.length; i++) {
      xmlRow.append("<" + rowName + "  id='");
      xmlRow.append(i);
      xmlRow.append("'>");
      for (int j = 0; j < rowData[i].length; j++) {
        xmlRow.append("<col>");
        xmlRow.append(StringHelper.obj2str(rowData[i][j], ""));
        xmlRow.append("</col>");
      }
      xmlRow.append("</" + rowName + ">\n");
    }
    return xmlRow.toString();
  }
 /** 细类 */
 public String getEventThinTypeName(Object id) {
   String value = "";
   String sql = "select name from t_attemper_code where id=" + id + "";
   value = StringHelper.obj2str(DBHandler.getSingleResult(sql), "");
   return value;
 }
Exemple #5
0
  /**
   * 向事故图层写入事故点
   *
   * @param obj
   */
  private void addPoint(Object[] obj) {
    boolean isSpSuccess = false;
    try {
      // 得到该事故点所处道路的sde关联id和国标id
      Object[] DLobj = getDLBH(obj[2], obj[12]); // 获取高速编号
      if (DLobj != null && DLobj.length != 0) {
        int qmz = StringHelper.obj2int(obj[0], 0);
        int bmz = StringHelper.obj2int(obj[1], 0);
        if (bmz >= 0 && bmz < 1000) {
          if (bmz % 100 != 0) {
            bmz = (int) bmz / 100 * 100;
          }
        } else {
          bmz = 0;
        }
        Object[][] points =
            pgs.getFieldsByCondition(
                "QMZBH ='" + qmz + "KM' AND BMZBH ='" + bmz + "M' AND DH = '" + DLobj[1] + "'",
                "SHAPE");
        if (points != null && points.length != 0) {
          if (points[0][0] != null) {
            String[] xy = points[0][0].toString().split(",");
            try {
              StringBuffer sb = new StringBuffer();
              sb.append("INSERT INTO T_TIRA_ACD_C_ACDFILE");
              sb.append(
                  " (GLS,MS,XZQH,SGBH,SGFSSJ,SGLX,SWRS,SSRS,SWRSQ,SZRS,SGDD,JYAQ,LH,LM,XQ,X,Y)");
              sb.append(
                  " VALUES('"
                      + qmz
                      + "','"
                      + bmz
                      + "','"
                      + StringHelper.obj2str(obj[2], "")
                      + "',");
              sb.append(
                  "'"
                      + StringHelper.obj2str(obj[3], "")
                      + "',TO_DATE('"
                      + StringHelper.obj2str(obj[4], "")
                      + "','YYYY-MM-DD HH24:MI:SS'),");
              sb.append(
                  "'"
                      + StringHelper.obj2str(obj[5], "")
                      + "','"
                      + StringHelper.obj2str(obj[6], "")
                      + "',");
              sb.append(
                  "'"
                      + StringHelper.obj2str(obj[7], "")
                      + "','"
                      + StringHelper.obj2str(obj[8], "")
                      + "',");
              sb.append(
                  "'"
                      + StringHelper.obj2str(obj[9], "")
                      + "','"
                      + StringHelper.obj2str(obj[10], "")
                      + "',");
              sb.append(
                  "'"
                      + StringHelper.obj2str(obj[11], "")
                      + "','"
                      + StringHelper.obj2str(obj[12], "")
                      + "',");
              sb.append(
                  "'"
                      + StringHelper.obj2str(obj[13], "")
                      + "','"
                      + StringHelper.obj2str(obj[14], "")
                      + "',");
              sb.append("'" + xy[0] + "','" + xy[1] + "'");
              isSpSuccess = DBHandler.execute(sb.toString());
            } catch (Exception e) {
              loger.error("定位事故信息失败!" + e);
            }
          }
        }
      }
    } catch (Exception e) {
      loger.error("定位事故信息失败!" + e);
    }

    /** 定位失败 */
    if (!isSpSuccess) {
      loger.error(
          "定位事故信息失败!xzqh"
              + StringHelper.obj2str(obj[2], "")
              + ";sgbh"
              + StringHelper.obj2str(obj[3], ""));
    }
  }
  /**
   * 设置模块主页<br>
   * 假如该用户没有权限查看默认页,则跳到左树第一个字节点 Modified by Leisx 2011-11-22
   *
   * @param action
   * @param request
   * @param response
   * @return
   * @throws Throwable
   */
  public ActionForward doGetHomePage(
      Action action, HttpServletRequest request, HttpServletResponse response) throws Throwable {

    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/xml");
    PrintWriter out = response.getWriter();

    String sID = StringHelper.obj2str(request.getParameter("sID"), "");
    String userName = StringHelper.obj2str(request.getParameter("userName"), "");
    String homePage = "";
    String funcId = "";

    if (!userName.equals("admin")) {
      String sql =
          "select distinct id, n_id, N_parent_id, text,isDefault from t_sys_func a, (select distinct funccode from t_sys_privfunc";
      sql +=
          " where privcode in (select distinct privcode from t_sys_rolepriv where rolecode in (select distinct rolecode";
      sql +=
          " from t_sys_userrole, t_sys_user where t_sys_user.username = '******' and t_sys_userrole.usercode =";
      sql +=
          " t_sys_user.usercode))) b where a.id = b.funccode and a.n_Parent_Id != '1' and subStr(id, 0, 2) = '"
              + sID
              + "' order by id";

      Object[][] results = DBHandler.getMultiResult(sql);
      System.out.println("HomePageCtrl.getHomePage.sql:" + sql);

      if (results != null) {
        for (int i = 0; i < results.length; i++) {
          if (results[i][4].equals("1")) {
            homePage = (String) results[i][1];
            System.out.println("homePage = " + homePage);
            funcId = (String) results[i][0];
            break;
          }
        }

        if (homePage == "") {
          for (int i = 0; i < results.length; i++) {
            if (!((String) results[i][1])
                .substring(((String) results[i][1]).length() - 4)
                .equals("main")) {
              homePage = String.valueOf(results[i][1]);
              System.out.println("homePage = " + homePage);
              funcId = String.valueOf(results[i][0]);
              break;
            }
          }
        }
      }
      if (homePage == "") {
        homePage = "exception.jsp";
      }
    }

    StringBuffer xmlData = new StringBuffer("<?xml version='1.0' encoding='UTF-8'?>\n");
    xmlData.append("<hp>\n");
    xmlData.append("<col>" + homePage + "</col>\n");
    xmlData.append("<col>" + funcId + "</col>\n");
    xmlData.append("</hp>\n");
    System.out.println("homePageXml:\n" + xmlData.toString());
    out.write(xmlData.toString());
    out.close();
    return null;
  }