Ejemplo n.º 1
0
  @SuppressWarnings("unchecked")
  @Override
  public String execute() {
    try {
      String username = (String) ActionContext.getContext().getSession().get("LOGINUSERNAME");
      String password = (String) ActionContext.getContext().getSession().get("LOGINPASSWORD");
      if (username == null || password == null) {
        return LOGIN;
      }

      ActionContext.getContext().getSession().put("SMGKSTATUSDICT", StatusConstants.SmgStatusDict);
      Integer selectStatus = StatusConstants.ZHUCEWEIYAZHENG;
      if (regStatus != null) {
        selectStatus = regStatus;
      }
      logger.debug("selectStatus:" + selectStatus);

      int total = 0;
      if (selectStatus != 0) {
        total = smgkInfoService.getSmgkInfoTotal(selectStatus);
      } else {
        total = smgkInfoService.getSmgkInfoTotal();
      }
      int page = 1;
      if (num != null) {
        page = num.intValue();
      }
      pu = new PaginationUtil(total, page, SmgkConstants.PAGE_MAX_RESULT);
      if (selectStatus != 0) {
        pageList =
            smgkInfoService.findSmgkInfoByPage(
                selectStatus, pu.getStartRecord(), SmgkConstants.PAGE_MAX_RESULT);
      } else {
        pageList =
            smgkInfoService.findSmgkInfoByPage(pu.getStartRecord(), SmgkConstants.PAGE_MAX_RESULT);
      }
      if (pageList != null) {
        for (SmgkInfo info : pageList) {
          if (info.getCityID() != null) {
            CityInfo ci = cityInfoService.getCityInfo(info.getCityID());
            if (ci != null) {
              cityList.add("" + ci.getName());
            } else {
              cityList.add("");
            }
          } else {
            cityList.add("");
          }

          if (info.getNation() != null) {
            nationList.add("" + NationsConstants.nationDict.get(info.getNation()));
          } else {
            nationList.add("");
          }
          if (info.getEducation() != null) {
            educationList.add("" + EducationConstants.educationDict.get(info.getEducation()));
          } else {
            educationList.add("");
          }

          if (info.getProvince() != null) {
            provinceList.add("" + ProvinceConstants.provinceDict.get(info.getProvince()));
          } else {
            provinceList.add("");
          }
        }
      }
    } catch (Exception e) {
      logger.error("" + e.getMessage(), e.getCause());
    }

    return SUCCESS;
  }