Sfoglia il codice sorgente

修改轮循,首次不分配

zhangguoyu 7 anni fa
parent
commit
de21146bee
3 ha cambiato i file con 35 aggiunte e 2 eliminazioni
  1. 14 0
      ACD/Agent.cpp
  2. 5 1
      ACD/Agent.h
  3. 16 1
      ACD/StrategyLoop.cpp

+ 14 - 0
ACD/Agent.cpp

@@ -22,6 +22,7 @@ CAgent::CAgent(UINT a_AgentID, UINT a_ExtID, LPCTSTR a_GroupID, UINT a_AgentType
22 22
 	m_AssoExtState = INNER_STATE_FREE;
23 23
 	m_IsRepose = false;
24 24
 
25
+	m_bFirstQueue = true;
25 26
 	// ÒµÎñÊôÐÔ
26 27
 	m_AnswerCount = 0;
27 28
 	m_ReposeCount = 0;
@@ -609,4 +610,17 @@ void CAgent::GetAgentProperty(CAgentProperty& AgentProperty)
609 610
 	AgentProperty.m_TimePostProcessing = m_TimePostProcessing;
610 611
 	AgentProperty.m_TimeRepos = m_TimeRepos;
611 612
 	AgentProperty.m_TimeTalk = m_TimeTalk;
613
+}
614
+
615
+bool CAgent::queueJump()
616
+{
617
+	if (m_bFirstQueue) {
618
+		m_bFirstQueue = false;
619
+		return true;
620
+	}
621
+	else 
622
+	{
623
+		return false;
624
+	}
625
+	
612 626
 }

+ 5 - 1
ACD/Agent.h

@@ -63,7 +63,9 @@ public:
63 63
 
64 64
 	BOOL lock(void);
65 65
 
66
-	void CAgent::GetAgentProperty(CAgentProperty& AgentProperty); // ych 2018.5.4
66
+	void GetAgentProperty(CAgentProperty& AgentProperty); // ych 2018.5.4
67
+
68
+	bool queueJump();
67 69
 private:
68 70
 	// 统计处理
69 71
 	void __reportLogin();							// 签出统计通知
@@ -99,6 +101,8 @@ private:
99 101
 	bool		m_IsRepose;			// 是否小休
100 102
 	AgentGroupNoList m_GroupNoList;	// 座席组号列表
101 103
 
104
+	bool		m_bFirstQueue;	//2018.6.11 for loop
105
+
102 106
 	// 业务属性
103 107
 	UINT		m_TimePostProcessing;	// 话后处理时长
104 108
 	UINT		m_AnswerCount;			// 应答次数

+ 16 - 1
ACD/StrategyLoop.cpp

@@ -22,6 +22,7 @@ CStrategyLoop::~CStrategyLoop(void)
22 22
 CAgent* CStrategyLoop::_locateAgent( CAgentGroup& AgentGroup )
23 23
 {
24 24
 	CAgent* pAgent = NULL;
25
+	bool t_b_has_jump = false;
25 26
 
26 27
 	for(int i=0; i<AgentGroup.GetCount(); ++i)	// 保证遍历一轮
27 28
 	{
@@ -29,9 +30,23 @@ CAgent* CStrategyLoop::_locateAgent( CAgentGroup& AgentGroup )
29 30
 			m_Index = 0;
30 31
 
31 32
 		pAgent = AgentGroup[m_Index++];
33
+		if (pAgent->queueJump()) {
34
+			t_b_has_jump = true;
35
+			continue;
36
+		}
32 37
 		if(pAgent->isFree()) 
33 38
 			return pAgent;
34 39
 	} // end if
35
-
40
+	if (t_b_has_jump == true) {
41
+		for (int i = 0; i<AgentGroup.GetCount(); ++i)	// 保证遍历一轮
42
+		{
43
+			if (m_Index >= AgentGroup.GetCount())
44
+				m_Index = 0;
45
+
46
+			pAgent = AgentGroup[m_Index++];
47
+			if (pAgent->isFree())
48
+				return pAgent;
49
+		} // end if
50
+	}
36 51
 	return NULL;
37 52
 }