package cn.ksource.web.util;
|
|
import java.io.InputStream;
|
import java.util.Properties;
|
|
public class DeptUtil{
|
/**
|
* 是否属于某个部门
|
* @param deptid
|
* @param key
|
* @return
|
*/
|
public static boolean isDept(String deptid,String key){
|
Properties prop =null;
|
try {
|
prop = new Properties();
|
InputStream in = DeptUtil.class.getResourceAsStream("/deptid.properties");
|
prop.load(in);
|
in.close();
|
if(prop.get(key).toString().equals(deptid)){
|
return true;
|
}
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return false;
|
}
|
/**
|
* 得到键的值
|
* @param deptid
|
* @param key
|
* @return
|
*/
|
public static String getOrderCurrentStatus(String key){
|
Properties prop =null;
|
try {
|
prop = new Properties();
|
InputStream in = DeptUtil.class.getResourceAsStream("/deptid.properties");
|
prop.load(in);
|
in.close();
|
Object obj=prop.get(key);
|
if(null!=obj){
|
return obj.toString();
|
}
|
return null;
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return "";
|
}
|
public static void main(String[] args) {
|
}
|
}
|