Exemple #1
0
  @Override
  public JSONObject getJsonObject(Map<String, Object> str) {
    SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
    JSONObject jsonObject2 = new JSONObject();
    Map<String, ColumnDesign> ret = resultDesignService.getTableDef("result");

    for (ColumnDesign columnDesign : ret.values()) {
      if (ColumnDesign.ALLOWSHOW.equals(columnDesign.getAllowShow())) { // 如果是要显示的

        if (columnDesign.getColumnType().equals(ColumnDesign.DATETYPE)) { // 如果是时间类型 格式化时间
          try {
            jsonObject2.put(
                columnDesign.getColumnNameDB(),
                fmt.format(str.get(columnDesign.getColumnNameDB())));
          } catch (Exception e) {
            e.printStackTrace();
          }
        } else {
          jsonObject2.put(columnDesign.getColumnNameDB(), str.get(columnDesign.getColumnNameDB()));
        }
      }
    }
    jsonObject2.put("uid", str.get("uuid"));
    return jsonObject2;
  }
Exemple #2
0
 public void update(String tableName, Map<String, String[]> str) {
   resultDesignService.update(tableName, str);
 }