Panwei 8.0 は現在のユーザー データを取得します

1. 画像表示データ

ここに画像の説明を挿入します

{
    
    "SubCompanyID":"285","DepartmentID":"3382","UserName":"运维组02","Loginid":"lzt","UserID":"16630","UserType":"0","Language":"7","Message":"true"}

2. データセットを取得するフロントエンドコード

var userInfor = getCurrentUserInfor();  // 调用js方法
var currentUserID = userInfor.UserID;   // 获取用户ID


function getCurrentUserInfor() {
    
    
    var dataMap = {
    
    };
    jQuery.ajax({
    
    
        url: "/fuli/getSysInforForCurrentUser.jsp?t=" + new Date().getTime(),
        data: "",
        async: false,
        dataType: "json",
        contentType: "application/json",
        success: function(data) {
    
    
            dataMap = data; //Message,SubCompanyID,DepartmentID,UserName,Loginid,UserID,UserType,Language
        }
    });
    return dataMap;
}

3. バックエンドの getSysInforForCurrentUser.jsp ファイル

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="weaver.hrm.*"%>
<%@ page import="weaver.general.*"%>
<%@ page import="net.sf.json.JSONObject"%>
<%@ page import="weaver.conn.RecordSet"%>
<% 

	RecordSet rs = new RecordSet();
	JSONObject json = new JSONObject();
	User user = HrmUserVarify.getUser(request , response);
	String Message = "flase";
	
	if(user != null){
    
    
		Message = "true";
		json.put( "SubCompanyID" , "" + user.getUserSubCompany1() );
		json.put( "DepartmentID" , ""+ user.getUserDepartment() );
		json.put( "UserName" , ""+ user.getLastname() );
		json.put( "Loginid" , ""+ user.getLoginid() );
		json.put( "UserID" , ""+ user.getUID() );
		json.put( "UserType" , ""+ user.getType() );
		json.put( "Language" , ""+ user.getLanguage() );		
	}

	json.put( "Message" , Message );
	out.println(json.toString());
%>

getUser() メソッドを呼び出す

