Esempio n. 1
0
 /**
  * 查询所有关键字json方式传输
  *
  * @return
  */
 @Action(
     value = "findAllKeywordTjson",
     results = {@Result(name = "json", type = "json")})
 public String findAllKeywordTjson() {
   this.setKeywordjson("");
   this.keyword = this.getKeywordTService().findAllKeywordTjson();
   if (this.keyword != null) {
     for (Iterator it = this.keyword.iterator(); it.hasNext(); ) {
       KeywordT k = (KeywordT) it.next();
       this.keywordjson +=
           "<option value='" + k.getKeywordid() + "'>" + k.getKeywordname() + "</option>";
     }
     this.setKeywordjson(keywordjson);
     return "json";
   }
   return "json";
 }
Esempio n. 2
0
 /**
  * 查询所有关键字
  *
  * @return
  */
 @SuppressWarnings("unchecked")
 @Action(
     value = "findAllKeywordT",
     results = {@Result(name = "json", type = "json")})
 public String findAllKeywordT() {
   int currentPage = page;
   int lineSize = rp;
   List<KeywordT> kt = this.getKeywordTService().findAllKeywordT(currentPage, lineSize);
   if (kt != null) {
     total = this.getKeywordTService().countAllKeywordT();
     rows.clear();
     for (Iterator it = kt.iterator(); it.hasNext(); ) {
       KeywordT k = (KeywordT) it.next();
       if (k.getType().equals("1")) {
         k.setType("商品类型");
       }
       if (k.getType().equals("2")) {
         k.setType("文章类型");
       }
       if (k.getState().equals("1")) {
         k.setState("显示");
       }
       if (k.getState().equals("2")) {
         k.setState("隐藏");
       }
       Map cellMap = new HashMap();
       cellMap.put("id", k.getKeywordid());
       cellMap.put(
           "cell",
           new Object[] {
             k.getKeywordname(),
             k.getType(),
             k.getState(),
             k.getSort(),
             BaseTools.formateDbDate(k.getCreatetime()),
             k.getCreatorid()
           });
       rows.add(cellMap);
     }
     return "json";
   }
   this.setTotal(0);
   rows.clear();
   return "json";
 }