Пример #1
0
  public String execute() throws Exception {
    try {
      String username = (String) ActionContext.getContext().getSession().get("LOGINUSERNAME");
      String password = (String) ActionContext.getContext().getSession().get("LOGINPASSWORD");
      if (username == null || password == null) {
        return LOGIN;
      }

      int page = 1;
      if (num != null) {
        page = num.intValue();
      }
      int total = emailSendInfoService.getEmailSendInfoTotal();
      pu = new PaginationUtil(total, page, SmgkConstants.PAGE_MAX_RESULT);
      pageList =
          emailSendInfoService.findEmailSendInfoByPage(
              pu.getStartRecord(), SmgkConstants.PAGE_MAX_RESULT);
      for (EmailSendInfo info : pageList) {
        if (pageList != null) {
          EmployeeInfo eInfo = employeeInfoService.getEmployeeInfo(info.getEmployeeID());
          EmailAddressInfo eaInfo =
              emailAddressInfoService.getEmailAddressInfo(info.getAddressID());
          AddressCatalogInfo acInfo =
              addressCatalogInfoService.getAddressCatalogInfo(info.getAcID());
          if (eInfo != null) {
            eaList.add("" + eaInfo.getName());
          } else {
            eaList.add("");
          }
          if (eaInfo != null) {
            eList.add("" + eInfo.getName());
          } else {
            eList.add("");
          }
          if (acInfo != null) {
            acList.add("" + acInfo.getName());
          } else {
            acList.add("");
          }
          if (info.getStatus() != null) {
            statusList.add("" + StatusConstants.StatusDict.get(info.getStatus()));
          } else {
            statusList.add("");
          }
        } else {
          this.addActionMessage("数据库中没有数据!");
        }
      }
    } catch (Exception e) {
      logger.error("" + e.getMessage(), e.getCause());
    }

    return SUCCESS;
  }
Пример #2
0
  @SuppressWarnings("unchecked")
  @Override
  public String execute() throws Exception {
    try {
      String username = (String) ActionContext.getContext().getSession().get("LOGINUSERNAME");
      String password = (String) ActionContext.getContext().getSession().get("LOGINPASSWORD");
      if (username == null || password == null) {
        return LOGIN;
      }
      int page = 1;
      if (num != null) {
        page = num.intValue();
      }

      // 先添加表头信息
      Long selectHeaderID = (Long) ActionContext.getContext().getSession().get("HEADERID");
      if (headerID != null) {
        selectHeaderID = headerID;
        ActionContext.getContext().getSession().put("HEADERID", selectHeaderID);
      }
      logger.debug("headerID:" + selectHeaderID);
      InquisitionHeaderInfo inquisitionHeaderInfo = null;
      if (selectHeaderID != null) {
        inquisitionHeaderInfo =
            inquisitionHeaderInfoService.getInquisitionHeaderInfo(selectHeaderID);
        ActionContext.getContext().getSession().put("HEADERLIST", inquisitionHeaderInfo);
        total = inquisitionHeaderSelectInfoService.getTotal(selectHeaderID);
      } else {
        total = inquisitionHeaderSelectInfoService.getTotal();
      }
      pu = new PaginationUtil(total, page, SmgkConstants.PAGE_MAX_RESULT);

      if (selectHeaderID != 0) {
        pageList =
            inquisitionHeaderSelectInfoService.findByPage(
                selectHeaderID, pu.getStartRecord(), SmgkConstants.PAGE_MAX_RESULT);
      } else {
        pageList =
            inquisitionHeaderSelectInfoService.findByPage(
                pu.getStartRecord(), SmgkConstants.PAGE_MAX_RESULT);
      }
      optionList.clear();
      selectList.clear();

      OptionInfo optionInfo = null;
      for (InquisitionHeaderSelectInfo info : pageList) {
        if (info.getOptionID() != null) {
          optionInfo = optionInfoService.getOptionInfo(info.getOptionID());
          if (optionInfo != null) {
            optionList.add("" + optionInfo.getChinaOption());
          }
        } else {
          optionList.add("");
        }
        if (info.getAlterID() != null) {
          optionInfo = optionInfoService.getOptionInfo(info.getAlterID());
          selectList.add("" + optionInfo.getChinaOption());
        } else {
          selectList.add("");
        }
      }
    } catch (Exception e) {
      logger.error("" + e.getMessage(), e.getCause());
    }
    return SUCCESS;
  }