Package org.g4studio.common.dao

Examples of org.g4studio.common.dao.Dao


* @since 2012-10-30
*/
public class RunQueryListFromOracleWithCursor {
 
  public static void main(String[] args) {
    Dao g4Dao = (Dao)SpringBeanLoader.getSpringBean("g4Dao");
    Dto prcDto = new BaseDto();
    prcDto.put("prm_Xm", "李");
    g4Dao.callPrc("Demo.g4_prc_cursor_demo", prcDto);
    List list = prcDto.getAsList("cur_list");
    for (int i = 0; i < list.size(); i++) {
      Dto dto = (BaseDto)list.get(i);
      System.out.println(dto.getAsString("xm") + ":" + dto.getAsBigDecimal("fyze"));
    }
View Full Code Here


  /**
   * 标签开始
   */
  public int doStartTag() throws JspException {
    Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
    HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    Dto grantDto = new BaseDto();
    grantDto.put("roleid", request.getParameter("roleid"));
    grantDto.put("authorizelevel", authorizelevel);
    List grantedList = g4Dao.queryForList("ArmTagSupport.queryGrantedMenusByRoleId", grantDto);
    List menuList = new ArrayList();
    String account = WebUtils.getSessionContainer(request).getUserInfo().getAccount();
    String developerAccount = WebUtils.getParamValue("DEFAULT_DEVELOP_ACCOUNT", request);
    String superAccount = WebUtils.getParamValue("DEFAULT_ADMIN_ACCOUNT", request);
    Dto qDto = new BaseDto();
    String userid = WebUtils.getSessionContainer(request).getUserInfo().getUserid();
    qDto.put("userid", userid);
    String roletype = request.getParameter("roletype");
    String menutype = SystemConstants.MENUTYPE_SYSTEM;
    if (roletype.equals(SystemConstants.ROLETYPE_BUSINESS)) {
      menutype = SystemConstants.MENUTYPE_BUSINESS;
    }
    if (authorizelevel.equals(SystemConstants.AUTHORIZELEVEL_ADMIN)) {
      menutype = SystemConstants.MENUTYPE_BUSINESS;
    }
    qDto.put("roleid", roletype);
    qDto.put("menutype", menutype);
    if (account.equalsIgnoreCase(developerAccount) || account.equalsIgnoreCase(superAccount)) {
      menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForRoleGrant", qDto);
    } else {
      qDto.put("menutype", SystemConstants.MENUTYPE_BUSINESS);
      menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForGrant", qDto);
    }
    for (int i = 0; i < menuList.size(); i++) {
      MenuVo menuVo = (MenuVo) menuList.get(i);
      if (checkGeant(grantedList, menuVo.getMenuid()).booleanValue()) {
        menuVo.setChecked("true");
View Full Code Here

 
  /**
   * 标签开始
   */
  public int doStartTag() throws JspException{
    Dao g4Dao = (Dao)SpringBeanLoader.getSpringBean("g4Dao");
    HttpServletRequest request = (HttpServletRequest)this.pageContext.getRequest();
    String deptid = request.getParameter("deptid");
    String roletype = request.getParameter("roletype");
    Dto deptDto = new BaseDto();
    deptDto.put("deptid", deptid);
    List deptList = g4Dao.queryForList("ArmTagSupport.queryDeptsForRoleGrant", deptDto);
    List userList = new ArrayList();
    Dto userDto = new BaseDto();
    //角色类型和用户类型代码是对应的
    userDto.put("usertype", roletype);
    if (roletype.equals("1")) {
      //注册用户
      //userDto.put("usertype4", "4");
    }
    for(int i = 0; i < deptList.size(); i++){
      DeptVo deptVo = (DeptVo)deptList.get(i);
      if(deptVo.getDeptid().equals(deptid)){
        deptVo.setIsroot("true");
      }
      userDto.put("deptid", deptVo.getDeptid());
      List tempList = g4Dao.queryForList("ArmTagSupport.queryUsersForRoleGrant", userDto);
      userList.addAll(tempList);
    }
    Dto grantDto = new BaseDto();
    grantDto.put("roleid", request.getParameter("roleid"));
    List grantList = g4Dao.queryForList("ArmTagSupport.queryGrantedUsersByRoleId", grantDto);
    for(int i = 0; i < userList.size(); i++){
      UserVo userVo = (UserVo)userList.get(i);
      String usertypeString = WebUtils.getCodeDesc("USERTYPE", userVo.getUsertype(), request);
      String usernameString = userVo.getUsername();
      usernameString += "[" + userVo.getAccount() + ", " + usertypeString + "]";
View Full Code Here

 
  /**
   * 标签开始
   */
  public int doStartTag() throws JspException{
    Dao g4Dao = (Dao)SpringBeanLoader.getSpringBean("g4Dao");
    HttpServletRequest request = (HttpServletRequest)this.pageContext.getRequest();
    String deptid = request.getParameter("deptid");
    String usertype = request.getParameter("usertype");
    Dto deptDto = new BaseDto();
    deptDto.put("deptid", deptid);
    List deptList = g4Dao.queryForList("ArmTagSupport.queryDeptsForUserGrant", deptDto);
    List roleList = new ArrayList();
    Dto roleDto = new BaseDto();
    //角色类型和用户类型代码是对应的
    //经办员和注册人员属于业务经办角色
    if (usertype.equals("4")) {
      //usertype = "1";
    }
    roleDto.put("roletype", usertype);
    for(int i = 0; i < deptList.size(); i++){
      DeptVo deptVo = (DeptVo)deptList.get(i);
      if(deptVo.getDeptid().equals(deptid)){
        deptVo.setIsroot("true");
      }
      roleDto.put("deptid", deptVo.getDeptid());
      List tempList = g4Dao.queryForList("ArmTagSupport.queryRolesForUserGrant", roleDto);
      roleList.addAll(tempList);
    }
    Dto grantDto = new BaseDto();
    grantDto.put("userid", request.getParameter("userid"));
    List grantList = g4Dao.queryForList("ArmTagSupport.queryGrantedRolesByUserId", grantDto);
    for(int i = 0; i < roleList.size(); i++){
      RoleVo roleVo = (RoleVo)roleList.get(i);
      String roletypeString = WebUtils.getCodeDesc("ROLETYPE", roleVo.getRoletype(), request);
      String rolenameString = roleVo.getRolename();
      rolenameString += "[" + roletypeString + "]";
View Full Code Here

 
  /**
   * 标签开始
   */
  public int doStartTag() throws JspException{
    Dao g4Dao = (Dao)SpringBeanLoader.getSpringBean("g4Dao");
    HttpServletRequest request = (HttpServletRequest)this.pageContext.getRequest();
    Dto grantDto = new BaseDto();
    grantDto.put("userid", request.getParameter("userid"));
    grantDto.put("authorizelevel", SystemConstants.AUTHORIZELEVEL_ACCESS);
    List grantedList = g4Dao.queryForList("ArmTagSupport.queryGrantedMenusByUserId", grantDto);
    List menuList = new ArrayList();
    String account = WebUtils.getSessionContainer(request).getUserInfo().getAccount();
    String developerAccount = WebUtils.getParamValue("DEFAULT_DEVELOP_ACCOUNT", request);
    String superAccount = WebUtils.getParamValue("DEFAULT_ADMIN_ACCOUNT", request);
    Dto qDto = new BaseDto();
    String userid = WebUtils.getSessionContainer(request).getUserInfo().getUserid();
    qDto.put("userid", userid);
    String userType = request.getParameter("usertype");
    if (userType.equals(SystemConstants.USERTYPE_ADMIN)) {
      qDto.put("menutype", SystemConstants.MENUTYPE_SYSTEM);
    }
    if (account.equalsIgnoreCase(developerAccount) || account.equalsIgnoreCase(superAccount)) {
      menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForUserGrant", qDto);
    }else {
      menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForGrant", qDto);
    }
    for(int i = 0; i < menuList.size(); i++){
      MenuVo menuVo = (MenuVo)menuList.get(i);
      if(checkGeant(grantedList, menuVo.getMenuid()).booleanValue()){
        menuVo.setChecked("true");
View Full Code Here

    dto.put("requestpath", request.getRequestURI());
    dto.put("methodname", request.getParameter("reqCode"));
    dto.put("eventid", IDHelper.getEventID());
    dto.put("costtime", costTime);
    if (G4Utils.isNotEmpty(menuid)) {
      Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
      String menuname = ((BaseDto) g4Dao.queryForObject("Resource.queryEamenuByMenuID", menuid)).getAsString("menuname");
      String msg = userInfo.getUsername() + "[" + userInfo.getAccount() + "]打开了菜单[" + menuname + "]";
      dto.put("description", msg);
      log.info(msg);
    } else {
      String msg = userInfo.getUsername() + "[" + userInfo.getAccount() + "]调用了Action方法["
View Full Code Here

   * 识别缺省的JDBC驱动类型(g4Dao)
   *
   * @throws SQLException
   */
  private void initDbType() throws SQLException {
    Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
    Connection connection = g4Dao.getConnection();
    String dbString = connection.getMetaData().getDatabaseProductName().toLowerCase();
    try {
      connection.close();
    } catch (Exception e) {
      log.error(G4Constants.Exception_Head + "未正常关闭数据库连接");
View Full Code Here

    int flag = clazzString.indexOf("$");
    if (flag < 0) {
      log.info("业务处理时发生了异常:[" + fullPath + "]");
      // ex.printStackTrace();
      String exceptionid = IDHelper.getExceptionID();
      Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
      Connection connection = null;
      PreparedStatement statement = null;
      try {
        connection = g4Dao.getConnection();
        String inserSql = "  INSERT INTO eaexception (exceptionid, clazz, methodname, activetime, exception) VALUES ( ?,?,?,?,?)";
        statement = connection.prepareStatement(inserSql);
        statement.setString(1, exceptionid);
        statement.setString(2, clazzString);
        statement.setString(3, methodName);
View Full Code Here

  /**
   * 标签开始
   */
  public int doStartTag() throws JspException{
    HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
    Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
    Dto qDto = new BaseDto();
    UserInfoVo userInfoVo = WebUtils.getSessionContainer(request).getUserInfo();
    qDto.put("userid", userInfoVo.getUserid());
    qDto.put("menuid", request.getParameter("menuid4Log"));
    List roleGrantList = g4Dao.queryForList("ArmTagSupport.getUiRoleGrantInfo", qDto);
    List userGrantList = g4Dao.queryForList("ArmTagSupport.getUiUserGrantInfo", qDto);
    List grantList = new ArrayList();
    if (G4Utils.isNotEmpty(roleGrantList)) {
      grantList.addAll(roleGrantList);
    }
    if (G4Utils.isNotEmpty(userGrantList)) {
View Full Code Here

TOP

Related Classes of org.g4studio.common.dao.Dao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.