/*     */ package weaver.hrm;
/*     */ 
/*     */ import java.util.ArrayList;
/*     */ import java.util.List;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import javax.servlet.http.HttpSession;
/*     */ import weaver.conn.RecordSet;
/*     */ import weaver.general.StaticObj;
/*     */ import weaver.general.Util;
/*     */ import weaver.hrm.online.HrmUserOnlineMap;
/*     */ import weaver.login.LicenseCheckLogin;
/*     */ import weaver.systeminfo.setting.HrmUserSettingComInfo;
/*     */ import weaver.systeminfo.systemright.CheckUserRight;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class HrmUserVarify
/*     */ {
    
    
/*     */   public static User getUserOld(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
/*     */   {
    
    
/*  34 */     User localUser = (User)paramHttpServletRequest.getSession(true).getAttribute("weaver_user@bean");
/*  35 */     if (localUser == null)
/*     */     {
    
    
/*  37 */       String str = Util.getCookie(paramHttpServletRequest, "loginfileweaver");
/*     */       
/*     */ 
/*     */ 
/*     */       try
/*     */       {
    
    
/*  43 */         if ((Util.null2String(str).equals("")) || (Util.null2String(str).toLowerCase().equals("null"))) {
    
    
/*  44 */           paramHttpServletResponse.sendRedirect("/login/Login.jsp");
/*     */         } else {
    
    
/*  46 */           paramHttpServletResponse.sendRedirect("/Refresh.jsp?loginfile=" + str + "&message=19");
/*     */         }
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/*     */     }
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*  55 */     return localUser;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static User getUser(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
/*     */   {
    
    
/*  64 */     User localUser = (User)paramHttpServletRequest.getSession(true).getAttribute("weaver_user@bean");
/*  65 */     if (localUser == null) {
    
    
/*  66 */       String str1 = Util.getCookie(paramHttpServletRequest, "loginfileweaver");
/*     */       try {
    
    
/*  68 */         if ((Util.null2String(str1).equals("")) || (Util.null2String(str1).toLowerCase().equals("null"))) {
    
    
/*  69 */           paramHttpServletResponse.sendRedirect("/login/Login.jsp");
/*  70 */           return null;
/*     */         }
/*  72 */         paramHttpServletResponse.sendRedirect("/Refresh.jsp?loginfile=" + str1 + "&message=19");
/*  73 */         return null;
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/*     */     }
/*     */     
/*     */ 
/*  79 */     int i = Util.getIntValue(paramHttpServletRequest.getParameter("f_weaver_belongto_userid"), 0);
/*  80 */     int j = Util.getIntValue(paramHttpServletRequest.getParameter("f_weaver_belongto_usertype"), 0);
/*  81 */     RecordSet localRecordSet = new RecordSet();
/*  82 */     if ((localUser != null) && (i != localUser.getUID()) && (i > 0))
/*     */     {
    
    
/*  84 */       int k = 0;
/*  85 */       String str2 = " SELECT belongto FROM HrmResource WHERE id= " + localUser.getUID();
/*  86 */       localRecordSet.executeSql(str2);
/*  87 */       int m; while (localRecordSet.next()) {
    
    
/*  88 */         m = localRecordSet.getInt("belongto");
/*  89 */         if (m == i) {
    
    
/*  90 */           k = 1;
/*  91 */           break;
/*     */         }
/*     */       }
/*     */       
/*  95 */       str2 = " SELECT id FROM HrmResource WHERE belongto= " + localUser.getUID();
/*  96 */       localRecordSet.executeSql(str2);
/*  97 */       while (localRecordSet.next()) {
    
    
/*  98 */         m = localRecordSet.getInt("id");
/*  99 */         if (m == i) {
    
    
/* 100 */           k = 1;
/* 101 */           break;
/*     */         }
/*     */       }
/*     */       
/* 105 */       if (k != 0) {
    
     localUser = User.getUser(i, j);
/*     */       }
/*     */     }
/* 108 */     return localUser;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static User getUser(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, String paramString1, String paramString2)
/*     */   {
    
    
/* 120 */     return getUser(paramHttpServletRequest, paramHttpServletResponse, Util.getIntValue(paramString1, 0), Util.getIntValue(paramString2, 0));
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static User getUser(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, int paramInt1, int paramInt2)
/*     */   {
    
    
/* 131 */     User localUser = (User)paramHttpServletRequest.getSession(true).getAttribute("weaver_user@bean");
/* 132 */     if (localUser == null) {
    
    
/* 133 */       localObject = Util.getCookie(paramHttpServletRequest, "loginfileweaver");
/*     */       try {
    
    
/* 135 */         if ((Util.null2String((String)localObject).equals("")) || (Util.null2String((String)localObject).toLowerCase().equals("null"))) {
    
    
/* 136 */           paramHttpServletResponse.sendRedirect("/login/Login.jsp");
/* 137 */           return null;
/*     */         }
/* 139 */         paramHttpServletResponse.sendRedirect("/Refresh.jsp?loginfile=" + (String)localObject + "&message=19");
/* 140 */         return null;
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/*     */     }
/*     */     
/*     */ 
/* 146 */     Object localObject = new RecordSet();
/* 147 */     if ((localUser != null) && (paramInt1 != localUser.getUID()) && (paramInt1 > 0))
/*     */     {
    
    
/* 149 */       int i = 0;
/* 150 */       String str = " SELECT belongto FROM HrmResource WHERE id= " + localUser.getUID();
/* 151 */       ((RecordSet)localObject).executeSql(str);
/* 152 */       int j; while (((RecordSet)localObject).next()) {
    
    
/* 153 */         j = ((RecordSet)localObject).getInt("belongto");
/* 154 */         if (j == paramInt1) {
    
    
/* 155 */           i = 1;
/* 156 */           break;
/*     */         }
/*     */       }
/*     */       
/* 160 */       str = " SELECT id FROM HrmResource WHERE belongto= " + localUser.getUID();
/* 161 */       ((RecordSet)localObject).executeSql(str);
/* 162 */       while (((RecordSet)localObject).next()) {
    
    
/* 163 */         j = ((RecordSet)localObject).getInt("id");
/* 164 */         if (j == paramInt1) {
    
    
/* 165 */           i = 1;
/* 166 */           break;
/*     */         }
/*     */       }
/*     */       
/* 170 */       if (i != 0) {
    
     localUser = User.getUser(paramInt1, paramInt2);
/*     */       }
/*     */     }
/* 173 */     return localUser;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static User checkUser(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
/*     */   {
    
    
/* 182 */     User localUser = (User)paramHttpServletRequest.getSession(true).getAttribute("weaver_user@bean");
/* 183 */     return localUser;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean checkUserRight(String paramString, User paramUser)
/*     */   {
    
    
/* 193 */     if (paramUser.getLoginid().equalsIgnoreCase("sysadmin")) return true;
/* 194 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/* 195 */     boolean bool = localCheckUserRight.checkUserRight(paramString, paramUser);
/*     */     
/*     */ 
/* 198 */     if (!bool) {
    
    
/* 199 */       String str = "";
/*     */       try {
    
    
/* 201 */         HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 202 */         str = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/*     */       
/* 206 */       if (str.equals("1")) {
    
    
/* 207 */         List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 208 */         if (localList != null) {
    
    
/* 209 */           for (Object localObject : localList) {
    
    
/* 210 */             bool = localCheckUserRight.checkUserRight(paramString, (User)localObject);
/* 211 */             if (bool) {
    
    
/*     */               break;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/*     */ 
/* 220 */     return bool;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static String getcheckUserRightUserId(String paramString, User paramUser)
/*     */   {
    
    
/* 229 */     return getcheckUserRightUserId(paramString, paramUser, true);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   private static String getcheckUserRightUserId(String paramString, User paramUser, boolean paramBoolean)
/*     */   {
    
    
/* 239 */     if ((paramBoolean) && (paramUser.getLoginid().equalsIgnoreCase("sysadmin"))) return "1";
/* 240 */     String str1 = "";
/* 241 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/* 242 */     boolean bool = localCheckUserRight.checkUserRight(paramString, paramUser);
/* 243 */     if (bool) {
    
     return "" + paramUser.getUID();
/*     */     }
/* 245 */     String str2 = "";
/*     */     try {
    
    
/* 247 */       HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 248 */       str2 = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */     }
/*     */     catch (Exception localException) {
    
    }
/* 251 */     if (str2.equals("1")) {
    
    
/* 252 */       List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 253 */       if (localList != null) {
    
    
/* 254 */         for (Object localObject : localList) {
    
    
/* 255 */           bool = localCheckUserRight.checkUserRight(paramString, (User)localObject);
/* 256 */           if (bool) {
    
    
/* 257 */             str1 = "" + ((User)localObject).getUID();
/* 258 */             break;
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 264 */     return str1;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean checkUserRightSystemadmin(String paramString, User paramUser)
/*     */   {
    
    
/* 275 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/*     */     
/*     */ 
/* 278 */     boolean bool = localCheckUserRight.checkUserRight(paramString, paramUser);
/*     */     
/*     */ 
/* 281 */     if (!bool) {
    
    
/* 282 */       String str = "";
/*     */       try {
    
    
/* 284 */         HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 285 */         str = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/* 288 */       if (str.equals("1")) {
    
    
/* 289 */         List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 290 */         if (localList != null) {
    
    
/* 291 */           for (Object localObject : localList) {
    
    
/* 292 */             bool = localCheckUserRight.checkUserRight(paramString, (User)localObject);
/* 293 */             if (bool) {
    
    
/*     */               break;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/*     */ 
/* 302 */     return bool;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static String getcheckUserRightSystemadminUserId(String paramString, User paramUser)
/*     */   {
    
    
/* 311 */     return getcheckUserRightUserId(paramString, paramUser, false);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean checkUserRight(String paramString1, User paramUser, String paramString2)
/*     */   {
    
    
/* 322 */     if (paramUser.getLoginid().equalsIgnoreCase("sysadmin")) return true;
/* 323 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/*     */     
/*     */ 
/* 326 */     boolean bool = localCheckUserRight.checkUserRight(paramString1, paramUser, paramString2);
/*     */     
/*     */ 
/* 329 */     if (!bool) {
    
    
/* 330 */       String str = "";
/*     */       try {
    
    
/* 332 */         HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 333 */         str = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/* 336 */       if (str.equals("1")) {
    
    
/* 337 */         List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 338 */         if (localList != null) {
    
    
/* 339 */           for (Object localObject : localList) {
    
    
/* 340 */             bool = localCheckUserRight.checkUserRight(paramString1, (User)localObject, paramString2);
/* 341 */             if (bool) {
    
    
/*     */               break;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/*     */ 
/* 350 */     return bool;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static String getcheckUserRightUserId(String paramString1, User paramUser, String paramString2)
/*     */   {
    
    
/* 359 */     String str1 = "";
/* 360 */     if (paramUser.getLoginid().equalsIgnoreCase("sysadmin")) return "1";
/* 361 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/* 362 */     boolean bool = localCheckUserRight.checkUserRight(paramString1, paramUser, paramString2);
/* 363 */     if (bool) {
    
     return "" + paramUser.getUID();
/*     */     }
/*     */     
/* 366 */     String str2 = "";
/*     */     try {
    
    
/* 368 */       HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 369 */       str2 = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */     }
/*     */     catch (Exception localException) {
    
    }
/* 372 */     if (str2.equals("1")) {
    
    
/* 373 */       List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 374 */       if (localList != null) {
    
    
/* 375 */         for (Object localObject : localList) {
    
    
/* 376 */           bool = localCheckUserRight.checkUserRight(paramString1, (User)localObject, paramString2);
/* 377 */           if (bool) {
    
    
/* 378 */             str1 = "" + ((User)localObject).getUID();
/* 379 */             break;
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 385 */     return str1;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean checkUserRight(String paramString, User paramUser, int paramInt)
/*     */   {
    
    
/* 396 */     return checkUserRight(paramString, paramUser, "" + paramInt);
/*     */   }
/*     */   
/*     */   public static String getcheckUserRightUserId(String paramString, User paramUser, int paramInt) {
    
    
/* 400 */     return getcheckUserRightUserId(paramString, paramUser, "" + paramInt);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static String getRightLevel(String paramString, User paramUser)
/*     */   {
    
    
/* 411 */     if (paramUser.getLoginid().equalsIgnoreCase("sysadmin")) return "2";
/* 412 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/*     */     
/*     */ 
/* 415 */     String str1 = localCheckUserRight.getRightLevel(paramString, paramUser);
/* 416 */     int i = Util.getIntValue(str1, -1);
/*     */     
/* 418 */     String str2 = "";
/*     */     try {
    
    
/* 420 */       HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 421 */       str2 = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */     }
/*     */     catch (Exception localException) {
    
    }
/* 424 */     if (str2.equals("1")) {
    
    
/* 425 */       List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 426 */       if (localList != null) {
    
    
/* 427 */         for (Object localObject : localList) {
    
    
/* 428 */           str1 = localCheckUserRight.getRightLevel(paramString, (User)localObject);
/* 429 */           if (!str1.equals("-1")) {
    
    
/* 430 */             int j = Util.getIntValue(str1, -1);
/* 431 */             if (j > i) {
    
     i = j;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 438 */     return "" + i;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public String getRightLevel(String paramString1, String paramString2)
/*     */   {
    
    
/* 448 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/*     */     
/*     */ 
/* 451 */     String str1 = localCheckUserRight.getRightLevel(paramString1, paramString2);
/* 452 */     int i = Util.getIntValue(str1, -1);
/*     */     
/*     */ 
/* 455 */     String str2 = "";
/*     */     try {
    
    
/* 457 */       HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 458 */       str2 = localHrmUserSettingComInfo.getBelongtoshowByUserId(paramString1);
/*     */     }
/*     */     catch (Exception localException) {
    
    }
/* 461 */     if (str2.equals("1")) {
    
    
/* 462 */       List localList = User.getBelongtoUsersByUserId(paramString1);
/* 463 */       if (localList != null) {
    
    
/* 464 */         for (Object localObject : localList) {
    
    
/* 465 */           str1 = localCheckUserRight.getRightLevel(paramString1, (User)localObject);
/* 466 */           if (!str1.equals("-1")) {
    
    
/* 467 */             int j = Util.getIntValue(str1, -1);
/* 468 */             if (j > i) {
    
     i = j;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/*     */ 
/* 476 */     return "" + i;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public boolean checkUserRight(String paramString1, String paramString2, String paramString3)
/*     */   {
    
    
/* 487 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/*     */     
/* 489 */     boolean bool = localCheckUserRight.checkUserRight(paramString1, paramString2, paramString3);
/*     */     
/*     */ 
/* 492 */     if (!bool) {
    
    
/* 493 */       String str = "";
/*     */       try {
    
    
/* 495 */         HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 496 */         str = localHrmUserSettingComInfo.getBelongtoshowByUserId(paramString1);
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/* 499 */       if (str.equals("1")) {
    
    
/* 500 */         List localList = User.getBelongtoUsersByUserId(paramString1);
/* 501 */         if (localList != null) {
    
    
/* 502 */           for (Object localObject : localList) {
    
    
/* 503 */             bool = localCheckUserRight.checkUserRight("" + ((User)localObject).getUID(), paramString2, paramString3);
/* 504 */             if (bool) {
    
    
/*     */               break;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 512 */     return bool;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static String getcheckUserRightUserId(String paramString1, String paramString2, String paramString3)
/*     */   {
    
    
/* 521 */     String str1 = "";
/* 522 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/* 523 */     boolean bool = localCheckUserRight.checkUserRight(paramString1, paramString2, paramString3);
/* 524 */     if (bool) {
    
     return "" + paramString1;
/*     */     }
/*     */     
/* 527 */     String str2 = "";
/*     */     try {
    
    
/* 529 */       HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 530 */       str2 = localHrmUserSettingComInfo.getBelongtoshowByUserId(paramString1);
/*     */     } catch (Exception localException) {
    
    }
/* 532 */     if (str2.equals("1")) {
    
    
/* 533 */       List localList = User.getBelongtoUsersByUserId(paramString1);
/* 534 */       if (localList != null) {
    
    
/* 535 */         for (Object localObject : localList) {
    
    
/* 536 */           bool = new CheckUserRight().checkUserRight("" + ((User)localObject).getUID(), paramString2, paramString3);
/* 537 */           if (bool) {
    
    
/* 538 */             str1 = "" + ((User)localObject).getUID();
/* 539 */             break;
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 545 */     return str1;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public boolean checkUserRole(String paramString1, User paramUser, String paramString2)
/*     */   {
    
    
/* 556 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/*     */     
/*     */ 
/* 559 */     boolean bool = localCheckUserRight.checkUserRole(paramString1, paramUser, paramString2);
/*     */     
/*     */ 
/* 562 */     if (!bool) {
    
    
/* 563 */       String str = "";
/*     */       try {
    
    
/* 565 */         HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 566 */         str = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */       }
/*     */       catch (Exception localException) {
    
    }
/* 569 */       if (str.equals("1")) {
    
    
/* 570 */         List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 571 */         if (localList != null) {
    
    
/* 572 */           for (Object localObject : localList) {
    
    
/* 573 */             bool = localCheckUserRight.checkUserRole(paramString1, (User)localObject, paramString2);
/* 574 */             if (bool) {
    
    
/*     */               break;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 582 */     return bool;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static String getcheckUserRoleUserId(String paramString1, User paramUser, String paramString2)
/*     */   {
    
    
/* 591 */     String str1 = "";
/* 592 */     CheckUserRight localCheckUserRight = new CheckUserRight();
/* 593 */     boolean bool = localCheckUserRight.checkUserRight(paramString1, paramUser, paramString2);
/* 594 */     if (bool) {
    
     return "" + paramUser.getUID();
/*     */     }
/*     */     
/* 597 */     String str2 = "";
/*     */     try {
    
    
/* 599 */       HrmUserSettingComInfo localHrmUserSettingComInfo = new HrmUserSettingComInfo();
/* 600 */       str2 = localHrmUserSettingComInfo.getBelongtoshowByUserId("" + paramUser.getUID());
/*     */     }
/*     */     catch (Exception localException) {
    
    }
/* 603 */     if (str2.equals("1")) {
    
    
/* 604 */       List localList = User.getBelongtoUsersByUserId(paramUser.getUID());
/* 605 */       if (localList != null) {
    
    
/* 606 */         for (Object localObject : localList) {
    
    
/* 607 */           bool = localCheckUserRight.checkUserRight(paramString1, (User)localObject, paramString2);
/* 608 */           if (bool) {
    
    
/* 609 */             str1 = "" + ((User)localObject).getUID();
/* 610 */             break;
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 616 */     return str1;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean isUserOnline(String paramString)
/*     */   {
    
    
/* 627 */     LicenseCheckLogin localLicenseCheckLogin = new LicenseCheckLogin();
/* 628 */     localLicenseCheckLogin.checkOnlineUser();
/*     */     
/* 630 */     StaticObj localStaticObj = StaticObj.getInstance();
/* 631 */     ArrayList localArrayList = (ArrayList)localStaticObj.getObject("onlineuserids");
/* 632 */     if (localArrayList == null) return false;
/* 633 */     int i = localArrayList.indexOf(paramString);
/* 634 */     if (i == -1) return false;
/* 635 */     return true;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 644 */   public static String getOnlineUserIp(String paramString) {
    
     return HrmUserOnlineMap.getInstance().getClientIpByUidFromClusterMap(paramString); }
/*     */   
/*     */   private static User getUserfromDB(String paramString) {
    
    
/* 647 */     RecordSet localRecordSet = new RecordSet();
/* 648 */     User localUser = new User();
/* 649 */     localRecordSet.execute("SELECT id,firstname,lastname,systemlanguage,seclevel FROM HrmResourceManager WHERE loginid='" + paramString + "'");
/* 650 */     if (localRecordSet.next()) {
    
    
/* 651 */       localUser.setUid(localRecordSet.getInt("id"));
/* 652 */       localUser.setLoginid(paramString);
/* 653 */       localUser.setFirstname(localRecordSet.getString("firstname"));
/* 654 */       localUser.setLastname(localRecordSet.getString("lastname"));
/* 655 */       localUser.setLanguage(Util.getIntValue(localRecordSet.getString("systemlanguage"), 0));
/* 656 */       localUser.setSeclevel(localRecordSet.getString("seclevel"));
/* 657 */       localUser.setLogintype("1");
/*     */     }
/* 659 */     localRecordSet.execute("HrmResource_SelectByLoginID", paramString);
/* 660 */     if (localRecordSet.next()) {
    
    
/* 661 */       localUser.setUid(localRecordSet.getInt("id"));
/* 662 */       localUser.setLoginid(paramString);
/* 663 */       localUser.setFirstname(localRecordSet.getString("firstname"));
/* 664 */       localUser.setLastname(localRecordSet.getString("lastname"));
/* 665 */       localUser.setAliasname(localRecordSet.getString("aliasname"));
/* 666 */       localUser.setTitle(localRecordSet.getString("title"));
/* 667 */       localUser.setTitlelocation(localRecordSet.getString("titlelocation"));
/* 668 */       localUser.setSex(localRecordSet.getString("sex"));
/* 669 */       localUser.setLanguage(Util.getIntValue(localRecordSet.getString("systemlanguage"), 0));
/* 670 */       localUser.setTelephone(localRecordSet.getString("telephone"));
/* 671 */       localUser.setMobile(localRecordSet.getString("mobile"));
/* 672 */       localUser.setMobilecall(localRecordSet.getString("mobilecall"));
/* 673 */       localUser.setEmail(localRecordSet.getString("email"));
/* 674 */       localUser.setCountryid(localRecordSet.getString("countryid"));
/* 675 */       localUser.setLocationid(localRecordSet.getString("locationid"));
/* 676 */       localUser.setResourcetype(localRecordSet.getString("resourcetype"));
/* 677 */       localUser.setStartdate(localRecordSet.getString("startdate"));
/* 678 */       localUser.setEnddate(localRecordSet.getString("enddate"));
/* 679 */       localUser.setContractdate(localRecordSet.getString("contractdate"));
/* 680 */       localUser.setJobtitle(localRecordSet.getString("jobtitle"));
/* 681 */       localUser.setJobgroup(localRecordSet.getString("jobgroup"));
/* 682 */       localUser.setJobactivity(localRecordSet.getString("jobactivity"));
/* 683 */       localUser.setJoblevel(localRecordSet.getString("joblevel"));
/* 684 */       localUser.setSeclevel(localRecordSet.getString("seclevel"));
/* 685 */       localUser.setUserDepartment(Util.getIntValue(localRecordSet.getString("departmentid"), 0));
/* 686 */       localUser.setUserSubCompany1(Util.getIntValue(localRecordSet.getString("subcompanyid1"), 0));
/* 687 */       localUser.setUserSubCompany2(Util.getIntValue(localRecordSet.getString("subcompanyid2"), 0));
/* 688 */       localUser.setUserSubCompany3(Util.getIntValue(localRecordSet.getString("subcompanyid3"), 0));
/* 689 */       localUser.setUserSubCompany4(Util.getIntValue(localRecordSet.getString("subcompanyid4"), 0));
/* 690 */       localUser.setManagerid(localRecordSet.getString("managerid"));
/* 691 */       localUser.setAssistantid(localRecordSet.getString("assistantid"));
/* 692 */       localUser.setPurchaselimit(localRecordSet.getString("purchaselimit"));
/* 693 */       localUser.setCurrencyid(localRecordSet.getString("currencyid"));
/* 694 */       localUser.setLastlogindate(localRecordSet.getString("lastlogindate"));
/* 695 */       localUser.setLogintype("1");
/*     */     }
/* 697 */     return localUser;
/*     */   }
/*     */ }


/* Location:              C:\Users\Administrator\Desktop\解压包\weaver.zip!\weaver\hrm\HrmUserVarify.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */

おすすめ

転載: blog.csdn.net/weixin_40476233/article/details/120415302