📄 personbean.java
字号:
}
}
return bool;
}
//是否有流程权限
public boolean isOperRight(String strCZQX) {
boolean bool = false;
String strOper = getMyOper();//getOper();
String[] opers = strOper.split(",");
for (int i = 0; i < opers.length; i++) {
if (opers[i].equals(strCZQX)) {
bool = true;
break;
}
}
return bool;
}
//取得人员记录列表
public Vector getDataFilterByCZQZ_LCQX(String strLCQX, String strCZQX) {
strCZQX = ds.toString(strCZQX);
strLCQX = ds.toString(strLCQX);
if (strLCQX.equals(""))
return null;
if (strCZQX.equals(""))
return null;
Vector vect = new Vector();
// DealBean db = new DealBean();
String sql = "";
//String strFormatedLCQX ="," + ds.toString(strLCQX) + ",";
sql = " select * from news.ZZ_ZGB where bmbh='" + strOrgNO
+ "' and ZZZT=0 " + " and ZZ_ZGB.ZGBH<>'1'"
+ " order by ZZ_ZGB.ZGBH ,ZNYH";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try {
//取得列数和列名
ResultSetMetaData rsmd = rs.getMetaData();
int cols = rsmd.getColumnCount();
while (rs.next()) {
String strPersonNo_Temp = ds.toString(rs.getString("ZGBH"));
if (strPersonNo_Temp.equals(""))
continue;
setPersonNO(strPersonNo_Temp);
if (!isFlowRight(strLCQX))
continue;
if (!isOperRight(strCZQX))
continue;
Hashtable hash = new Hashtable();
for (int i = 1; i <= cols; i++) {
String field = ds.toString(rsmd.getColumnName(i));
String value = ds.toString(rs.getString(i));
if (field.equals("BMBH")) {
value = getApartName(value);
}
if (field.equals("ZZZT")) {
if (value.equals("0"))
value = "正常";
if (value.equals("1"))
value = "离职";
if (value.equals("2"))
value = "退休";
}
if (value == null)
value = "";
hash.put(field, value);
}
vect.add(hash);
}
} catch (Exception e) {
System.out.println("运行时出错:" + e);
} finally {
if (rs != null)
try {
stmt = rs.getStatement();
rs.close();
} catch (Exception e) {
System.out.println("关闭记录集rs时出错" + e);
}
if (stmt != null)
try {
stmt.close();
} catch (Exception e) {
System.out.println("关闭声明时statement出错" + e);
}
}
return vect;
}
//取得人员记录列表
public Vector getDataFilterByCZQZ(String strCZQX) {
strCZQX = ds.toString(strCZQX);
if (strCZQX.equals(""))
return null;
Vector vect = new Vector();
// DealBean db = new DealBean();
String sql = "";
//String strFormatedLCQX ="," + ds.toString(strLCQX) + ",";
sql = " select * from news.ZZ_ZGB where bmbh='" + strOrgNO
+ "' and ZZZT=0 " + " and ZZ_ZGB.ZGBH<>'1'"
+ " order by ZZ_ZGB.ZGBH ";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try {
//取得列数和列名
ResultSetMetaData rsmd = rs.getMetaData();
int cols = rsmd.getColumnCount();
while (rs.next()) {
String strPersonNo_Temp = ds.toString(rs.getString("ZGBH"));
if (strPersonNo_Temp.equals(""))
continue;
setPersonNO(strPersonNo_Temp);
if (!isOperRight(strCZQX))
continue;
Hashtable hash = new Hashtable();
for (int i = 1; i <= cols; i++) {
String field = ds.toString(rsmd.getColumnName(i));
String value = ds.toString(rs.getString(i));
if (field.equals("BMBH")) {
value = getApartName(value);
}
if (field.equals("ZZZT")) {
if (value.equals("0"))
value = "正常";
if (value.equals("1"))
value = "离职";
if (value.equals("2"))
value = "退休";
}
if (value == null)
value = "";
hash.put(field, value);
}
vect.add(hash);
}
} catch (Exception e) {
System.out.println("运行时出错:" + e);
} finally {
if (rs != null)
try {
stmt = rs.getStatement();
rs.close();
} catch (Exception e) {
System.out.println("关闭记录集rs时出错" + e);
}
if (stmt != null)
try {
stmt.close();
} catch (Exception e) {
System.out.println("关闭声明时statement出错" + e);
}
}
return vect;
}
//取得人员记录列表
public Vector getData(String strLCQX) {
strLCQX = ds.toString(strLCQX);
if (strLCQX.equals(""))
return null;
Vector vect = new Vector();
// DealBean db = new DealBean();
String sql = "";
//String strFormatedLCQX ="," + ds.toString(strLCQX) + ",";
sql = " select * from news.ZZ_ZGB where bmbh='" + strOrgNO
+ "' and ZZZT=0 " + " and ZZ_ZGB.ZGBH<>'1'"
+ " order by ZZ_ZGB.ZGBH ";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try {
//取得列数和列名
ResultSetMetaData rsmd = rs.getMetaData();
int cols = rsmd.getColumnCount();
while (rs.next()) {
String strPersonNo_Temp = ds.toString(rs.getString("ZGBH"));
if (strPersonNo_Temp.equals(""))
continue;
setPersonNO(strPersonNo_Temp);
if (!isFlowRight(strLCQX))
continue;
Hashtable hash = new Hashtable();
for (int i = 1; i <= cols; i++) {
String field = ds.toString(rsmd.getColumnName(i));
String value = ds.toString(rs.getString(i));
if (field.equals("BMBH")) {
value = getApartName(value);
}
if (field.equals("ZZZT")) {
if (value.equals("0"))
value = "正常";
if (value.equals("1"))
value = "离职";
if (value.equals("2"))
value = "退休";
}
if (value == null)
value = "";
hash.put(field, value);
}
vect.add(hash);
}
} catch (Exception e) {
System.out.println("运行时出错:" + e);
} finally {
if (rs != null)
try {
stmt = rs.getStatement();
rs.close();
} catch (Exception e) {
System.out.println("关闭记录集rs时出错" + e);
}
if (stmt != null)
try {
stmt.close();
} catch (Exception e) {
System.out.println("关闭声明时statement出错" + e);
}
}
return vect;
}
public DefaultMutableTreeNode CutBMTree(DefaultMutableTreeNode root,
String strLCQX) {
Vector vectBMBH = getFlowBM1(strLCQX);
//System.out.println("\r\n222222222222222222222"+vectBMBH);
//开始剪枝
boolean canCut = true;
boolean cut = true;
while (canCut && root.getChildCount() > 0) {
canCut = false;
for (Enumeration e = root.preorderEnumeration(); e
.hasMoreElements();) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e
.nextElement();
Hashtable hs = (Hashtable) (node.getUserObject());
String strID = (String) hs.get("BMBH");
if (!vectBMBH.contains(strID)) {
if (node.isLeaf()) {
node.removeFromParent();
canCut = true;
continue;
} //end if
} else {
Hashtable hst = (Hashtable) node.getUserObject();
hst.put("Enabled", "True");
} //end if else
} //end for
} //end while
return root;
}
public DefaultMutableTreeNode CutBMTree1(Vector vectBMBH,
DefaultMutableTreeNode root, String strLCQX) {
//System.out.println("\r\n222222222222222222222"+vectBMBH);
//开始剪枝
boolean canCut = true;
boolean cut = true;
while (canCut && root.getChildCount() > 0) {
canCut = false;
for (Enumeration e = root.preorderEnumeration(); e
.hasMoreElements();) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e
.nextElement();
Hashtable hs = (Hashtable) (node.getUserObject());
String strID = (String) hs.get("BMBH");
if (!vectBMBH.contains(strID)) {
if (node.isLeaf()) {
node.removeFromParent();
canCut = true;
continue;
} //end if
} else {
Hashtable hst = (Hashtable) node.getUserObject();
hst.put("Enabled", "True");
} //end if else
} //end for
} //end while
return root;
}
public String getZWData(String strPersonNo)//通过职工编号得到ZZ_ZGZWB的所有记录
{
String zwmc = "";
Vector vt = new Vector();
String sql = "select BMBH,ZWBH from news.ZZ_ZGZWB where ZGBH='"
+ strPersonNo + "'";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try {
while (rs.next()) {
String bmbh = ds.toString(rs.getString("BMBH"));
String zwbh = ds.toString(rs.getString("ZWBH"));
if (!zwmc.equals(""))
zwmc = zwmc + "、" + getDutyName(bmbh, zwbh);
else
zwmc = getDutyName(bmbh, zwbh);
}
} catch (Exception e) {
System.out.println("运行时出错:" + e);
} finally {
if (rs != null)
try {
stmt = rs.getStatement();
rs.close();
} catch (Exception e) {
System.out.println("关闭记录集rs时出错" + e);
}
if (stmt != null)
try {
stmt.close();
} catch (Exception e) {
System.out.println("关闭声明时statement出错" + e);
}
}
return zwmc;
}
//查询职务名称
public String getDutyName(String bmbh, String zwbh) {
String zwName = "";
String sql = "select ZWMC from news.ZZ_ZWB where ZWZT=0 and BMBH='"
+ bmbh + "' and ZWBH='" + zwbh + "' order by JBXH";
ResultSet rs = selectRecord(sql);
Statement stmt = null;
try {
Vector vt = new Vector();
Hashtable ht = new Hashtable();
if (rs.next()) {
zwName = ds.toString(rs.getString("ZWMC"));
}
} catch (Exception e) {
System.out.println("运行时出错:" + e);
} finally {
if (rs != null)
try {
stmt = rs.getStatement();
rs.close();
} catch (Exception e) {
System.out.println("关闭记录集rs时出错" + e);
}
if (stmt != null)
try {
stmt.close();
} catch (Exception e) {
System.out.println("关闭声明时statement出错" + e);
}
}
return zwName;
}
//取得人员记录列表display.jsp排序用
public Vector getData(boolean isfather, String pxzd, boolean isdesc,
String srchzd, String srchzdval, boolean isexact) {
//isfather是否看总公司所有纪录;pxzd按哪个字段排序;isdesc是否降序排列;srchzd按哪个字段搜索;isexact是否精确查询
Vector vect = new Vector();
String sql = "";
String zdnames = "BMBH,ZGBH,XM,XB,GH,PZCS";
if (isfather) {
sql = " select " + zdnames
+ " from news.ZZ_ZGB where ZZZT=0 order by BMBH";
if (!srchzd.equals("")) {
if (isexact)
sql = " select " + zdnames
+ " from news.ZZ_ZGB where ZZZT=0 and " + srchzd
+ "='" + srchzdval + "'";
if (!isexact)
sql = " select " + zdnames
+ " from news.ZZ_ZGB where ZZZT=0 and " + srchzd
+ " like '%" + srchzdval + "%'";
sql = sql + " order by BMBH";
}
if (!pxzd.equals("") && !pxzd.equals("BMBH")) {
sql = sql + "," + pxzd;
} else {
sql = sql + ",JBXH";
}
} else {
int n = -1;
int m = strOrgNO.length() - 1;
for (; m > 0; m--) {
char indexchar = strOrgNO.charAt(m);
if (indexchar != '0') {
n = m;
break;
}
}
if (n == 6 || n == 7) {
strOrgNO = strOrgNO.substring(0, 8);
} else if (n == 4 || n == 5)
strOrgNO = strOrgNO.substring(0, 6);
else if (n == 2 || n == 3)
strOrgNO = strOrgNO.substring(0, 4);
sql = " select " + zdnames + " from news.ZZ_ZGB where (bmbh='"
+ strOrgNO + "' or bmbh like'" + strOrgNO
+ "%') and ZZZT=0";
if (!srchzd.equals("")) {
if (isexact)
sql = sql + " and " + srchzd + "='" + srchzdval + "'";
if (!isexact)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -