예제 #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
  public String detail() throws Exception {
    String username = (String) ActionContext.getContext().getSession().get("LOGINUSERNAME");
    String password = (String) ActionContext.getContext().getSession().get("LOGINPASSWORD");
    try {
      if (username == null || password == null) {
        return LOGIN;
      }
      if (sendID == null) {
        this.addActionError("编号为空!");
        return ERROR;
      }
      EmailSendInfo esi = emailSendInfoService.getEmailSendInfo(sendID);
      if (esi != null) {
        ActionContext.getContext().put("SENDDETAIL", esi);
      }
      EmailAddressInfo ai = emailAddressInfoService.getEmailAddressInfo(esi.getAddressID());
      if (ai.getName() != null) {
        ActionContext.getContext().put("ADDRESS", ai.getName());
      }

      AddressCatalogInfo aci = addressCatalogInfoService.getAddressCatalogInfo(esi.getAcID());
      if (aci.getName() != null) {
        ActionContext.getContext().put("CATALOG", aci.getName());
      }

      EmployeeInfo ei = employeeInfoService.getEmployeeInfo(esi.getEmployeeID());
      if (ei.getName() != null) {
        ActionContext.getContext().put("EMPLOYEE", ei.getName());
      }
      if (esi.getStatus() != null) {
        ActionContext.getContext().put("STATUS", StatusConstants.StatusDict.get(esi.getStatus()));
      }
    } catch (Exception e) {
      logger.error(e.getMessage(), e.getCause());
    }

    return SUCCESS;
  }