AdminOrgUnitInfo info = (AdminOrgUnitInfo) prmtdepartment.getValue();
if(info==null){
//申请人
UserInfo userInfo=(com.kingdee.eas.base.permission.UserInfo)(com.kingdee.eas.common.client.SysContext.getSysContext().getCurrentUser());
try {
//获取当前申请人默认的部门
String fid ="";
StringBuffer sql = new StringBuffer();
sql.append(" /*dialect*/ \n");
sql.append(" select distinct org.fid fid from T_BD_Person psn \n");
sql.append(" left join T_ORG_PositionMember mem on psn.FID = mem.FPersonID \n");
sql.append(" left join T_ORG_Position pos on mem.FPositionID = pos.FID \n");
sql.append(" left join T_ORG_Admin org on pos.FAdminOrgUnitID = org.FID \n");
sql.append(" left join T_PM_User usr on usr.FPersonID = psn.FID \n");
sql.append(" left join T_ORG_BaseUnit unt on usr.FDefOrgUnitID = unt.FID \n");
sql.append(" where psn.FDeletedStatus = 1 and mem.FISPRIMARY =1 and usr.fid ='"+userInfo.getId().toString()+"' \n");
ISQLExecutor iSQLExecutor = SQLExecutorFactory.getRemoteInstance(sql.toString());
IRowSet rs = iSQLExecutor.executeSQL();
while(rs.next()){
fid=rs.getString("fid");
}
if(fid!=""){
AdminOrgUnitInfo adminInfo = AdminOrgUnitFactory.getRemoteInstance().getAdminOrgUnitInfo(new ObjectUuidPK(fid));
prmtdepartment.setValue(adminInfo);
}else{
com.kingdee.eas.util.client.MsgBox.showInfo("当前用户未找到对应部门不能申请!");
SysUtil.abort();
}
} catch (BOSException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (EASBizException e) {
e.printStackTrace();
}
}