Ejemplo n.º 1
0
 /**
  * 下拉维度列表
  *
  * @return
  */
 public String combo() {
   List<Demension> list = demensionService.getAll();
   StringBuffer sb = new StringBuffer("[['0','全部..']");
   for (Demension dem : list) {
     sb.append(",['").append(dem.getDemId()).append("','").append(dem.getDemName()).append("']");
   }
   sb.append("]");
   jsonString = sb.toString();
   return SUCCESS;
 }
Ejemplo n.º 2
0
  /** 显示列表 */
  public String list() {

    QueryFilter filter = new QueryFilter(getRequest());
    List<Demension> list = demensionService.getAll(filter);

    Type type = new TypeToken<List<Demension>>() {}.getType();
    StringBuffer buff =
        new StringBuffer("{success:true,'totalCounts':")
            .append(filter.getPagingBean().getTotalItems())
            .append(",result:");

    Gson gson = new Gson();
    buff.append(gson.toJson(list, type));
    buff.append("}");

    jsonString = buff.toString();

    return SUCCESS;
  }