DataMgr.h
3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* CC/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <afxtempl.h>
#include "acdcommon.h"
#include "MainFormView.h"
typedef struct //座席信息
{
char agentId[64];
char agentDn[64];
int currStatus;
char loginTime[64];
char loginDurx[64];
char currStatusTime[64];
char currStatusDurx[64];
char origCaller[128];
char origCallee[128];
char statusStr[256];
int privQueueNum;
char clientIpAddr[128];
} AgentInfo;
typedef struct //技能队列信息
{
char callid[128];
char startTime[64];
char waitDurx[64];
char origCaller[128];
char origCallee[128];
} SkillQueueInfo;
typedef struct //私有队列信息
{
char callid[128];
char startTime[64];
char waitDurx[64];
char origCaller[128];
char origCallee[128];
} PrivQueueInfo;
struct SysInfoT //系统统计数据
{
int totalAgents;
int totalCalls;
int ivrCalls;
int agentCalls;
int queueCalls;
int privQueueCalls;
};
typedef CMap<CString,LPCTSTR,int,int> Agents; //座席Map(座席号,某个整数)
typedef CMap<CString,LPCTSTR,AgentInfo*,AgentInfo*> AgentMap; //座席信息Map(座席号,座席信息)
typedef CMap<CString,LPCTSTR,Agents*,Agents*> SkillAgentsMap; //技能座席Map (技能,座席Map),保存每个技能的座席
typedef CMap<CString,LPCTSTR,CString,LPCTSTR> SkillQueueMap; //技能队列Map (技能,队列String),保存每个技能的队列字串
#define MAKELONGLONG(a, b) ((__int64)(((unsigned __int64)(a) & 0xffffffff) | ((unsigned __int64)(b) & 0xffffffff) << 32))
#define LOLONG(a) ((__int32)((unsigned __int64)(a) & 0xffffffff))
#define HILONG(a) ((__int32)((unsigned __int64)(a) >> 32))
#define WM_SKILLCHANGED WM_USER+9900 //用户选择了某个技能
#define WM_DATACHANGED WM_USER+9901 //后台线程获取了数据,需要界面更新
#define WM_GETAGENTSDATA WM_USER+9902 // deprecated
#define WM_DISPLAYSYSINFO WM_USER+9903 //需要显示系统统计信息
#define WM_DISPLAYAGENTINFO WM_USER+9904 //需要显示技能信息
#define WM_SKILLGROUPCHANGED WM_USER+9905
#define WM_RESETAGENTDETAIL WM_USER+9906 //需要显示技能信息
#define WM_SKILLNODE WM_USER+9907 //需要查询的技能节点
#define WM_SYSINFONODE WM_USER+9908 //需要显示sysinfo节点
class CDataMgr
{
public:
CDataMgr(void);
~CDataMgr(void);
static CDataMgr* getInstance();
void startGetAgentsDataThread();
static UINT ThreadGetAgentsAndQueueData(LPVOID param);
void createSkillAgentsMap(CString skill, Agents* pAgents);
void createSkillQueueMap(CString skill, CString strQueue);
void setQueueStringForSkill(CString skill, CString queueStr);
Agents* getAgentsBySkill(CString skill);
void setAgentInfo(CString agentId,AgentInfo* pAgentInfo);
AgentInfo* getAgentInfo(CString agentId);
AgentInfo* getAgentInfoOrCreate(CString agentId);
CString CDataMgr::getQueueStringBySkill(CString skill);
void beginGetSysInfo();
void beginGetBySkill(CString skill);
SkillAgentsMap m_skillAgentsMap;
AgentMap m_agentMap;
SkillQueueMap m_skillQueueMap;
HWND m_hAgentDetailWnd;
HWND m_hQueueDetailWnd;
HWND m_hSysInfoWnd;
HWND m_hAgentFrameView;
HWND m_hSkillGroupTreeView;
CMainFormView* m_pMainFormView;
CWinThread* m_pThread;
SysInfoT m_sysInfo;
CRITICAL_SECTION m_csForAgents; //保护座席相关数据的临界区
CRITICAL_SECTION m_csForQueue; //保护技能队列相关数据的临界区
int m_privQueueColumn;
private:
static CDataMgr* m_dataMgr;
};