Przeglądaj źródła

新增话务模块

zhoufan 4 lat temu
rodzic
commit
ef3b47aa48
36 zmienionych plików z 6311 dodań i 31 usunięć
  1. 7 0
      RMYY_CallCenter_Api.Bll/RMYY_CallCenter_Api.Bll.csproj
  2. 124 0
      RMYY_CallCenter_Api.Bll/T_Call_Blacklist.cs
  3. 221 0
      RMYY_CallCenter_Api.Bll/T_Call_CallRecords.cs
  4. 130 0
      RMYY_CallCenter_Api.Bll/T_Call_LeaveRecord.cs
  5. 134 0
      RMYY_CallCenter_Api.Bll/T_Sys_MobileData.cs
  6. 199 0
      RMYY_CallCenter_Api.Bll/T_Sys_SystemConfig.cs
  7. 148 0
      RMYY_CallCenter_Api.Bll/T_Sys_TelTitleData.cs
  8. 165 0
      RMYY_CallCenter_Api.Bll/T_Sys_WorkOffDays.cs
  9. 7 0
      RMYY_CallCenter_Api.Dal/RMYY_CallCenter_Api.Dal.csproj
  10. 328 0
      RMYY_CallCenter_Api.Dal/T_Call_Blacklist.cs
  11. 965 0
      RMYY_CallCenter_Api.Dal/T_Call_CallRecords.cs
  12. 372 0
      RMYY_CallCenter_Api.Dal/T_Call_LeaveRecord.cs
  13. 1 1
      RMYY_CallCenter_Api.Dal/T_Sys_Department.cs
  14. 327 0
      RMYY_CallCenter_Api.Dal/T_Sys_MobileData.cs
  15. 292 0
      RMYY_CallCenter_Api.Dal/T_Sys_SystemConfig.cs
  16. 255 0
      RMYY_CallCenter_Api.Dal/T_Sys_TelTitleData.cs
  17. 363 0
      RMYY_CallCenter_Api.Dal/T_Sys_WorkOFFDays.cs
  18. 7 0
      RMYY_CallCenter_Api.Model/RMYY_CallCenter_Api.Model.csproj
  19. 119 0
      RMYY_CallCenter_Api.Model/T_Call_Blacklist.cs
  20. 468 0
      RMYY_CallCenter_Api.Model/T_Call_CallRecords.cs
  21. 163 0
      RMYY_CallCenter_Api.Model/T_Call_LeaveRecord.cs
  22. 107 0
      RMYY_CallCenter_Api.Model/T_Sys_MobileData.cs
  23. 65 0
      RMYY_CallCenter_Api.Model/T_Sys_SystemConfig.cs
  24. 66 0
      RMYY_CallCenter_Api.Model/T_Sys_TelTitleData.cs
  25. 92 0
      RMYY_CallCenter_Api.Model/T_Sys_WorkOFFDays.cs
  26. 1 1
      RMYY_CallCenter_Api.Utility/Helper/NPOIHelper.cs
  27. 318 0
      RMYY_CallCenter_Api/Controllers/CallTel/CallInScreenController.cs
  28. 206 0
      RMYY_CallCenter_Api/Controllers/CallTel/CallblackController.cs
  29. 129 0
      RMYY_CallCenter_Api/Controllers/CallTel/CallleaveController.cs
  30. 280 0
      RMYY_CallCenter_Api/Controllers/CallTel/CallrecordsController.cs
  31. 180 0
      RMYY_CallCenter_Api/Controllers/CallTel/MobiledataController.cs
  32. 59 0
      RMYY_CallCenter_Api/Controllers/CallTel/WorkOffDaysController.cs
  33. 0 1
      RMYY_CallCenter_Api/Controllers/GongDanTypeController.cs
  34. 6 25
      RMYY_CallCenter_Api/Controllers/System/UserAccountController.cs
  35. 1 1
      RMYY_CallCenter_Api/Global.asax.cs
  36. 6 2
      RMYY_CallCenter_Api/RMYY_CallCenter_Api.csproj

+ 7 - 0
RMYY_CallCenter_Api.Bll/RMYY_CallCenter_Api.Bll.csproj

@@ -42,15 +42,22 @@
42 42
   </ItemGroup>
43 43
   <ItemGroup>
44 44
     <Compile Include="PagerBll.cs" />
45
+    <Compile Include="T_Call_Blacklist.cs" />
46
+    <Compile Include="T_Call_CallRecords.cs" />
47
+    <Compile Include="T_Call_LeaveRecord.cs" />
45 48
     <Compile Include="T_Sys_Department.cs" />
46 49
     <Compile Include="T_Sys_DictionaryBase.cs" />
47 50
     <Compile Include="T_Sys_DictionaryValue.cs" />
48 51
     <Compile Include="T_Sys_GongDan.cs" />
49 52
     <Compile Include="T_Sys_GongDanType.cs" />
50 53
     <Compile Include="T_Sys_Menu.cs" />
54
+    <Compile Include="T_Sys_MobileData.cs" />
51 55
     <Compile Include="T_Sys_Role.cs" />
56
+    <Compile Include="T_Sys_SystemConfig.cs" />
57
+    <Compile Include="T_Sys_TelTitleData.cs" />
52 58
     <Compile Include="T_Sys_UserAccount.cs" />
53 59
     <Compile Include="Properties\AssemblyInfo.cs" />
60
+    <Compile Include="T_Sys_WorkOffDays.cs" />
54 61
   </ItemGroup>
55 62
   <ItemGroup>
56 63
     <ProjectReference Include="..\RMYY_CallCenter_Api.Dal\RMYY_CallCenter_Api.Dal.csproj">

+ 124 - 0
RMYY_CallCenter_Api.Bll/T_Call_Blacklist.cs

@@ -0,0 +1,124 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+	/// T_Call_Blacklist
12
+	/// </summary>
13
+	public partial class T_Call_Blacklist
14
+    {
15
+        private readonly Dal.T_Call_Blacklist dal = new Dal.T_Call_Blacklist();
16
+        public T_Call_Blacklist()
17
+        { }
18
+        #region  BasicMethod
19
+
20
+
21
+        /// <summary>
22
+        /// 是否存在该记录
23
+        /// </summary>
24
+        public bool Exists(int F_BlackId)
25
+        {
26
+            return dal.Exists(F_BlackId);
27
+        }
28
+
29
+        /// <summary>
30
+        /// 增加一条数据
31
+        /// </summary>
32
+        public int Add(Model.T_Call_Blacklist model)
33
+        {
34
+            return dal.Add(model);
35
+        }
36
+
37
+        /// <summary>
38
+        /// 更新一条数据
39
+        /// </summary>
40
+        public bool Update(Model.T_Call_Blacklist model)
41
+        {
42
+            return dal.Update(model);
43
+        }
44
+
45
+        /// <summary>
46
+        /// 删除一条数据
47
+        /// </summary>
48
+        public bool Delete(int F_BlackId)
49
+        {
50
+
51
+            return dal.Delete(F_BlackId);
52
+        }
53
+        /// <summary>
54
+        /// 删除一条数据
55
+        /// </summary>
56
+        public bool DeleteList(string F_BlackIdlist)
57
+        {
58
+            return dal.DeleteList(F_BlackIdlist);
59
+        }
60
+
61
+        /// <summary>
62
+        /// 得到一个对象实体
63
+        /// </summary>
64
+        public Model.T_Call_Blacklist GetModel(int F_BlackId)
65
+        {
66
+
67
+            return dal.GetModel(F_BlackId);
68
+        }
69
+        /// <summary>
70
+        /// 获得数据列表
71
+        /// </summary>
72
+        public DataSet GetList(string strWhere)
73
+        {
74
+            return dal.GetList(strWhere);
75
+        }
76
+        /// <summary>
77
+        /// 获得数据列表
78
+        /// </summary>
79
+        public List<Model.T_Call_Blacklist> GetModelList(string strWhere)
80
+        {
81
+            DataSet ds = dal.GetList(strWhere);
82
+            return DataTableToList(ds.Tables[0]);
83
+        }
84
+        /// <summary>
85
+        /// 获得数据列表
86
+        /// </summary>
87
+        public List<Model.T_Call_Blacklist> DataTableToList(DataTable dt)
88
+        {
89
+            List<Model.T_Call_Blacklist> modelList = new List<Model.T_Call_Blacklist>();
90
+            int rowsCount = dt.Rows.Count;
91
+            if (rowsCount > 0)
92
+            {
93
+                Model.T_Call_Blacklist model;
94
+                for (int n = 0; n < rowsCount; n++)
95
+                {
96
+                    model = dal.DataRowToModel(dt.Rows[n]);
97
+                    if (model != null)
98
+                    {
99
+                        modelList.Add(model);
100
+                    }
101
+                }
102
+            }
103
+            return modelList;
104
+        }
105
+
106
+        /// <summary>
107
+        /// 获得数据列表
108
+        /// </summary>
109
+        public DataSet GetAllList()
110
+        {
111
+            return GetList("");
112
+        }
113
+
114
+        /// <summary>
115
+        /// 分页获取数据列表
116
+        /// </summary>
117
+        public int GetRecordCount(string strWhere)
118
+        {
119
+            return dal.GetRecordCount(strWhere);
120
+        }
121
+
122
+        #endregion  BasicMethod
123
+    }
124
+}

+ 221 - 0
RMYY_CallCenter_Api.Bll/T_Call_CallRecords.cs

@@ -0,0 +1,221 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+	/// 通话记录表
12
+	/// </summary>
13
+	public partial class T_Call_CallRecords
14
+    {
15
+        private readonly Dal.T_Call_CallRecords dal = new Dal.T_Call_CallRecords();
16
+        public T_Call_CallRecords()
17
+        { }
18
+        #region  BasicMethod
19
+
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int CallRecordsId)
24
+        {
25
+            return dal.Exists(CallRecordsId);
26
+        }
27
+
28
+        /// <summary>
29
+        /// 增加一条数据
30
+        /// </summary>
31
+        public int Add(Model.T_Call_CallRecords model)
32
+        {
33
+            return dal.Add(model);
34
+        }
35
+
36
+        /// <summary>
37
+        /// 更新一条数据
38
+        /// </summary>
39
+        public bool Update(Model.T_Call_CallRecords model)
40
+        {
41
+            return dal.Update(model);
42
+        }
43
+
44
+        /// <summary>
45
+        /// 删除一条数据
46
+        /// </summary>
47
+        public bool Delete(int CallRecordsId)
48
+        {
49
+
50
+            return dal.Delete(CallRecordsId);
51
+        }
52
+        /// <summary>
53
+        /// 删除一条数据
54
+        /// </summary>
55
+        public bool DeleteList(string CallRecordsIdlist)
56
+        {
57
+            return dal.DeleteList(CallRecordsIdlist);
58
+        }
59
+
60
+        /// <summary>
61
+        /// 得到一个对象实体
62
+        /// </summary>
63
+        public Model.T_Call_CallRecords GetModel(int CallRecordsId)
64
+        {
65
+
66
+            return dal.GetModel(CallRecordsId);
67
+        }
68
+
69
+        /// <summary>
70
+        /// 获得数据列表
71
+        /// </summary>
72
+        public DataSet GetList(string strWhere)
73
+        {
74
+            return dal.GetList(strWhere);
75
+        }
76
+        /// <summary>
77
+        /// 获得前几行数据
78
+        /// </summary>
79
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
80
+        {
81
+            return dal.GetList(Top, strWhere, filedOrder);
82
+        }
83
+        /// <summary>
84
+        /// 获得数据列表
85
+        /// </summary>
86
+        public List<Model.T_Call_CallRecords> GetModelList(string strWhere)
87
+        {
88
+            DataSet ds = dal.GetList(strWhere);
89
+            return DataTableToList(ds.Tables[0]);
90
+        }
91
+        /// <summary>
92
+        /// 获得数据列表
93
+        /// </summary>
94
+        public List<Model.T_Call_CallRecords> DataTableToList(DataTable dt)
95
+        {
96
+            List<Model.T_Call_CallRecords> modelList = new List<Model.T_Call_CallRecords>();
97
+            int rowsCount = dt.Rows.Count;
98
+            if (rowsCount > 0)
99
+            {
100
+                Model.T_Call_CallRecords model;
101
+                for (int n = 0; n < rowsCount; n++)
102
+                {
103
+                    model = dal.DataRowToModel(dt.Rows[n]);
104
+                    if (model != null)
105
+                    {
106
+                        modelList.Add(model);
107
+                    }
108
+                }
109
+            }
110
+            return modelList;
111
+        }
112
+
113
+        /// <summary>
114
+        /// 获得数据列表
115
+        /// </summary>
116
+        public DataSet GetAllList()
117
+        {
118
+            return GetList("");
119
+        }
120
+
121
+        /// <summary>
122
+        /// 分页获取数据列表
123
+        /// </summary>
124
+        public int GetRecordCount(string strWhere)
125
+        {
126
+            return dal.GetRecordCount(strWhere);
127
+        }
128
+
129
+        #endregion  BasicMethod
130
+
131
+        #region 更新来电振铃电话记录信息
132
+
133
+        /// <summary>
134
+        /// 更新来电振铃电话记录信息
135
+        /// </summary>
136
+        public bool UpdateCallInRingTelRecord(Model.T_Call_CallRecords model)
137
+        {
138
+            return dal.UpdateCallInRingTelRecord(model);
139
+        }
140
+
141
+        #endregion
142
+
143
+        #region 更新来电摘机电话记录信息
144
+
145
+        /// <summary>
146
+        /// 更新来电摘机电话记录信息
147
+        /// </summary>
148
+        public bool UpdateCallInAnswerTelRecord(Model.T_Call_CallRecords model)
149
+        {
150
+            return dal.UpdateCallInAnswerTelRecord(model);
151
+        }
152
+
153
+        #endregion
154
+
155
+        #region 更新来电挂断电话记录信息
156
+
157
+        /// <summary>
158
+        /// 更新来电挂断电话记录信息
159
+        /// </summary>
160
+        public bool UpdateCallInHookTelRecord(string callId)
161
+        {
162
+            return dal.UpdateCallInHookTelRecord(callId);
163
+        }
164
+
165
+        #endregion
166
+
167
+        #region 更新来电录音记录信息
168
+
169
+        /// <summary>
170
+        /// 更新来电录音记录信息
171
+        /// </summary>
172
+        public bool UpdateCallInPathTelRecord(Model.T_Call_CallRecords model)
173
+        {
174
+            return dal.UpdateCallInPathTelRecord(model);
175
+        }
176
+
177
+        #endregion
178
+
179
+        #region 根据来电号码获取电话记录
180
+        /// <summary>
181
+        /// 根据来电号码获取电话记录
182
+        /// </summary>
183
+        public Model.T_Call_CallRecords GetModelByTelphone(string CallNumber)
184
+        {
185
+
186
+            return dal.GetModelByTelphone(CallNumber);
187
+        }
188
+        #endregion
189
+
190
+        #region 根据CallId获取电话记录
191
+        /// <summary>
192
+        /// 根据CallId获取电话记录
193
+        /// </summary>
194
+        public Model.T_Call_CallRecords GetModelByCallId(string CallId)
195
+        {
196
+
197
+            return dal.GetModelByCallId(CallId);
198
+        }
199
+        /// <summary>
200
+        /// 根据CallId获取电话记录
201
+        /// </summary>
202
+        public Model.T_Call_CallRecords GetModelByRecordId(string CallId)
203
+        {
204
+
205
+            return dal.GetModelByRecordId(CallId);
206
+        }
207
+        #endregion
208
+
209
+        #region 更新来电处理状态信息
210
+
211
+        /// <summary>
212
+        /// 更新来电处理状态信息
213
+        /// </summary>
214
+        public bool UpdateCallInRecordDealType(string callid, int type)
215
+        {
216
+            return dal.UpdateCallInRecordDealType(callid, type);
217
+        }
218
+
219
+        #endregion
220
+    }
221
+}

+ 130 - 0
RMYY_CallCenter_Api.Bll/T_Call_LeaveRecord.cs

@@ -0,0 +1,130 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+	/// 留言表
12
+	/// </summary>
13
+	public partial class T_Call_LeaveRecord
14
+    {
15
+        private readonly Dal.T_Call_LeaveRecord dal = new Dal.T_Call_LeaveRecord();
16
+        public T_Call_LeaveRecord()
17
+        { }
18
+        #region  BasicMethod
19
+
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int F_Id)
24
+        {
25
+            return dal.Exists(F_Id);
26
+        }
27
+
28
+        /// <summary>
29
+        /// 增加一条数据
30
+        /// </summary>
31
+        public int Add(Model.T_Call_LeaveRecord model)
32
+        {
33
+            return dal.Add(model);
34
+        }
35
+
36
+        /// <summary>
37
+        /// 更新一条数据
38
+        /// </summary>
39
+        public bool Update(Model.T_Call_LeaveRecord model)
40
+        {
41
+            return dal.Update(model);
42
+        }
43
+
44
+        /// <summary>
45
+        /// 删除一条数据
46
+        /// </summary>
47
+        public bool Delete(int F_Id)
48
+        {
49
+
50
+            return dal.Delete(F_Id);
51
+        }
52
+        /// <summary>
53
+        /// 删除一条数据
54
+        /// </summary>
55
+        public bool DeleteList(string F_Idlist)
56
+        {
57
+            return dal.DeleteList(F_Idlist);
58
+        }
59
+
60
+        /// <summary>
61
+        /// 得到一个对象实体
62
+        /// </summary>
63
+        public Model.T_Call_LeaveRecord GetModel(int F_Id)
64
+        {
65
+
66
+            return dal.GetModel(F_Id);
67
+        }
68
+        /// <summary>
69
+        /// 获得数据列表
70
+        /// </summary>
71
+        public DataSet GetList(string strWhere)
72
+        {
73
+            return dal.GetList(strWhere);
74
+        }
75
+        /// <summary>
76
+        /// 获得前几行数据
77
+        /// </summary>
78
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
79
+        {
80
+            return dal.GetList(Top, strWhere, filedOrder);
81
+        }
82
+        /// <summary>
83
+        /// 获得数据列表
84
+        /// </summary>
85
+        public List<Model.T_Call_LeaveRecord> GetModelList(string strWhere)
86
+        {
87
+            DataSet ds = dal.GetList(strWhere);
88
+            return DataTableToList(ds.Tables[0]);
89
+        }
90
+        /// <summary>
91
+        /// 获得数据列表
92
+        /// </summary>
93
+        public List<Model.T_Call_LeaveRecord> DataTableToList(DataTable dt)
94
+        {
95
+            List<Model.T_Call_LeaveRecord> modelList = new List<Model.T_Call_LeaveRecord>();
96
+            int rowsCount = dt.Rows.Count;
97
+            if (rowsCount > 0)
98
+            {
99
+                Model.T_Call_LeaveRecord model;
100
+                for (int n = 0; n < rowsCount; n++)
101
+                {
102
+                    model = dal.DataRowToModel(dt.Rows[n]);
103
+                    if (model != null)
104
+                    {
105
+                        modelList.Add(model);
106
+                    }
107
+                }
108
+            }
109
+            return modelList;
110
+        }
111
+
112
+        /// <summary>
113
+        /// 获得数据列表
114
+        /// </summary>
115
+        public DataSet GetAllList()
116
+        {
117
+            return GetList("");
118
+        }
119
+
120
+        /// <summary>
121
+        /// 分页获取数据列表
122
+        /// </summary>
123
+        public int GetRecordCount(string strWhere)
124
+        {
125
+            return dal.GetRecordCount(strWhere);
126
+        }
127
+
128
+        #endregion  BasicMethod
129
+    }
130
+}

+ 134 - 0
RMYY_CallCenter_Api.Bll/T_Sys_MobileData.cs

@@ -0,0 +1,134 @@
1
+using System;
2
+using System.Data;
3
+using System.Collections.Generic;
4
+using RMYY_CallCenter_Api.Model;
5
+namespace RMYY_CallCenter_Api.Bll
6
+{
7
+    /// <summary>
8
+    /// T_Sys_MobileData
9
+    /// </summary>
10
+    public partial class T_Sys_MobileData
11
+    {
12
+        private readonly RMYY_CallCenter_Api.Dal.T_Sys_MobileData dal = new RMYY_CallCenter_Api.Dal.T_Sys_MobileData();
13
+        public T_Sys_MobileData()
14
+        { }
15
+        #region  BasicMethod
16
+        /// <summary>
17
+        /// 是否存在该记录
18
+        /// </summary>
19
+        public bool Exists(int F_Id)
20
+        {
21
+            return dal.Exists(F_Id);
22
+        }
23
+
24
+        /// <summary>
25
+        /// 增加一条数据
26
+        /// </summary>
27
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_MobileData model)
28
+        {
29
+            return dal.Add(model);
30
+        }
31
+
32
+        /// <summary>
33
+        /// 更新一条数据
34
+        /// </summary>
35
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_MobileData model)
36
+        {
37
+            return dal.Update(model);
38
+        }
39
+
40
+        /// <summary>
41
+        /// 删除一条数据
42
+        /// </summary>
43
+        public bool Delete(int F_Id)
44
+        {
45
+
46
+            return dal.Delete(F_Id);
47
+        }
48
+        /// <summary>
49
+        /// 删除一条数据
50
+        /// </summary>
51
+        public bool DeleteList(string F_Idlist)
52
+        {
53
+            return dal.DeleteList(F_Idlist);
54
+        }
55
+        /// <summary>
56
+        /// 删除一条数据
57
+        /// </summary>
58
+        public bool DeleteList(string F_Idlist, string usercode)
59
+        {
60
+            return dal.DeleteList(F_Idlist, usercode);
61
+        }
62
+
63
+        /// <summary>
64
+        /// 得到一个对象实体
65
+        /// </summary>
66
+        public RMYY_CallCenter_Api.Model.T_Sys_MobileData GetModel(int F_Id)
67
+        {
68
+
69
+            return dal.GetModel(F_Id);
70
+        }
71
+
72
+        /// <summary>
73
+        /// 获得数据列表
74
+        /// </summary>
75
+        public DataSet GetList(string strWhere)
76
+        {
77
+            return dal.GetList(strWhere);
78
+        }
79
+        /// <summary>
80
+        /// 获得前几行数据
81
+        /// </summary>
82
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
83
+        {
84
+            return dal.GetList(Top, strWhere, filedOrder);
85
+        }
86
+        /// <summary>
87
+        /// 获得数据列表
88
+        /// </summary>
89
+        public List<RMYY_CallCenter_Api.Model.T_Sys_MobileData> GetModelList(string strWhere)
90
+        {
91
+            DataSet ds = dal.GetList(strWhere);
92
+            return DataTableToList(ds.Tables[0]);
93
+        }
94
+        /// <summary>
95
+        /// 获得数据列表
96
+        /// </summary>
97
+        public List<RMYY_CallCenter_Api.Model.T_Sys_MobileData> DataTableToList(DataTable dt)
98
+        {
99
+            List<RMYY_CallCenter_Api.Model.T_Sys_MobileData> modelList = new List<RMYY_CallCenter_Api.Model.T_Sys_MobileData>();
100
+            int rowsCount = dt.Rows.Count;
101
+            if (rowsCount > 0)
102
+            {
103
+                RMYY_CallCenter_Api.Model.T_Sys_MobileData model;
104
+                for (int n = 0; n < rowsCount; n++)
105
+                {
106
+                    model = dal.DataRowToModel(dt.Rows[n]);
107
+                    if (model != null)
108
+                    {
109
+                        modelList.Add(model);
110
+                    }
111
+                }
112
+            }
113
+            return modelList;
114
+        }
115
+
116
+        /// <summary>
117
+        /// 获得数据列表
118
+        /// </summary>
119
+        public DataSet GetAllList()
120
+        {
121
+            return GetList("");
122
+        }
123
+
124
+        /// <summary>
125
+        /// 分页获取数据列表
126
+        /// </summary>
127
+        public int GetRecordCount(string strWhere)
128
+        {
129
+            return dal.GetRecordCount(strWhere);
130
+        }
131
+        #endregion  BasicMethod
132
+    }
133
+}
134
+

+ 199 - 0
RMYY_CallCenter_Api.Bll/T_Sys_SystemConfig.cs

