Пример #1
0
 @RequestMapping("listNotice")
 public String listNotice(
     HttpServletRequest request,
     HttpServletResponse response,
     Infomation infomation,
     Integer backPage) {
   infomationManager.updateValidateInfomation();
   Long companyId = (Long) request.getSession().getAttribute(SecurityConstants.USER_COMPANY_ID);
   PageSearch page = PageUtils.preparePage(request, Infomation.class, true);
   User user = (User) request.getSession().getAttribute(SecurityConstants.SESSION_USER);
   page.getFilters()
       .add(new PropertyFilter(Infomation.class.getName(), "EQL_companyId", companyId.toString()));
   if (IBSConstants.USER_TYPE_COMPANY_HR == user.getType()) {
     page.getFilters()
         .add(
             new PropertyFilter(
                 Infomation.class.getName(), "EQL_createdBy", user.getObjectId().toString()));
   }
   String cp = request.getParameter("c_p");
   Integer currPage = 1;
   if (cp != null && !("").equals(cp)) {
     currPage = Integer.parseInt(cp);
   }
   page.setSortOrder("asc");
   page.setSortProperty("createdOn");
   page.setCurrentPage(currPage);
   handleFind(page);
   List<Infomation> items = page.getList();
   request.setAttribute("items", items);
   request.setAttribute("pageInfomation", page);
   return "info/listNotice";
 }
Пример #2
0
  /**
   * 积分发放记录
   *
   * @author zhliu
   * @date 2015年6月15日
   * @parm
   * @param request
   * @param response
   * @return
   */
  @RequestMapping(value = "")
  public String index(HttpServletRequest request) {
    try {
      User user = (User) request.getSession().getAttribute(SecurityConstants.SESSION_USER);
      PageSearch page = preparePage(request);
      PageSearchInit.initcurrentPage(page, request);

      /** 查询发放名目 */
      WelfareItem welfareItem = new WelfareItem();
      welfareItem.setItemType(IBSConstants.WELFAREITEM_TYPE_WELFARE);
      welfareItem.setItemGrade(IBSConstants.WELFAREITEM_GRADE_CLASSIFY);
      List<WelfareItem> welfareItems = welfareManager.getBySample(welfareItem);
      List<ActivityItem> acItemList =
          exActivityManager.queryActivityItemList(user.getCompanyId(), null);
      if (!UserUtils.isCompanyAdmin()) { // 非企业管理员
        page.getFilters()
            .add(
                new PropertyFilter(
                    "PointDistrubute", "EQL_userId", String.valueOf(user.getObjectId())));
      }
      page.getFilters()
          .add(
              new PropertyFilter(
                  "PointDistrubute", "EQL_companyId", String.valueOf(user.getCompanyId())));
      page.setSortProperty("createDate");
      page.setSortOrder("desc");

      page = pointDistrubuteManager.queryPointDistRelItem(page);
      // 查询发放对象字典信息
      List<Dictionary> dictionaryList =
          dictionaryManager.getDictionariesByDictionaryId(
              IBSConstants.POINTS_GRANT_OBJECT_CONSTANT);

      // 查询发放对象字典信息
      List<Dictionary> grantPointsStatusList =
          dictionaryManager.getDictionariesByDictionaryId(IBSConstants.GRANT_POINTS_STATUS);
      request.setAttribute("dictionaryList", dictionaryList);
      request.setAttribute("grantPointsStatusList", grantPointsStatusList);
      request.setAttribute("pageActivity", page);
      request.setAttribute("welfareItems", welfareItems);
      request.setAttribute("acItemList", acItemList);
      Date now = new Date();
      for (PointDistrubute distrubute : (List<PointDistrubute>) page.getList()) {
        // 借用字段
        distrubute.setUserId((long) distrubute.getDistributeDate().compareTo(now));
      }
    } catch (Exception e) {
      logger.error("index", e);
    }
    return HOME_DIR + "/listpointsGrant";
  }