Пример #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 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;
    }
  }
Пример #3
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;
    }
  }