@@ -0,0 +1,199 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Data;
6
+using RMYY_CallCenter_Api.Utility;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+    /// T_Sys_SystemConfig
12
+    /// </summary>
13
+    public partial class T_Sys_SystemConfig
14
+    {
15
+        private readonly Dal.T_Sys_SystemConfig dal = new Dal.T_Sys_SystemConfig();
16
+        public T_Sys_SystemConfig()
17
+        { }
18
+        #region  BasicMethod
19
+        /// <summary>
20
+        /// 是否存在该记录
21
+        /// </summary>
22
+        public bool Exists(int F_ParamId)
23
+        {
24
+            return dal.Exists(F_ParamId);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 增加一条数据
29
+        /// </summary>
30
+        public int Add(Model.T_Sys_SystemConfig model)
31
+        {
32
+            OutRedis();
33
+            return dal.Add(model);
34
+        }
35
+
36
+        /// <summary>
37
+        /// 更新一条数据
38
+        /// </summary>
39
+        public bool Update(Model.T_Sys_SystemConfig model)
40
+        {
41
+            OutRedis();
42
+            return dal.Update(model);
43
+        }
44
+
45
+        /// <summary>
46
+        /// 删除一条数据
47
+        /// </summary>
48
+        public bool Delete(int F_ParamId)
49
+        {
50
+            OutRedis();
51
+            return dal.Delete(F_ParamId);
52
+        }
53
+        /// <summary>
54
+        /// 删除一条数据
55
+        /// </summary>
56
+        public bool DeleteList(string F_ParamIdlist)
57
+        {
58
+            OutRedis();
59
+            return dal.DeleteList(F_ParamIdlist);
60
+        }
61
+
62
+        /// <summary>
63
+        /// 得到一个对象实体
64
+        /// </summary>
65
+        public Model.T_Sys_SystemConfig GetModel(int F_ParamId)
66
+        {
67
+            var dt = GetRedis();
68
+            if (dt != null)
69
+            {
70
+                var dr = dt.Select("F_ParamId=" + F_ParamId);
71
+                if (dr != null && dr.Count() > 0)
72
+                {
73
+                    return dal.DataRowToModel(dr[0]);
74
+                }
75
+                else
76
+                {
77
+                    return null;
78
+                }
79
+            }
80
+            else
81
+            {
82
+                return dal.GetModel(F_ParamId);
83
+            }
84
+        }
85
+
86
+        /// <summary>
87
+        /// 获得数据列表
88
+        /// </summary>
89
+        public DataSet GetList(string strWhere)
90
+        {
91
+            return dal.GetList(strWhere);
92
+        }
93
+        /// <summary>
94
+        /// 获得前几行数据
95
+        /// </summary>
96
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
97
+        {
98
+            return dal.GetList(Top, strWhere, filedOrder);
99
+        }
100
+        /// <summary>
101
+        /// 获得数据列表
102
+        /// </summary>
103
+        public List<Model.T_Sys_SystemConfig> GetModelList(string strWhere)
104
+        {
105
+            var dt = GetRedis();
106
+            if (dt != null)
107
+            {
108
+                var dtnew = new DataTable();
109
+                var drs = dt.Select(strWhere);
110
+                if (drs.Length > 0)
111
+                {
112
+                    dtnew = drs.CopyToDataTable();
113
+                }
114
+                return DataTableToList(dtnew);
115
+            }
116
+            else
117
+            {
118
+                DataSet ds = dal.GetList(strWhere);
119
+                return DataTableToList(ds.Tables[0]);
120
+            }
121
+        }
122
+        /// <summary>
123
+        /// 获得数据列表
124
+        /// </summary>
125
+        public List<Model.T_Sys_SystemConfig> DataTableToList(DataTable dt)
126
+        {
127
+            List<Model.T_Sys_SystemConfig> modelList = new List<Model.T_Sys_SystemConfig>();
128
+            int rowsCount = dt.Rows.Count;
129
+            if (rowsCount > 0)
130
+            {
131
+                Model.T_Sys_SystemConfig model;
132
+                for (int n = 0; n < rowsCount; n++)
133
+                {
134
+                    model = dal.DataRowToModel(dt.Rows[n]);
135
+                    if (model != null)
136
+                    {
137
+                        modelList.Add(model);
138
+                    }
139
+                }
140
+            }
141
+            return modelList;
142
+        }
143
+
144
+        /// <summary>
145
+        /// 获得数据列表
146
+        /// </summary>
147
+        public DataSet GetAllList()
148
+        {
149
+            return GetList("");
150
+        }
151
+
152
+        /// <summary>
153
+        /// 分页获取数据列表
154
+        /// </summary>
155
+        public int GetRecordCount(string strWhere)
156
+        {
157
+            return dal.GetRecordCount(strWhere);
158
+        }
159
+
160
+        #endregion  BasicMethod
161
+
162
+        /// <summary>
163
+        /// 根据编号获取值
164
+        /// </summary>
165
+        /// <param name="p_ParamCode">编号</param>
166
+        /// <returns></returns>
167
+        public string GetParamValueByParamCode(string p_ParamCode)
168
+        {
169
+            return dal.GetParamValueByParamCode(p_ParamCode);
170
+        }
171
+
172
+        private DataTable GetRedis()
173
+        {
174
+            var strList = RedisHelper.StringGet("SysConfig");
175
+            if (strList != null)
176
+            {
177
+                return strList.ToString().ToObject<DataTable>();
178
+            }
179
+            else
180
+            {
181
+                return InRedis();
182
+            }
183
+        }
184
+
185
+        private DataTable InRedis()
186
+        {
187
+            var dt = dal.GetList("").Tables[0];
188
+
189
+            RedisHelper.StringSet("SysConfig", dt.ToJson(), new TimeSpan(24, 0, 0));
190
+
191
+            return dt;
192
+        }
193
+
194
+        private void OutRedis()
195
+        {
196
+            RedisHelper.KeyDelete("SysConfig");
197
+        }
198
+    }
199
+}

+ 148 - 0
RMYY_CallCenter_Api.Bll/T_Sys_TelTitleData.cs

@@ -0,0 +1,148 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+	/// T_Sys_TelTitleData
12
+	/// </summary>
13
+	public partial class T_Sys_TelTitleData
14
+    {
15
+        private readonly RMYY_CallCenter_Api.Dal.T_Sys_TelTitleData dal = new RMYY_CallCenter_Api.Dal.T_Sys_TelTitleData();
16
+        public T_Sys_TelTitleData()
17
+        { }
18
+        #region  Method
19
+
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int F_Id)
24
+        {
25
+            return dal.Exists(F_Id);
26
+        }
27
+
28
+        /// <summary>
29
+        /// 增加一条数据
30
+        /// </summary>
31
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_TelTitleData model)
32
+        {
33
+            return dal.Add(model);
34
+        }
35
+
36
+        /// <summary>
37
+        /// 更新一条数据
38
+        /// </summary>
39
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_TelTitleData model)
40
+        {
41
+            return dal.Update(model);
42
+        }
43
+
44
+        /// <summary>
45
+        /// 删除一条数据
46
+        /// </summary>
47
+        public bool Delete(int F_Id)
48
+        {
49
+
50
+            return dal.Delete(F_Id);
51
+        }
52
+        /// <summary>
53
+        /// 删除一条数据
54
+        /// </summary>
55
+        public bool DeleteList(string F_Idlist)
56
+        {
57
+            return dal.DeleteList(F_Idlist);
58
+        }
59
+
60
+        /// <summary>
61
+        /// 得到一个对象实体
62
+        /// </summary>
63
+        public RMYY_CallCenter_Api.Model.T_Sys_TelTitleData GetModel(int F_Id)
64
+        {
65
+
66
+            return dal.GetModel(F_Id);
67
+        }
68
+
69
+        /// <summary>
70
+        /// 获得数据列表
71
+        /// </summary>
72
+        public DataSet GetList(string strWhere)
73
+        {
74
+            return dal.GetList(strWhere);
75
+        }
76
+        /// <summary>
77
+        /// 获得前几行数据
78
+        /// </summary>
79
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
80
+        {
81
+            return dal.GetList(Top, strWhere, filedOrder);
82
+        }
83
+        /// <summary>
84
+        /// 获得数据列表
85
+        /// </summary>
86
+        public List<RMYY_CallCenter_Api.Model.T_Sys_TelTitleData> GetModelList(string strWhere)
87
+        {
88
+            DataSet ds = dal.GetList(strWhere);
89
+            return DataTableToList(ds.Tables[0]);
90
+        }
91
+        /// <summary>
92
+        /// 获得数据列表
93
+        /// </summary>
94
+        public List<RMYY_CallCenter_Api.Model.T_Sys_TelTitleData> DataTableToList(DataTable dt)
95
+        {
96
+            List<RMYY_CallCenter_Api.Model.T_Sys_TelTitleData> modelList = new List<RMYY_CallCenter_Api.Model.T_Sys_TelTitleData>();
97
+            int rowsCount = dt.Rows.Count;
98
+            if (rowsCount > 0)
99
+            {
100
+                RMYY_CallCenter_Api.Model.T_Sys_TelTitleData model;
101
+                for (int n = 0; n < rowsCount; n++)
102
+                {
103
+                    model = new RMYY_CallCenter_Api.Model.T_Sys_TelTitleData();
104
+                    if (dt.Rows[n]["F_Id"] != null && dt.Rows[n]["F_Id"].ToString() != "")
105
+                    {
106
+                        model.F_Id = int.Parse(dt.Rows[n]["F_Id"].ToString());
107
+                    }
108
+                    if (dt.Rows[n]["F_TitleName"] != null && dt.Rows[n]["F_TitleName"].ToString() != "")
109
+                    {
110
+                        model.F_TitleName = dt.Rows[n]["F_TitleName"].ToString();
111
+                    }
112
+                    if (dt.Rows[n]["F_KeyPhoneNum"] != null && dt.Rows[n]["F_KeyPhoneNum"].ToString() != "")
113
+                    {
114
+                        model.F_KeyPhoneNum = dt.Rows[n]["F_KeyPhoneNum"].ToString();
115
+                    }
116
+                    if (dt.Rows[n]["F_DefPhoneNumLen"] != null && dt.Rows[n]["F_DefPhoneNumLen"].ToString() != "")
117
+                    {
118
+                        model.F_DefPhoneNumLen = int.Parse(dt.Rows[n]["F_DefPhoneNumLen"].ToString());
119
+                    }
120
+                    if (dt.Rows[n]["F_WCode"] != null && dt.Rows[n]["F_WCode"].ToString() != "")
121
+                    {
122
+                        model.F_WCode = dt.Rows[n]["F_WCode"].ToString();
123
+                    }
124
+                    modelList.Add(model);
125
+                }
126
+            }
127
+            return modelList;
128
+        }
129
+
130
+        /// <summary>
131
+        /// 获得数据列表
132
+        /// </summary>
133
+        public DataSet GetAllList()
134
+        {
135
+            return GetList("");
136
+        }
137
+
138
+        /// <summary>
139
+        /// 分页获取数据列表
140
+        /// </summary>
141
+        public int GetRecordCount(string strWhere)
142
+        {
143
+            return dal.GetRecordCount(strWhere);
144
+        }
145
+
146
+        #endregion  Method
147
+    }
148
+}

+ 165 - 0
RMYY_CallCenter_Api.Bll/T_Sys_WorkOffDays.cs

@@ -0,0 +1,165 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+	/// 休息日表
12
+	/// </summary>
13
+	public partial class T_Sys_WorkOffDays
14
+    {
15
+        private readonly RMYY_CallCenter_Api.Dal.T_Sys_WorkOffDays dal = new RMYY_CallCenter_Api.Dal.T_Sys_WorkOffDays();
16
+        public T_Sys_WorkOffDays()
17
+        { }
18
+        #region  Method
19
+
20
+        /// <summary>
21
+        /// 增加一条数据
22
+        /// </summary>
23
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
24
+        {
25
+            return dal.Add(model);
26
+        }
27
+
28
+        /// <summary>
29
+        /// 更新一条数据
30
+        /// </summary>
31
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
32
+        {
33
+            return dal.Update(model);
34
+        }
35
+        public bool UpdateState(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
36
+        {
37
+            return dal.UpdateState(model);
38
+        }
39
+
40
+        /// <summary>
41
+        /// 删除一条数据
42
+        /// </summary>
43
+        public bool Delete(int F_OffID)
44
+        {
45
+
46
+            return dal.Delete(F_OffID);
47
+        }
48
+        public bool DeleteByDate(string date, string usercode, DateTime nowdate)
49
+        {
50
+            return dal.DeleteByDate(date, usercode,nowdate);
51
+        }
52
+        /// <summary>
53
+        /// 删除一条数据
54
+        /// </summary>
55
+        public bool DeleteList(string F_OffIDlist)
56
+        {
57
+            return dal.DeleteList(F_OffIDlist);
58
+        }
59
+
60
+        /// <summary>
61
+        /// 得到一个对象实体
62
+        /// </summary>
63
+        public RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays GetModel(int F_OffID)
64
+        {
65
+
66
+            return dal.GetModel(F_OffID);
67
+        }
68
+        public RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays GetModel(string date)
69
+        {
70
+
71
+            return dal.GetModel(date);
72
+        }
73
+
74
+        /// <summary>
75
+        /// 获得数据列表
76
+        /// </summary>
77
+        public DataSet GetList(string strWhere)
78
+        {
79
+            return dal.GetList(strWhere);
80
+        }
81
+        /// <summary>
82
+        /// 获得前几行数据
83
+        /// </summary>
84
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
85
+        {
86
+            return dal.GetList(Top, strWhere, filedOrder);
87
+        }
88
+        /// <summary>
89
+        /// 获得数据列表
90
+        /// </summary>
91
+        public List<RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays> GetModelList(string strWhere)
92
+        {
93
+            DataSet ds = dal.GetList(strWhere);
94
+            return DataTableToList(ds.Tables[0]);
95
+        }
96
+        /// <summary>
97
+        /// 获得数据列表
98
+        /// </summary>
99
+        public List<RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays> DataTableToList(DataTable dt)
100
+        {
101
+            List<RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays> modelList = new List<RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays>();
102
+            int rowsCount = dt.Rows.Count;
103
+            if (rowsCount > 0)
104
+            {
105
+                RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model;
106
+                for (int n = 0; n < rowsCount; n++)
107
+                {
108
+                    model = new RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays();
109
+                    if (dt.Rows[n]["F_OffID"] != null && dt.Rows[n]["F_OffID"].ToString() != "")
110
+                    {
111
+                        model.F_OffID = int.Parse(dt.Rows[n]["F_OffID"].ToString());
112
+                    }
113
+                    if (dt.Rows[n]["F_OffDate"] != null && dt.Rows[n]["F_OffDate"].ToString() != "")
114
+                    {
115
+                        model.F_OffDate = DateTime.Parse(dt.Rows[n]["F_OffDate"].ToString());
116
+                    }
117
+                    if (dt.Rows[n]["F_OffState"] != null && dt.Rows[n]["F_OffState"].ToString() != "")
118
+                    {
119
+                        model.F_OffState = int.Parse(dt.Rows[n]["F_OffState"].ToString());
120
+                    }
121
+                    if (dt.Rows[n]["F_remark"] != null && dt.Rows[n]["F_remark"].ToString() != "")
122
+                    {
123
+                        model.F_remark = dt.Rows[n]["F_remark"].ToString();
124
+                    }
125
+                    if (dt.Rows[n]["F_CreateBy"] != null && dt.Rows[n]["F_CreateBy"].ToString() != "")
126
+                    {
127
+                        model.F_CreateBy = dt.Rows[n]["F_CreateBy"].ToString();
128
+                    }
129
+                    if (dt.Rows[n]["F_CreateOn"] != null && dt.Rows[n]["F_CreateOn"].ToString() != "")
130
+                    {
131
+                        model.F_CreateOn = DateTime.Parse(dt.Rows[n]["F_CreateOn"].ToString());
132
+                    }
133
+                    if (dt.Rows[n]["F_DeleteBy"] != null && dt.Rows[n]["F_DeleteBy"].ToString() != "")
134
+                    {
135
+                        model.F_DeleteBy = dt.Rows[n]["F_DeleteBy"].ToString();
136
+                    }
137
+                    if (dt.Rows[n]["F_DeleteOn"] != null && dt.Rows[n]["F_DeleteOn"].ToString() != "")
138
+                    {
139
+                        model.F_DeleteOn = DateTime.Parse(dt.Rows[n]["F_DeleteOn"].ToString());
140
+                    }
141
+                    modelList.Add(model);
142
+                }
143
+            }
144
+            return modelList;
145
+        }
146
+
147
+        /// <summary>
148
+        /// 获得数据列表
149
+        /// </summary>
150
+        public DataSet GetAllList()
151
+        {
152
+            return GetList("");
153
+        }
154
+
155
+        /// <summary>
156
+        /// 分页获取数据列表
157
+        /// </summary>
158
+        public int GetRecordCount(string strWhere)
159
+        {
160
+            return dal.GetRecordCount(strWhere);
161
+        }
162
+
163
+        #endregion  Method
164
+    }
165
+}

+ 7 - 0
RMYY_CallCenter_Api.Dal/RMYY_CallCenter_Api.Dal.csproj

@@ -42,15 +42,22 @@
42 42
   </ItemGroup>
43 43
   <ItemGroup>
44 44
     <Compile Include="PagerDal.cs" />
45
+    <Compile Include="T_Call_Blacklist.cs" />
46
+    <Compile Include="T_Call_CallRecords.cs" />
47
+    <Compile Include="T_Call_LeaveRecord.cs" />
45 48
     <Compile Include="T_Sys_Department.cs" />
46 49
     <Compile Include="T_Sys_DictionaryBase.cs" />
47 50
     <Compile Include="T_Sys_DictionaryValue.cs" />
48 51
     <Compile Include="T_Sys_GongDan.cs" />
49 52
     <Compile Include="T_Sys_GongDanType.cs" />
50 53
     <Compile Include="T_Sys_Menu.cs" />
54
+    <Compile Include="T_Sys_MobileData.cs" />
51 55
     <Compile Include="T_Sys_Role.cs" />
56
+    <Compile Include="T_Sys_SystemConfig.cs" />
57
+    <Compile Include="T_Sys_TelTitleData.cs" />
52 58
     <Compile Include="T_Sys_UserAccount.cs" />
53 59
     <Compile Include="Properties\AssemblyInfo.cs" />
60
+    <Compile Include="T_Sys_WorkOffDays.cs" />
54 61
   </ItemGroup>
55 62
   <ItemGroup>
56 63
     <ProjectReference Include="..\RMYY_CallCenter_Api.DB\RMYY_CallCenter_Api.DB.csproj">

+ 328 - 0
RMYY_CallCenter_Api.Dal/T_Call_Blacklist.cs

@@ -0,0 +1,328 @@
1
+using RMYY_CallCenter_Api.DB;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Data.SqlClient;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace RMYY_CallCenter_Api.Dal
11
+{
12
+    /// <summary>
13
+	/// 数据访问类:T_Call_Blacklist
14
+	/// </summary>
15
+	public partial class T_Call_Blacklist
16
+    {
17
+        public T_Call_Blacklist()
18
+        { }
19
+        #region  BasicMethod
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int F_BlackId)
24
+        {
25
+            StringBuilder strSql = new StringBuilder();
26
+            strSql.Append("select count(1) from T_Call_Blacklist with(nolock)");
27
+            strSql.Append(" where F_BlackId=@F_BlackId");
28
+            SqlParameter[] parameters = {
29
+                    new SqlParameter("@F_BlackId", SqlDbType.Int,4)
30
+            };
31
+            parameters[0].Value = F_BlackId;
32
+
33
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
34
+        }
35
+
36
+
37
+        /// <summary>
38
+        /// 增加一条数据
39
+        /// </summary>
40
+        public int Add(Model.T_Call_Blacklist model)
41
+        {
42
+            StringBuilder strSql = new StringBuilder();
43
+            strSql.Append("insert into T_Call_Blacklist(");
44
+            strSql.Append("F_CallId,F_TelPhone,F_BlackType,F_SetTime,F_RemoveTime,F_Describe,F_UserId,F_InterceptNum,F_IsDelete,F_CreateTime)");
45
+            strSql.Append(" values (");
46
+            strSql.Append("@F_CallId,@F_TelPhone,@F_BlackType,@F_SetTime,@F_RemoveTime,@F_Describe,@F_UserId,@F_InterceptNum,@F_IsDelete,getdate())");
47
+            strSql.Append(";select @@IDENTITY");
48
+            SqlParameter[] parameters = {
49
+                    new SqlParameter("@F_CallId", SqlDbType.VarChar,50),
50
+                    new SqlParameter("@F_TelPhone", SqlDbType.NVarChar,20),
51
+                    new SqlParameter("@F_BlackType", SqlDbType.Int,4),
52
+                    new SqlParameter("@F_SetTime", SqlDbType.DateTime),
53
+                    new SqlParameter("@F_RemoveTime", SqlDbType.DateTime),
54
+                    new SqlParameter("@F_Describe", SqlDbType.NVarChar,1000),
55
+                    new SqlParameter("@F_UserId", SqlDbType.Int,4),
56
+                    new SqlParameter("@F_InterceptNum", SqlDbType.Int,4),
57
+                    new SqlParameter("@F_IsDelete", SqlDbType.Bit,1)
58
+                    //new SqlParameter("@F_CreateTime", SqlDbType.DateTime)
59
+            };
60
+            parameters[0].Value = model.F_CallId;
61
+            parameters[1].Value = model.F_TelPhone;
62
+            parameters[2].Value = model.F_BlackType;
63
+            parameters[3].Value = model.F_SetTime;
64
+            parameters[4].Value = model.F_RemoveTime;
65
+            parameters[5].Value = model.F_Describe;
66
+            parameters[6].Value = model.F_UserId;
67
+            parameters[7].Value = model.F_InterceptNum;
68
+            parameters[8].Value = model.F_IsDelete;
69
+            //parameters[9].Value = model.F_CreateTime;
70
+
71
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
72
+            if (obj == null)
73
+            {
74
+                return 0;
75
+            }
76
+            else
77
+            {
78
+                return Convert.ToInt32(obj);
79
+            }
80
+        }
81
+        /// <summary>
82
+        /// 更新一条数据
83
+        /// </summary>
84
+        public bool Update(Model.T_Call_Blacklist model)
85
+        {
86
+            StringBuilder strSql = new StringBuilder();
87
+            strSql.Append("update T_Call_Blacklist set ");
88
+            strSql.Append("F_CallId=@F_CallId,");
89
+            strSql.Append("F_TelPhone=@F_TelPhone,");
90
+            strSql.Append("F_BlackType=@F_BlackType,");
91
+            strSql.Append("F_SetTime=@F_SetTime,");
92
+            strSql.Append("F_RemoveTime=@F_RemoveTime,");
93
+            strSql.Append("F_Describe=@F_Describe,");
94
+            strSql.Append("F_UserId=@F_UserId,");
95
+            strSql.Append("F_InterceptNum=@F_InterceptNum,");
96
+            strSql.Append("F_IsDelete=@F_IsDelete ");
97
+            //strSql.Append("F_CreateTime=@F_CreateTime");
98
+            strSql.Append(" where F_BlackId=@F_BlackId");
99
+            SqlParameter[] parameters = {
100
+                    new SqlParameter("@F_CallId", SqlDbType.VarChar,50),
101
+                    new SqlParameter("@F_TelPhone", SqlDbType.NVarChar,20),
102
+                    new SqlParameter("@F_BlackType", SqlDbType.Int,4),
103
+                    new SqlParameter("@F_SetTime", SqlDbType.DateTime),
104
+                    new SqlParameter("@F_RemoveTime", SqlDbType.DateTime),
105
+                    new SqlParameter("@F_Describe", SqlDbType.NVarChar,1000),
106
+                    new SqlParameter("@F_UserId", SqlDbType.Int,4),
107
+                    new SqlParameter("@F_InterceptNum", SqlDbType.Int,4),
108
+                    new SqlParameter("@F_IsDelete", SqlDbType.Bit,1),
109
+                    //new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
110
+                    new SqlParameter("@F_BlackId", SqlDbType.Int,4)};
111
+            parameters[0].Value = model.F_CallId;
112
+            parameters[1].Value = model.F_TelPhone;
113
+            parameters[2].Value = model.F_BlackType;
114
+            parameters[3].Value = model.F_SetTime;
115
+            parameters[4].Value = model.F_RemoveTime;
116
+            parameters[5].Value = model.F_Describe;
117
+            parameters[6].Value = model.F_UserId;
118
+            parameters[7].Value = model.F_InterceptNum;
119
+            parameters[8].Value = model.F_IsDelete;
120
+            //parameters[9].Value = model.F_CreateTime;
121
+            parameters[9].Value = model.F_BlackId;
122
+
123
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
124
+            if (rows > 0)
125
+            {
126
+                return true;
127
+            }
128
+            else
129
+            {
130
+                return false;
131
+            }
132
+        }
133
+
134
+        /// <summary>
135
+        /// 删除一条数据
136
+        /// </summary>
137
+        public bool Delete(int F_BlackId)
138
+        {
139
+
140
+            StringBuilder strSql = new StringBuilder();
141
+            strSql.Append("delete from T_Call_Blacklist ");
142
+            strSql.Append(" where F_BlackId=@F_BlackId");
143
+            SqlParameter[] parameters = {
144
+                    new SqlParameter("@F_BlackId", SqlDbType.Int,4)
145
+            };
146
+            parameters[0].Value = F_BlackId;
147
+
148
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
149
+            if (rows > 0)
150
+            {
151
+                return true;
152
+            }
153
+            else
154
+            {
155
+                return false;
156
+            }
157
+        }
158
+        /// <summary>
159
+        /// 批量删除数据
160
+        /// </summary>
161
+        public bool DeleteList(string F_BlackIdlist)
162
+        {
163
+            StringBuilder strSql = new StringBuilder();
164
+            strSql.Append("delete from T_Call_Blacklist ");
165
+            strSql.Append(" where F_BlackId in (" + F_BlackIdlist + ")  ");
166
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
167
+            if (rows > 0)
168
+            {
169
+                return true;
170
+            }
171
+            else
172
+            {
173
+                return false;
174
+            }
175
+        }
176
+
177
+
178
+        /// <summary>
179
+        /// 得到一个对象实体
180
+        /// </summary>
181
+        public Model.T_Call_Blacklist GetModel(int F_BlackId)
182
+        {
183
+
184
+            StringBuilder strSql = new StringBuilder();
185
+            strSql.Append("select  top 1 F_BlackId,F_CallId,F_TelPhone,F_BlackType,F_SetTime,F_RemoveTime,F_Describe,F_UserId,F_InterceptNum,F_IsDelete,F_CreateTime from T_Call_Blacklist with(nolock)");
186
+            strSql.Append(" where F_BlackId=@F_BlackId");
187
+            SqlParameter[] parameters = {
188
+                    new SqlParameter("@F_BlackId", SqlDbType.Int,4)
189
+            };
190
+            parameters[0].Value = F_BlackId;
191
+
192
+            Model.T_Call_Blacklist model = new Model.T_Call_Blacklist();
193
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
194
+            if (ds.Tables[0].Rows.Count > 0)
195
+            {
196
+                return DataRowToModel(ds.Tables[0].Rows[0]);
197
+            }
198
+            else
199
+            {
200
+                return null;
201
+            }
202
+        }
203
+
204
+
205
+        /// <summary>
206
+        /// 得到一个对象实体
207
+        /// </summary>
208
+        public Model.T_Call_Blacklist DataRowToModel(DataRow row)
209
+        {
210
+            Model.T_Call_Blacklist model = new Model.T_Call_Blacklist();
211
+            if (row != null)
212
+            {
213
+                if (row["F_BlackId"] != null && row["F_BlackId"].ToString() != "")
214
+                {
215
+                    model.F_BlackId = int.Parse(row["F_BlackId"].ToString());
216
+                }
217
+                if (row["F_CallId"] != null)
218
+                {
219
+                    model.F_CallId = row["F_CallId"].ToString();
220
+                }
221
+                if (row["F_TelPhone"] != null)
222
+                {
223
+                    model.F_TelPhone = row["F_TelPhone"].ToString();
224
+                }
225
+                if (row["F_BlackType"] != null && row["F_BlackType"].ToString() != "")
226
+                {
227
+                    model.F_BlackType = int.Parse(row["F_BlackType"].ToString());
228
+                }
229
+                if (row["F_SetTime"] != null && row["F_SetTime"].ToString() != "")
230
+                {
231
+                    model.F_SetTime = DateTime.Parse(row["F_SetTime"].ToString());
232
+                }
233
+                if (row["F_RemoveTime"] != null && row["F_RemoveTime"].ToString() != "")
234
+                {
235
+                    model.F_RemoveTime = DateTime.Parse(row["F_RemoveTime"].ToString());
236
+                }
237
+                if (row["F_Describe"] != null)
238
+                {
239
+                    model.F_Describe = row["F_Describe"].ToString();
240
+                }
241
+                if (row["F_UserId"] != null && row["F_UserId"].ToString() != "")
242
+                {
243
+                    model.F_UserId = int.Parse(row["F_UserId"].ToString());
244
+                }
245
+                if (row["F_InterceptNum"] != null && row["F_InterceptNum"].ToString() != "")
246
+                {
247
+                    model.F_InterceptNum = int.Parse(row["F_InterceptNum"].ToString());
248
+                }
249
+                if (row["F_IsDelete"] != null && row["F_IsDelete"].ToString() != "")
250
+                {
251
+                    if ((row["F_IsDelete"].ToString() == "1") || (row["F_IsDelete"].ToString().ToLower() == "true"))
252
+                    {
253
+                        model.F_IsDelete = true;
254
+                    }
255
+                    else
256
+                    {
257
+                        model.F_IsDelete = false;
258
+                    }
259
+                }
260
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
261
+                {
262
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
263
+                }
264
+            }
265
+            return model;
266
+        }
267
+
268
+        /// <summary>
269
+        /// 获得数据列表
270
+        /// </summary>
271
+        public DataSet GetList(string strWhere)
272
+        {
273
+            StringBuilder strSql = new StringBuilder();
274
+            strSql.Append("select F_BlackId,F_CallId,F_TelPhone,F_BlackType,F_SetTime,F_RemoveTime,F_Describe,F_UserId,F_InterceptNum,F_IsDelete,F_CreateTime ");
275
+            strSql.Append(" FROM T_Call_Blacklist with(nolock)");
276
+            if (strWhere.Trim() != "")
277
+            {
278
+                strSql.Append(" where " + strWhere);
279
+            }
280
+            return DbHelperSQL.Query(strSql.ToString());
281
+        }
282
+
283
+        /// <summary>
284
+        /// 获得前几行数据
285
+        /// </summary>
286
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
287
+        {
288
+            StringBuilder strSql = new StringBuilder();
289
+            strSql.Append("select ");
290
+            if (Top > 0)
291
+            {
292
+                strSql.Append(" top " + Top.ToString());
293
+            }
294
+            strSql.Append(" F_BlackId,F_CallId,F_TelPhone,F_BlackType,F_SetTime,F_RemoveTime,F_Describe,F_UserId,F_InterceptNum,F_IsDelete,F_CreateTime ");
295
+            strSql.Append(" FROM T_Call_Blacklist with(nolock)");
296
+            if (strWhere.Trim() != "")
297
+            {
298
+                strSql.Append(" where " + strWhere);
299
+            }
300
+            strSql.Append(" order by " + filedOrder);
301
+            return DbHelperSQL.Query(strSql.ToString());
302
+        }
303
+
304
+        /// <summary>
305
+        /// 获取记录总数
306
+        /// </summary>
307
+        public int GetRecordCount(string strWhere)
308
+        {
309
+            StringBuilder strSql = new StringBuilder();
310
+            strSql.Append("select count(1) FROM T_Call_Blacklist with(nolock)");
311
+            if (strWhere.Trim() != "")
312
+            {
313
+                strSql.Append(" where " + strWhere);
314
+            }
315
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
316
+            if (obj == null)
317
+            {
318
+                return 0;
319
+            }
320
+            else
321
+            {
322
+                return Convert.ToInt32(obj);
323
+            }
324
+        }
325
+
326
+        #endregion  BasicMethod
327
+    }
328
+}

