コード例 #1
0
ファイル: AnnouncementAction.java プロジェクト: koalhou/J2EE
  public String addAnnouncement() {
    if (null == announcementInfo) {
      return addBefore();
    }
    final String addTitle = getText("announcement.add.info");
    log.info(addTitle);
    try {
      UserInfo user = getCurrentUser();
      announcementInfo.setGonggao_author(user.getUserID());
      announcementInfo.setGonggao_id(UUIDGenerator.getUUID());
      announcementInfo.setEnterprise_id(user.getOrganizationID());
      service.insert("WxManage.insertannouncementInfo", announcementInfo);
    } catch (BusinessException e) {
      log.error(addTitle, e);
      addActionError(e.getMessage());
      return ERROR;
    }
    setMessage("announcement.addsuccess.message");

    this.addOperationLog(formatLog(addTitle, null));
    // 设置操作类型
    this.setOperationType(Constants.INSERT);
    // 设置所属应用系统
    this.setApplyId(Constants.CLW_P_CODE);
    // 设置所属模块
    //        this.setModuleId(MouldId.XCP_DRIVERMANAGE_ADD);
    return SUCCESS;
  }
コード例 #2
0
ファイル: AnnouncementAction.java プロジェクト: koalhou/J2EE
 /**
  * 浏览公告信息
  *
  * @return
  */
 public String announcementBrowse() {
   final String browseTitle = getText("wx.announcement.browse.title");
   log.info(browseTitle);
   HttpServletRequest request =
       (HttpServletRequest)
           ActionContext.getContext().get(org.apache.struts2.StrutsStatics.HTTP_REQUEST);
   UserInfo user = getCurrentUser();
   try {
     if (null == announcementInfo) {
       announcementInfo = new AnnouncementInfo();
     }
     announcementInfo.setGonggao_author(author);
     announcementInfo.setStart_time(start_time + " 00:00:00");
     announcementInfo.setEnd_time(end_time + " 23:59:59");
     announcementInfo.setEnterprise_id(user.getOrganizationID());
     String rpNum = request.getParameter("rp");
     String pageIndex = request.getParameter("page");
     String sortName = request.getParameter("sortname");
     String sortOrder = request.getParameter("sortorder");
     announcementInfo.setSortname(sortName);
     announcementInfo.setSortorder(sortOrder);
     int totalCount = 0;
     totalCount = service.getCount("WxManage.getCount", announcementInfo);
     // Page pageObj = new Page(page, totalCount, pageSize, url, param);
     // this.pageBar = PageHelper.getPageBar(pageObj);
     announcementList =
         (List<AnnouncementInfo>)
             service.getObjectsByPage(
                 "WxManage.getInfos",
                 announcementInfo,
                 (Integer.parseInt(pageIndex) - 1) * Integer.parseInt(rpNum),
                 Integer.parseInt(rpNum));
     this.map = getPagination(announcementList, totalCount, pageIndex, rpNum); // 转换map
     //            if (announcementList.size() == 0) {
     //                addActionMessage(getText("nodata.list"));
     //            }
     // 用于添加或者删除时显示消息
     if (null != message) {
       addActionMessage(getText(message));
     }
     // 设置操作描述
     this.addOperationLog(formatLog(browseTitle, null));
     // 设置操作类型
     this.setOperationType(Constants.SELECT);
     // 设置所属应用系统
     this.setApplyId(Constants.CLW_P_CODE);
     // 设置所属模块
     //            this.setModuleId(MouldId.XCP_DRIVERMANAGE_QUERY);
   } catch (BusinessException e) {
     addActionError(getText(e.getMessage()));
     log.error(browseTitle, e);
     return ERROR;
   }
   return SUCCESS;
 }