コード例 #1
0
  /** 删除对象 */
  public String delete() {
    if (items != null)
      for (String ids : items) {
        String[] idArray = ids.split(",");
        for (String id : idArray) {
          if (StringUtils.isNotEmpty(id) && StringUtils.isNumeric(id)) {
            cmsRequestlog = cmsRequestlogManager.getById(Long.parseLong(id));
            if (cmsRequestlog != null) {
              // cmsRequestlog.setStatus(-1);
              // cmsRequestlogManager.update(cmsRequestlog);
              cmsRequestlogManager.removeById(cmsRequestlog.getId());
            }
          }
        }
        // cmsRequestlogManager.removeById(Long.parseLong(id));
      }

    if ("ajax".equalsIgnoreCase(Utils.getParam(getRequest(), "ajax"))) {
      Map map = new HashMap();
      map.put("re", 1);
      return writeAjaxResponse(Json.toJson(map));
    } else {
      return LIST_ACTION;
    }
  }
コード例 #2
0
 public void prepare() throws Exception {
   if (isNullOrEmptyString(id)) {
     cmsRequestlog = new CmsRequestlog();
   } else {
     cmsRequestlog = (CmsRequestlog) cmsRequestlogManager.getById(id);
   }
 }
コード例 #3
0
 public String listAjax() {
   CmsRequestlogQuery query = newQuery(CmsRequestlogQuery.class, DEFAULT_SORT_COLUMNS);
   String sort = this.getRequest().getParameter("sort");
   if (StringUtils.isNotEmpty(sort)) query.setSortColumns(sort);
   Page page = cmsRequestlogManager.findPage(query);
   Map map = new HashMap();
   map.put("total", page.getTotalCount());
   map.put("rows", page.getResult());
   return writeAjaxResponse(Json.toJson(map));
 }
コード例 #4
0
 /** 执行搜索 */
 public String list() {
   CmsRequestlogQuery query = newQuery(CmsRequestlogQuery.class, DEFAULT_SORT_COLUMNS);
   String sort = this.getRequest().getParameter("sort");
   if (StringUtils.isNotEmpty(sort)) query.setSortColumns(sort);
   Page page = cmsRequestlogManager.findPage(query);
   if ("ajax".equalsIgnoreCase(Utils.getParam(getRequest(), "ajax"))) {
     Map map = new HashMap();
     map.put("pg", page);
     return writeAjaxResponse(Json.toJson(map));
   } else {
     this.getRequest().setAttribute("pg", page);
     return LIST_JSP;
   }
 }
コード例 #5
0
  /** 保存更新对象 */
  public String update() {
    long theuserid = Utils.getSessionUserId(getRequest());
    if (theuserid >= 0) {
      cmsRequestlog.setModifyuser(theuserid);
    }
    cmsRequestlog.setModifytimelong(System.currentTimeMillis());

    cmsRequestlogManager.update(this.cmsRequestlog);

    if ("ajax".equalsIgnoreCase(Utils.getParam(getRequest(), "ajax"))) {
      Map map = new HashMap();
      map.put("obj", cmsRequestlog);
      return writeAjaxResponse(Json.toJson(map));
    } else {
      return OK_JSP;
    }
  }
コード例 #6
0
  /** 保存新增对象 */
  public String save() {
    //		cmsRequestlog.setCreateTime(new Date());
    //		cmsRequestlog.setDeleted("0");

    long theuserid = Utils.getSessionUserId(getRequest());
    if (theuserid >= 0) {
      cmsRequestlog.setModifyuser(theuserid);
    }
    cmsRequestlog.setCreatetimelong(System.currentTimeMillis());
    cmsRequestlog.setModifytimelong(System.currentTimeMillis());
    cmsRequestlog.setStatus(0);

    cmsRequestlogManager.save(cmsRequestlog);

    if ("ajax".equalsIgnoreCase(Utils.getParam(getRequest(), "ajax"))) {
      Map map = new HashMap();
      map.put("obj", cmsRequestlog);
      return writeAjaxResponse(Json.toJson(map));
    } else {
      return OK_JSP;
    }
  }