Plik diff jest za duży
+ 965 - 0
RMYY_CallCenter_Api.Dal/T_Call_CallRecords.cs


+ 372 - 0
RMYY_CallCenter_Api.Dal/T_Call_LeaveRecord.cs

@@ -0,0 +1,372 @@
1
+using System;
2
+using System.Data;
3
+using System.Text;
4
+using System.Data.SqlClient;
5
+using RMYY_CallCenter_Api.DB;
6
+
7
+namespace RMYY_CallCenter_Api.Dal
8
+{
9
+    /// <summary>
10
+    /// 数据访问类:T_Call_LeaveRecord
11
+    /// </summary>
12
+    public partial class T_Call_LeaveRecord
13
+    {
14
+        public T_Call_LeaveRecord()
15
+        { }
16
+        #region  BasicMethod
17
+        /// <summary>
18
+        /// 是否存在该记录
19
+        /// </summary>
20
+        public bool Exists(int F_Id)
21
+        {
22
+            StringBuilder strSql = new StringBuilder();
23
+            strSql.Append("select count(1) from T_Call_LeaveRecord with(nolock)");
24
+            strSql.Append(" where F_Id=@F_Id");
25
+            SqlParameter[] parameters = {
26
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
27
+            };
28
+            parameters[0].Value = F_Id;
29
+
30
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
31
+        }
32
+
33
+
34
+        /// <summary>
35
+        /// 增加一条数据
36
+        /// </summary>
37
+        public int Add(Model.T_Call_LeaveRecord model)
38
+        {
39
+            StringBuilder strSql = new StringBuilder();
40
+            strSql.Append("insert into T_Call_LeaveRecord(");
41
+            strSql.Append("F_CallId,F_Phone,F_LeaveTime,F_Status,F_UserId,F_UserCode,F_UserName,F_DealTime,F_DealContent,F_Remark,F_CallAppId,F_RecFileUrl,F_StartTime,F_EndTime,F_LongTime,F_WorkOrderId)");
42
+            strSql.Append(" values (");
43
+            strSql.Append("@F_CallId,@F_Phone,@F_LeaveTime,@F_Status,@F_UserId,@F_UserCode,@F_UserName,@F_DealTime,@F_DealContent,@F_Remark,@F_CallAppId,@F_RecFileUrl,@F_StartTime,@F_EndTime,@F_LongTime,@F_WorkOrderId)");
44
+            strSql.Append(";select @@IDENTITY");
45
+            SqlParameter[] parameters = {
46
+                    new SqlParameter("@F_CallId", SqlDbType.VarChar,50),
47
+                    new SqlParameter("@F_Phone", SqlDbType.VarChar,50),
48
+                    new SqlParameter("@F_LeaveTime", SqlDbType.DateTime),
49
+                    new SqlParameter("@F_Status", SqlDbType.Int,4),
50
+                    new SqlParameter("@F_UserId", SqlDbType.Int,4),
51
+                    new SqlParameter("@F_UserCode", SqlDbType.NVarChar,20),
52
+                    new SqlParameter("@F_UserName", SqlDbType.NVarChar,20),
53
+                    new SqlParameter("@F_DealTime", SqlDbType.DateTime),
54
+                    new SqlParameter("@F_DealContent", SqlDbType.NText),
55
+                    new SqlParameter("@F_Remark", SqlDbType.NText),
56
+                    new SqlParameter("@F_CallAppId", SqlDbType.NVarChar,50),
57
+                    new SqlParameter("@F_RecFileUrl", SqlDbType.NVarChar,50),
58
+                    new SqlParameter("@F_StartTime", SqlDbType.DateTime),
59
+                    new SqlParameter("@F_EndTime", SqlDbType.DateTime),
60
+                    new SqlParameter("@F_LongTime", SqlDbType.Int,4),
61
+                    new SqlParameter("@F_WorkOrderId", SqlDbType.VarChar,50)};
62
+            parameters[0].Value = model.F_CallId;
63
+            parameters[1].Value = model.F_Phone;
64
+            parameters[2].Value = model.F_LeaveTime;
65
+            parameters[3].Value = model.F_Status;
66
+            parameters[4].Value = model.F_UserId;
67
+            parameters[5].Value = model.F_UserCode;
68
+            parameters[6].Value = model.F_UserName;
69
+            parameters[7].Value = model.F_DealTime;
70
+            parameters[8].Value = model.F_DealContent;
71
+            parameters[9].Value = model.F_Remark;
72
+            parameters[10].Value = model.F_CallAppId;
73
+            parameters[11].Value = model.F_RecFileUrl;
74
+            parameters[12].Value = model.F_StartTime;
75
+            parameters[13].Value = model.F_EndTime;
76
+            parameters[14].Value = model.F_LongTime;
77
+            parameters[15].Value = model.F_WorkOrderId;
78
+
79
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
80
+            if (obj == null)
81
+            {
82
+                return 0;
83
+            }
84
+            else
85
+            {
86
+                return Convert.ToInt32(obj);
87
+            }
88
+        }
89
+        /// <summary>
90
+        /// 更新一条数据
91
+        /// </summary>
92
+        public bool Update(Model.T_Call_LeaveRecord model)
93
+        {
94
+            StringBuilder strSql = new StringBuilder();
95
+            strSql.Append("update T_Call_LeaveRecord set ");
96
+            strSql.Append("F_CallId=@F_CallId,");
97
+            strSql.Append("F_Phone=@F_Phone,");
98
+            strSql.Append("F_LeaveTime=@F_LeaveTime,");
99
+            strSql.Append("F_Status=@F_Status,");
100
+            strSql.Append("F_UserId=@F_UserId,");
101
+            strSql.Append("F_UserCode=@F_UserCode,");
102
+            strSql.Append("F_UserName=@F_UserName,");
103
+            strSql.Append("F_DealTime=@F_DealTime,");
104
+            strSql.Append("F_DealContent=@F_DealContent,");
105
+            strSql.Append("F_Remark=@F_Remark,");
106
+            strSql.Append("F_CallAppId=@F_CallAppId,");
107
+            strSql.Append("F_RecFileUrl=@F_RecFileUrl,");
108
+            strSql.Append("F_StartTime=@F_StartTime,");
109
+            strSql.Append("F_EndTime=@F_EndTime,");
110
+            strSql.Append("F_LongTime=@F_LongTime,");
111
+            strSql.Append("F_WorkOrderId=@F_WorkOrderId");
112
+            strSql.Append(" where F_Id=@F_Id");
113
+            SqlParameter[] parameters = {
114
+                    new SqlParameter("@F_CallId", SqlDbType.VarChar,50),
115
+                    new SqlParameter("@F_Phone", SqlDbType.VarChar,50),
116
+                    new SqlParameter("@F_LeaveTime", SqlDbType.DateTime),
117
+                    new SqlParameter("@F_Status", SqlDbType.Int,4),
118
+                    new SqlParameter("@F_UserId", SqlDbType.Int,4),
119
+                    new SqlParameter("@F_UserCode", SqlDbType.NVarChar,20),
120
+                    new SqlParameter("@F_UserName", SqlDbType.NVarChar,20),
121
+                    new SqlParameter("@F_DealTime", SqlDbType.DateTime),
122
+                    new SqlParameter("@F_DealContent", SqlDbType.NText),
123
+                    new SqlParameter("@F_Remark", SqlDbType.NText),
124
+                    new SqlParameter("@F_CallAppId", SqlDbType.NVarChar,50),
125
+                    new SqlParameter("@F_RecFileUrl", SqlDbType.NVarChar,50),
126
+                    new SqlParameter("@F_StartTime", SqlDbType.DateTime),
127
+                    new SqlParameter("@F_EndTime", SqlDbType.DateTime),
128
+                    new SqlParameter("@F_LongTime", SqlDbType.Int,4),
129
+                    new SqlParameter("@F_WorkOrderId", SqlDbType.VarChar,50),
130
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
131
+            parameters[0].Value = model.F_CallId;
132
+            parameters[1].Value = model.F_Phone;
133
+            parameters[2].Value = model.F_LeaveTime;
134
+            parameters[3].Value = model.F_Status;
135
+            parameters[4].Value = model.F_UserId;
136
+            parameters[5].Value = model.F_UserCode;
137
+            parameters[6].Value = model.F_UserName;
138
+            parameters[7].Value = model.F_DealTime;
139
+            parameters[8].Value = model.F_DealContent;
140
+            parameters[9].Value = model.F_Remark;
141
+            parameters[10].Value = model.F_CallAppId;
142
+            parameters[11].Value = model.F_RecFileUrl;
143
+            parameters[12].Value = model.F_StartTime;
144
+            parameters[13].Value = model.F_EndTime;
145
+            parameters[14].Value = model.F_LongTime;
146
+            parameters[15].Value = model.F_WorkOrderId;
147
+            parameters[16].Value = model.F_Id;
148
+
149
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
150
+            if (rows > 0)
151
+            {
152
+                return true;
153
+            }
154
+            else
155
+            {
156
+                return false;
157
+            }
158
+        }
159
+
160
+        /// <summary>
161
+        /// 删除一条数据
162
+        /// </summary>
163
+        public bool Delete(int F_Id)
164
+        {
165
+
166
+            StringBuilder strSql = new StringBuilder();
167
+            strSql.Append("delete from T_Call_LeaveRecord ");
168
+            strSql.Append(" where F_Id=@F_Id");
169
+            SqlParameter[] parameters = {
170
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
171
+            };
172
+            parameters[0].Value = F_Id;
173
+
174
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
175
+            if (rows > 0)
176
+            {
177
+                return true;
178
+            }
179
+            else
180
+            {
181
+                return false;
182
+            }
183
+        }
184
+        /// <summary>
185
+        /// 批量删除数据
186
+        /// </summary>
187
+        public bool DeleteList(string F_Idlist)
188
+        {
189
+            StringBuilder strSql = new StringBuilder();
190
+            strSql.Append("delete from T_Call_LeaveRecord ");
191
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
192
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
193
+            if (rows > 0)
194
+            {
195
+                return true;
196
+            }
197
+            else
198
+            {
199
+                return false;
200
+            }
201
+        }
202
+
203
+
204
+        /// <summary>
205
+        /// 得到一个对象实体
206
+        /// </summary>
207
+        public Model.T_Call_LeaveRecord GetModel(int F_Id)
208
+        {
209
+
210
+            StringBuilder strSql = new StringBuilder();
211
+            strSql.Append("select  top 1 F_Id,F_CallId,F_Phone,F_LeaveTime,F_Status,F_UserId,F_UserCode,F_UserName,F_DealTime,F_DealContent,F_Remark,F_CallAppId,F_RecFileUrl,F_StartTime,F_EndTime,F_LongTime,F_WorkOrderId from T_Call_LeaveRecord with(nolock)");
212
+            strSql.Append(" where F_Id=@F_Id");
213
+            SqlParameter[] parameters = {
214
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
215
+            };
216
+            parameters[0].Value = F_Id;
217
+
218
+            Model.T_Call_LeaveRecord model = new Model.T_Call_LeaveRecord();
219
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
220
+            if (ds.Tables[0].Rows.Count > 0)
221
+            {
222
+                return DataRowToModel(ds.Tables[0].Rows[0]);
223
+            }
224
+            else
225
+            {
226
+                return null;
227
+            }
228
+        }
229
+
230
+
231
+        /// <summary>
232
+        /// 得到一个对象实体
233
+        /// </summary>
234
+        public Model.T_Call_LeaveRecord DataRowToModel(DataRow row)
235
+        {
236
+            Model.T_Call_LeaveRecord model = new Model.T_Call_LeaveRecord();
237
+            if (row != null)
238
+            {
239
+                if (row["F_Id"] != null && row["F_Id"].ToString() != "")
240
+                {
241
+                    model.F_Id = int.Parse(row["F_Id"].ToString());
242
+                }
243
+                if (row["F_CallId"] != null)
244
+                {
245
+                    model.F_CallId = row["F_CallId"].ToString();
246
+                }
247
+                if (row["F_Phone"] != null)
248
+                {
249
+                    model.F_Phone = row["F_Phone"].ToString();
250
+                }
251
+                if (row["F_LeaveTime"] != null && row["F_LeaveTime"].ToString() != "")
252
+                {
253
+                    model.F_LeaveTime = DateTime.Parse(row["F_LeaveTime"].ToString());
254
+                }
255
+                if (row["F_Status"] != null && row["F_Status"].ToString() != "")
256
+                {
257
+                    model.F_Status = int.Parse(row["F_Status"].ToString());
258
+                }
259
+                if (row["F_UserId"] != null && row["F_UserId"].ToString() != "")
260
+                {
261
+                    model.F_UserId = int.Parse(row["F_UserId"].ToString());
262
+                }
263
+                if (row["F_UserCode"] != null)
264
+                {
265
+                    model.F_UserCode = row["F_UserCode"].ToString();
266
+                }
267
+                if (row["F_UserName"] != null)
268
+                {
269
+                    model.F_UserName = row["F_UserName"].ToString();
270
+                }
271
+                if (row["F_DealTime"] != null && row["F_DealTime"].ToString() != "")
272
+                {
273
+                    model.F_DealTime = DateTime.Parse(row["F_DealTime"].ToString());
274
+                }
275
+                if (row["F_DealContent"] != null)
276
+                {
277
+                    model.F_DealContent = row["F_DealContent"].ToString();
278
+                }
279
+                if (row["F_Remark"] != null)
280
+                {
281
+                    model.F_Remark = row["F_Remark"].ToString();
282
+                }
283
+                if (row["F_CallAppId"] != null)
284
+                {
285
+                    model.F_CallAppId = row["F_CallAppId"].ToString();
286
+                }
287
+                if (row["F_RecFileUrl"] != null)
288
+                {
289
+                    model.F_RecFileUrl = row["F_RecFileUrl"].ToString();
290
+                }
291
+                if (row["F_StartTime"] != null && row["F_StartTime"].ToString() != "")
292
+                {
293
+                    model.F_StartTime = DateTime.Parse(row["F_StartTime"].ToString());
294
+                }
295
+                if (row["F_EndTime"] != null && row["F_EndTime"].ToString() != "")
296
+                {
297
+                    model.F_EndTime = DateTime.Parse(row["F_EndTime"].ToString());
298
+                }
299
+                if (row["F_LongTime"] != null && row["F_LongTime"].ToString() != "")
300
+                {
301
+                    model.F_LongTime = int.Parse(row["F_LongTime"].ToString());
302
+                }
303
+                if (row["F_WorkOrderId"] != null)
304
+                {
305
+                    model.F_WorkOrderId = row["F_WorkOrderId"].ToString();
306
+                }
307
+            }
308
+            return model;
309
+        }
310
+
311
+        /// <summary>
312
+        /// 获得数据列表
313
+        /// </summary>
314
+        public DataSet GetList(string strWhere)
315
+        {
316
+            StringBuilder strSql = new StringBuilder();
317
+            strSql.Append("select F_Id,F_CallId,F_Phone,F_LeaveTime,F_Status,F_UserId,F_UserCode,F_UserName,F_DealTime,F_DealContent,F_Remark,F_CallAppId,F_RecFileUrl,F_StartTime,F_EndTime,F_LongTime,F_WorkOrderId ");
318
+            strSql.Append(" FROM T_Call_LeaveRecord with(nolock)");
319
+            if (strWhere.Trim() != "")
320
+            {
321
+                strSql.Append(" where " + strWhere);
322
+            }
323
+            return DbHelperSQL.Query(strSql.ToString());
324
+        }
325
+
326
+        /// <summary>
327
+        /// 获得前几行数据
328
+        /// </summary>
329
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
330
+        {
331
+            StringBuilder strSql = new StringBuilder();
332
+            strSql.Append("select ");
333
+            if (Top > 0)
334
+            {
335
+                strSql.Append(" top " + Top.ToString());
336
+            }
337
+            strSql.Append(" F_Id,F_CallId,F_Phone,F_LeaveTime,F_Status,F_UserId,F_UserCode,F_UserName,F_DealTime,F_DealContent,F_Remark,F_CallAppId,F_RecFileUrl,F_StartTime,F_EndTime,F_LongTime,F_WorkOrderId ");
338
+            strSql.Append(" FROM T_Call_LeaveRecord with(nolock)");
339
+            if (strWhere.Trim() != "")
340
+            {
341
+                strSql.Append(" where " + strWhere);
342
+            }
343
+            strSql.Append(" order by " + filedOrder);
344
+            return DbHelperSQL.Query(strSql.ToString());
345
+        }
346
+
347
+        /// <summary>
348
+        /// 获取记录总数
349
+        /// </summary>
350
+        public int GetRecordCount(string strWhere)
351
+        {
352
+            StringBuilder strSql = new StringBuilder();
353
+            strSql.Append("select count(1) FROM T_Call_LeaveRecord with(nolock)");
354
+            if (strWhere.Trim() != "")
355
+            {
356
+                strSql.Append(" where " + strWhere);
357
+            }
358
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
359
+            if (obj == null)
360
+            {
361
+                return 0;
362
+            }
363
+            else
364
+            {
365
+                return Convert.ToInt32(obj);
366
+            }
367
+        }
368
+
369
+        #endregion  BasicMethod
370
+    }
371
+}
372
+

+ 1 - 1
RMYY_CallCenter_Api.Dal/T_Sys_Department.cs

@@ -20,7 +20,7 @@ namespace RMYY_CallCenter_Api.Dal
20 20
         public bool Exists(string F_DeptCode)
21 21
         {
22 22
             StringBuilder strSql = new StringBuilder();
23
-            strSql.Append("select count(1) from T_Sys_Department ");
23
+            strSql.Append("select count(1) from T_Sys_Department with(nolock)");
24 24
             strSql.Append(" where F_DeptCode=@F_DeptCode");
25 25
             SqlParameter[] parameters = {
26 26
                     new SqlParameter("@F_DeptCode", SqlDbType.VarChar,50)

+ 327 - 0
RMYY_CallCenter_Api.Dal/T_Sys_MobileData.cs

@@ -0,0 +1,327 @@
1
+using System;
2
+using System.Data;
3
+using System.Text;
4
+using System.Data.SqlClient;
5
+using RMYY_CallCenter_Api.DB;
6
+
7
+namespace RMYY_CallCenter_Api.Dal
8
+{
9
+    /// <summary>
10
+    /// 数据访问类:T_Sys_MobileData
11
+    /// </summary>
12
+    public partial class T_Sys_MobileData
13
+    {
14
+        public T_Sys_MobileData()
15
+        { }
16
+        #region  BasicMethod
17
+        /// <summary>
18
+        /// 是否存在该记录
19
+        /// </summary>
20
+        public bool Exists(int F_Id)
21
+        {
22
+            StringBuilder strSql = new StringBuilder();
23
+            strSql.Append("select count(1) from T_Sys_MobileData with(nolock)");
24
+            strSql.Append(" where F_Id=@F_Id");
25
+            SqlParameter[] parameters = {
26
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
27
+            };
28
+            parameters[0].Value = F_Id;
29
+
30
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
31
+        }
32
+
33
+
34
+        /// <summary>
35
+        /// 增加一条数据
36
+        /// </summary>
37
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_MobileData model)
38
+        {
39
+            StringBuilder strSql = new StringBuilder();
40
+            strSql.Append("insert into T_Sys_MobileData(");
41
+            strSql.Append("F_MobileNum,F_ZipCode,F_CityDes,F_CardDes,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime)");
42
+            strSql.Append(" values (");
43
+            strSql.Append("@F_MobileNum,@F_ZipCode,@F_CityDes,@F_CardDes,@F_CreateUser,@F_CreateTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime)");
44
+            strSql.Append(";select @@IDENTITY");
45
+            SqlParameter[] parameters = {
46
+                    new SqlParameter("@F_MobileNum", SqlDbType.VarChar,20),
47
+                    new SqlParameter("@F_ZipCode", SqlDbType.VarChar,10),
48
+                    new SqlParameter("@F_CityDes", SqlDbType.VarChar,50),
49
+                    new SqlParameter("@F_CardDes", SqlDbType.VarChar,50),
50
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
51
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
52
+                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
53
+                    new SqlParameter("@F_DeleteUser", SqlDbType.VarChar,50),
54
+                    new SqlParameter("@F_DeleteTime", SqlDbType.DateTime)};
55
+            parameters[0].Value = model.F_MobileNum;
56
+            parameters[1].Value = model.F_ZipCode;
57
+            parameters[2].Value = model.F_CityDes;
58
+            parameters[3].Value = model.F_CardDes;
59
+            parameters[4].Value = model.F_CreateUser;
60
+            parameters[5].Value = model.F_CreateTime;
61
+            parameters[6].Value = model.F_IsDelete;
62
+            parameters[7].Value = model.F_DeleteUser;
63
+            parameters[8].Value = model.F_DeleteTime;
64
+
65
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
66
+            if (obj == null)
67
+            {
68
+                return 0;
69
+            }
70
+            else
71
+            {
72
+                return Convert.ToInt32(obj);
73
+            }
74
+        }
75
+        /// <summary>
76
+        /// 更新一条数据
77
+        /// </summary>
78
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_MobileData model)
79
+        {
80
+            StringBuilder strSql = new StringBuilder();
81
+            strSql.Append("update T_Sys_MobileData set ");
82
+            strSql.Append("F_MobileNum=@F_MobileNum,");
83
+            strSql.Append("F_ZipCode=@F_ZipCode,");
84
+            strSql.Append("F_CityDes=@F_CityDes,");
85
+            strSql.Append("F_CardDes=@F_CardDes,");
86
+            strSql.Append("F_CreateUser=@F_CreateUser,");
87
+            strSql.Append("F_CreateTime=@F_CreateTime,");
88
+            strSql.Append("F_IsDelete=@F_IsDelete,");
89
+            strSql.Append("F_DeleteUser=@F_DeleteUser,");
90
+            strSql.Append("F_DeleteTime=@F_DeleteTime");
91
+            strSql.Append(" where F_Id=@F_Id");
92
+            SqlParameter[] parameters = {
93
+                    new SqlParameter("@F_MobileNum", SqlDbType.VarChar,20),
94
+                    new SqlParameter("@F_ZipCode", SqlDbType.VarChar,10),
95
+                    new SqlParameter("@F_CityDes", SqlDbType.VarChar,50),
96
+                    new SqlParameter("@F_CardDes", SqlDbType.VarChar,50),
97
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
98
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
99
+                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
100
+                    new SqlParameter("@F_DeleteUser", SqlDbType.VarChar,50),
101
+                    new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
102
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
103
+            parameters[0].Value = model.F_MobileNum;
104
+            parameters[1].Value = model.F_ZipCode;
105
+            parameters[2].Value = model.F_CityDes;
106
+            parameters[3].Value = model.F_CardDes;
107
+            parameters[4].Value = model.F_CreateUser;
108
+            parameters[5].Value = model.F_CreateTime;
109
+            parameters[6].Value = model.F_IsDelete;
110
+            parameters[7].Value = model.F_DeleteUser;
111
+            parameters[8].Value = model.F_DeleteTime;
112
+            parameters[9].Value = model.F_Id;
113
+
114
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
115
+            if (rows > 0)
116
+            {
117
+                return true;
118
+            }
119
+            else
120
+            {
121
+                return false;
122
+            }
123
+        }
124
+
125
+        /// <summary>
126
+        /// 删除一条数据
127
+        /// </summary>
128
+        public bool Delete(int F_Id)
129
+        {
130
+
131
+            StringBuilder strSql = new StringBuilder();
132
+            strSql.Append("delete from T_Sys_MobileData ");
133
+            strSql.Append(" where F_Id=@F_Id");
134
+            SqlParameter[] parameters = {
135
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
136
+            };
137
+            parameters[0].Value = F_Id;
138
+
139
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
140
+            if (rows > 0)
141
+            {
142
+                return true;
143
+            }
144
+            else
145
+            {
146
+                return false;
147
+            }
148
+        }
149
+        /// <summary>
150
+        /// 批量删除数据
151
+        /// </summary>
152
+        public bool DeleteList(string F_Idlist)
153
+        {
154
+            StringBuilder strSql = new StringBuilder();
155
+            strSql.Append("delete from T_Sys_MobileData ");
156
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
157
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
158
+            if (rows > 0)
159
+            {
160
+                return true;
161
+            }
162
+            else
163
+            {
164
+                return false;
165
+            }
166
+        }
167
+
168
+        /// <summary>
169
+        /// 批量删除数据
170
+        /// </summary>
171
+        public bool DeleteList(string F_Idlist, string usercode)
172
+        {
173
+            StringBuilder strSql = new StringBuilder();
174
+            strSql.Append("update T_Sys_MobileData set F_IsDelete=1,F_DeleteUser='" + usercode + "',F_DeleteTime=getdate() ");
175
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
176
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
177
+            if (rows > 0)
178
+            {
179
+                return true;
180
+            }
181
+            else
182
+            {
183
+                return false;
184
+            }
185
+        }
186
+
187
+        /// <summary>
188
+        /// 得到一个对象实体
189
+        /// </summary>
190
+        public RMYY_CallCenter_Api.Model.T_Sys_MobileData GetModel(int F_Id)
191
+        {
192
+
193
+            StringBuilder strSql = new StringBuilder();
194
+            strSql.Append("select  top 1 F_Id,F_MobileNum,F_ZipCode,F_CityDes,F_CardDes,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime from T_Sys_MobileData ");
195
+            strSql.Append(" where F_Id=@F_Id");
196
+            SqlParameter[] parameters = {
197
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
198
+            };
199
+            parameters[0].Value = F_Id;
200
+
201
+            RMYY_CallCenter_Api.Model.T_Sys_MobileData model = new RMYY_CallCenter_Api.Model.T_Sys_MobileData();
202
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
203
+            if (ds.Tables[0].Rows.Count > 0)
204
+            {
205
+                return DataRowToModel(ds.Tables[0].Rows[0]);
206
+            }
207
+            else
208
+            {
209
+                return null;
210
+            }
211
+        }
212
+
213
+
214
+        /// <summary>
215
+        /// 得到一个对象实体
216
+        /// </summary>
217
+        public RMYY_CallCenter_Api.Model.T_Sys_MobileData DataRowToModel(DataRow row)
218
+        {
219
+            RMYY_CallCenter_Api.Model.T_Sys_MobileData model = new RMYY_CallCenter_Api.Model.T_Sys_MobileData();
220
+            if (row != null)
221
+            {
222
+                if (row["F_Id"] != null && row["F_Id"].ToString() != "")
223
+                {
224
+                    model.F_Id = int.Parse(row["F_Id"].ToString());
225
+                }
226
+                if (row["F_MobileNum"] != null)
227
+                {
228
+                    model.F_MobileNum = row["F_MobileNum"].ToString();
229
+                }
230
+                if (row["F_ZipCode"] != null)
231
+                {
232
+                    model.F_ZipCode = row["F_ZipCode"].ToString();
233
+                }
234
+                if (row["F_CityDes"] != null)
235
+                {
236
+                    model.F_CityDes = row["F_CityDes"].ToString();
237
+                }
238
+                if (row["F_CardDes"] != null)
239
+                {
240
+                    model.F_CardDes = row["F_CardDes"].ToString();
241
+                }
242
+                if (row["F_CreateUser"] != null)
243
+                {
244
+                    model.F_CreateUser = row["F_CreateUser"].ToString();
245
+                }
246
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
247
+                {
248
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
249
+                }
250
+                if (row["F_IsDelete"] != null && row["F_IsDelete"].ToString() != "")
251
+                {
252
+                    model.F_IsDelete = int.Parse(row["F_IsDelete"].ToString());
253
+                }
254
+                if (row["F_DeleteUser"] != null)
255
+                {
256
+                    model.F_DeleteUser = row["F_DeleteUser"].ToString();
257
+                }
258
+                if (row["F_DeleteTime"] != null && row["F_DeleteTime"].ToString() != "")
259
+                {
260
+                    model.F_DeleteTime = DateTime.Parse(row["F_DeleteTime"].ToString());
261
+                }
262
+            }
263
+            return model;
264
+        }
265
+
266
+        /// <summary>
267
+        /// 获得数据列表
268
+        /// </summary>
269
+        public DataSet GetList(string strWhere)
270
+        {
271
+            StringBuilder strSql = new StringBuilder();
272
+            strSql.Append("select F_Id,F_MobileNum,F_ZipCode,F_CityDes,F_CardDes,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime ");
273
+            strSql.Append(" FROM T_Sys_MobileData with(nolock)");
274
+            if (strWhere.Trim() != "")
275
+            {
276
+                strSql.Append(" where " + strWhere);
277
+            }
278
+            return DbHelperSQL.Query(strSql.ToString());
279
+        }
280
+
281
+        /// <summary>
282
+        /// 获得前几行数据
283
+        /// </summary>
284
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
285
+        {
286
+            StringBuilder strSql = new StringBuilder();
287
+            strSql.Append("select ");
288
+            if (Top > 0)
289
+            {
290
+                strSql.Append(" top " + Top.ToString());
291
+            }
292
+            strSql.Append(" F_Id,F_MobileNum,F_ZipCode,F_CityDes,F_CardDes,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime ");
293
+            strSql.Append(" FROM T_Sys_MobileData with(nolock)");
294
+            if (strWhere.Trim() != "")
295
+            {
296
+                strSql.Append(" where " + strWhere);
297
+            }
298
+            strSql.Append(" order by " + filedOrder);
299
+            return DbHelperSQL.Query(strSql.ToString());
300
+        }
301
+
302
+        /// <summary>
303
+        /// 获取记录总数
304
+        /// </summary>
305
+        public int GetRecordCount(string strWhere)
306
+        {
307
+            StringBuilder strSql = new StringBuilder();
308
+            strSql.Append("select count(1) FROM T_Sys_MobileData with(nolock)");
309
+            if (strWhere.Trim() != "")
310
+            {
311
+                strSql.Append(" where " + strWhere);
312
+            }
313
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
314
+            if (obj == null)
315
+            {
316
+                return 0;
317
+            }
318
+            else
319
+            {
320
+                return Convert.ToInt32(obj);
321
+            }
322
+        }
323
+
324
+        #endregion  BasicMethod
325
+    }
326
+}
327
+

+ 292 - 0
RMYY_CallCenter_Api.Dal/T_Sys_SystemConfig.cs

@@ -0,0 +1,292 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using RMYY_CallCenter_Api.DB;
6
+using System.Data;
7
+using System.Data.SqlClient;
8
+
9
+namespace RMYY_CallCenter_Api.Dal
10
+{
11
+    /// <summary>
12
+    /// 数据访问类:T_Sys_SystemConfig
13
+    /// </summary>
14
+    public partial class T_Sys_SystemConfig
15
+    {
16
+        public T_Sys_SystemConfig()
17
+        { }
18
+        #region  BasicMethod
19
+        /// <summary>
20
+        /// 是否存在该记录
21
+        /// </summary>
22
+        public bool Exists(int F_ParamId)
23
+        {
24
+            StringBuilder strSql = new StringBuilder();
25
+            strSql.Append("select count(1) from T_Sys_SystemConfig with(nolock)");
26
+            strSql.Append(" where F_ParamId=@F_ParamId");
27
+            SqlParameter[] parameters = {
28
+                    new SqlParameter("@F_ParamId", SqlDbType.Int,4)
29
+            };
30
+            parameters[0].Value = F_ParamId;
31
+
32
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
33
+        }
34
+
35
+
36
+        /// <summary>
37
+        /// 增加一条数据
38
+        /// </summary>
39
+        public int Add(Model.T_Sys_SystemConfig model)
40
+        {
41
+            StringBuilder strSql = new StringBuilder();
42
+            strSql.Append("insert into T_Sys_SystemConfig(");
43
+            strSql.Append("F_ParamCode,F_ParamValue,F_ParamDes,F_State)");
44
+            strSql.Append(" values (");
45
+            strSql.Append("@F_ParamCode,@F_ParamValue,@F_ParamDes,@F_State)");
46
+            strSql.Append(";select @@IDENTITY");
47
+            SqlParameter[] parameters = {
48
+                    new SqlParameter("@F_ParamCode", SqlDbType.VarChar,50),
49
+                    new SqlParameter("@F_ParamValue", SqlDbType.VarChar,100),
50
+                    new SqlParameter("@F_ParamDes", SqlDbType.VarChar,50),
51
+                    new SqlParameter("@F_State", SqlDbType.Int,4)};
52
+            parameters[0].Value = model.F_ParamCode;
53
+            parameters[1].Value = model.F_ParamValue;
54
+            parameters[2].Value = model.F_ParamDes;
55
+            parameters[3].Value = model.F_State;
56
+
57
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
58
+            if (obj == null)
59
+            {
60
+                return 0;
61
+            }
62
+            else
63
+            {
64
+                return Convert.ToInt32(obj);
65
+            }
66
+        }
67
+        /// <summary>
68
+        /// 更新一条数据
69
+        /// </summary>
70
+        public bool Update(Model.T_Sys_SystemConfig model)
71
+        {
72
+            StringBuilder strSql = new StringBuilder();
73
+            strSql.Append("update T_Sys_SystemConfig set ");
74
+            strSql.Append("F_ParamCode=@F_ParamCode,");
75
+            strSql.Append("F_ParamValue=@F_ParamValue,");
76
+            strSql.Append("F_ParamDes=@F_ParamDes,");
77
+            strSql.Append("F_State=@F_State");
78
+            strSql.Append(" where F_ParamId=@F_ParamId");
79
+            SqlParameter[] parameters = {
80
+                    new SqlParameter("@F_ParamCode", SqlDbType.VarChar,50),
81
+                    new SqlParameter("@F_ParamValue", SqlDbType.VarChar,100),
82
+                    new SqlParameter("@F_ParamDes", SqlDbType.VarChar,50),
83
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
84
+                    new SqlParameter("@F_ParamId", SqlDbType.Int,4)};
85
+            parameters[0].Value = model.F_ParamCode;
86
+            parameters[1].Value = model.F_ParamValue;
87
+            parameters[2].Value = model.F_ParamDes;
88
+            parameters[3].Value = model.F_State;
89
+            parameters[4].Value = model.F_ParamId;
90
+
91
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
92
+            if (rows > 0)
93
+            {
94
+                return true;
95
+            }
96
+            else
97
+            {
98
+                return false;
99
+            }
100
+        }
101
+
102
+        /// <summary>
103
+        /// 删除一条数据
104
+        /// </summary>
105
+        public bool Delete(int F_ParamId)
106
+        {
107
+
108
+            StringBuilder strSql = new StringBuilder();
109
+            strSql.Append("delete from T_Sys_SystemConfig ");
110
+            strSql.Append(" where F_ParamId=@F_ParamId");
111
+            SqlParameter[] parameters = {
112
+                    new SqlParameter("@F_ParamId", SqlDbType.Int,4)
113
+            };
114
+            parameters[0].Value = F_ParamId;
115
+
116
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
117
+            if (rows > 0)
118
+            {
119
+                return true;
120
+            }
121
+            else
122
+            {
123
+                return false;
124
+            }
125
+        }
126
+        /// <summary>
127
+        /// 批量删除数据
128
+        /// </summary>
129
+        public bool DeleteList(string F_ParamIdlist)
130
+        {
131
+            StringBuilder strSql = new StringBuilder();
132
+            strSql.Append("delete from T_Sys_SystemConfig ");
133
+            strSql.Append(" where F_ParamId in (" + F_ParamIdlist + ")  ");
134
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
135
+            if (rows > 0)
136
+            {
137
+                return true;
138
+            }
139
+            else
140
+            {
141
+                return false;
142
+            }
143
+        }
144
+
145
+
146
+        /// <summary>
147
+        /// 得到一个对象实体
148
+        /// </summary>
149
+        public Model.T_Sys_SystemConfig GetModel(int F_ParamId)
150
+        {
151
+
152
+            StringBuilder strSql = new StringBuilder();
153
+            strSql.Append("select  top 1 F_ParamId,F_ParamCode,F_ParamValue,F_ParamDes,F_State from T_Sys_SystemConfig WITH(NOLOCK) ");
154
+            strSql.Append(" where F_ParamId=@F_ParamId");
155
+            SqlParameter[] parameters = {
156
+                    new SqlParameter("@F_ParamId", SqlDbType.Int,4)
157
+            };
158
+            parameters[0].Value = F_ParamId;
159
+
160
+            Model.T_Sys_SystemConfig model = new Model.T_Sys_SystemConfig();
161
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
162
+            if (ds.Tables[0].Rows.Count > 0)
163
+            {
164
+                return DataRowToModel(ds.Tables[0].Rows[0]);
165
+            }
166
+            else
167
+            {
168
+                return null;
169
+            }
170
+        }
171
+
172
+
173
+        /// <summary>
174
+        /// 得到一个对象实体
175
+        /// </summary>
176
+        public Model.T_Sys_SystemConfig DataRowToModel(DataRow row)
177
+        {
178
+            Model.T_Sys_SystemConfig model = new Model.T_Sys_SystemConfig();
179
+            if (row != null)
180
+            {
181
+                if (row["F_ParamId"] != null && row["F_ParamId"].ToString() != "")
182
+                {
183
+                    model.F_ParamId = int.Parse(row["F_ParamId"].ToString());
184
+                }
185
+                if (row["F_ParamCode"] != null)
186
+                {
187
+                    model.F_ParamCode = row["F_ParamCode"].ToString();
188
+                }
189
+                if (row["F_ParamValue"] != null)
190
+                {
191
+                    model.F_ParamValue = row["F_ParamValue"].ToString();
192
+                }
193
+                if (row["F_ParamDes"] != null)
194
+                {
195
+                    model.F_ParamDes = row["F_ParamDes"].ToString();
196
+                }
197
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
198
+                {
199
+                    model.F_State = int.Parse(row["F_State"].ToString());
200
+                }
201
+            }
202
+            return model;
203
+        }
204
+
205
+        /// <summary>
206
+        /// 获得数据列表
207
+        /// </summary>
208
+        public DataSet GetList(string strWhere)
209
+        {
210
+            StringBuilder strSql = new StringBuilder();
211
+            strSql.Append("select F_ParamId,F_ParamCode,F_ParamValue,F_ParamDes,F_State ");
212
+            strSql.Append(" FROM T_Sys_SystemConfig WITH(NOLOCK) ");
213
+            if (strWhere.Trim() != "")
214
+            {
215
+                strSql.Append(" where " + strWhere);
216
+            }
217
+            return DbHelperSQL.Query(strSql.ToString());
218
+        }
219
+
220
+        /// <summary>
221
+        /// 获得前几行数据
222
+        /// </summary>
223
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
224
+        {
225
+            StringBuilder strSql = new StringBuilder();
226
+            strSql.Append("select ");
227
+            if (Top > 0)
228
+            {
229
+                strSql.Append(" top " + Top.ToString());
230
+            }
231
+            strSql.Append(" F_ParamId,F_ParamCode,F_ParamValue,F_ParamDes,F_State ");
232
+            strSql.Append(" FROM T_Sys_SystemConfig ");
233
+            if (strWhere.Trim() != "")
234
+            {
235
+                strSql.Append(" where " + strWhere);
236
+            }
237
+            strSql.Append(" order by " + filedOrder);
238
+            return DbHelperSQL.Query(strSql.ToString());
239
+        }
240
+
241
+        /// <summary>
242
+        /// 获取记录总数
243
+        /// </summary>
244
+        public int GetRecordCount(string strWhere)
245
+        {
246
+            StringBuilder strSql = new StringBuilder();
247
+            strSql.Append("select count(1) FROM T_Sys_SystemConfig WITH(NOLOCK) ");
248
+            if (strWhere.Trim() != "")
249
+            {
250
+                strSql.Append(" where " + strWhere);
251
+            }
252
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
253
+            if (obj == null)
254
+            {
255
+                return 0;
256
+            }
257
+            else
258
+            {
259
+                return Convert.ToInt32(obj);
260
+            }
261
+        }
262
+
263
+        #endregion  BasicMethod
264
+
265
+        /// <summary>
266
+        /// 根据编号获取值
267
+        /// </summary>
268
+        /// <param name="p_ParamCode">编号</param>
269
+        /// <returns></returns>
270
+        public string GetParamValueByParamCode(string p_ParamCode)
271
+        {
272
+            StringBuilder strSql = new StringBuilder();
273
+            strSql.Append("select  top 1 F_ParamValue from T_Sys_SystemConfig WITH(NOLOCK) ");
274
+            strSql.Append(" where F_ParamCode=@F_ParamCode");
275
+            SqlParameter[] parameters = {
276
+                    new SqlParameter("@F_ParamCode", SqlDbType.VarChar,50)
277
+};
278
+            parameters[0].Value = p_ParamCode;
279
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
280
+
281
+            if (obj == null)
282
+            {
283
+                return "";
284
+            }
285
+            else
286
+            {
287
+                return obj.ToString();
288
+            }
289
+
290
+        }
291
+    }
292
+}

+ 255 - 0
RMYY_CallCenter_Api.Dal/T_Sys_TelTitleData.cs

@@ -0,0 +1,255 @@
1
+using RMYY_CallCenter_Api.DB;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Data.SqlClient;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace RMYY_CallCenter_Api.Dal
11
+{
12
+    /// <summary>
13
+	/// 数据访问类:T_Sys_TelTitleData
14
+	/// </summary>
15
+	public partial class T_Sys_TelTitleData
16
+    {
17
+        public T_Sys_TelTitleData()
18
+        { }
19
+        #region  Method
20
+
21
+        /// <summary>
22
+        /// 是否存在该记录
23
+        /// </summary>
24
+        public bool Exists(int F_Id)
25
+        {
26
+            StringBuilder strSql = new StringBuilder();
27
+            strSql.Append("select count(1) from T_Sys_TelTitleData with(nolock)");
28
+            strSql.Append(" where F_Id=@F_Id");
29
+            SqlParameter[] parameters = {
30
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
31
+};
32
+            parameters[0].Value = F_Id;
33
+
34
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
35
+        }
36
+
37
+
38
+        /// <summary>
39
+        /// 增加一条数据
40
+        /// </summary>
41
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_TelTitleData model)
42
+        {
43
+            StringBuilder strSql = new StringBuilder();
44
+            strSql.Append("insert into T_Sys_TelTitleData(");
45
+            strSql.Append("F_TitleName,F_KeyPhoneNum,F_DefPhoneNumLen,F_WCode)");
46
+            strSql.Append(" values (");
47
+            strSql.Append("@F_TitleName,@F_KeyPhoneNum,@F_DefPhoneNumLen,@F_WCode)");
48
+            strSql.Append(";select @@IDENTITY");
49
+            SqlParameter[] parameters = {
50
+                    new SqlParameter("@F_TitleName", SqlDbType.VarChar,50),
51
+                    new SqlParameter("@F_KeyPhoneNum", SqlDbType.VarChar,10),
52
+                    new SqlParameter("@F_DefPhoneNumLen", SqlDbType.Int,4),
53
+                    new SqlParameter("@F_WCode", SqlDbType.VarChar,50)};
54
+            parameters[0].Value = model.F_TitleName;
55
+            parameters[1].Value = model.F_KeyPhoneNum;
56
+            parameters[2].Value = model.F_DefPhoneNumLen;
57
+            parameters[3].Value = model.F_WCode;
58
+
59
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
60
+            if (obj == null)
61
+            {
62
+                return 0;
63
+            }
64
+            else
65
+            {
66
+                return Convert.ToInt32(obj);
67
+            }
68
+        }
69
+        /// <summary>
70
+        /// 更新一条数据
71
+        /// </summary>
72
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_TelTitleData model)
73
+        {
74
+            StringBuilder strSql = new StringBuilder();
75
+            strSql.Append("update T_Sys_TelTitleData set ");
76
+            strSql.Append("F_TitleName=@F_TitleName,");
77
+            strSql.Append("F_KeyPhoneNum=@F_KeyPhoneNum,");
78
+            strSql.Append("F_DefPhoneNumLen=@F_DefPhoneNumLen,");
79
+            strSql.Append("F_WCode=@F_WCode");
80
+            strSql.Append(" where F_Id=@F_Id");
81
+            SqlParameter[] parameters = {
82
+                    new SqlParameter("@F_TitleName", SqlDbType.VarChar,50),
83
+                    new SqlParameter("@F_KeyPhoneNum", SqlDbType.VarChar,10),
84
+                    new SqlParameter("@F_DefPhoneNumLen", SqlDbType.Int,4),
85
+                    new SqlParameter("@F_WCode", SqlDbType.VarChar,50),
86
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
87
+            parameters[0].Value = model.F_TitleName;
88
+            parameters[1].Value = model.F_KeyPhoneNum;
89
+            parameters[2].Value = model.F_DefPhoneNumLen;
90
+            parameters[3].Value = model.F_WCode;
91
+            parameters[4].Value = model.F_Id;
92
+
93
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
94
+            if (rows > 0)
95
+            {
96
+                return true;
97
+            }
98
+            else
99
+            {
100
+                return false;
101
+            }
102
+        }
103
+
104
+        /// <summary>
105
+        /// 删除一条数据
106
+        /// </summary>
107
+        public bool Delete(int F_Id)
108
+        {
109
+
110
+            StringBuilder strSql = new StringBuilder();
111
+            strSql.Append("delete from T_Sys_TelTitleData ");
112
+            strSql.Append(" where F_Id=@F_Id");
113
+            SqlParameter[] parameters = {
114
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
115
+};
116
+            parameters[0].Value = F_Id;
117
+
118
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
119
+            if (rows > 0)
120
+            {
121
+                return true;
122
+            }
123
+            else
124
+            {
125
+                return false;
126
+            }
127
+        }
128
+        /// <summary>
129
+        /// 批量删除数据
130
+        /// </summary>
131
+        public bool DeleteList(string F_Idlist)
132
+        {
133
+            StringBuilder strSql = new StringBuilder();
134
+            strSql.Append("delete from T_Sys_TelTitleData ");
135
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
136
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
137
+            if (rows > 0)
138
+            {
139
+                return true;
140
+            }
141
+            else
142
+            {
143
+                return false;
144
+            }
145
+        }
146
+
147
+
148
+        /// <summary>
149
+        /// 得到一个对象实体
150
+        /// </summary>
151
+        public RMYY_CallCenter_Api.Model.T_Sys_TelTitleData GetModel(int F_Id)
152
+        {
153
+
154
+            StringBuilder strSql = new StringBuilder();
155
+            strSql.Append("select  top 1 F_Id,F_TitleName,F_KeyPhoneNum,F_DefPhoneNumLen,F_WCode from T_Sys_TelTitleData  with(nolock)");
156
+            strSql.Append(" where F_Id=@F_Id");
157
+            SqlParameter[] parameters = {
158
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
159
+};
160
+            parameters[0].Value = F_Id;
161
+
162
+            RMYY_CallCenter_Api.Model.T_Sys_TelTitleData model = new RMYY_CallCenter_Api.Model.T_Sys_TelTitleData();
163
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
164
+            if (ds.Tables[0].Rows.Count > 0)
165
+            {
166
+                if (ds.Tables[0].Rows[0]["F_Id"] != null && ds.Tables[0].Rows[0]["F_Id"].ToString() != "")
167
+                {
168
+                    model.F_Id = int.Parse(ds.Tables[0].Rows[0]["F_Id"].ToString());
169
+                }
170
+                if (ds.Tables[0].Rows[0]["F_TitleName"] != null && ds.Tables[0].Rows[0]["F_TitleName"].ToString() != "")
171
+                {
172
+                    model.F_TitleName = ds.Tables[0].Rows[0]["F_TitleName"].ToString();
173
+                }
174
+                if (ds.Tables[0].Rows[0]["F_KeyPhoneNum"] != null && ds.Tables[0].Rows[0]["F_KeyPhoneNum"].ToString() != "")
175
+                {
176
+                    model.F_KeyPhoneNum = ds.Tables[0].Rows[0]["F_KeyPhoneNum"].ToString();
177
+                }
178
+                if (ds.Tables[0].Rows[0]["F_DefPhoneNumLen"] != null && ds.Tables[0].Rows[0]["F_DefPhoneNumLen"].ToString() != "")
179
+                {
180
+                    model.F_DefPhoneNumLen = int.Parse(ds.Tables[0].Rows[0]["F_DefPhoneNumLen"].ToString());
181
+                }
182
+                if (ds.Tables[0].Rows[0]["F_WCode"] != null && ds.Tables[0].Rows[0]["F_WCode"].ToString() != "")
183
+                {
184
+                    model.F_WCode = ds.Tables[0].Rows[0]["F_WCode"].ToString();
185
+                }
186
+                return model;
187
+            }
188
+            else
189
+            {
190
+                return null;
191
+            }
192
+        }
193
+
194
+        /// <summary>
195
+        /// 获得数据列表
196
+        /// </summary>
197
+        public DataSet GetList(string strWhere)
198
+        {
199
+            StringBuilder strSql = new StringBuilder();
200
+            strSql.Append("select F_Id,F_TitleName,F_KeyPhoneNum,F_DefPhoneNumLen,F_WCode ");
201
+            strSql.Append(" FROM T_Sys_TelTitleData with(nolock)");
202
+            if (strWhere.Trim() != "")
203
+            {
204
+                strSql.Append(" where " + strWhere);
205
+            }
206
+            return DbHelperSQL.Query(strSql.ToString());
207
+        }
208
+
209
+        /// <summary>
210
+        /// 获得前几行数据
211
+        /// </summary>
212
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
213
+        {
214
+            StringBuilder strSql = new StringBuilder();
215
+            strSql.Append("select ");
216
+            if (Top > 0)
217
+            {
218
+                strSql.Append(" top " + Top.ToString());
219
+            }
220
+            strSql.Append(" F_Id,F_TitleName,F_KeyPhoneNum,F_DefPhoneNumLen,F_WCode ");
221
+            strSql.Append(" FROM T_Sys_TelTitleData with(nolock)");
222
+            if (strWhere.Trim() != "")
223
+            {
224
+                strSql.Append(" where " + strWhere);
225
+            }
226
+            strSql.Append(" order by " + filedOrder);
227
+            return DbHelperSQL.Query(strSql.ToString());
228
+        }
229
+
230
+        /// <summary>
231
+        /// 获取记录总数
232
+        /// </summary>
233
+        public int GetRecordCount(string strWhere)
234
+        {
235
+            StringBuilder strSql = new StringBuilder();
236
+            strSql.Append("select count(1) FROM T_Sys_TelTitleData with(nolock)");
237
+            if (strWhere.Trim() != "")
238
+            {
239
+                strSql.Append(" where " + strWhere);
240
+            }
241
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
242
+            if (obj == null)
243
+            {
244
+                return 0;
245
+            }
246
+            else
247
+            {
248
+                return Convert.ToInt32(obj);
249
+            }
250
+        }
251
+
252
+
253
+        #endregion  Method
254
+    }
255
+}

+ 363 - 0
RMYY_CallCenter_Api.Dal/T_Sys_WorkOFFDays.cs

@@ -0,0 +1,363 @@
1
+using RMYY_CallCenter_Api.DB;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Data.SqlClient;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace RMYY_CallCenter_Api.Dal
11
+{
12
+    /// <summary>
13
+    /// 数据访问类:T_Sys_WorkOffDays
14
+    /// </summary>
15
+    public partial class T_Sys_WorkOffDays
16
+    {
17
+        public T_Sys_WorkOffDays()
18
+        { }
19
+        #region  Method
20
+
21
+
22
+        /// <summary>
23
+        /// 增加一条数据
24
+        /// </summary>
25
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
26
+        {
27
+            StringBuilder strSql = new StringBuilder();
28
+            strSql.Append("insert into T_Sys_WorkOffDays(");
29
+            strSql.Append("F_OffDate,F_OffState,F_remark,F_CreateBy,F_CreateOn,F_DeleteBy,F_DeleteOn)");
30
+            strSql.Append(" values (");
31
+            strSql.Append("@F_OffDate,@F_OffState,@F_remark,@F_CreateBy,@F_CreateOn,@F_DeleteBy,@F_DeleteOn)");
32
+            strSql.Append(";select @@IDENTITY");
33
+            SqlParameter[] parameters = {
34
+                    new SqlParameter("@F_OffDate", SqlDbType.Date,3),
35
+                    new SqlParameter("@F_OffState", SqlDbType.Int,4),
36
+                    new SqlParameter("@F_remark", SqlDbType.NVarChar,2000),
37
+                    new SqlParameter("@F_CreateBy", SqlDbType.NVarChar,50),
38
+                    new SqlParameter("@F_CreateOn", SqlDbType.DateTime),
39
+                    new SqlParameter("@F_DeleteBy", SqlDbType.NVarChar,50),
40
+                    new SqlParameter("@F_DeleteOn", SqlDbType.DateTime)};
41
+            parameters[0].Value = model.F_OffDate;
42
+            parameters[1].Value = model.F_OffState;
43
+            parameters[2].Value = model.F_remark;
44
+            parameters[3].Value = model.F_CreateBy;
45
+            parameters[4].Value = model.F_CreateOn;
46
+            parameters[5].Value = model.F_DeleteBy;
47
+            parameters[6].Value = model.F_DeleteOn;
48
+
49
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
50
+            if (obj == null)
51
+            {
52
+                return 0;
53
+            }
54
+            else
55
+            {
56
+                return Convert.ToInt32(obj);
57
+            }
58
+        }
59
+        /// <summary>
60
+        /// 更新一条数据
61
+        /// </summary>
62
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
63
+        {
64
+            StringBuilder strSql = new StringBuilder();
65
+            strSql.Append("update T_Sys_WorkOffDays set ");
66
+            strSql.Append("F_OffDate=@F_OffDate,");
67
+            strSql.Append("F_OffState=@F_OffState,");
68
+            strSql.Append("F_remark=@F_remark,");
69
+            strSql.Append("F_CreateBy=@F_CreateBy,");
70
+            strSql.Append("F_CreateOn=@F_CreateOn,");
71
+            strSql.Append("F_DeleteBy=@F_DeleteBy,");
72
+            strSql.Append("F_DeleteOn=@F_DeleteOn");
73
+            strSql.Append(" where F_OffID=@F_OffID");
74
+            SqlParameter[] parameters = {
75
+                    new SqlParameter("@F_OffDate", SqlDbType.Date,3),
76
+                    new SqlParameter("@F_OffState", SqlDbType.Int,4),
77
+                    new SqlParameter("@F_remark", SqlDbType.NVarChar,2000),
78
+                    new SqlParameter("@F_CreateBy", SqlDbType.NVarChar,50),
79
+                    new SqlParameter("@F_CreateOn", SqlDbType.DateTime),
80
+                    new SqlParameter("@F_DeleteBy", SqlDbType.NVarChar,50),
81
+                    new SqlParameter("@F_DeleteOn", SqlDbType.DateTime),
82
+                    new SqlParameter("@F_OffID", SqlDbType.Int,4)};
83
+            parameters[0].Value = model.F_OffDate;
84
+            parameters[1].Value = model.F_OffState;
85
+            parameters[2].Value = model.F_remark;
86
+            parameters[3].Value = model.F_CreateBy;
87
+            parameters[4].Value = model.F_CreateOn;
88
+            parameters[5].Value = model.F_DeleteBy;
89
+            parameters[6].Value = model.F_DeleteOn;
90
+            parameters[7].Value = model.F_OffID;
91
+
92
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
93
+            if (rows > 0)
94
+            {
95
+                return true;
96
+            }
97
+            else
98
+            {
99
+                return false;
100
+            }
101
+        }
102
+
103
+        /// <summary>
104
+        /// 更新一条数据
105
+        /// </summary>
106
+        public bool UpdateState(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
107
+        {
108
+            StringBuilder strSql = new StringBuilder();
109
+            strSql.Append("update T_Sys_WorkOffDays set ");
110
+            strSql.Append("F_OffState=@F_OffState,");
111
+            strSql.Append("F_remark=@F_remark,");
112
+            strSql.Append("F_DeleteBy=@F_DeleteBy,");
113
+            strSql.Append("F_DeleteOn=@F_DeleteOn");
114
+            strSql.Append(" where F_OffDate=@F_OffDate");
115
+            SqlParameter[] parameters = {
116
+                    
117
+                    new SqlParameter("@F_OffState", SqlDbType.Int,4),
118
+                    new SqlParameter("@F_remark", SqlDbType.NVarChar,2000),
119
+                    new SqlParameter("@F_DeleteBy", SqlDbType.NVarChar,50),
120
+                    new SqlParameter("@F_DeleteOn", SqlDbType.DateTime),
121
+                    new SqlParameter("@F_OffDate", SqlDbType.Date,3),};
122
+            
123
+            parameters[0].Value = model.F_OffState;
124
+            parameters[1].Value = model.F_remark;
125
+            parameters[2].Value = model.F_DeleteBy;
126
+            parameters[3].Value = model.F_DeleteOn;
127
+            parameters[4].Value = model.F_OffDate;
128
+
129
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
130
+            if (rows > 0)
131
+            {
132
+                return true;
133
+            }
134
+            else
135
+            {
136
+                return false;
137
+            }
138
+        }
139
+
140
+        /// <summary>
141
+        /// 删除一条数据
142
+        /// </summary>
143
+        public bool Delete(int F_OffID)
144
+        {
145
+
146
+            StringBuilder strSql = new StringBuilder();
147
+            strSql.Append("delete from T_Sys_WorkOffDays ");
148
+            strSql.Append(" where F_OffID=@F_OffID");
149
+            SqlParameter[] parameters = {
150
+                    new SqlParameter("@F_OffID", SqlDbType.Int,4)
151
+            };
152
+            parameters[0].Value = F_OffID;
153
+
154
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
155
+            if (rows > 0)
156
+            {
157
+                return true;
158
+            }
159
+            else
160
+            {
161
+                return false;
162
+            }
163
+        }
164
+        public bool DeleteByDate(string date,string usercode,DateTime nowdate)
165
+        {
166
+            StringBuilder strSql = new StringBuilder();
167
+            strSql.Append("update T_Sys_WorkOffDays set ");
168
+            strSql.Append("F_OffState=1,");
169
+            strSql.Append("F_DeleteBy=@F_DeleteBy,");
170
+            strSql.Append("F_DeleteOn=@F_DeleteOn");
171
+            strSql.Append(" where F_OffDate=@F_OffDate");
172
+            SqlParameter[] parameters = {
173
+                new SqlParameter("@F_DeleteBy", SqlDbType.NVarChar,50),
174
+                    new SqlParameter("@F_DeleteOn", SqlDbType.DateTime),
175
+                    new SqlParameter("@F_OffDate", SqlDbType.Date,3)
176
+            };
177
+            parameters[0].Value = usercode;
178
+            parameters[1].Value = nowdate;
179
+            parameters[2].Value = date;
180
+
181
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
182
+            if (rows > 0)
183
+            {
184
+                return true;
185
+            }
186
+            else
187
+            {
188
+                return false;
189
+            }
190
+        }
191
+        /// <summary>
192
+        /// 批量删除数据
193
+        /// </summary>
194
+        public bool DeleteList(string F_OffIDlist)
195
+        {
196
+            StringBuilder strSql = new StringBuilder();
197
+            strSql.Append("delete from T_Sys_WorkOffDays ");
198
+            strSql.Append(" where F_OffID in (" + F_OffIDlist + ")  ");
199
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
200
+            if (rows > 0)
201
+            {
202
+                return true;
203
+            }
204
+            else
205
+            {
206
+                return false;
207
+            }
208
+        }
209
+
210
+
211
+        /// <summary>
212
+        /// 得到一个对象实体
213
+        /// </summary>
214
+        public RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays GetModel(int F_OffID)
215
+        {
216
+
217
+            StringBuilder strSql = new StringBuilder();
218
+            strSql.Append("select  top 1 * from T_Sys_WorkOffDays with(nolock)");
219
+            strSql.Append(" where F_OffID=@F_OffID");
220
+            SqlParameter[] parameters = {
221
+                    new SqlParameter("@F_OffID", SqlDbType.Int,4)
222
+            };
223
+            parameters[0].Value = F_OffID;
224
+
225
+            RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model = new RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays();
226
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
227
+            if (ds.Tables[0].Rows.Count > 0)
228
+            {
229
+                model = DataRowToModel(ds.Tables[0].Rows[0]);
230
+                return model;
231
+            }
232
+            else
233
+            {
234
+                return null;
235
+            }
236
+        }
237
+
238
+        public RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays GetModel(string date)
239
+        {
240
+
241
+            StringBuilder strSql = new StringBuilder();
242
+            strSql.Append("select  top 1 * from T_Sys_WorkOffDays with(nolock)");
243
+            strSql.Append(" where F_OffDate=@F_OffDate");
244
+            SqlParameter[] parameters = {
245
+                    new SqlParameter("@F_OffDate", SqlDbType.Date,3)
246
+            };
247
+            parameters[0].Value = date;
248
+
249
+            RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model = new RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays();
250
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
251
+            if (ds.Tables[0].Rows.Count > 0)
252
+            {
253
+                model = DataRowToModel(ds.Tables[0].Rows[0]);
254
+                return model;
255
+            }
256
+            else
257
+            {
258
+                return null;
259
+            }
260
+        }
261
+
262
+        public Model.T_Sys_WorkOffDays DataRowToModel(DataRow row)
263
+        {
264
+            Model.T_Sys_WorkOffDays model = new Model.T_Sys_WorkOffDays();
265
+            if (row != null)
266
+            {
267
+                if (row["F_OffID"] != null && row["F_OffID"].ToString() != "")
268
+                {
269
+                    model.F_OffID = int.Parse(row["F_OffID"].ToString());
270
+                }
271
+                if (row["F_OffDate"] != null && row["F_OffDate"].ToString() != "")
272
+                {
273
+                    model.F_OffDate = DateTime.Parse(row["F_OffDate"].ToString());
274
+                }
275
+                if (row["F_OffState"] != null && row["F_OffState"].ToString() != "")
276
+                {
277
+                    model.F_OffState = int.Parse(row["F_OffState"].ToString());
278
+                }
279
+                if (row["F_remark"] != null && row["F_remark"].ToString() != "")
280
+                {
281
+                    model.F_remark = row["F_remark"].ToString();
282
+                }
283
+                if (row["F_CreateBy"] != null && row["F_CreateBy"].ToString() != "")
284
+                {
285
+                    model.F_CreateBy = row["F_CreateBy"].ToString();
286
+                }
287
+                if (row["F_CreateOn"] != null && row["F_CreateOn"].ToString() != "")
288
+                {
289
+                    model.F_CreateOn = DateTime.Parse(row["F_CreateOn"].ToString());
290
+                }
291
+                if (row["F_DeleteBy"] != null && row["F_DeleteBy"].ToString() != "")
292
+                {
293
+                    model.F_DeleteBy = row["F_DeleteBy"].ToString();
294
+                }
295
+                if (row["F_DeleteOn"] != null && row["F_DeleteOn"].ToString() != "")
296
+                {
297
+                    model.F_DeleteOn = DateTime.Parse(row["F_DeleteOn"].ToString());
298
+                }
299
+            }
300
+            return model;
301
+        }
302
+
303
+        /// <summary>
304
+        /// 获得数据列表
305
+        /// </summary>
306
+        public DataSet GetList(string strWhere)
307
+        {
308
+            StringBuilder strSql = new StringBuilder();
309
+            strSql.Append("select * ");
310
+            strSql.Append(" FROM T_Sys_WorkOffDays with(nolock)");
311
+            if (strWhere.Trim() != "")
312
+            {
313
+                strSql.Append(" where " + strWhere);
314
+            }
315
+            return DbHelperSQL.Query(strSql.ToString());
316
+        }
317
+
318
+        /// <summary>
319
+        /// 获得前几行数据
320
+        /// </summary>
321
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
322
+        {
323
+            StringBuilder strSql = new StringBuilder();
324
+            strSql.Append("select ");
325
+            if (Top > 0)
326
+            {
327
+                strSql.Append(" top " + Top.ToString());
328
+            }
329
+            strSql.Append(" * ");
330
+            strSql.Append(" FROM T_Sys_WorkOffDays with(nolock)");
331
+            if (strWhere.Trim() != "")
332
+            {
333
+                strSql.Append(" where " + strWhere);
334
+            }
335
+            strSql.Append(" order by " + filedOrder);
336
+            return DbHelperSQL.Query(strSql.ToString());
337
+        }
338
+
339
+        /// <summary>
340
+        /// 获取记录总数
341
+        /// </summary>
342
+        public int GetRecordCount(string strWhere)
343
+        {
344
+            StringBuilder strSql = new StringBuilder();
345
+            strSql.Append("select count(1) FROM T_Sys_WorkOffDays with(nolock)");
346
+            if (strWhere.Trim() != "")
347
+            {
348
+                strSql.Append(" where " + strWhere);
349
+            }
350
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
351
+            if (obj == null)
352
+            {
353
+                return 0;
354
+            }
355
+            else
356
+            {
357
+                return Convert.ToInt32(obj);
358
+            }
359
+        }
360
+
361
+        #endregion  Method
362
+    }
363
+}

+ 7 - 0
RMYY_CallCenter_Api.Model/RMYY_CallCenter_Api.Model.csproj

@@ -41,15 +41,22 @@
41 41
     <Reference Include="System.Xml" />
42 42
   </ItemGroup>
43 43
   <ItemGroup>
44
+    <Compile Include="T_Call_Blacklist.cs" />
45
+    <Compile Include="T_Call_CallRecords.cs" />
46
+    <Compile Include="T_Call_LeaveRecord.cs" />
44 47
     <Compile Include="T_Sys_Department.cs" />
45 48
     <Compile Include="T_Sys_DictionaryBase.cs" />
46 49
     <Compile Include="T_Sys_DictionaryValue.cs" />
47 50
     <Compile Include="T_Sys_GongDan.cs" />
48 51
     <Compile Include="T_Sys_GongDanType.cs" />
49 52
     <Compile Include="T_Sys_Menu.cs" />
53
+    <Compile Include="T_Sys_MobileData.cs" />
50 54
     <Compile Include="T_Sys_Role.cs" />
55
+    <Compile Include="T_Sys_SystemConfig.cs" />
56
+    <Compile Include="T_Sys_TelTitleData.cs" />
51 57
     <Compile Include="T_Sys_UserAccount.cs" />
52 58
     <Compile Include="Properties\AssemblyInfo.cs" />
59
+    <Compile Include="T_Sys_WorkOffDays.cs" />
53 60
   </ItemGroup>
54 61
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
55 62
 </Project>

+ 119 - 0
RMYY_CallCenter_Api.Model/T_Call_Blacklist.cs

@@ -0,0 +1,119 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace RMYY_CallCenter_Api.Model
8
+{
9
+    /// <summary>
10
+	/// 黑名单表
11
+	/// </summary>
12
+	[Serializable]
13
+    public partial class T_Call_Blacklist
14
+    {
15
+        public T_Call_Blacklist()
16
+        { }
17
+        #region Model
18
+        private int _f_blackid;
19
+        private string _f_callid;
20
+        private string _f_telphone;
21
+        private int? _f_blacktype;
22
+        private DateTime? _f_settime;
23
+        private DateTime? _f_removetime;
24
+        private string _f_describe;
25
+        private int? _f_userid;
26
+        private int? _f_interceptnum = 0;
27
+        private bool _f_isdelete = false;
28
+        private DateTime? _f_createtime = DateTime.Now;
29
+        /// <summary>
30
+        /// 黑名单id,自增
31
+        /// </summary>
32
+        public int F_BlackId
33
+        {
34
+            set { _f_blackid = value; }
35
+            get { return _f_blackid; }
36
+        }
37
+        /// <summary>
38
+        /// 通话记录id
39
+        /// </summary>
40
+        public string F_CallId
41
+        {
42
+            set { _f_callid = value; }
43
+            get { return _f_callid; }
44
+        }
45
+        /// <summary>
46
+        /// 电话
47
+        /// </summary>
48
+        public string F_TelPhone
49
+        {
50
+            set { _f_telphone = value; }
51
+            get { return _f_telphone; }
52
+        }
53
+        /// <summary>
54
+        /// 黑白名单(1黑名单,2白名单)///////////////黑名单类型(0:暂时,1:永久,2:已取消)
55
+        /// </summary>
56
+        public int? F_BlackType
57
+        {
58
+            set { _f_blacktype = value; }
59
+            get { return _f_blacktype; }
60
+        }
61
+        /// <summary>
62
+        /// 设置时间
63
+        /// </summary>
64
+        public DateTime? F_SetTime
65
+        {
66
+            set { _f_settime = value; }
67
+            get { return _f_settime; }
68
+        }
69
+        /// <summary>
70
+        /// 解除时间
71
+        /// </summary>
72
+        public DateTime? F_RemoveTime
73
+        {
74
+            set { _f_removetime = value; }
75
+            get { return _f_removetime; }
76
+        }
77
+        /// <summary>
78
+        /// 说明
79
+        /// </summary>
80
+        public string F_Describe
81
+        {
82
+            set { _f_describe = value; }
83
+            get { return _f_describe; }
84
+        }
85
+        /// <summary>
86
+        /// 
87
+        /// </summary>
88
+        public int? F_UserId
89
+        {
90
+            set { _f_userid = value; }
91
+            get { return _f_userid; }
92
+        }
93
+        /// <summary>
94
+        /// 拦截次数
95
+        /// </summary>
96
+        public int? F_InterceptNum
97
+        {
98
+            set { _f_interceptnum = value; }
99
+            get { return _f_interceptnum; }
100
+        }
101
+        /// <summary>
102
+        /// 
103
+        /// </summary>
104
+        public bool F_IsDelete
105
+        {
106
+            set { _f_isdelete = value; }
107
+            get { return _f_isdelete; }
108
+        }
109
+        /// <summary>
110
+        /// 
111
+        /// </summary>
112
+        public DateTime? F_CreateTime
113
+        {
114
+            set { _f_createtime = value; }
115
+            get { return _f_createtime; }
116
+        }
117
+        #endregion Model
118
+    }
119
+}

+ 468 - 0
RMYY_CallCenter_Api.Model/T_Call_CallRecords.cs

@@ -0,0 +1,468 @@
1
+using System;
2
+namespace RMYY_CallCenter_Api.Model
3
+{
4
+    /// <summary>
5
+    /// 通话记录表
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_Call_CallRecords
9
+    {
10
+        public T_Call_CallRecords()
11
+        { }
12
+        #region Model
13
+        private string _callid;
14
+        private string _callnumber;
15
+        private string _cusid;
16
+        private string _cuscode;
17
+        private int? _calltype = 0;
18
+        private int? _callstate;
19
+        private int? _dealtype;
20
+        private DateTime? _begintime = DateTime.Now;
21
+        private DateTime? _ivrstarttime;
22
+        private DateTime? _ivrendtime;
23
+        private DateTime? _ringstarttime;
24
+        private DateTime? _ringendtime;
25
+        private DateTime? _talkstarttime;
26
+        private DateTime? _talkendtime;
27
+        private DateTime? _endtime = DateTime.Now;
28
+        private int? _longtime;
29
+        private int? _ivrlongtime;
30
+        private int? _ringlongtime;
31
+        private int? _talklongtime;
32
+        private int? _userid;
33
+        private string _usercode;
34
+        private string _username;
35
+        private string _extnumber;
36
+        private string _filepath;
37
+        private bool _isexitworkorder = false;
38
+        private int? _isdeal = 0;
39
+        private int? _operatetype;
40
+        private string _operateobject;
41
+        private DateTime? _operatetime;
42
+        private string _remark;
43
+        private int? _myd;
44
+        private int? _businesstype;
45
+        private string _location;
46
+        private int _callrecordsid;
47
+        private DateTime? _waitstarttime;
48
+        private DateTime? _waitendtime;
49
+        private int? _waitlongtime = 0;
50
+        private int? _nocallstate = 0;
51
+        private int? _worktimesdiff;
52
+        private int? _f_qcstate = 0;
53
+        private decimal? _f_qcscore = 0M;
54
+        private string _f_qcremark;
55
+        private int? _f_qcuserid;
56
+        private string _f_qcusername;
57
+        private DateTime? _f_qctime;
58
+        private int? _f_qcisselect;
59
+        private int? _f_callintype;
60
+        private int? _f_callouttype;
61
+        private int? _actionid = 1;
62
+        private int? _actiontype = 0;
63
+        /// <summary>
64
+        /// 呼叫编号
65
+        /// </summary>
66
+        public string CallId
67
+        {
68
+            set { _callid = value; }
69
+            get { return _callid; }
70
+        }
71
+        /// <summary>
72
+        /// 来电号码
73
+        /// </summary>
74
+        public string CallNumber
75
+        {
76
+            set { _callnumber = value; }
77
+            get { return _callnumber; }
78
+        }
79
+        /// <summary>
80
+        /// 客户id
81
+        /// </summary>
82
+        public string CusId
83
+        {
84
+            set { _cusid = value; }
85
+            get { return _cusid; }
86
+        }
87
+        /// <summary>
88
+        /// 客户编号
89
+        /// </summary>
90
+        public string CusCode
91
+        {
92
+            set { _cuscode = value; }
93
+            get { return _cuscode; }
94
+        }
95
+        /// <summary>
96
+        /// 呼叫类型,0呼入1呼出
97
+        /// </summary>
98
+        public int? CallType
99
+        {
100
+            set { _calltype = value; }
101
+            get { return _calltype; }
102
+        }
103
+        /// <summary>
104
+        /// 呼叫状态,0:未接通电话1已接通电话
105
+        /// </summary>
106
+        public int? CallState
107
+        {
108
+            set { _callstate = value; }
109
+            get { return _callstate; }
110
+        }
111
+        /// <summary>
112
+        /// 处理方式0:IVR处理1骚扰电话2自助服务3转值班电话4留言5呼损6人工处理
113
+        /// </summary>
114
+        public int? DealType
115
+        {
116
+            set { _dealtype = value; }
117
+            get { return _dealtype; }
118
+        }
119
+        /// <summary>
120
+        /// 开始时间
121
+        /// </summary>
122
+        public DateTime? BeginTime
123
+        {
124
+            set { _begintime = value; }
125
+            get { return _begintime; }
126
+        }
127
+        /// <summary>
128
+        /// ivr开始时间
129
+        /// </summary>
130
+        public DateTime? IvrStartTime
131
+        {
132
+            set { _ivrstarttime = value; }
133
+            get { return _ivrstarttime; }
134
+        }
135
+        /// <summary>
136
+        /// ivr结束时间
137
+        /// </summary>
138
+        public DateTime? IvrEndTime
139
+        {
140
+            set { _ivrendtime = value; }
141
+            get { return _ivrendtime; }
142
+        }
143
+        /// <summary>
144
+        /// 振铃开始时间
145
+        /// </summary>
146
+        public DateTime? RingStartTime
147
+        {
148
+            set { _ringstarttime = value; }
149
+            get { return _ringstarttime; }
150
+        }
151
+        /// <summary>
152
+        /// 振铃结束时间
153
+        /// </summary>
154
+        public DateTime? RingEndTime
155
+        {
156
+            set { _ringendtime = value; }
157
+            get { return _ringendtime; }
158
+        }
159
+        /// <summary>
160
+        /// 通话开始时间
161
+        /// </summary>
162
+        public DateTime? TalkStartTime
163
+        {
164
+            set { _talkstarttime = value; }
165
+            get { return _talkstarttime; }
166
+        }
167
+        /// <summary>
168
+        /// 通话结束时间
169
+        /// </summary>
170
+        public DateTime? TalkEndTime
171
+        {
172
+            set { _talkendtime = value; }
173
+            get { return _talkendtime; }
174
+        }
175
+        /// <summary>
176
+        /// 结束时间
177
+        /// </summary>
178
+        public DateTime? EndTime
179
+        {
180
+            set { _endtime = value; }
181
+            get { return _endtime; }
182
+        }
183
+        /// <summary>
184
+        /// 总时长(s)
185
+        /// </summary>
186
+        public int? LongTime
187
+        {
188
+            set { _longtime = value; }
189
+            get { return _longtime; }
190
+        }
191
+        /// <summary>
192
+        /// IVR时长(s)
193
+        /// </summary>
194
+        public int? IvrLongTime
195
+        {
196
+            set { _ivrlongtime = value; }
197
+            get { return _ivrlongtime; }
198
+        }
199
+        /// <summary>
200
+        /// 振铃时长(s)
201
+        /// </summary>
202
+        public int? RingLongTime
203
+        {
204
+            set { _ringlongtime = value; }
205
+            get { return _ringlongtime; }
206
+        }
207
+        /// <summary>
208
+        /// 通话时长(s)
209
+        /// </summary>
210
+        public int? TalkLongTime
211
+        {
212
+            set { _talklongtime = value; }
213
+            get { return _talklongtime; }
214
+        }
215
+        /// <summary>
216
+        /// 坐席id
217
+        /// </summary>
218
+        public int? UserId
219
+        {
220
+            set { _userid = value; }
221
+            get { return _userid; }
222
+        }
223
+        /// <summary>
224
+        /// 坐席工号
225
+        /// </summary>
226
+        public string UserCode
227
+        {
228
+            set { _usercode = value; }
229
+            get { return _usercode; }
230
+        }
231
+        /// <summary>
232
+        /// 坐席姓名
233
+        /// </summary>
234
+        public string UserName
235
+        {
236
+            set { _username = value; }
237
+            get { return _username; }
238
+        }
239
+        /// <summary>
240
+        /// 坐席分机号
241
+        /// </summary>
242
+        public string ExtNumber
243
+        {
244
+            set { _extnumber = value; }
245
+            get { return _extnumber; }
246
+        }
247
+        /// <summary>
248
+        /// 用于获取录音的编号
249
+        /// </summary>
250
+        public string FilePath
251
+        {
252
+            set { _filepath = value; }
253
+            get { return _filepath; }
254
+        }
255
+        /// <summary>
256
+        /// 是否录入工单
257
+        /// </summary>
258
+        public bool IsExitWorkOrder
259
+        {
260
+            set { _isexitworkorder = value; }
261
+            get { return _isexitworkorder; }
262
+        }
263
+        /// <summary>
264
+        /// 是否处理0未处理1已处理2注销
265
+        /// </summary>
266
+        public int? IsDeal
267
+        {
268
+            set { _isdeal = value; }
269
+            get { return _isdeal; }
270
+        }
271
+        /// <summary>
272
+        /// 操作类型,0正常1转移2三方通话
273
+        /// </summary>
274
+        public int? OperateType
275
+        {
276
+            set { _operatetype = value; }
277
+            get { return _operatetype; }
278
+        }
279
+        /// <summary>
280
+        /// 操作目标
281
+        /// </summary>
282
+        public string OperateObject
283
+        {
284
+            set { _operateobject = value; }
285
+            get { return _operateobject; }
286
+        }
287
+        /// <summary>
288
+        /// 操作时间
289
+        /// </summary>
290
+        public DateTime? OperateTime
291
+        {
292
+            set { _operatetime = value; }
293
+            get { return _operatetime; }
294
+        }
295
+        /// <summary>
296
+        /// 备注
297
+        /// </summary>
298
+        public string Remark
299
+        {
300
+            set { _remark = value; }
301
+            get { return _remark; }
302
+        }
303
+        /// <summary>
304
+        /// 满意度,1非常满意、2基本满意、3不满意
305
+        /// </summary>
306
+        public int? MYD
307
+        {
308
+            set { _myd = value; }
309
+            get { return _myd; }
310
+        }
311
+        /// <summary>
312
+        /// IVR中选择的业务类型
313
+        /// </summary>
314
+        public int? BusinessType
315
+        {
316
+            set { _businesstype = value; }
317
+            get { return _businesstype; }
318
+        }
319
+        /// <summary>
320
+        /// 
321
+        /// </summary>
322
+        public string Location
323
+        {
324
+            set { _location = value; }
325
+            get { return _location; }
326
+        }
327
+        /// <summary>
328
+        /// 来电自增Id
329
+        /// </summary>
330
+        public int CallRecordsId
331
+        {
332
+            set { _callrecordsid = value; }
333
+            get { return _callrecordsid; }
334
+        }
335
+        /// <summary>
336
+        /// 排队开始时间
337
+        /// </summary>
338
+        public DateTime? WaitStartTime
339
+        {
340
+            set { _waitstarttime = value; }
341
+            get { return _waitstarttime; }
342
+        }
343
+        /// <summary>
344
+        /// 排队结束时间
345
+        /// </summary>
346
+        public DateTime? WaitEndTime
347
+        {
348
+            set { _waitendtime = value; }
349
+            get { return _waitendtime; }
350
+        }
351
+        /// <summary>
352
+        /// 排队时长
353
+        /// </summary>
354
+        public int? WaitLongTime
355
+        {
356
+            set { _waitlongtime = value; }
357
+            get { return _waitlongtime; }
358
+        }
359
+        /// <summary>
360
+        /// 未接通状态(0其他、1坐席未登录、2坐席忙、3振铃)
361
+        /// </summary>
362
+        public int? NoCallState
363
+        {
364
+            set { _nocallstate = value; }
365
+            get { return _nocallstate; }
366
+        }
367
+        /// <summary>
368
+        /// 与工作时间间隔秒数
369
+        /// </summary>
370
+        public int? WorkTimesDiff
371
+        {
372
+            set { _worktimesdiff = value; }
373
+            get { return _worktimesdiff; }
374
+        }
375
+        /// <summary>
376
+        /// 质检状态(0未质检、1已质检)
377
+        /// </summary>
378
+        public int? F_QCState
379
+        {
380
+            set { _f_qcstate = value; }
381
+            get { return _f_qcstate; }
382
+        }
383
+        /// <summary>
384
+        /// 质检分值
385
+        /// </summary>
386
+        public decimal? F_QCScore
387
+        {
388
+            set { _f_qcscore = value; }
389
+            get { return _f_qcscore; }
390
+        }
391
+        /// <summary>
392
+        /// 质检备注
393
+        /// </summary>
394
+        public string F_QCRemark
395
+        {
396
+            set { _f_qcremark = value; }
397
+            get { return _f_qcremark; }
398
+        }
399
+        /// <summary>
400
+        /// 质检人Id
401
+        /// </summary>
402
+        public int? F_QCUserId
403
+        {
404
+            set { _f_qcuserid = value; }
405
+            get { return _f_qcuserid; }
406
+        }
407
+        /// <summary>
408
+        /// 质检人名称
409
+        /// </summary>
410
+        public string F_QCUserName
411
+        {
412
+            set { _f_qcusername = value; }
413
+            get { return _f_qcusername; }
414
+        }
415
+        /// <summary>
416
+        /// 质检时间
417
+        /// </summary>
418
+        public DateTime? F_QCTime
419
+        {
420
+            set { _f_qctime = value; }
421
+            get { return _f_qctime; }
422
+        }
423
+        /// <summary>
424
+        /// 是否推荐
425
+        /// </summary>
426
+        public int? F_QCIsSelect
427
+        {
428
+            set { _f_qcisselect = value; }
429
+            get { return _f_qcisselect; }
430
+        }
431
+        /// <summary>
432
+        /// 呼入性质
433
+        /// </summary>
434
+        public int? F_CallInType
435
+        {
436
+            set { _f_callintype = value; }
437
+            get { return _f_callintype; }
438
+        }
439
+        /// <summary>
440
+        /// 呼出性质
441
+        /// </summary>
442
+        public int? F_CallOutType
443
+        {
444
+            set { _f_callouttype = value; }
445
+            get { return _f_callouttype; }
446
+        }
447
+        /// <summary>
448
+		/// 区别正常呼入呼出、转移、三方通话
449
+		/// </summary>
450
+		public int? ActionID
451
+        {
452
+            set { _actionid = value; }
453
+            get { return _actionid; }
454
+        }
455
+        /// <summary>
456
+        /// 1正常呼入呼出、2转移、3三方通话
457
+        /// </summary>
458
+        public int? ActionType
459
+        {
460
+            set { _actiontype = value; }
461
+            get { return _actiontype; }
462
+        }
463
+        public string WorkOrderId { set; get; }
464
+        #endregion Model
465
+
466
+    }
467
+}
468
+

+ 163 - 0
RMYY_CallCenter_Api.Model/T_Call_LeaveRecord.cs

@@ -0,0 +1,163 @@
1
+using System;
2
+namespace RMYY_CallCenter_Api.Model
3
+{
4
+    /// <summary>
5
+    /// 留言表
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_Call_LeaveRecord
9
+    {
10
+        public T_Call_LeaveRecord()
11
+        { }
12
+        #region Model
13
+        private int _f_id;
14
+        private string _f_callid;
15
+        private string _f_phone;
16
+        private DateTime _f_leavetime;
17
+        private int _f_status;
18
+        private int? _f_userid;
19
+        private string _f_usercode;
20
+        private string _f_username;
21
+        private DateTime? _f_dealtime;
22
+        private string _f_dealcontent;
23
+        private string _f_remark;
24
+        private string _f_callappid;
25
+        private string _f_recfileurl;
26
+        private DateTime? _f_starttime;
27
+        private DateTime? _f_endtime;
28
+        private int? _f_longtime;
29
+        /// <summary>
30
+        /// 标识列,自动增长
31
+        /// </summary>
32
+        public int F_Id
33
+        {
34
+            set { _f_id = value; }
35
+            get { return _f_id; }
36
+        }
37
+        /// <summary>
38
+        /// 
39
+        /// </summary>
40
+        public string F_CallId
41
+        {
42
+            set { _f_callid = value; }
43
+            get { return _f_callid; }
44
+        }
45
+        /// <summary>
46
+        /// 来电号码
47
+        /// </summary>
48
+        public string F_Phone
49
+        {
50
+            set { _f_phone = value; }
51
+            get { return _f_phone; }
52
+        }
53
+        /// <summary>
54
+        /// 留言时间
55
+        /// </summary>
56
+        public DateTime F_LeaveTime
57
+        {
58
+            set { _f_leavetime = value; }
59
+            get { return _f_leavetime; }
60
+        }
61
+        /// <summary>
62
+        /// 状态0未处理1已处理2注销
63
+        /// </summary>
64
+        public int F_Status
65
+        {
66
+            set { _f_status = value; }
67
+            get { return _f_status; }
68
+        }
69
+        /// <summary>
70
+        /// 处理坐席id
71
+        /// </summary>
72
+        public int? F_UserId
73
+        {
74
+            set { _f_userid = value; }
75
+            get { return _f_userid; }
76
+        }
77
+        /// <summary>
78
+        /// 坐席工号
79
+        /// </summary>
80
+        public string F_UserCode
81
+        {
82
+            set { _f_usercode = value; }
83
+            get { return _f_usercode; }
84
+        }
85
+        /// <summary>
86
+        /// 坐席姓名
87
+        /// </summary>
88
+        public string F_UserName
89
+        {
90
+            set { _f_username = value; }
91
+            get { return _f_username; }
92
+        }
93
+        /// <summary>
94
+        /// 处理时间
95
+        /// </summary>
96
+        public DateTime? F_DealTime
97
+        {
98
+            set { _f_dealtime = value; }
99
+            get { return _f_dealtime; }
100
+        }
101
+        /// <summary>
102
+        /// 处理结果
103
+        /// </summary>
104
+        public string F_DealContent
105
+        {
106
+            set { _f_dealcontent = value; }
107
+            get { return _f_dealcontent; }
108
+        }
109
+        /// <summary>
110
+        /// 备注
111
+        /// </summary>
112
+        public string F_Remark
113
+        {
114
+            set { _f_remark = value; }
115
+            get { return _f_remark; }
116
+        }
117
+        /// <summary>
118
+        /// 
119
+        /// </summary>
120
+        public string F_CallAppId
121
+        {
122
+            set { _f_callappid = value; }
123
+            get { return _f_callappid; }
124
+        }
125
+        /// <summary>
126
+        /// 
127
+        /// </summary>
128
+        public string F_RecFileUrl
129
+        {
130
+            set { _f_recfileurl = value; }
131
+            get { return _f_recfileurl; }
132
+        }
133
+        /// <summary>
134
+        /// 开始时间
135
+        /// </summary>
136
+        public DateTime? F_StartTime
137
+        {
138
+            set { _f_starttime = value; }
139
+            get { return _f_starttime; }
140
+        }
141
+        /// <summary>
142
+        /// 结束时间
143
+        /// </summary>
144
+        public DateTime? F_EndTime
145
+        {
146
+            set { _f_endtime = value; }
147
+            get { return _f_endtime; }
148
+        }
149
+        /// <summary>
150
+        /// 时长
151
+        /// </summary>
152
+        public int? F_LongTime
153
+        {
154
+            set { _f_longtime = value; }
155
+            get { return _f_longtime; }
156
+        }
157
+
158
+        public string F_WorkOrderId { set; get; }
159
+        #endregion Model
160
+
161
+    }
162
+}
163
+

+ 107 - 0
RMYY_CallCenter_Api.Model/T_Sys_MobileData.cs

@@ -0,0 +1,107 @@
1
+using System;
2
+namespace RMYY_CallCenter_Api.Model
3
+{
4
+    /// <summary>
5
+    /// T_Sys_MobileData:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_Sys_MobileData
9
+    {
10
+        public T_Sys_MobileData()
11
+        { }
12
+        #region Model
13
+        private int _f_id;
14
+        private string _f_mobilenum;
15
+        private string _f_zipcode;
16
+        private string _f_citydes;
17
+        private string _f_carddes;
18
+        private string _f_createuser;
19
+        private DateTime? _f_createtime;
20
+        private int? _f_isdelete;
21
+        private string _f_deleteuser;
22
+        private DateTime? _f_deletetime;
23
+        /// <summary>
24
+        /// 
25
+        /// </summary>
26
+        public int F_Id
27
+        {
28
+            set { _f_id = value; }
29
+            get { return _f_id; }
30
+        }
31
+        /// <summary>
32
+        /// 
33
+        /// </summary>
34
+        public string F_MobileNum
35
+        {
36
+            set { _f_mobilenum = value; }
37
+            get { return _f_mobilenum; }
38
+        }
39
+        /// <summary>
40
+        /// 
41
+        /// </summary>
42
+        public string F_ZipCode
43
+        {
44
+            set { _f_zipcode = value; }
45
+            get { return _f_zipcode; }
46
+        }
47
+        /// <summary>
48
+        /// 
49
+        /// </summary>
50
+        public string F_CityDes
51
+        {
52
+            set { _f_citydes = value; }
53
+            get { return _f_citydes; }
54
+        }
55
+        /// <summary>
56
+        /// 
57
+        /// </summary>
58
+        public string F_CardDes
59
+        {
60
+            set { _f_carddes = value; }
61
+            get { return _f_carddes; }
62
+        }
63
+        /// <summary>
64
+        /// 
65
+        /// </summary>
66
+        public string F_CreateUser
67
+        {
68
+            set { _f_createuser = value; }
69
+            get { return _f_createuser; }
70
+        }
71
+        /// <summary>
72
+        /// 
73
+        /// </summary>
74
+        public DateTime? F_CreateTime
75
+        {
76
+            set { _f_createtime = value; }
77
+            get { return _f_createtime; }
78
+        }
79
+        /// <summary>
80
+        /// 
81
+        /// </summary>
82
+        public int? F_IsDelete
83
+        {
84
+            set { _f_isdelete = value; }
85
+            get { return _f_isdelete; }
86
+        }
87
+        /// <summary>
88
+        /// 
89
+        /// </summary>
90
+        public string F_DeleteUser
91
+        {
92
+            set { _f_deleteuser = value; }
93
+            get { return _f_deleteuser; }
94
+        }
95
+        /// <summary>
96
+        /// 
97
+        /// </summary>
98
+        public DateTime? F_DeleteTime
99
+        {
100
+            set { _f_deletetime = value; }
101
+            get { return _f_deletetime; }
102
+        }
103
+        #endregion Model
104
+
105
+    }
106
+}
107
+

+ 65 - 0
RMYY_CallCenter_Api.Model/T_Sys_SystemConfig.cs

@@ -0,0 +1,65 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+
6
+namespace RMYY_CallCenter_Api.Model
7
+{
8
+    /// <summary>
9
+    /// T_Sys_SystemConfig:实体类(属性说明自动提取数据库字段的描述信息)
10
+    /// </summary>
11
+    [Serializable]
12
+    public partial class T_Sys_SystemConfig
13
+    {
14
+        public T_Sys_SystemConfig()
15
+        { }
16
+        #region Model
17
+        private int _f_paramid;
18
+        private string _f_paramcode;
19
+        private string _f_paramvalue;
20
+        private string _f_paramdes;
21
+        private int? _f_state = 0;
22
+        /// <summary>
23
+        /// 
24
+        /// </summary>
25
+        public int F_ParamId
26
+        {
27
+            set { _f_paramid = value; }
28
+            get { return _f_paramid; }
29
+        }
30
+        /// <summary>
31
+        /// 
32
+        /// </summary>
33
+        public string F_ParamCode
34
+        {
35
+            set { _f_paramcode = value; }
36
+            get { return _f_paramcode; }
37
+        }
38
+        /// <summary>
39
+        /// 
40
+        /// </summary>
41
+        public string F_ParamValue
42
+        {
43
+            set { _f_paramvalue = value; }
44
+            get { return _f_paramvalue; }
45
+        }
46
+        /// <summary>
47
+        /// 
48
+        /// </summary>
49
+        public string F_ParamDes
50
+        {
51
+            set { _f_paramdes = value; }
52
+            get { return _f_paramdes; }
53
+        }
54
+        /// <summary>
55
+        /// 
56
+        /// </summary>
57
+        public int? F_State
58
+        {
59
+            set { _f_state = value; }
60
+            get { return _f_state; }
61
+        }
62
+        #endregion Model
63
+
64
+    }
65
+}

+ 66 - 0
RMYY_CallCenter_Api.Model/T_Sys_TelTitleData.cs

@@ -0,0 +1,66 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace RMYY_CallCenter_Api.Model
8
+{
9
+    /// <summary>
10
+	/// T_Sys_TelTitleData:实体类(属性说明自动提取数据库字段的描述信息)
11
+	/// </summary>
12
+	[Serializable]
13
+    public partial class T_Sys_TelTitleData
14
+    {
15
+        public T_Sys_TelTitleData()
16
+        { }
17
+        #region Model
18
+        private int _f_id;
19
+        private string _f_titlename;
20
+        private string _f_keyphonenum;
21
+        private int? _f_defphonenumlen;
22
+        private string _f_wcode;
23
+        /// <summary>
24
+        /// 
25
+        /// </summary>
26
+        public int F_Id
27
+        {
28
+            set { _f_id = value; }
29
+            get { return _f_id; }
30
+        }
31
+        /// <summary>
32
+        /// 
33
+        /// </summary>
34
+        public string F_TitleName
35
+        {
36
+            set { _f_titlename = value; }
37
+            get { return _f_titlename; }
38
+        }
39
+        /// <summary>
40
+        /// 
41
+        /// </summary>
42
+        public string F_KeyPhoneNum
43
+        {
44
+            set { _f_keyphonenum = value; }
45
+            get { return _f_keyphonenum; }
46
+        }
47
+        /// <summary>
48
+        /// 
49
+        /// </summary>
50
+        public int? F_DefPhoneNumLen
51
+        {
52
+            set { _f_defphonenumlen = value; }
53
+            get { return _f_defphonenumlen; }
54
+        }
55
+        /// <summary>
56
+        /// 
57
+        /// </summary>
58
+        public string F_WCode
59
+        {
60
+            set { _f_wcode = value; }
61
+            get { return _f_wcode; }
62
+        }
63
+        #endregion Model
64
+
65
+    }
66
+}

+ 92 - 0
RMYY_CallCenter_Api.Model/T_Sys_WorkOFFDays.cs

@@ -0,0 +1,92 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace RMYY_CallCenter_Api.Model
8
+{
9
+    /// <summary>
10
+	/// 休息日表
11
+	/// </summary>
12
+	[Serializable]
13
+    public partial class T_Sys_WorkOffDays
14
+    {
15
+        public T_Sys_WorkOffDays()
16
+        { }
17
+        #region Model
18
+        private int _f_offid;
19
+        private DateTime? _f_offdate = DateTime.Now;
20
+        private int? _f_offstate;
21
+        private string _f_remark;
22
+        private string _f_createby;
23
+        private DateTime? _f_createon = DateTime.Now;
24
+        private string _f_deleteby;
25
+        private DateTime? _f_deleteon;
26
+        /// <summary>
27
+        /// 
28
+        /// </summary>
29
+        public int F_OffID
30
+        {
31
+            set { _f_offid = value; }
32
+            get { return _f_offid; }
33
+        }
34
+        /// <summary>
35
+        /// 休息日日期
36
+        /// </summary>
37
+        public DateTime? F_OffDate
38
+        {
39
+            set { _f_offdate = value; }
40
+            get { return _f_offdate; }
41
+        }
42
+        /// <summary>
43
+        /// 状态,0在用,1删除
44
+        /// </summary>
45
+        public int? F_OffState
46
+        {
47
+            set { _f_offstate = value; }
48
+            get { return _f_offstate; }
49
+        }
50
+        /// <summary>
51
+        /// 备注
52
+        /// </summary>
53
+        public string F_remark
54
+        {
55
+            set { _f_remark = value; }
56
+            get { return _f_remark; }
57
+        }
58
+        /// <summary>
59
+        /// 添加人
60
+        /// </summary>
61
+        public string F_CreateBy
62
+        {
63
+            set { _f_createby = value; }
64
+            get { return _f_createby; }
65
+        }
66
+        /// <summary>
67
+        /// 添加时间
68
+        /// </summary>
69
+        public DateTime? F_CreateOn
70
+        {
71
+            set { _f_createon = value; }
72
+            get { return _f_createon; }
73
+        }
74
+        /// <summary>
75
+        /// 删除人
76
+        /// </summary>
77
+        public string F_DeleteBy
78
+        {
79
+            set { _f_deleteby = value; }
80
+            get { return _f_deleteby; }
81
+        }
82
+        /// <summary>
83
+        /// 删除时间
84
+        /// </summary>
85
+        public DateTime? F_DeleteOn
86
+        {
87
+            set { _f_deleteon = value; }
88
+            get { return _f_deleteon; }
89
+        }
90
+        #endregion Model
91
+    }
92
+}

+ 1 - 1
RMYY_CallCenter_Api.Utility/Helper/NPOIHelper.cs

@@ -12,7 +12,7 @@ using NPOI.SS.UserModel;
12 12
 using NPOI.SS.Util;
13 13
 using NPOI.XSSF.UserModel;
14 14
 
15
-namespace CallCenter.Utility
15
+namespace RMYY_CallCenter_Api.Utility
16 16
 {
17 17
     public class NPOIHelper
18 18
     {

+ 318 - 0
RMYY_CallCenter_Api/Controllers/CallTel/CallInScreenController.cs

@@ -0,0 +1,318 @@
1
+
2
+using RMYY_CallCenter_Api.Utility;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Data;
6
+using System.Linq;
7
+using System.Web;
8
+using System.Web.Mvc;
9
+
10
+namespace RMYY_CallCenter_Api.Controllers.CallTel
11
+{
12
+    public class CallInScreenController : BaseController
13
+    {
14
+        /// <summary>
15
+        /// 添加黑名单
16
+        /// </summary>
17
+        /// <returns></returns>
18
+        public ActionResult AddBlack(string tel, string callid, int num = 0, int type = 0)
19
+        {
20
+            Model.T_Call_Blacklist dModel = new Bll.T_Call_Blacklist().GetModelList(" F_TelPhone='" + tel + "' ").FirstOrDefault();
21
+
22
+            var date = DateTime.Now;
23
+            var enddate = date;
24
+            switch (type)
25
+            {
26
+                case 1: enddate = enddate.AddDays(num); break;
27
+                case 2: enddate = enddate.AddHours(num); break;
28
+                case 3: enddate = enddate.AddMinutes(num); break;
29
+                case 4: enddate = DateTime.MaxValue; break;
30
+            }
31
+            if (dModel == null)
32
+            {
33
+                dModel = new Model.T_Call_Blacklist();
34
+                dModel.F_CallId = callid;
35
+                dModel.F_TelPhone = tel.Trim();
36
+                dModel.F_SetTime = date;
37
+                dModel.F_RemoveTime = enddate;
38
+                dModel.F_BlackType = 1;
39
+                dModel.F_InterceptNum = 1;
40
+                dModel.F_UserId = User.F_UserId;
41
+                int b = new Bll.T_Call_Blacklist().Add(dModel);
42
+                if (b > 0)
43
+                {
44
+                    return Success("添加成功", dModel);
45
+                }
46
+                else
47
+                {
48
+                    return Error("添加失败");
49
+                }
50
+            }
51
+            else
52
+            {
53
+
54
+                dModel.F_RemoveTime = enddate;
55
+                dModel.F_BlackType = 1;
56
+                if (new Bll.T_Call_Blacklist().Update(dModel))
57
+                {
58
+                    return Success("添加成功", dModel);
59
+                }
60
+                else
61
+                {
62
+                    return Error("修改失败");
63
+                }
64
+            }
65
+        }
66
+
67
+        /// <summary>
68
+        /// 取消黑名单
69
+        /// </summary>
70
+        /// <returns></returns>
71
+        public ActionResult DelBlack(string tel)
72
+        {
73
+            Model.T_Call_Blacklist dModel = new Bll.T_Call_Blacklist().GetModelList(" F_TelPhone='" + tel + "' ").FirstOrDefault();
74
+            if (dModel != null)
75
+            {
76
+                bool bl = new Bll.T_Call_Blacklist().Delete(dModel.F_BlackId);
77
+                if (bl)
78
+                {
79
+                    return Success("取消成功");
80
+                }
81
+                else
82
+                {
83
+                    return Error("取消失败");
84
+                }
85
+            }
86
+            else
87
+            {
88
+                return Error("参数错误");
89
+            }
90
+        }
91
+
92
+        ///// <summary>
93
+        ///// 根据来电号码获取客户信息
94
+        ///// </summary>
95
+        ///// <returns></returns>
96
+        //public ActionResult GetCustomerByTel(string tel)
97
+        //{
98
+        //    var dt = new Bll.T_Cus_CustomerBase().GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
99
+
100
+        //    return Success("获取成功", dt);
101
+        //}
102
+
103
+        /// <summary>
104
+        /// 根据来电号码获取最近的callid
105
+        /// </summary>
106
+        /// <returns></returns>
107
+        public ActionResult GetCallIdByPhone(string tel)
108
+        {
109
+            return Success("加载成功", new Bll.T_Call_CallRecords().GetModelByTelphone(tel));
110
+        }
111
+
112
+        /// <summary>
113
+        /// 根据callid获取最近的通话记录
114
+        /// </summary>
115
+        /// <returns></returns>
116
+        public ActionResult GetTelRecordByCallid(string callid)
117
+        {
118
+            return Success("通话记录加载成功", new Bll.T_Call_CallRecords().GetModelByCallId(callid));
119
+        }
120
+
121
+        /// <summary>
122
+        /// 来电归属地查询
123
+        /// </summary>
124
+        /// <returns></returns>
125
+        public ActionResult GetPhoneLocation(string tel)
126
+        {
127
+
128
+            string location = "未知";
129
+            if (!string.IsNullOrEmpty(tel))
130
+            {
131
+                if (tel.Trim().Length == 11 && tel.Substring(0, 1) != "0")
132
+                {
133
+                    Bll.T_Sys_MobileData mobile_Bll = new Bll.T_Sys_MobileData();
134
+                    Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModelList(" F_MobileNum = '" + tel.Substring(0, 7) + "'").FirstOrDefault();
135
+
136
+                    if (mobileModel != null)
137
+                    {
138
+                        location = mobileModel.F_CityDes + mobileModel.F_CardDes;
139
+                    }
140
+                }
141
+                else
142
+                {
143
+                    Bll.T_Sys_TelTitleData numbBll = new Bll.T_Sys_TelTitleData();
144
+                    if (tel.Length > 4)
145
+                    {
146
+                        List<Model.T_Sys_TelTitleData> mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + tel.Substring(0, 4) + "'");
147
+                        if (mobileModel == null || mobileModel.Count <= 0)
148
+                        {
149
+                            mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + tel.Substring(0, 3) + "'");
150
+                        }
151
+                        if (mobileModel.Count > 0)
152
+                        {
153
+                            location = mobileModel[0].F_TitleName;
154
+                        }
155
+                    }
156
+                }
157
+            }
158
+            return Success("归属地加载成功", location);
159
+
160
+
161
+        }
162
+
163
+        /// <summary>
164
+        /// 历史记录列表
165
+        /// </summary>
166
+        /// <returns></returns>
167
+        public ActionResult GetOldList(string tel,  int page = 1, int pagesize = 10)
168
+        {
169
+
170
+            string sql = "";
171
+            DataTable dt = new DataTable();
172
+
173
+            if (!string.IsNullOrEmpty(tel.Trim()) && tel != "undefined")
174
+            {
175
+                sql += " and CallNumber= '" + tel.Trim() + "' ";
176
+            }
177
+
178
+            int recordCount = 0;
179
+            dt = Bll.PagerBll.GetListPager(
180
+                "T_Call_CallRecords",
181
+                "CallRecordsId",
182
+                "*,dbo.GetUserName(UserCode) as UserName, dbo.GetDictionaryName(F_CallInType) as TypeName",
183
+                sql,
184
+                "ORDER BY CallRecordsId desc",
185
+                pagesize,
186
+                page,
187
+                true,
188
+                out recordCount);
189
+            var config = new Bll.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
190
+            foreach (DataRow dr in dt.Rows)
191
+            {
192
+                string path = dr["FilePath"] != null ? dr["FilePath"].ToString() : "";
193
+                if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
194
+                {
195
+                    var ym = config.F_ParamValue;
196
+                    if (ym.Substring(ym.Length - 1) == "/")
197
+                    {
198
+                        ym = ym.Substring(0, ym.Length - 1);
199
+                    }
200
+                    string lujing = path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
201
+                    string wlpath = ym + lujing;
202
+                    dr["FilePath"] = wlpath;
203
+                }
204
+            }
205
+
206
+            var obj = new
207
+            {
208
+                state = "success",
209
+                message = "成功",
210
+                rows = dt,
211
+                total = recordCount
212
+            };
213
+
214
+            return Content(obj.ToJson());
215
+
216
+
217
+        }
218
+
219
+        /// <summary>
220
+        /// 振铃事件
221
+        /// </summary>
222
+        /// <returns></returns>
223
+        public ActionResult UpdateZL(string callid)
224
+        {
225
+            Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
226
+            model.CallId = callid;
227
+            model.UserId = User.F_UserId;
228
+            model.UserCode = User.F_UserCode;
229
+            model.UserName = User.F_UserName;
230
+            model.ExtNumber = User.F_ExtensionNumber;
231
+
232
+            model.DealType = 5;
233
+            bool bl = new Bll.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
234
+            if (bl)
235
+            {
236
+                return Success("更新振铃状态成功");
237
+            }
238
+            else
239
+            {
240
+                return Success("更新振铃状态失败");
241
+            }
242
+        }
243
+
244
+        /// <summary>
245
+        /// 摘机事件
246
+        /// </summary>
247
+        /// <returns></returns>
248
+        public ActionResult UpdateZJ(string callid)
249
+        {
250
+
251
+            Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
252
+            model.CallId = callid;
253
+            model.CallState = 1;
254
+            model.DealType = 6;
255
+            bool bl = new Bll.T_Call_CallRecords().UpdateCallInAnswerTelRecord(model);
256
+            if (bl)
257
+            {
258
+                return Success("更新摘机状态成功");
259
+            }
260
+            else
261
+            {
262
+                return Success("更新摘机状态失败");//临时修改
263
+            }
264
+
265
+        }
266
+
267
+        /// <summary>
268
+        /// 呼入性质
269
+        /// </summary>
270
+        /// <returns></returns>
271
+        public ActionResult UpdateCallInType(string callid, int tid = 0)
272
+        {
273
+            Model.T_Call_CallRecords vmodel = new Bll.T_Call_CallRecords().GetModelByCallId(callid);
274
+            if (vmodel != null)
275
+            {
276
+                var n = DB.DbHelperSQL.ExecuteSql("update T_Call_CallRecords set F_CallInType=" + tid + " where CallRecordsId=" + vmodel.CallRecordsId);
277
+                if (n > 0)
278
+                {
279
+                    return Success("操作成功");
280
+                }
281
+                else
282
+                {
283
+                    return Success("操作失败");
284
+                }
285
+            }
286
+            else
287
+            {
288
+                return Success("操作失败");
289
+            }
290
+        }
291
+
292
+        /// <summary>
293
+        /// 呼出性质
294
+        /// </summary>
295
+        /// <returns></returns>
296
+        public ActionResult UpdateCallOutType(string callid, int tid = 0)
297
+        {
298
+            Model.T_Call_CallRecords vmodel = new Bll.T_Call_CallRecords().GetModelByCallId(callid);
299
+            if (vmodel != null)
300
+            {
301
+                var n = DB.DbHelperSQL.ExecuteSql("update T_Call_CallRecords set F_CallInType=" + tid + " where CallRecordsId=" + vmodel.CallRecordsId);
302
+                if (n > 0)
303
+                {
304
+                    return Success("操作成功");
305
+                }
306
+                else
307
+                {
308
+                    return Success("操作失败");
309
+                }
310
+            }
311
+            else
312
+            {
313
+                return Success("操作失败");
314
+            }
315
+        }
316
+
317
+    }
318
+}

+ 206 - 0
RMYY_CallCenter_Api/Controllers/CallTel/CallblackController.cs

@@ -0,0 +1,206 @@
1
+using RMYY_CallCenter_Api.Utility;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Linq;
6
+using System.Web;
7
+using System.Web.Mvc;
8
+
9
+namespace RMYY_CallCenter_Api.Controllers.CallTel
10
+{
11
+    public class CallblackController : BaseController
12
+    {
13
+        //获取黑名单列表
14
+        public ActionResult GetList(string tel, int? type, string stime, string etime, int page = 1, int pagesize = 10)
15
+        {
16
+            string sql = "";
17
+            DataTable dt = new DataTable();
18
+
19
+            if (tel != null && tel.Trim() != "")
20
+            {
21
+                sql += " and F_TelPhone like '%" + tel.Trim() + "%' ";
22
+            }
23
+            if (stime != null && stime.Trim() != "")
24
+            {
25
+                sql += " and F_SetTime > '" + Convert.ToDateTime(stime.Trim()) + "' ";
26
+            }
27
+            if (etime != null && etime.Trim() != "")
28
+            {
29
+                sql += " and F_SetTime < '" + Convert.ToDateTime(etime.Trim()) + "' ";
30
+            }
31
+            if (type != null)
32
+            {
33
+                sql += " and F_BlackType=" + type;
34
+            }
35
+
36
+            int recordCount = 0;
37
+            dt = Bll.PagerBll.GetListPager(
38
+                "T_Call_Blacklist with(nolock)",
39
+                "F_BlackId",
40
+                "*,dbo.GetUserNameByID(F_UserId) as F_UserName",
41
+                sql,
42
+                "ORDER BY F_BlackId desc",
43
+                pagesize,
44
+                page,
45
+                true,
46
+                out recordCount);
47
+
48
+            var obj = new
49
+            {
50
+                state = "success",
51
+                message = "成功",
52
+                rows = dt,
53
+                total = recordCount
54
+            };
55
+
56
+            return Content(obj.ToJson());
57
+        }
58
+
59
+        //获取黑名单
60
+        public ActionResult GetBlack(int blackid)
61
+        {
62
+            if (blackid>0)
63
+            {
64
+                Bll.T_Call_Blacklist dBLL = new Bll.T_Call_Blacklist();
65
+                Model.T_Call_Blacklist dModel = dBLL.GetModel(blackid);
66
+                if (dModel != null)
67
+                {
68
+                    var sdate = ""; var edate = "";
69
+                    if (dModel.F_SetTime != null)
70
+                        sdate = dModel.F_SetTime.Value.ToString("yyyy-MM-dd");
71
+                    if (dModel.F_RemoveTime != null)
72
+                        edate = dModel.F_RemoveTime.Value.ToString("yyyy-MM-dd");
73
+                    var obj = new
74
+                    {
75
+                        F_BlackId = dModel.F_BlackId,
76
+                        F_TelPhone = dModel.F_TelPhone,
77
+                        F_BlackType = dModel.F_BlackType,
78
+                        F_SetTime = sdate,
79
+                        F_RemoveTime = edate,
80
+                        F_Describe = dModel.F_Describe,
81
+                        F_UserId = dModel.F_UserId,
82
+                        F_CreateTime = dModel.F_CreateTime
83
+                    };
84
+                    return Success("获取黑名单成功", obj);
85
+                }
86
+                else
87
+                {
88
+                    return Error("获取黑名单失败");
89
+                }
90
+            }
91
+            else
92
+            {
93
+                return Error("获取参数失败");
94
+            }
95
+
96
+        }
97
+
98
+        //添加黑名单
99
+        public ActionResult AddBlack(int blackid, string telphone, int? type, string settime, string removetime, string des)
100
+        {
101
+            var date = DateTime.Now;
102
+            if (blackid > 0)
103
+            {
104
+                Bll.T_Call_Blacklist dBLL = new Bll.T_Call_Blacklist();
105
+                Model.T_Call_Blacklist dModel = dBLL.GetModel(blackid);
106
+                if (dModel != null)
107
+                {
108
+                    if (telphone != null && telphone.Trim() != "")
109
+                        dModel.F_TelPhone = telphone.Trim();
110
+                    if (type != null)
111
+                    {
112
+                        dModel.F_BlackType = type;
113
+                        if (type == 1)
114
+                        {
115
+                            if (settime != null && settime.Trim() != "")
116
+                                dModel.F_SetTime = Convert.ToDateTime(settime.Trim());
117
+                            else
118
+                                dModel.F_SetTime = date;
119
+                            if (removetime != null && removetime.Trim() != "")
120
+                                dModel.F_RemoveTime = Convert.ToDateTime(removetime.Trim());
121
+                            else
122
+                                dModel.F_SetTime = date;
123
+                        }
124
+                    }
125
+                    if (des != null && des.Trim() != "")
126
+                        dModel.F_Describe = des.Trim();
127
+                    dModel.F_InterceptNum += 1;
128
+                    dModel.F_UserId = User.F_UserId;
129
+                    bool b = dBLL.Update(dModel);
130
+                    if (b)
131
+                    {
132
+                        return Success("黑名单编辑成功", dModel);
133
+                    }
134
+                    else
135
+                    {
136
+                        return Error("黑名单编辑失败");
137
+                    }
138
+                }
139
+                else
140
+                {
141
+                    return Error("黑名单编辑失败");
142
+                }
143
+            }
144
+            else
145
+            {
146
+                Model.T_Call_Blacklist dModel = new Model.T_Call_Blacklist();
147
+                dModel.F_CallId = "0";
148
+                if (telphone != null && telphone.Trim() != "")
149
+                    dModel.F_TelPhone = telphone.Trim();
150
+                if (type != null)
151
+                {
152
+                    dModel.F_BlackType = type;
153
+                    if (type == 1)
154
+                    {
155
+                        if (settime != null && settime.Trim() != "")
156
+                            dModel.F_SetTime = Convert.ToDateTime(settime.Trim());
157
+                        else
158
+                            dModel.F_SetTime = date;
159
+                        if (removetime != null && removetime.Trim() != "")
160
+                            dModel.F_RemoveTime = Convert.ToDateTime(removetime.Trim());
161
+                        else
162
+                            dModel.F_RemoveTime = date;
163
+                    }
164
+                }
165
+                if (des != null && des.Trim() != "")
166
+                    dModel.F_Describe = des.Trim();
167
+                dModel.F_InterceptNum = 1;
168
+                dModel.F_UserId = User.F_UserId;
169
+                int b = new Bll.T_Call_Blacklist().Add(dModel);
170
+                if (b > 0)
171
+                {
172
+                    return Success("黑名单添加成功", dModel);
173
+                }
174
+                else
175
+                {
176
+                    return Error("黑名单添加失败");
177
+                }
178
+            }
179
+        }
180
+
181
+
182
+        //删除黑名单记录
183
+        public ActionResult DelCallBlack(string[] ids)
184
+        {
185
+            if (ids != null && ids.Length > 0)
186
+            {
187
+                string idd = " ";
188
+                foreach (string str in ids)
189
+                {
190
+                    idd += str + ",";
191
+                }
192
+                if (new Bll.T_Call_Blacklist().DeleteList(idd.TrimEnd(',')))
193
+                {
194
+                    return Success("黑名单删除成功");
195
+                }
196
+                else
197
+                    return Error("黑名单删除失败");
198
+            }
199
+            else
200
+            {
201
+                return Error("请选择要删除的黑名单记录");
202
+            }
203
+
204
+        }
205
+    }
206
+}

+ 129 - 0
RMYY_CallCenter_Api/Controllers/CallTel/CallleaveController.cs

@@ -0,0 +1,129 @@
1
+using RMYY_CallCenter_Api.Utility;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Linq;
6
+using System.Web;
7
+using System.Web.Mvc;
8
+
9
+namespace RMYY_CallCenter_Api.Controllers.CallTel
10
+{
11
+    public class CallleaveController : BaseController
12
+    {
13
+        //获取留言列表
14
+        public ActionResult GetList(string settime, string removetime, string strtelnum, int status = -1, int page = 1, int pagesize = 10)
15
+        {
16
+            string sql = "";
17
+            DataTable dt = new DataTable();
18
+
19
+            if (strtelnum != null && strtelnum.Trim() != "")
20
+            {
21
+                sql += " and F_Phone= '" + strtelnum.Trim() + "' ";
22
+            }
23
+            if (settime.Trim() != "" && settime != "undefined")
24
+            {
25
+                sql += " and CONVERT(varchar(10),F_LeaveTime, 23) = '" + settime.Trim() + "' ";
26
+            }
27
+            if (removetime.Trim() != "" && removetime != "undefined")
28
+            {
29
+                sql += " and CONVERT(varchar(10),F_DealTime, 23) = '" + removetime.Trim() + "' ";
30
+            }
31
+            if (status > -1)
32
+            {
33
+                sql += " and F_Status = " + status;
34
+            }
35
+
36
+            int recordCount = 0;
37
+            dt = Bll.PagerBll.GetListPager(
38
+                "T_Call_LeaveRecord",
39
+                "F_Id",
40
+                "*",
41
+                sql,
42
+                "ORDER BY F_Id desc",
43
+                pagesize,
44
+                page,
45
+                true,
46
+                out recordCount);
47
+
48
+            var config = new Bll.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
49
+            foreach (DataRow dr in dt.Rows)
50
+            {
51
+                string path = dr["F_RecFileUrl"] != null ? dr["F_RecFileUrl"].ToString() : "";
52
+                if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
53
+                {
54
+                    dr["F_RecFileUrl"] = config.F_ParamValue + path;
55
+                }
56
+            }
57
+
58
+            var obj = new
59
+            {
60
+                state = "success",
61
+                message = "成功",
62
+                rows = dt,
63
+                total = recordCount
64
+            };
65
+
66
+            return Content(obj.ToJson());
67
+        }
68
+
69
+        //删除留言记录
70
+        public ActionResult DelLeaveRecord(string[] ids)
71
+        {
72
+            if (ids != null && ids.Length > 0)
73
+            {
74
+                string idd = " ";
75
+                foreach (string str in ids)
76
+                {
77
+                    idd += str + ",";
78
+                }
79
+                if (new Bll.T_Call_LeaveRecord().DeleteList(idd.TrimEnd(',')))
80
+                {
81
+                    return Success("删除成功");
82
+                }
83
+                else
84
+                    return Error("删除失败");
85
+            }
86
+            else
87
+            {
88
+                return Error("请选择要删除的记录");
89
+            }
90
+        }
91
+
92
+        //更新留言处理状态
93
+        public ActionResult OptLeaveRecord(string[] ids)
94
+        {
95
+            if (ids.Length > 0)
96
+            {
97
+                foreach (string arrid in ids)
98
+                {
99
+                    Model.T_Call_LeaveRecord model = new Bll.T_Call_LeaveRecord().GetModel(Convert.ToInt32(arrid));
100
+                    if (model != null)
101
+                    {
102
+                        model.F_Status = 1;
103
+                        model.F_DealTime = DateTime.Now;
104
+                        model.F_DealContent = "1";
105
+                        model.F_UserName = User.F_UserName;
106
+                        model.F_UserCode = User.F_UserCode;
107
+                        model.F_UserId = User.F_UserId;
108
+
109
+                        new Bll.T_Call_LeaveRecord().Update(model);
110
+                    }
111
+                }
112
+                return Success("处理成功");
113
+            }
114
+            else
115
+            {
116
+                return Error("请选择要处理的留言");
117
+            }
118
+        }
119
+
120
+        /// <summary>
121
+        /// 获取留言信息
122
+        /// </summary>
123
+        /// <returns></returns>
124
+        public ActionResult GetLeaveRecord(int id)
125
+        {
126
+            return Success("获取成功", new Bll.T_Call_LeaveRecord().GetModel(id));
127
+        }
128
+    }
129
+}

+ 280 - 0
RMYY_CallCenter_Api/Controllers/CallTel/CallrecordsController.cs

@@ -0,0 +1,280 @@
1
+
2
+using RMYY_CallCenter_Api.DB;
3
+using RMYY_CallCenter_Api.Utility;
4
+using System;
5
+using System.Collections.Generic;
6
+using System.Data;
7
+using System.Linq;
8
+using System.Web;
9
+using System.Web.Mvc;
10
+
11
+namespace RMYY_CallCenter_Api.Controllers.CallTel
12
+{
13
+    public class CallrecordsController : BaseController
14
+    {
15
+        //获取通话记录列表
16
+        public ActionResult GetList( string phone, string usercode, string extnumber, string starttime, string endtime, int islike=1, int type=0,int actiontype=0,int calltype=-1, int callstate=-1, int page = 1, int pagesize = 10, int isdc=0)
17
+        {
18
+            string sql = "";
19
+            DataTable dt = new DataTable();
20
+
21
+            if (type != 0)
22
+            {
23
+                sql += " and F_CallInType = '" + type + "' ";
24
+            }
25
+            if (usercode != null && usercode.Trim() != "")
26
+            {
27
+                sql += " and UserCode in(" + usercode + ")";
28
+            }
29
+            
30
+            if (islike > 0)
31
+            {
32
+                if (phone != null && phone.Trim() != "")
33
+                {
34
+                    sql += " and CallNumber like '%" + phone + "%'";
35
+                }
36
+            }
37
+            else
38
+            {
39
+                if (phone != null && phone.Trim() != "")
40
+                {
41
+                    sql += " and CallNumber = '" + phone + "'";
42
+                }
43
+            }
44
+            if (callstate > -1)
45
+            {
46
+                if (callstate == 0)
47
+                {
48
+                    sql += " and CallState=0 and isnull(UserCode,'')!='' ";
49
+                }
50
+                else if (callstate == 3)
51
+                {
52
+                    sql += " and CallState=0 and CallType=0 and isnull(UserCode,'')='' ";
53
+                }
54
+                else
55
+                {
56
+                    sql += " and CallState='" + callstate + "'";
57
+                }
58
+            }
59
+            if (calltype > -1)
60
+            {
61
+                sql += " and CallType='" + calltype + "'";
62
+            }
63
+            if (actiontype > 0)
64
+            {
65
+                sql += " and ActionType=" + actiontype;
66
+            }
67
+            if (starttime.Trim() != "")
68
+            {
69
+                sql += " and BeginTime>='" + starttime + "' ";
70
+            }
71
+            if (endtime.Trim() != "")
72
+            { 
73
+                sql += " and BeginTime<='" + endtime + "' ";
74
+            }
75
+            if(extnumber.Trim()!="")
76
+            {
77
+                sql += " and isnull(ExtNumber,'')='" + extnumber.Trim() + "'";
78
+            }
79
+
80
+            if (isdc > 0)
81
+            {
82
+                var dtdc = DbHelperSQL.Query(" select   ROW_NUMBER()  OVER(ORDER BY CallRecordsId desc) 编号, CallNumber 电话号码,(case CallType when 0 then '呼入' else '呼出' end ) 呼叫方向,(case CallState when 0 then ( case  when CallType=0 and isnull(UserCode,'')='' then  '主动放弃' else '未接通'   end    ) else '已接通' end ) 呼叫状态,UserCode 坐席工号,dbo.GetUserName(UserCode) as 坐席姓名, "
83
+                    + "BeginTime 开始时间,TalkStartTime 通话开始时间 ,TalkEndTime " +
84
+                    " 通话结束时间 ,EndTime 结束时间 ,LongTime 通话时长 ,PhoneType " +
85
+                    "电话类别"
86
+                   + " from T_Call_CallRecords  a WITH(NOLOCK)  where 1=1 " + sql+ "ORDER BY CallRecordsId desc").Tables[0];
87
+                var msg = new NPOIHelper().ExportToExcel("通话记录", dtdc);
88
+                if (msg == "")
89
+                {
90
+                    return Success("导出成功");
91
+                }
92
+                else
93
+                {
94
+                    return Error("导出失败");
95
+                }
96
+            }
97
+            else
98
+            {
99
+                int recordCount = 0;
100
+                dt = Bll.PagerBll.GetListPager(
101
+                    "T_Call_CallRecords WITH(NOLOCK)",
102
+                    "CallRecordsId",
103
+                    "*,dbo.GetUserName(UserCode) as UserName, WorkOrderId,dbo.GetDictionaryName(F_CallInType) as TypeName",
104
+                    sql,
105
+                    "ORDER BY CallRecordsId desc",
106
+                    pagesize,
107
+                    page,
108
+                    true,
109
+                    out recordCount);
110
+
111
+                var config = new Bll.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
112
+
113
+                foreach (DataRow dr in dt.Rows)
114
+                {
115
+                    string path = dr["FilePath"] != null ? dr["FilePath"].ToString() : "";
116
+                    if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
117
+                    {
118
+                        var ym = config.F_ParamValue;
119
+                        if (ym.Substring(ym.Length - 1) == "/")
120
+                        {
121
+                            ym = ym.Substring(0, ym.Length - 1);
122
+                        }
123
+
124
+                        string lujing = path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
125
+                        string wlpath = ym + lujing;
126
+
127
+                        dr["FilePath"] = wlpath;
128
+                    }
129
+                }
130
+
131
+                var obj = new
132
+                {
133
+                    state = "success",
134
+                    message = "成功",
135
+                    rows = dt,
136
+                    total = recordCount
137
+                };
138
+
139
+                return Content(obj.ToJson());
140
+            }
141
+           
142
+
143
+
144
+        }
145
+
146
+        //获取未接来电
147
+        public ActionResult GetListWJ(string phone, string starttime, string endtime, int ishfSuccess=-1,int ishf=-1,int page = 1, int pagesize = 10)
148
+        {
149
+
150
+            string sql = "";
151
+            DataTable dt = new DataTable();
152
+
153
+
154
+            if (phone != null && phone.Trim() != "")
155
+            {
156
+                sql += " and CallNumber like '%" + phone + "%'";
157
+            }
158
+
159
+            if (starttime.Trim() != "")
160
+            {
161
+                sql += " and BeginTime>= '" + starttime + "' ";
162
+            }
163
+            if (endtime.Trim() != "")
164
+            {
165
+                sql += " and BeginTime<='" + endtime + "' ";
166
+            }
167
+            if (ishf>-1)
168
+            {
169
+                sql += " and F_wjishf=" + ishf + " ";
170
+            }
171
+            if (ishfSuccess>-1)
172
+            {
173
+                sql += " and F_wjishfSuccess=" + ishfSuccess;
174
+            }
175
+            sql += " and CallState='0' and CallType='0'";
176
+
177
+            int recordCount = 0;
178
+            dt = Bll.PagerBll.GetListPager(
179
+                        "T_Call_CallRecords WITH(NOLOCK)",
180
+                        "CallRecordsId",
181
+                        "*",
182
+                        sql,
183
+                        "ORDER BY CallRecordsId desc",
184
+                        pagesize,
185
+                        page,
186
+                        true,
187
+                        out recordCount);
188
+
189
+            var obj = new
190
+            {
191
+                state = "success",
192
+                message = "成功",
193
+                rows = dt,
194
+                total = recordCount
195
+            };
196
+
197
+            return Content(obj.ToJson());
198
+        }
199
+
200
+        //获取转移或三方通话,均为手机号
201
+        //rep_transfer只有转移的数据
202
+        public ActionResult GetListZY(string phone, string usercode, string starttime, string endtime, int callstate = -1, int page = 1, int pagesize = 10)
203
+        {
204
+            string sql = "";
205
+            DataTable dt = new DataTable();
206
+
207
+            sql += " and ActionType>1";//1正常呼入呼出、2转移、3三方通话
208
+
209
+            if (usercode != null && usercode.Trim() != "")
210
+            {
211
+                sql += " and UserCode='" + usercode + "'";
212
+            }
213
+
214
+            if (phone != null && phone.Trim() != "")
215
+            {
216
+                sql += " and CallNumber like '%" + phone + "%'";
217
+            }
218
+            if (callstate>-1)
219
+            {
220
+                sql += " and CallState='" + callstate + "'";
221
+            }
222
+
223
+            if (starttime.Trim() != "")
224
+            {
225
+                sql += " and BeginTime>= '" + starttime + "' ";
226
+            }
227
+            if (endtime.Trim() != "")
228
+            {
229
+                sql += " and BeginTime<='" + endtime + "' ";
230
+            }
231
+
232
+            int recordCount = 0;
233
+
234
+            dt = Bll.PagerBll.GetListPager(
235
+                   "T_Call_CallRecords WITH(NOLOCK)",
236
+                   "CallRecordsId",
237
+                   "*",
238
+                   sql,
239
+                   "ORDER BY CallRecordsId desc",
240
+                   pagesize,
241
+                   page,
242
+                   true,
243
+                   out recordCount);
244
+
245
+            var obj = new
246
+            {
247
+                state = "success",
248
+                message = "成功",
249
+                rows = dt,
250
+                total = recordCount
251
+            };
252
+
253
+            return Content(obj.ToJson());
254
+        }
255
+
256
+        //删除通话记录
257
+        public ActionResult DelCallRecord(string[] ids)
258
+        {
259
+            if (ids != null && ids.Length > 0)
260
+            {
261
+                string idd = " ";
262
+                foreach (string str in ids)
263
+                {
264
+                    idd += str + ",";
265
+                }
266
+                if (new Bll.T_Call_CallRecords().DeleteList(idd.TrimEnd(',')))
267
+                {
268
+                    return Success("删除成功");
269
+                }
270
+                else
271
+                    return Error("删除失败");
272
+            }
273
+            else
274
+            {
275
+                return Error("请选择要删除的记录");
276
+            }
277
+
278
+        }
279
+    }
280
+}

+ 180 - 0
RMYY_CallCenter_Api/Controllers/CallTel/MobiledataController.cs

@@ -0,0 +1,180 @@
1
+using RMYY_CallCenter_Api.Utility;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Linq;
6
+using System.Web;
7
+using System.Web.Mvc;
8
+
9
+namespace RMYY_CallCenter_Api.Controllers.CallTel
10
+{
11
+    public class MobiledataController : BaseController
12
+    {
13
+        //获取号码归属地列表
14
+        public ActionResult GetList(string strtelnum,int page = 1, int pagesize = 10)
15
+        {
16
+          
17
+                string sql = " and F_IsDelete=0";
18
+                DataTable dt = new DataTable();
19
+
20
+                if (strtelnum != null && strtelnum.Trim() != "")
21
+                {
22
+                    sql += " and (F_MobileNum= '" + strtelnum.Trim() + "' or F_ZipCode like '%" + strtelnum.Trim()
23
+                        + "%' or F_CityDes like '%" + strtelnum.Trim() + "%'or F_CardDes like '%" + strtelnum.Trim() + "%')";
24
+                }
25
+
26
+                int recordCount = 0;
27
+                dt = Bll.PagerBll.GetListPager(
28
+                    "T_Sys_MobileData with(nolock)",
29
+                    "F_Id",
30
+                    "*",
31
+                    sql,
32
+                    "ORDER BY F_Id desc",
33
+                    pagesize,
34
+                    page,
35
+                    true,
36
+                    out recordCount);
37
+
38
+                var obj = new
39
+                {
40
+                    state = "success",
41
+                    message = "成功",
42
+                    rows = dt,
43
+                    total = recordCount
44
+                };
45
+
46
+                return Content(obj.ToJson());
47
+
48
+           
49
+        }
50
+
51
+        //获取详情
52
+        public ActionResult GetMobiledata(int id)
53
+        {
54
+            return Success("获取号码归属地成功", new Bll.T_Sys_MobileData().GetModel(id));
55
+        }
56
+
57
+        //获取号码归属地
58
+        public ActionResult GetMobiledataByNum(string mobileNum)
59
+        {
60
+            if (!string.IsNullOrEmpty(mobileNum))
61
+            {
62
+                Model.T_Sys_MobileData dModel = new Bll.T_Sys_MobileData().GetModelList(" F_MobileNum='" + mobileNum.Trim() + "' ").FirstOrDefault();
63
+                if (dModel != null)
64
+                {
65
+                    return Success("获取号码归属地成功", dModel);
66
+                }
67
+                else
68
+                {
69
+                    return Error("获取号码归属地失败");
70
+                }
71
+            }
72
+            else
73
+            {
74
+                return Error("获取参数失败");
75
+            }
76
+        }
77
+
78
+        //添加/编辑号码归属地
79
+        public ActionResult AddMobiledata(string mobileNum, string zipCode, string cityDes, string cardDes, int id = 0)
80
+        {
81
+            Bll.T_Sys_MobileData dBLL = new Bll.T_Sys_MobileData();
82
+            Model.T_Sys_MobileData dModel = new Model.T_Sys_MobileData();
83
+
84
+            if (id != 0)
85
+            {
86
+
87
+                dModel = dBLL.GetModel(id);
88
+                if (dModel != null)
89
+                {
90
+                    if (!string.IsNullOrWhiteSpace(mobileNum.Trim()))
91
+                    {
92
+                        dModel.F_MobileNum = mobileNum.Trim();
93
+                    }
94
+                    if (!string.IsNullOrWhiteSpace(zipCode.Trim()))
95
+                    {
96
+                        dModel.F_ZipCode = zipCode.Trim();
97
+                    }
98
+                    if (!string.IsNullOrWhiteSpace(cityDes.Trim()))
99
+                    {
100
+                        dModel.F_CityDes = cityDes.Trim();
101
+                    }
102
+                    if (!string.IsNullOrWhiteSpace(cardDes.Trim()))
103
+                    {
104
+                        dModel.F_CardDes = cardDes.Trim();
105
+                    }
106
+
107
+                    bool b = dBLL.Update(dModel);
108
+                    if (b)
109
+                    {
110
+                        return Success("编辑成功");
111
+                    }
112
+                    else
113
+                    {
114
+                        return Error("编辑失败");
115
+                    }
116
+                }
117
+                else
118
+                {
119
+                    return Error("编辑失败");
120
+                }
121
+            }
122
+            else
123
+            {
124
+                dModel = new Model.T_Sys_MobileData();
125
+
126
+                if (!string.IsNullOrWhiteSpace(mobileNum.Trim()))
127
+                {
128
+                    dModel.F_MobileNum = mobileNum.Trim();
129
+                }
130
+                if (!string.IsNullOrWhiteSpace(zipCode.Trim()))
131
+                {
132
+                    dModel.F_ZipCode = zipCode.Trim();
133
+                }
134
+                if (!string.IsNullOrWhiteSpace(cityDes.Trim()))
135
+                {
136
+                    dModel.F_CityDes = cityDes.Trim();
137
+                }
138
+                if (!string.IsNullOrWhiteSpace(cardDes.Trim()))
139
+                {
140
+                    dModel.F_CardDes = cardDes.Trim();
141
+                }
142
+                dModel.F_IsDelete = 0;
143
+                dModel.F_CreateUser = User.F_UserCode;
144
+                dModel.F_CreateTime = DateTime.Now;
145
+                int n = dBLL.Add(dModel);
146
+                if (n > 0)
147
+                {
148
+                    return Success("添加成功", n);
149
+                }
150
+                else
151
+                {
152
+                    return Error("添加失败");
153
+                }
154
+            }
155
+        }
156
+
157
+        //删除号码归属地记录
158
+        public ActionResult DelMobiledata(string[] nums)
159
+        {
160
+            if (nums != null && nums.Length > 0)
161
+            {
162
+                string idd = " ";
163
+                foreach (string str in nums)
164
+                {
165
+                    idd += "'" + str + "',";
166
+                }
167
+                if (new Bll.T_Sys_MobileData().DeleteList(idd.TrimEnd(','), User.F_UserCode))
168
+                {
169
+                    return Success("删除成功");
170
+                }
171
+                else
172
+                    return Error("删除失败");
173
+            }
174
+            else
175
+            {
176
+                return Error("请选择要删除的记录");
177
+            }
178
+        }
179
+    }
180
+}

+ 59 - 0
RMYY_CallCenter_Api/Controllers/CallTel/WorkOffDaysController.cs

@@ -0,0 +1,59 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Web;
6
+using System.Web.Mvc;
7
+
8
+namespace RMYY_CallCenter_Api.Controllers.CallTel
9
+{
10
+    public class WorkOffDaysController : BaseController
11
+    {
12
+        Bll.T_Sys_WorkOffDays dBLL = new Bll.T_Sys_WorkOffDays();
13
+        //获取休息日列表
14
+        public ActionResult GetList(string date)
15
+        {
16
+            string sql = " and DATEDIFF(MONTH,GETDATE(),f_offdate) in (-1,0,1) ";
17
+            if (!string.IsNullOrEmpty(date))
18
+                sql = " and DATEDIFF(MONTH,'"+ date + "',f_offdate) in (-1,0,1) ";
19
+            List<Model.T_Sys_WorkOffDays> wodlist = dBLL.GetModelList(" F_OffState=0 " + sql + " order by F_OffDate");
20
+            var obj = wodlist.Select(wol => new
21
+            {
22
+                date = wol.F_OffDate.Value.ToString("yyyy-MM-dd"),
23
+            });
24
+            return Success("获取成功", obj);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 设置或取消休息日
29
+        /// </summary>
30
+        /// <param name="offdate">日期</param>
31
+        /// <param name="type">0,设为休息日;1,取消休息日</param>
32
+        /// <returns></returns>
33
+        public ActionResult setOfforOn(string offdate, int type)
34
+        {
35
+            if (string.IsNullOrWhiteSpace(offdate))
36
+                return Error("参数错误");
37
+
38
+            Model.T_Sys_WorkOffDays dModel = dBLL.GetModel(offdate);
39
+            if (dModel == null)
40
+            {
41
+                return Error("设置的日期有误,请联系管理员");
42
+            }
43
+            dModel.F_OffDate = Convert.ToDateTime(offdate);
44
+            dModel.F_OffState = type;
45
+            dModel.F_DeleteBy = User.F_UserCode;
46
+            dModel.F_DeleteOn = DateTime.Now;
47
+
48
+            var res = dBLL.UpdateState(dModel);
49
+            if (res)
50
+            {
51
+                return Success("设置成功");
52
+            }
53
+            else
54
+            {
55
+                return Error("设置失败");
56
+            }
57
+        }
58
+    }
59
+}

+ 0 - 1
RMYY_CallCenter_Api/Controllers/GongDanTypeController.cs

@@ -5,7 +5,6 @@ using System.Linq;
5 5
 using System.Text;
6 6
 using System.Web;
7 7
 using System.Web.Mvc;
8
-using CallCenter.Utility;
9 8
 using CallCenterApi.Interface.Models;
10 9
 using RMYY_CallCenter_Api.Model;
11 10
 using RMYY_CallCenter_Api.Models;

+ 6 - 25
RMYY_CallCenter_Api/Controllers/System/UserAccountController.cs

@@ -17,27 +17,18 @@ namespace RMYY_CallCenter_Api.Controllers.System
17 17
         /// </summary>
18 18
         /// <returns></returns>
19 19
         [HttpPost]
20
-        public ActionResult GetList()
20
+        public ActionResult GetList(string key, int roleid = 0, int deptid = 0, int page = 1, int pagesize = 10)
21 21
         {
22 22
             DataTable dt = new DataTable();
23 23
             string sql = string.Empty;
24 24
 
25
-            string roleid = Request.Params["roleid"]?.ToString();
26
-            string deptid = Request.Params["deptid"]?.ToString();
27
-            string key = Request.Params["key"];
28
-
29
-            string strpageindex = Request.Params["page"];
30
-            int pageindex = 1;
31
-            string strpagesize = Request.Params["pagesize"];
32
-            int pagesize = 10;
33
-
34
-            if (!string.IsNullOrWhiteSpace(deptid))
25
+            if (deptid > 0)
35 26
             {
36
-                sql += " and F_DeptId='" + deptid.ToInt() + "'";
27
+                sql += " and F_DeptId='" + deptid + "'";
37 28
             }
38
-            if (!string.IsNullOrWhiteSpace(roleid))
29
+            if (roleid > 0)
39 30
             {
40
-                sql += " and F_RoleId='" + roleid.ToInt() + "'";
31
+                sql += " and F_RoleId='" + roleid + "'";
41 32
             }
42 33
 
43 34
             if (!string.IsNullOrWhiteSpace(key))
@@ -45,16 +36,6 @@ namespace RMYY_CallCenter_Api.Controllers.System
45 36
                 sql += " and (F_UserCode like '%{0}%' or F_UserName like '%{1}%')";
46 37
             }
47 38
 
48
-            if (!string.IsNullOrWhiteSpace(strpageindex))
49
-            {
50
-                pageindex = strpageindex.ToInt();
51
-            }
52
-
53
-            if (!string.IsNullOrWhiteSpace(strpagesize))
54
-            {
55
-                pagesize = strpagesize.ToInt();
56
-            }
57
-
58 39
             int recordCount = 0;
59 40
             dt = Bll.PagerBll.GetListPager(
60 41
                                     "T_Sys_UserAccount with(nolock)",
@@ -63,7 +44,7 @@ namespace RMYY_CallCenter_Api.Controllers.System
63 44
                                     sql,
64 45
                                     "ORDER BY F_UserId desc",
65 46
                                     pagesize,
66
-                                    pageindex,
47
+                                    page,
67 48
                                     true,
68 49
                                     out recordCount);
69 50
             var obj = new

+ 1 - 1
RMYY_CallCenter_Api/Global.asax.cs

@@ -14,7 +14,7 @@ namespace RMYY_CallCenter_Api
14 14
         protected void Application_Start()
15 15
         {
16 16
             AreaRegistration.RegisterAllAreas();
17
-            //FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
17
+            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
18 18
             RouteConfig.RegisterRoutes(RouteTable.Routes);
19 19
         }
20 20
 

+ 6 - 2
RMYY_CallCenter_Api/RMYY_CallCenter_Api.csproj

@@ -122,6 +122,12 @@
122 122
     <Compile Include="Common\Common.cs" />
123 123
     <Compile Include="Common\ListBase.cs" />
124 124
     <Compile Include="Controllers\BaseController.cs" />
125
+    <Compile Include="Controllers\CallTel\CallblackController.cs" />
126
+    <Compile Include="Controllers\CallTel\CallInScreenController.cs" />
127
+    <Compile Include="Controllers\CallTel\CallleaveController.cs" />
128
+    <Compile Include="Controllers\CallTel\CallrecordsController.cs" />
129
+    <Compile Include="Controllers\CallTel\MobiledataController.cs" />
130
+    <Compile Include="Controllers\CallTel\WorkOffDaysController.cs" />
125 131
     <Compile Include="Controllers\DictionaryController.cs" />
126 132
     <Compile Include="Controllers\GongDanTypeController.cs" />
127 133
     <Compile Include="Controllers\HomeController.cs" />
@@ -164,8 +170,6 @@
164 170
   </ItemGroup>
165 171
   <ItemGroup>
166 172
     <Folder Include="App_Data\" />
167
-    <Folder Include="Views\GongDanType\" />
168
-    <Folder Include="Views\Index\" />
169 173
   </ItemGroup>
170 174
   <ItemGroup>
171 175
     <Content Include="Configs\log4net.config" />