コード例 #1
0
ファイル: studentAction.java プロジェクト: koalhou/J2EE
  /**
   * 页面初始化/查询
   *
   * @return
   */
  public String init() {

    try {
      UserInfo user = getCurrentUser();
      if (info == null) {
        info = new StudentInfo();
      }
      info.setOrganization_id(user.getOrganizationID());
      info.setEnterprise_id(user.getEntiID());
      studentList = (List<StudentInfo>) service.getObjects("User.getStudentList", info);

      if (studentList != null && studentList.size() == 0) {
        // 无用户信息
        addActionError("无任何记录信息!");
        return ERROR;
      }
    } catch (BusinessException e) {
      super.addActionError("数据库操作失败!");
      log.error(e.getMessage());
      return ERROR;
    } catch (Exception e) {
      super.addActionError("数据库操作失败!");
      log.error(e.getMessage());
      return ERROR;
    }

    return SUCCESS;
  }
コード例 #2
0
ファイル: AnnouncementAction.java プロジェクト: koalhou/J2EE
 public String showVehicleDetail() {
   try {
     AnnouncementInfo info =
         (AnnouncementInfo) service.getObject("WxManage.getGonggaoInfoById", announcementInfo);
     String vins = info.getGonggao_veh();
     if (vins != null && !"".equals(vins)) {
       String vinStr = "";
       String[] tmp = vins.split(",");
       for (String v : tmp) {
         vinStr += "'" + v + "',";
       }
       if (!"".equals(vinStr)) vinStr = vinStr.substring(0, vinStr.length() - 1);
       UserInfo user = getCurrentUser();
       VehcileInfo vehinfo = new VehcileInfo();
       vehinfo.setOrganization_id(user.getOrganizationID());
       if (vehicle_ln != null && vehicle_ln != "") {
         vehinfo.setVehicle_ln(vehicle_ln.trim());
       }
       vehinfo.setVehicle_vin(vinStr);
       vehicleList = (List<VehcileInfo>) service.getObjects("WxManage.getInfosVeh", vehinfo);
     }
   } catch (BusinessException e) {
     super.addActionError(getText("info.db.error"));
     log.error(e.getMessage());
     return ERROR;
   } catch (Exception e) {
     super.addActionError(getText("info.db.error"));
     log.error(e.getMessage());
     return ERROR;
   }
   return SUCCESS;
 }
コード例 #3
0
ファイル: AnnouncementAction.java プロジェクト: koalhou/J2EE
 public String queryVehicle() {
   try {
     UserInfo user = getCurrentUser();
     VehcileInfo vehinfo = new VehcileInfo();
     vehinfo.setOrganization_id(user.getOrganizationID());
     if (vehicle_ln != null && vehicle_ln != "") {
       vehinfo.setVehicle_ln(vehicle_ln.trim());
     }
     vehicleList = (List<VehcileInfo>) service.getObjects("WxManage.getInfosVeh", vehinfo);
     if (vehicleList != null && vehicleList.size() == 0) {
       // 无用户信息
       addActionError(getText("nodata.list"));
       return ERROR;
     }
   } catch (BusinessException e) {
     super.addActionError(getText("info.db.error"));
     log.error(e.getMessage());
     return ERROR;
   } catch (Exception e) {
     super.addActionError(getText("info.db.error"));
     log.error(e.getMessage());
     return ERROR;
   }
   return SUCCESS;
 }
コード例 #4
0
ファイル: AnnouncementAction.java プロジェクト: koalhou/J2EE
 public String showDetail() {
   try {
     announcementInfo =
         (AnnouncementInfo) service.getObject("WxManage.getGonggaoInfoById", announcementInfo);
   } catch (BusinessException e) {
     super.addActionError(getText("info.db.error"));
     log.error(e.getMessage());
     return ERROR;
   } catch (Exception e) {
     super.addActionError(getText("info.db.error"));
     log.error(e.getMessage());
     return ERROR;
   }
   return SUCCESS;
 }
コード例 #5
0
ファイル: SimManageAction.java プロジェクト: koalhou/J2EE
  /**
   * 页面初始化/查询
   *
   * @return
   */
  public String init() {
    ActionContext.getContext()
        .getSession()
        .put(Constants.CURRENT_LOCATION, getText("sim.manage.location"));

    try {
      Map<String, String> map = new HashMap<String, String>();
      map.put("simNumber", SearchUtil.formatSpecialChar(simNumber));
      map.put("phoneNumber", SearchUtil.formatSpecialChar(phoneNumber));

      int totalCount = 0;
      totalCount = service.getCount("SimManage.getCount", map);
      Page pageObj = new Page(page, totalCount, pageSize, url, param);
      this.pageBar = PageHelper.getPageBar(pageObj);

      simList =
          (List<SimInfo>)
              service.getObjectsByPage(
                  "SimManage.getSimInfos", map, pageObj.getStartOfPage(), pageSize);

      if (simList != null && simList.size() == 0) {
        // 无SIM卡信息
        addActionError(getText("common.no.data"));
        return ERROR;
      }

      // 显示操作成功信息
      if (null != message) {
        addActionMessage(getText(message));
      }

    } catch (BusinessException e) {
      super.addActionError(getText("info.db.error"));
      log.error("Query sim infos error:" + e.getMessage());
      return ERROR;
    } catch (Exception e) {
      super.addActionError(getText("info.db.error"));
      log.error("Query sim infos error:" + e.getMessage());
      return ERROR;
    } finally {
      setOperationType(Constants.SELECT, ModuleId.CLW_M_CS_SIM_QUERY_MID);
      addOperationLog("查询SIM卡信息");
    }

    return SUCCESS;
  }