Пример #1
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;
    }
  }
Пример #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;
    }
  }
  @Transactional
  public void removeById(java.lang.Long id) {
    CmsUserEmail cmsUserEmail = this.getById(id);
    if (cmsUserEmail != null) {
      Map map = new HashMap();
      map.put("object", cmsUserEmail);
      String json = Utils.toJson(map);
      CmsDeleteBackup cmsDeleteBackup = new CmsDeleteBackup();
      cmsDeleteBackup.setTableName("CmsUserEmail");
      cmsDeleteBackup.setContent(json);
      cmsDeleteBackup.setCreatetimelong(System.currentTimeMillis());
      cmsDeleteBackup.setModifytimelong(0L);
      cmsDeleteBackup.setStatus(0);
      this.cmsDeleteBackupDao.save(cmsDeleteBackup);
    }

    super.removeById(id);
  }