BOOL CInlineQueData::GetWindowCanDoQue(UINT nWindowID,CStringArray& queerial_id_array,CString& callStaffID,BOOL* pIsUsePower)
{
// 	if(m_lstInlineQue.GetCount() < 1)
// 	{
// 		return FALSE;
// 	}
	CStringArray arrStrQueId;//可处理队列以及优先级
	SLZWindow Window;
	BOOL flag = m_rWindowTable.QueryWindowById(nWindowID,Window);
	if(!flag)return FALSE;
	Window.GetArrayQueId(arrStrQueId);//获取可处理队列及优先级
	CString staffID = theApp.m_Controller.m_mapLoginList[Window.GetWindowId()];//获取登录STAFFID
	if(staffID.IsEmpty())return FALSE;
	if(arrStrQueId.GetCount() < 1)
	{
		return FALSE;
	}
	queerial_id_array.Copy(arrStrQueId);
	callStaffID = staffID;
	*pIsUsePower = Window.GetIsUsePower();
	return TRUE;
}
/*
获取排队 队列首个数据
*/
BOOL CInlineQueData::GetInlineQueData(const UINT iWinId, 
									  SLZData& rdata)
{
	if(m_lstInlineQue.GetCount() < 1)
	{
		return FALSE;
	}
	CStringArray arrStrQueId;//可处理队列以及优先级
	SLZWindow Window;
	BOOL flag = m_rWindowTable.QueryWindowById(iWinId,Window);
	if(!flag)return FALSE;
	BOOL bIsUserPower = Window.GetIsUsePower();//是否使用优先级
	Window.GetArrayQueId(arrStrQueId);//获取可处理队列及优先级
	CString staffID = theApp.m_Controller.m_mapLoginList[Window.GetWindowId()];//获取登录STAFFID
	if(staffID.IsEmpty())return FALSE;
	if(arrStrQueId.GetCount() < 1)
	{
		return FALSE;
	}
	///////////////////////
	BOOL bFind = FALSE;
	m_mtInlineQue.Lock();
	if(bIsUserPower)//使用优先级
	{
		int count = arrStrQueId.GetCount();
		for(int i = 0; i < count; i++)
		{
			POSITION pos = m_lstInlineQue.GetHeadPosition();
			while(pos)
			{
				SLZData data;
				POSITION posLast = pos;
				data = m_lstInlineQue.GetNext(pos);
				if(data.GetWindowId()==0)//如果没设置指定窗口
				{
					if(arrStrQueId[i].Compare(data.GetBussinessType()) == 0)
					{
						bFind = TRUE;
						rdata = data;
						m_lstInlineQue.RemoveAt(posLast);
						break;
					}
				}
				else//设置了指定窗口优先呼叫
				{
					if(iWinId == data.GetWindowId())
					{
						rdata = data;
						m_lstInlineQue.RemoveAt(posLast);
						bFind = TRUE;
						break;
					}
				}
			}
			if(bFind)
			{
				break;
			}
		}
	}
	else//不使用优先级
	{
		/*
		/////////////////////////////////////////首先找到可处理队列中哪几个队列有数据
		CStringArray haveDataArray;
		GetCandoQueHaveData(haveDataArray,arrStrQueId,iWinId);
		if(haveDataArray.GetCount() == 0)
		{
			return FALSE;
		}
		/////////////////////////////////////////随机取数
		int count = haveDataArray.GetCount();
		time_t t;	
		srand((unsigned) time(&t));	
		int nRand = rand() % count;
		CString strQueID = haveDataArray[nRand];
		POSITION pos = m_lstInlineQue.GetHeadPosition();
		while(pos)
		{
			SLZData data;
			POSITION posLast = pos;
			data = m_lstInlineQue.GetNext(pos);
			if(data.GetWindowId()==0)//如果没设置指定窗口
			{
				if(strQueID.Compare(data.GetBussinessType()) == 0)
				{
					rdata = data;
					m_lstInlineQue.RemoveAt(posLast);
					bFind = TRUE;
					break;
				}
			}
			else//指定了窗口
			{
				if(iWinId == data.GetWindowId())
				{
					rdata = data;
					m_lstInlineQue.RemoveAt(posLast);
					bFind = TRUE;
					break;
				}
			}
		}
		*/
		bFind = GetFirstTakeNumData(rdata,arrStrQueId);
		if(bFind)
			bFind = RemoveFirstTakeNumData(rdata);
	}
	CTime currTime = CTime::GetCurrentTime();
	rdata.SetCallTime(currTime);//设置呼叫时间
	rdata.SetStaffId(staffID);//设置员工ID,哪个员工呼叫
	rdata.SetWindowId(iWinId);//设置哪个窗口呼叫
	rdata.SetWindowShowId(Window.GetShowWndId());//设置窗口编号
	m_mtInlineQue.Unlock();
	return bFind;
}