📄 dbprofilemanager.java~4~
字号:
}
return unitList;
}
public ArrayList getAllUsers_byUnit(String unitID) {
ArrayList userList = new ArrayList();
Hashtable temp_hash = new Hashtable();
try {
Unit unit = this.getUnit(unitID);
ArrayList unitList = unit.getAllSubUnits(unit);
for (int i = 0; i < unitList.size(); i++) {
unit = (Unit) unitList.get(i);
int[] users = unit.getAssociateUsers();
for (int j = 0; j < users.length; j++) {
if (!temp_hash.containsKey(new Integer(users[j]))) {
userList.add(new Integer(users[j]));
}
temp_hash.put(new Integer(users[j]), new Integer(users[j]));
}
}
temp_hash.clear();
return userList;
}
catch (UnitNotFoundException e) {
return null;
}
}
public ArrayList getAllInsideUsers_byUnit(String unitID) {
ArrayList userList = new ArrayList();
Hashtable temp_hash = new Hashtable();
try {
Unit unit = this.getUnit(unitID);
ArrayList unitList = unit.getAllInsideSubUnits(unit);
for (int i = 0; i < unitList.size(); i++) {
unit = (Unit) unitList.get(i);
int[] users = unit.getAssociateUsers();
for (int j = 0; j < users.length; j++) {
if (!temp_hash.containsKey(new Integer(users[j]))) {
userList.add(new Integer(users[j]));
}
temp_hash.put(new Integer(users[j]), new Integer(users[j]));
}
}
temp_hash.clear();
return userList;
}
catch (UnitNotFoundException e) {
return null;
}
}
public boolean isSupervisor(String unitid, int userid,int level){
boolean is = false;
User[] users = getAllUserInUnitFormLevel(unitid,level);
for(int i = 0;i < users.length;i++){
int usrID = users[i].getID();
if(userid == usrID)
return true;
}
return is;
}
public boolean isSupervisor(String unitid, int userid){
return isSupervisor(unitid,userid,4);
}
public User[] getAllUserInUnitFormLevel(String unitid, int level) {
User[] users = null;
HashMap table = new HashMap();
try {
Unit unit = this.getUnit(unitid);
ArrayList unitList = unit.getAllInsideSubUnits(unit);
for (int i = 0; i < unitList.size(); i++) {
unit = (Unit) unitList.get(i);
int[] groupIDs = unit.getAssociateGroups();
for (int j = 0; j < groupIDs.length; j++) {
Group group = this.getGroup(groupIDs[j]);
if (group.getPriority() == level) {
Iterator iter = group.members();
for (int k = 0; k < group.getMemberCount(); k++) {
User user = (User) iter.next();
table.put(user.getID() + "", user);
}
}
}
}
}
catch (Exception e) {}
users = new User[table.size()];
Iterator iterator = table.keySet().iterator();
int m = 0;
while (iterator.hasNext()) {
String s_ID = (String) iterator.next();
users[m] = (User) table.get(s_ID);
m++;
}
return users;
}
public User[] getUserInUnitFormLevel(String unitid, int level) {
User[] users = null;
HashMap table = new HashMap();
try {
Unit unit = this.getUnit(unitid);
int[] groupIDs = unit.getAssociateGroups();
for (int j = 0; j < groupIDs.length; j++) {
Group group = this.getGroup(groupIDs[j]);
if (group.getPriority() == level) {
Iterator iter = group.members();
for (int k = 0; k < group.getMemberCount(); k++) {
User user = (User) iter.next();
table.put(user.getID() + "", user);
}
}
}
}
catch (Exception e) {}
users = new User[table.size()];
Iterator iterator = table.keySet().iterator();
int m = 0;
while (iterator.hasNext()) {
String s_ID = (String) iterator.next();
users[m] = (User) table.get(s_ID);
m++;
}
return users;
}
/**
* 处理登记内容表
*/
private final static String GET_userDJ_ByTypeAndStatus =
"select djbh from u_djnrb where tslx=? and lrrID=? and clbz=?";
private final static String GET_DJS_ByCLR =//得到处理人的案件
"select djbh from u_djnrb where clr=? and clbz='0' and (gxdw=? or cldw=?) and tslx=?";
private final static String GET_UnDoDJs =
"SELECT djbh FROM u_djnrb where (gxdw=? or cldw=?) and clbz='0'";
private final static String GET_UnDoDJsByType =
"SELECT djbh FROM u_djnrb where (gxdw=? or cldw=?) and clbz='0' and tslx=?";
private final static String GET_UnDoDJsByType2 =
"SELECT djbh FROM u_djnrb where (gxdw=? and cldw=?) and clbz='0' and tslx=?";
public String[] getUnDoByCLR(String clr,String gxdw,String cldw,String type){
String[] list = null;
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_DJS_ByCLR);
pstmt.setString(1, clr);
pstmt.setString(2, gxdw);
pstmt.setString(3, cldw);
pstmt.setString(4, type);
ResultSet rs = pstmt.executeQuery();
ArrayList djList = new ArrayList();
while (rs.next()) {
djList.add(rs.getString(1));
}
list = new String[djList.size()];
for (int i = 0; i < djList.size(); i++) {
list[i] = (String) djList.get(i);
}
}
catch (SQLException sqle) {
sqle.printStackTrace();
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
public String[] getUnDoByType(String gxdw,String cldw,String type){
String[] list = null;
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_UnDoDJsByType);
pstmt.setString(1, gxdw);
pstmt.setString(2, cldw);
pstmt.setString(3, type);
ResultSet rs = pstmt.executeQuery();
ArrayList djList = new ArrayList();
while (rs.next()) {
djList.add(rs.getString(1));
}
list = new String[djList.size()];
for (int i = 0; i < djList.size(); i++) {
list[i] = (String) djList.get(i);
}
}
catch (SQLException sqle) {
sqle.printStackTrace();
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
public String[] getUnDoByType2(String gxdw,String cldw,String type){
String[] list = null;
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_UnDoDJsByType2);
pstmt.setString(1, gxdw);
pstmt.setString(2, cldw);
pstmt.setString(3, type);
ResultSet rs = pstmt.executeQuery();
ArrayList djList = new ArrayList();
while (rs.next()) {
djList.add(rs.getString(1));
}
list = new String[djList.size()];
for (int i = 0; i < djList.size(); i++) {
list[i] = (String) djList.get(i);
}
}
catch (SQLException sqle) {
sqle.printStackTrace();
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
public String[] getUnDoDjs(String gxdw,String cldw){
String[] list = null;
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_UnDoDJs);
pstmt.setString(1, gxdw);
pstmt.setString(2, cldw);
ResultSet rs = pstmt.executeQuery();
ArrayList djList = new ArrayList();
while (rs.next()) {
djList.add(rs.getString(1));
}
list = new String[djList.size()];
for (int i = 0; i < djList.size(); i++) {
list[i] = (String) djList.get(i);
}
}
catch (SQLException sqle) {
sqle.printStackTrace();
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
public String[] getUserDjByTypeAndStatus(String type,String userID,String clbz){
String[] list = null;
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_userDJ_ByTypeAndStatus);
pstmt.setString(1, type);
pstmt.setString(2, userID);
pstmt.setString(3, clbz);
ResultSet rs = pstmt.executeQuery();
ArrayList djList = new ArrayList();
while (rs.next()) {
djList.add(rs.getString(1));
}
list = new String[djList.size()];
for (int i = 0; i < djList.size(); i++) {
list[i] = (String) djList.get(i);
}
}
catch (SQLException sqle) {
sqle.printStackTrace();
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
/*李军增加的函数*/
public String[] Getwcllb(String cldw){
String[] list = null;
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(USER_WDJLB);
pstmt.setString(1, djbh);
pstmt.setString(2, tsrq);
pstmt.setString(3, tslx);
pstmt.setString(4, lrr);
pstmt.setString(5, tsrmc);
pstmt.setString(6, btsdw);
ResultSet rs = pstmt.executeQuery();
ArrayList djList = new ArrayList();
while (rs.next()) {
djList.add(rs.getString(1));
}
list = new String[djList.size()];
for (int i = 0; i < djList.size(); i++) {
list[i] = (String) djList.get(i);
}
}
catch (SQLException sqle) {
sqle.printStackTrace();
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
/*李军增加的函数结束*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -