⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 users.java

📁 OA典型例子
💻 JAVA
字号:

/*
 * Users.java
 * Generated using xgen and texen from bean.vm
 * Tue Nov 18 10:07:35 CST 2003
 */

package com.sure.oa.orgnization;
import com.sure.util.MD5;
import com.sure.businessmodel.UpdateException;
import com.sure.businesslogic.AlreadyExistsException;
import com.sure.businesslogic.NotFoundException;
import com.sure.dataabstraction.DBManager;
import com.sure.dataabstraction.DBPoolException;
import com.sure.oa.system.permission.*;
import com.sure.oa.senddoc.*;
import java.sql.*;
import java.sql.SQLException;
import java.util.Vector;
import java.util.Iterator;

/**
 * 存取人员的属性
 * @author datonghuiren@sohu.com
 */
public class Users extends UsersBase {
private int psnChanPass = 0;
  public void setPsnChanPass(int psnChanPass) {
      this.psnChanPass = psnChanPass;
    }
    public void setPsnChanPass(String psnChanPass) {
      try{
        this.psnChanPass = Integer.parseInt(psnChanPass);
      }catch(Exception e) { }
    }
    public int getPsnChanPass() {
      return psnChanPass;
    }
    /**2qu6lou2men502room
     * 使用MD5算法进行加密
     * @param sourcePassword 待加密的明文密码
     * @return 返回加密后的字符串。32位。
     */
    public String getEncodedPassword(String sourcePassword) {
      String unionPassword = "";
      if(sourcePassword != null)
        unionPassword = new String(sourcePassword);
      unionPassword = unitId + unionPassword;
      MD5 md = new MD5();
      md.Update(unionPassword);
      return md.asHex();
    }

    /**
     * 如果是管理员添加的则不能修改和删除
     * @return
     */
    public String getIsManager(){
      String retValue = "";
      if (status.intValue() == 0)
        retValue = "disabled";
      return retValue;
    }

  /**
   * 返回人员所属的部门名称
   * @return
   */
   public String getDeptName() throws SQLException,DBPoolException,NotFoundException{
     String retValue = "";
     try{
       UnitManager umg = new UnitManager();
       Unit u = umg.getUnit(Integer.parseInt(deptId));
       retValue = u.getUnitName();
     }
     catch(Exception e){}
     finally{
       return retValue;
     }
   }

   /**
    * 返回人员所属的角色ID(应根据不同文种,待扩展)
    * @return roleId
    */
    public String getRoleId() throws SQLException,DBPoolException,NotFoundException{
      String retValue = "0";
      usersRightManager umg=new usersRightManager();
      retValue=umg.getRoleId(userId.intValue());
      return retValue;
     }

  /**
   * 是否能够删除
   * @return
   */
  public String getCanDel() throws SQLException,DBPoolException, NotFoundException {
    Connection cn=DBManager.getConnection();
    String retValue="";
    try{
      String where = "where operatorId="+userId+"";
      Vector v = SendDocLogPersistentBase.load(cn, where);
      if (v.size() > 0) {
        retValue= "disabled";
      }else {
        retValue= "canDel";
      }
    }
    catch(Exception e){
      e.printStackTrace();
    }
    finally{
      cn.close();
    }
    return retValue;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -