duhongyu 3 lat temu
rodzic
commit
650e6d837e
23 zmienionych plików z 1203 dodań i 346 usunięć
  1. 1 0
      CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj
  2. 3 3
      CallCenterApi/CallCenterApi.BLL/T_Sys_Area.cs
  3. 3 3
      CallCenterApi/CallCenterApi.BLL/T_Sys_AreaChildren.cs
  4. 3 3
      CallCenterApi/CallCenterApi.BLL/T_Sys_Department.cs
  5. 159 162
      CallCenterApi/CallCenterApi.BLL/T_Sys_DictionaryValue.cs
  6. 3 3
      CallCenterApi/CallCenterApi.BLL/T_Sys_SystemConfig.cs
  7. 86 86
      CallCenterApi/CallCenterApi.BLL/T_Sys_UserAccount.cs
  8. 11 0
      CallCenterApi/CallCenterApi.BLL/app.config
  9. 4 0
      CallCenterApi/CallCenterApi.BLL/packages.config
  10. 6 0
      CallCenterApi/CallCenterApi.Common/CallCenterApi.Common.csproj
  11. 5 2
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj
  12. 77 76
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs
  13. 3 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/packages.config
  14. 1 0
      CallCenterCommon/CallCenter.QuartzService/CallCenter.QuartzService.csproj
  15. 11 0
      CallCenterCommon/CallCenter.QuartzService/app.config
  16. 6 3
      CallCenterCommon/CallCenter.Utility/CallCenter.Utility.csproj
  17. 3 3
      CallCenterCommon/CallCenter.Utility/RedisHelper1.cs
  18. 815 0
      CallCenterCommon/CallCenter.Utility/RedisHelper2.cs
  19. 3 1
      CallCenterCommon/CallCenter.Utility/packages.config
  20. BIN
      文档/材料/~$《关于部署大数据局12345市长热线系统的函》的答复-20220425.docx
  21. BIN
      文档/材料/~$心VPN&堡垒机登录说明 for windows.docx
  22. BIN
      文档/材料/云中心VPN&堡垒机登录说明 for windows.docx
  23. BIN
      文档/材料/关于《关于部署大数据局12345市长热线系统的函》的答复-20220425.docx

+ 1 - 0
CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

@@ -190,6 +190,7 @@
190 190
     </ProjectReference>
191 191
   </ItemGroup>
192 192
   <ItemGroup>
193
+    <None Include="app.config" />
193 194
     <None Include="packages.config" />
194 195
   </ItemGroup>
195 196
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 3 - 3
CallCenterApi/CallCenterApi.BLL/T_Sys_Area.cs

@@ -233,7 +233,7 @@ namespace CallCenterApi.BLL
233 233
 
234 234
         private DataTable GetRedis()
235 235
         {
236
-            var strList = RedisHelper1.StringGet("T_Sys_Area");
236
+            var strList = RedisHelper.StringGet("T_Sys_Area");
237 237
             if (strList != null)
238 238
             {
239 239
                 return strList.ToString().ToObject<DataTable>();
@@ -248,14 +248,14 @@ namespace CallCenterApi.BLL
248 248
         {
249 249
             var dt = dal.GetList("").Tables[0];
250 250
 
251
-            RedisHelper1.StringSet("T_Sys_Area", dt.ToJson(), new TimeSpan(24, 0, 0));
251
+            RedisHelper.StringSet("T_Sys_Area", dt.ToJson(), new TimeSpan(24, 0, 0));
252 252
 
253 253
             return dt;
254 254
         }
255 255
 
256 256
         private void OutRedis()
257 257
         {
258
-            RedisHelper1.KeyDelete("T_Sys_Area");
258
+            RedisHelper.KeyDelete("T_Sys_Area");
259 259
         }
260 260
     }
261 261
 }

+ 3 - 3
CallCenterApi/CallCenterApi.BLL/T_Sys_AreaChildren.cs

@@ -99,7 +99,7 @@ namespace CallCenterApi.BLL
99 99
         }
100 100
         private DataTable GetRedis()
101 101
         {
102
-            var strList = RedisHelper1.StringGet("T_Sys_AreaChildren");
102
+            var strList = RedisHelper.StringGet("T_Sys_AreaChildren");
103 103
             if (strList != null)
104 104
             {
105 105
                 return strList.ToString().ToObject<DataTable>();
@@ -113,14 +113,14 @@ namespace CallCenterApi.BLL
113 113
         {
114 114
             var dt = dal.GetList("").Tables[0];
115 115
 
116
-            RedisHelper1.StringSet("T_Sys_AreaChildren", dt.ToJson(), new TimeSpan(24, 0, 0));
116
+            RedisHelper.StringSet("T_Sys_AreaChildren", dt.ToJson(), new TimeSpan(24, 0, 0));
117 117
 
118 118
             return dt;
119 119
         }
120 120
 
121 121
         private void OutRedis()
122 122
         {
123
-            RedisHelper1.KeyDelete("T_Sys_AreaChildren");
123
+            RedisHelper.KeyDelete("T_Sys_AreaChildren");
124 124
         }
125 125
         /// <summary>
126 126
         /// 获得数据列表

+ 3 - 3
CallCenterApi/CallCenterApi.BLL/T_Sys_Department.cs

@@ -229,7 +229,7 @@ namespace CallCenterApi.BLL
229 229
 
230 230
         private DataTable GetRedis()
231 231
         {
232
-            var strList = RedisHelper1.StringGet("T_Sys_Department");
232
+            var strList = RedisHelper.StringGet("T_Sys_Department");
233 233
             if (strList != null)
234 234
             {
235 235
                 return strList.ToString().ToObject<DataTable>();
@@ -244,14 +244,14 @@ namespace CallCenterApi.BLL
244 244
         {
245 245
             var dt = dal.GetList("").Tables[0];
246 246
 
247
-            RedisHelper1.StringSet("T_Sys_Department", dt.ToJson(), new TimeSpan(24, 0, 0));
247
+            RedisHelper.StringSet("T_Sys_Department", dt.ToJson(), new TimeSpan(24, 0, 0));
248 248
 
249 249
             return dt;
250 250
         }
251 251
 
252 252
         private void OutRedis()
253 253
         {
254
-            RedisHelper1.KeyDelete("T_Sys_Department");
254
+            RedisHelper.KeyDelete("T_Sys_Department");
255 255
         }
256 256
     }
257 257
 }

+ 159 - 162
CallCenterApi/CallCenterApi.BLL/T_Sys_DictionaryValue.cs

@@ -4,62 +4,61 @@ using System.Collections.Generic;
4 4
 
5 5
 using CallCenterApi.Model;
6 6
 using CallCenter.Utility;
7
-using Newtonsoft.Json;
8 7
 
9 8
 namespace CallCenterApi.BLL
10 9
 {
11
-	/// <summary>
12
-	/// 1
13
-	/// </summary>
14
-	public partial class T_Sys_DictionaryValue
15
-	{
16
-		private readonly CallCenterApi.DAL.T_Sys_DictionaryValue dal=new CallCenterApi.DAL.T_Sys_DictionaryValue();
17
-		public T_Sys_DictionaryValue()
18
-		{}
19
-		#region  Method
10
+    /// <summary>
11
+    /// 1
12
+    /// </summary>
13
+    public partial class T_Sys_DictionaryValue
14
+    {
15
+        private readonly CallCenterApi.DAL.T_Sys_DictionaryValue dal = new CallCenterApi.DAL.T_Sys_DictionaryValue();
16
+        public T_Sys_DictionaryValue()
17
+        { }
18
+        #region  Method
20 19
 
21
-		/// <summary>
22
-		/// 是否存在该记录
23
-		/// </summary>
24
-		public bool Exists(int F_ValueId)
25
-		{
26
-			return dal.Exists(F_ValueId);
27
-		}
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int F_ValueId)
24
+        {
25
+            return dal.Exists(F_ValueId);
26
+        }
28 27
 
29
-		/// <summary>
30
-		/// 增加一条数据
31
-		/// </summary>
32
-		public int  Add(CallCenterApi.Model.T_Sys_DictionaryValue model)
33
-		{
28
+        /// <summary>
29
+        /// 增加一条数据
30
+        /// </summary>
31
+        public int Add(CallCenterApi.Model.T_Sys_DictionaryValue model)
32
+        {
34 33
             OutRedis();
35 34
             return dal.Add(model);
36
-		}
35
+        }
37 36
 
38
-		/// <summary>
39
-		/// 更新一条数据
40
-		/// </summary>
41
-		public bool Update(CallCenterApi.Model.T_Sys_DictionaryValue model)
42
-		{
37
+        /// <summary>
38
+        /// 更新一条数据
39
+        /// </summary>
40
+        public bool Update(CallCenterApi.Model.T_Sys_DictionaryValue model)
41
+        {
43 42
             OutRedis();
44 43
             return dal.Update(model);
45
-		}
44
+        }
46 45
 
47
-		/// <summary>
48
-		/// 删除一条数据
49
-		/// </summary>
50
-		public bool Delete(int F_ValueId)
51
-		{
46
+        /// <summary>
47
+        /// 删除一条数据
48
+        /// </summary>
49
+        public bool Delete(int F_ValueId)
50
+        {
52 51
             OutRedis();
53 52
             return dal.Delete(F_ValueId);
54
-		}
55
-		/// <summary>
56
-		/// 删除一条数据
57
-		/// </summary>
58
-		public bool DeleteList(string F_ValueIdlist )
59
-		{
53
+        }
54
+        /// <summary>
55
+        /// 删除一条数据
56
+        /// </summary>
57
+        public bool DeleteList(string F_ValueIdlist)
58
+        {
60 59
             OutRedis();
61
-            return dal.DeleteList(F_ValueIdlist );
62
-		}
60
+            return dal.DeleteList(F_ValueIdlist);
61
+        }
63 62
         public bool DeleteList1(string F_ValueIdlist)
64 63
         {
65 64
             OutRedis();
@@ -70,25 +69,24 @@ namespace CallCenterApi.BLL
70 69
         /// 得到一个对象实体
71 70
         /// </summary>
72 71
         public CallCenterApi.Model.T_Sys_DictionaryValue GetModel(int F_ValueId)
73
-		{
74
-            //var dt = GetRedis();
75
-            //if (dt != null)
76
-            //{
77
-            //    var dr = dt.Select("F_ValueId=" + F_ValueId);
78
-            //    if (dr != null && dr.Length > 0)
79
-            //    {
80
-            //        return dal.DataRowToModel(dr[0]);
81
-            //    }
82
-            //    else
83
-            //    {
84
-            //        return null;
85
-            //    }
86
-            //}
87
-            //else
88
-            //{
89
-            //    return dal.GetModel(F_ValueId);
90
-            //}
91
-            return dal.GetModel(F_ValueId);
72
+        {
73
+            var dt = GetRedis();
74
+            if (dt != null)
75
+            {
76
+                var dr = dt.Select("F_ValueId=" + F_ValueId);
77
+                if (dr != null && dr.Length > 0)
78
+                {
79
+                    return dal.DataRowToModel(dr[0]);
80
+                }
81
+                else
82
+                {
83
+                    return null;
84
+                }
85
+            }
86
+            else
87
+            {
88
+                return dal.GetModel(F_ValueId);
89
+            }
92 90
         }
93 91
 
94 92
         /// <summary>
@@ -120,27 +118,27 @@ namespace CallCenterApi.BLL
120 118
         /// </summary>
121 119
         public DataSet GetList(string strWhere, string filedOrder = "")
122 120
         {
123
-            //var dt = GetRedis();
124
-            //if (dt != null)
125
-            //{
126
-            //    var ds = new DataSet();
121
+            var dt = GetRedis();
122
+            if (dt != null)
123
+            {
124
+                var ds = new DataSet();
125
+
126
+                var drs = dt.Select(strWhere, filedOrder);
127
+                if (drs.Length > 0)
128
+                {
129
+                    ds.Tables.Add(drs.CopyToDataTable());
130
+                }
131
+                else
132
+                {
133
+                    ds.Tables.Add(new DataTable());
134
+                }
135
+                return ds;
136
+            }
137
+            else
138
+            {
139
+                return dal.GetList(strWhere);
140
+            }
127 141
 
128
-            //    var drs = dt.Select(strWhere, filedOrder);
129
-            //    if (drs.Length > 0)
130
-            //    {
131
-            //        ds.Tables.Add(drs.CopyToDataTable());
132
-            //    }
133
-            //    else
134
-            //    {
135
-            //        ds.Tables.Add(new DataTable());
136
-            //    }
137
-            //    return ds;
138
-            //}
139
-            //else
140
-            //{
141
-            //    return dal.GetList(strWhere);
142
-            //}
143
-            return dal.GetList(strWhere);
144 142
         }
145 143
 
146 144
         /// <summary>
@@ -153,33 +151,31 @@ namespace CallCenterApi.BLL
153 151
         /// <summary>
154 152
         /// 获得前几行数据
155 153
         /// </summary>
156
-        public DataSet GetList(int Top,string strWhere,string filedOrder)
157
-		{
158
-			return dal.GetList(Top,strWhere,filedOrder);
159
-		}
160
-		/// <summary>
161
-		/// 获得数据列表
162
-		/// </summary>
163
-		public List<CallCenterApi.Model.T_Sys_DictionaryValue> GetModelList(string strWhere, string filedOrder = "")
164
-		{
165
-            //var dt = GetRedis();
166
-            //if (dt != null)
167
-            //{
168
-            //    var dtnew = new DataTable();
169
-            //    var drs = dt.Select(strWhere, filedOrder);
170
-            //    if (drs.Length > 0)
171
-            //    {
172
-            //        dtnew = drs.CopyToDataTable();
173
-            //    }
174
-            //    return DataTableToList(dtnew);
175
-            //}
176
-            //else
177
-            //{
178
-            //    DataSet ds = dal.GetList(strWhere, filedOrder);
179
-            //    return DataTableToList(ds.Tables[0]);
180
-            //}
181
-            DataSet ds = dal.GetList(strWhere, filedOrder);
182
-            return DataTableToList(ds.Tables[0]);
154
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
155
+        {
156
+            return dal.GetList(Top, strWhere, filedOrder);
157
+        }
158
+        /// <summary>
159
+        /// 获得数据列表
160
+        /// </summary>
161
+        public List<CallCenterApi.Model.T_Sys_DictionaryValue> GetModelList(string strWhere, string filedOrder = "")
162
+        {
163
+            var dt = GetRedis();
164
+            if (dt != null)
165
+            {
166
+                var dtnew = new DataTable();
167
+                var drs = dt.Select(strWhere, filedOrder);
168
+                if (drs.Length > 0)
169
+                {
170
+                    dtnew = drs.CopyToDataTable();
171
+                }
172
+                return DataTableToList(dtnew);
173
+            }
174
+            else
175
+            {
176
+                DataSet ds = dal.GetList(strWhere, filedOrder);
177
+                return DataTableToList(ds.Tables[0]);
178
+            }
183 179
         }
184 180
 
185 181
         /// <summary>
@@ -194,59 +190,59 @@ namespace CallCenterApi.BLL
194 190
         /// 获得数据列表
195 191
         /// </summary>
196 192
         public List<CallCenterApi.Model.T_Sys_DictionaryValue> DataTableToList(DataTable dt)
197
-		{
198
-			List<CallCenterApi.Model.T_Sys_DictionaryValue> modelList = new List<CallCenterApi.Model.T_Sys_DictionaryValue>();
199
-			int rowsCount = dt.Rows.Count;
200
-			if (rowsCount > 0)
201
-			{
202
-				CallCenterApi.Model.T_Sys_DictionaryValue model;
203
-				for (int n = 0; n < rowsCount; n++)
204
-				{
205
-					model = new CallCenterApi.Model.T_Sys_DictionaryValue();
206
-					if(dt.Rows[n]["F_ValueId"]!=null && dt.Rows[n]["F_ValueId"].ToString()!="")
207
-					{
208
-						model.F_ValueId=int.Parse(dt.Rows[n]["F_ValueId"].ToString());
209
-					}
210
-					if(dt.Rows[n]["F_ItemId"]!=null && dt.Rows[n]["F_ItemId"].ToString()!="")
211
-					{
212
-						model.F_ItemId=int.Parse(dt.Rows[n]["F_ItemId"].ToString());
213
-					}
214
-					if(dt.Rows[n]["F_Value"]!=null && dt.Rows[n]["F_Value"].ToString()!="")
215
-					{
216
-					model.F_Value=dt.Rows[n]["F_Value"].ToString();
217
-					}
218
-					if(dt.Rows[n]["F_PrentId"]!=null && dt.Rows[n]["F_PrentId"].ToString()!="")
219
-					{
220
-						model.F_PrentId=int.Parse(dt.Rows[n]["F_PrentId"].ToString());
221
-					}
222
-					if(dt.Rows[n]["F_Layer"]!=null && dt.Rows[n]["F_Layer"].ToString()!="")
223
-					{
224
-						model.F_Layer=int.Parse(dt.Rows[n]["F_Layer"].ToString());
225
-					}
226
-					if(dt.Rows[n]["F_IsLeaf"]!=null && dt.Rows[n]["F_IsLeaf"].ToString()!="")
227
-					{
228
-						if((dt.Rows[n]["F_IsLeaf"].ToString()=="1")||(dt.Rows[n]["F_IsLeaf"].ToString().ToLower()=="true"))
229
-						{
230
-						model.F_IsLeaf=true;
231
-						}
232
-						else
233
-						{
234
-							model.F_IsLeaf=false;
235
-						}
236
-					}
237
-					modelList.Add(model);
238
-				}
239
-			}
240
-			return modelList;
241
-		}
193
+        {
194
+            List<CallCenterApi.Model.T_Sys_DictionaryValue> modelList = new List<CallCenterApi.Model.T_Sys_DictionaryValue>();
195
+            int rowsCount = dt.Rows.Count;
196
+            if (rowsCount > 0)
197
+            {
198
+                CallCenterApi.Model.T_Sys_DictionaryValue model;
199
+                for (int n = 0; n < rowsCount; n++)
200
+                {
201
+                    model = new CallCenterApi.Model.T_Sys_DictionaryValue();
202
+                    if (dt.Rows[n]["F_ValueId"] != null && dt.Rows[n]["F_ValueId"].ToString() != "")
203
+                    {
204
+                        model.F_ValueId = int.Parse(dt.Rows[n]["F_ValueId"].ToString());
205
+                    }
206
+                    if (dt.Rows[n]["F_ItemId"] != null && dt.Rows[n]["F_ItemId"].ToString() != "")
207
+                    {
208
+                        model.F_ItemId = int.Parse(dt.Rows[n]["F_ItemId"].ToString());
209
+                    }
210
+                    if (dt.Rows[n]["F_Value"] != null && dt.Rows[n]["F_Value"].ToString() != "")
211
+                    {
212
+                        model.F_Value = dt.Rows[n]["F_Value"].ToString();
213
+                    }
214
+                    if (dt.Rows[n]["F_PrentId"] != null && dt.Rows[n]["F_PrentId"].ToString() != "")
215
+                    {
216
+                        model.F_PrentId = int.Parse(dt.Rows[n]["F_PrentId"].ToString());
217
+                    }
218
+                    if (dt.Rows[n]["F_Layer"] != null && dt.Rows[n]["F_Layer"].ToString() != "")
219
+                    {
220
+                        model.F_Layer = int.Parse(dt.Rows[n]["F_Layer"].ToString());
221
+                    }
222
+                    if (dt.Rows[n]["F_IsLeaf"] != null && dt.Rows[n]["F_IsLeaf"].ToString() != "")
223
+                    {
224
+                        if ((dt.Rows[n]["F_IsLeaf"].ToString() == "1") || (dt.Rows[n]["F_IsLeaf"].ToString().ToLower() == "true"))
225
+                        {
226
+                            model.F_IsLeaf = true;
227
+                        }
228
+                        else
229
+                        {
230
+                            model.F_IsLeaf = false;
231
+                        }
232
+                    }
233
+                    modelList.Add(model);
234
+                }
235
+            }
236
+            return modelList;
237
+        }
242 238
 
243
-		/// <summary>
244
-		/// 获得数据列表
245
-		/// </summary>
246
-		public DataSet GetAllList()
247
-		{
248
-			return GetList("");
249
-		}
239
+        /// <summary>
240
+        /// 获得数据列表
241
+        /// </summary>
242
+        public DataSet GetAllList()
243
+        {
244
+            return GetList("");
245
+        }
250 246
 
251 247
         /// <summary>
252 248
         /// 分页获取数据列表
@@ -274,7 +270,8 @@ namespace CallCenterApi.BLL
274 270
         private DataTable InRedis()
275 271
         {
276 272
             var dt = dal.GetList("").Tables[0];
277
-            RedisHelper1.StringSet("T_Sys_DictionaryValue", dt.ToJson (), new TimeSpan(24, 0, 0));
273
+
274
+            RedisHelper1.StringSet("T_Sys_DictionaryValue", dt.ToJson(), new TimeSpan(24, 0, 0));
278 275
 
279 276
             return dt;
280 277
         }
@@ -283,7 +280,7 @@ namespace CallCenterApi.BLL
283 280
         {
284 281
             RedisHelper1.KeyDelete("T_Sys_DictionaryValue");
285 282
             RedisHelper1.KeyDelete("ztree_38");
286
-            RedisHelper1.KeyDelete("ztree_38new");
283
+            RedisHelper.KeyDelete("ztree_38new");
287 284
             RedisHelper1.KeyDelete("key_38");
288 285
             RedisHelper1.KeyDelete("ZTreeList_0");
289 286
         }

+ 3 - 3
CallCenterApi/CallCenterApi.BLL/T_Sys_SystemConfig.cs

@@ -182,7 +182,7 @@ namespace CallCenterApi.BLL
182 182
 
183 183
         private DataTable GetRedis()
184 184
         {
185
-            var strList = RedisHelper1.StringGet("SysConfig");
185
+            var strList = RedisHelper.StringGet("SysConfig");
186 186
             if (strList != null)
187 187
             {
188 188
                 return strList.ToString().ToObject<DataTable>();
@@ -197,14 +197,14 @@ namespace CallCenterApi.BLL
197 197
         {
198 198
             var dt = dal.GetList("").Tables[0];
199 199
 
200
-            RedisHelper1.StringSet("SysConfig", dt.ToJson(), new TimeSpan(24, 0, 0));
200
+            RedisHelper.StringSet("SysConfig", dt.ToJson(), new TimeSpan(24, 0, 0));
201 201
 
202 202
             return dt;
203 203
         }
204 204
 
205 205
         private void OutRedis()
206 206
         {
207
-            RedisHelper1.KeyDelete("SysConfig");
207
+            RedisHelper.KeyDelete("SysConfig");
208 208
         }
209 209
     }
210 210
 }

+ 86 - 86
CallCenterApi/CallCenterApi.BLL/T_Sys_UserAccount.cs

@@ -83,24 +83,24 @@ namespace CallCenterApi.BLL
83 83
         public Model.T_Sys_UserAccount GetModel(int F_UserId)
84 84
         {
85 85
 
86
-            //var dt = GetRedis();
87
-            //if (dt != null)
88
-            //{
89
-            //    var dr = dt.Select("F_UserId=" + F_UserId);
90
-            //    if (dr != null && dr.Count() > 0)
91
-            //    {
92
-            //        return dal.DataRowToModel(dr[0]);
93
-            //    }
94
-            //    else
95
-            //    {
96
-            //        return null;
97
-            //    }
98
-            //}
99
-            //else
100
-            //{
101
-            //    return dal.GetModel(F_UserId);
102
-            //}
103
-            return dal.GetModel(F_UserId);
86
+            var dt = GetRedis();
87
+            if (dt != null)
88
+            {
89
+                var dr = dt.Select("F_UserId=" + F_UserId);
90
+                if (dr != null && dr.Count() > 0)
91
+                {
92
+                    return dal.DataRowToModel(dr[0]);
93
+                }
94
+                else
95
+                {
96
+                    return null;
97
+                }
98
+            }
99
+            else
100
+            {
101
+                return dal.GetModel(F_UserId);
102
+            }
103
+           // return dal.GetModel(F_UserId);
104 104
         }
105 105
         /// <summary>
106 106
         /// 得到一个对象实体
@@ -108,24 +108,24 @@ namespace CallCenterApi.BLL
108 108
         public Model.T_Sys_UserAccount GetModel(string F_UserCode)
109 109
         {
110 110
 
111
-            //var dt = GetRedis();
112
-            //if (dt != null)
113
-            //{
114
-            //    var dr = dt.Select("F_UserCode='" + F_UserCode+"'");
115
-            //    if (dr != null&& dr.Count()>0)
116
-            //    {
117
-            //        return dal.DataRowToModel(dr[0]);
118
-            //    }
119
-            //    else
120
-            //    {
121
-            //        return null;
122
-            //    }
123
-            //}
124
-            //else
125
-            //{
126
-            //    return dal.GetModel(F_UserCode);
127
-            //}
128
-            return dal.GetModel(F_UserCode);
111
+            var dt = GetRedis();
112
+            if (dt != null)
113
+            {
114
+                var dr = dt.Select("F_UserCode='" + F_UserCode + "'");
115
+                if (dr != null && dr.Count() > 0)
116
+                {
117
+                    return dal.DataRowToModel(dr[0]);
118
+                }
119
+                else
120
+                {
121
+                    return null;
122
+                }
123
+            }
124
+            else
125
+            {
126
+                return dal.GetModel(F_UserCode);
127
+            }
128
+             //return dal.GetModel(F_UserCode);
129 129
         }
130 130
         /// <summary>
131 131
         /// 得到一个对象实体
@@ -135,7 +135,7 @@ namespace CallCenterApi.BLL
135 135
 
136 136
             return dal.GetModelByWxOpenId(F_UserCode);
137 137
         }
138
-        
138
+
139 139
         /// <summary>
140 140
         /// 登录得到一个对象实体
141 141
         /// </summary>
@@ -173,34 +173,34 @@ namespace CallCenterApi.BLL
173 173
         /// </summary>
174 174
         public DataSet GetList(string strWhere, string filedOrder = "")
175 175
         {
176
-            //var dt = GetRedis();
177
-            //if (dt != null)
178
-            //{
179
-            //    var ds = new DataSet();
180
-            //    if (string.IsNullOrEmpty(strWhere))
181
-            //    {
182
-            //        ds.Tables.Add(dt.Copy());
183
-            //    }
184
-            //    else
185
-            //    {
186
-            //        var drs = dt.Select(strWhere, filedOrder);
187
-            //        if (drs.Length > 0)
188
-            //        {
189
-            //            ds.Tables.Add(drs.CopyToDataTable());
190
-            //        }
191
-            //        else
192
-            //        {
193
-            //            ds.Tables.Add(new DataTable());
194
-            //        }
195
-            //    }
176
+            var dt = GetRedis();
177
+            if (dt != null)
178
+            {
179
+                var ds = new DataSet();
180
+                if (string.IsNullOrEmpty(strWhere))
181
+                {
182
+                    ds.Tables.Add(dt.Copy());
183
+                }
184
+                else
185
+                {
186
+                    var drs = dt.Select(strWhere, filedOrder);
187
+                    if (drs.Length > 0)
188
+                    {
189
+                        ds.Tables.Add(drs.CopyToDataTable());
190
+                    }
191
+                    else
192
+                    {
193
+                        ds.Tables.Add(new DataTable());
194
+                    }
195
+                }
196 196
 
197
-            //    return ds;
198
-            //}
199
-            //else
200
-            //{
201
-            //    return dal.GetList(strWhere, filedOrder);
202
-            //}
203
-            return dal.GetList(strWhere, filedOrder);
197
+                return ds;
198
+            }
199
+            else
200
+            {
201
+                return dal.GetList(strWhere, filedOrder);
202
+            }
203
+          //  return dal.GetList(strWhere, filedOrder);
204 204
         }
205 205
 
206 206
         /// <summary>
@@ -228,31 +228,31 @@ namespace CallCenterApi.BLL
228 228
         /// </summary>
229 229
         public DataSet GetSeatList(string strWhere, string filedOrder)
230 230
         {
231
-            return dal.GetList( strWhere, filedOrder);
231
+            return dal.GetList(strWhere, filedOrder);
232 232
         }
233 233
         /// <summary>
234 234
         /// 获得数据列表
235 235
         /// </summary>
236 236
         public List<Model.T_Sys_UserAccount> GetModelList(string strWhere, string filedOrder = "")
237 237
         {
238
-            //var dt = GetRedis();
239
-            //if (dt != null)
240
-            //{
241
-            //    var dtnew = new DataTable();
242
-            //    var drs = dt.Select(strWhere, filedOrder);
243
-            //    if (drs.Length > 0)
244
-            //    {
245
-            //        dtnew = drs.CopyToDataTable();
246
-            //    }
247
-            //    return DataTableToList(dtnew);
248
-            //}
249
-            //else
250
-            //{
251
-            //    DataSet ds = dal.GetList(strWhere, filedOrder);
252
-            //    return DataTableToList(ds.Tables[0]);
253
-            //}
254
-            DataSet ds = dal.GetList(strWhere, filedOrder);
255
-            return DataTableToList(ds.Tables[0]);
238
+            var dt = GetRedis();
239
+            if (dt != null)
240
+            {
241
+                var dtnew = new DataTable();
242
+                var drs = dt.Select(strWhere, filedOrder);
243
+                if (drs.Length > 0)
244
+                {
245
+                    dtnew = drs.CopyToDataTable();
246
+                }
247
+                return DataTableToList(dtnew);
248
+            }
249
+            else
250
+            {
251
+                DataSet ds = dal.GetList(strWhere, filedOrder);
252
+                return DataTableToList(ds.Tables[0]);
253
+            }
254
+            //  DataSet ds = dal.GetList(strWhere, filedOrder);
255
+            // return DataTableToList(ds.Tables[0]);
256 256
         }
257 257
 
258 258
         /// <summary>
@@ -341,7 +341,7 @@ namespace CallCenterApi.BLL
341 341
 
342 342
         private DataTable GetRedis()
343 343
         {
344
-            var strList = RedisHelper1.StringGet("T_Sys_UserAccount");
344
+            var strList = RedisHelper2.StringGet("T_Sys_UserAccount");
345 345
             if (strList != null)
346 346
             {
347 347
                 return strList.ToString().ToObject<DataTable>();
@@ -356,14 +356,14 @@ namespace CallCenterApi.BLL
356 356
         {
357 357
             var dt = dal.GetList("").Tables[0];
358 358
 
359
-            RedisHelper1.StringSet("T_Sys_UserAccount", dt.ToJson(), new TimeSpan(24, 0, 0));
359
+            RedisHelper2.StringSet("T_Sys_UserAccount", dt.ToJson(), new TimeSpan(24, 0, 0));
360 360
 
361 361
             return dt;
362 362
         }
363 363
 
364 364
         private void OutRedis()
365 365
         {
366
-            RedisHelper1.KeyDelete("T_Sys_UserAccount");
366
+            RedisHelper2.KeyDelete("T_Sys_UserAccount");
367 367
         }
368 368
     }
369 369
 }

+ 11 - 0
CallCenterApi/CallCenterApi.BLL/app.config

@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<configuration>
3
+  <runtime>
4
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5
+      <dependentAssembly>
6
+        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7
+        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
8
+      </dependentAssembly>
9
+    </assemblyBinding>
10
+  </runtime>
11
+</configuration>

+ 4 - 0
CallCenterApi/CallCenterApi.BLL/packages.config

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
4
+</packages>

+ 6 - 0
CallCenterApi/CallCenterApi.Common/CallCenterApi.Common.csproj

@@ -34,10 +34,16 @@
34 34
       <HintPath>..\CallCenterApi.Interface\CallCenterApi.Interface\Lib\LumiSoft.Net.dll</HintPath>
35 35
     </Reference>
36 36
     <Reference Include="Microsoft.JScript" />
37
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
38
+      <HintPath>..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
39
+    </Reference>
37 40
     <Reference Include="System" />
38 41
     <Reference Include="System.Configuration" />
39 42
     <Reference Include="System.Core" />
40 43
     <Reference Include="System.Runtime.Serialization" />
44
+    <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
45
+      <HintPath>..\..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
46
+    </Reference>
41 47
     <Reference Include="System.Web" />
42 48
     <Reference Include="System.Web.Services" />
43 49
     <Reference Include="System.Xml.Linq" />

+ 5 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -87,8 +87,8 @@
87 87
       <Private>True</Private>
88 88
     </Reference>
89 89
     <Reference Include="Microsoft.CSharp" />
90
-    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
91
-      <HintPath>..\..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
90
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
91
+      <HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
92 92
     </Reference>
93 93
     <Reference Include="Senparc.Weixin, Version=4.12.3.31913, Culture=neutral, processorArchitecture=MSIL">
94 94
       <SpecificVersion>False</SpecificVersion>
@@ -102,6 +102,9 @@
102 102
     <Reference Include="System.Net.Http" />
103 103
     <Reference Include="System.Net.Http.WebRequest" />
104 104
     <Reference Include="System.Transactions" />
105
+    <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
106
+      <HintPath>..\..\..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
107
+    </Reference>
105 108
     <Reference Include="System.Web.DynamicData" />
106 109
     <Reference Include="System.Web.Entity" />
107 110
     <Reference Include="System.Web.ApplicationServices" />

+ 77 - 76
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs

@@ -24,23 +24,23 @@ namespace CallCenterApi.Interface.Controllers
24 24
             string sql = " and F_State=0 ";
25 25
             if (pid.Trim() != "")
26 26
             {
27
-                sql += " and F_PrentId=" + pid.Trim() ;
27
+                sql += " and F_PrentId=" + pid.Trim();
28 28
             }
29 29
             else
30 30
             {
31 31
                 pid = "0";
32 32
                 sql += " and F_PrentId=0   ";
33 33
             }
34
-            //if (pid == "0")
35
-            //{
36
-            //    var strList = RedisHelper1.StringGet("ZTreeList_0");
37
-            //    if (strList != null)
38
-            //    {
39
-            //        return Success("加载成功",strList.ToString().ToObject<List<Model.TreeModel>>());
40
-            //    }
41
-              
42
-            //}
43
-          
34
+            if (pid == "0")
35
+            {
36
+                var strList = RedisHelper1.StringGet("ZTreeList_0");
37
+                if (strList != null)
38
+                {
39
+                    return Success("加载成功", strList.ToString().ToObject<List<Model.TreeModel>>());
40
+                }
41
+
42
+            }
43
+
44 44
 
45 45
             dt = new BLL.T_Sys_DictionaryValue().GetList(" 1=1 " + sql).Tables[0];
46 46
 
@@ -48,16 +48,16 @@ namespace CallCenterApi.Interface.Controllers
48 48
             //  string sqltest = "       with cte(F_ValueId ,F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId) as(select F_ValueId, F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId  from T_Sys_DictionaryValue where   F_State = 0 and   F_Value like'%出租汽车%'  UNION all select t.F_ValueId, t.F_Value,t .F_PrentId ,t.F_Layer,t.F_IsLeaf,t.F_State,t.F_ItemId from T_Sys_DictionaryValue as t inner join cte as c on  c.F_ValueId = t.F_PrentId )select* from cte   ";
49 49
             //  dt = DbHelperSQL.Query(sqltest).Tables[0];
50 50
 
51
-           
52
-            string sqltest = "     with cte(F_ValueId ,F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId) as(select F_ValueId ,F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId from T_Sys_DictionaryValue where F_PrentId = "+ pid + " UNION all select t.F_ValueId, t.F_Value,t .F_PrentId,t.F_Layer,t.F_IsLeaf,t.F_State,t.F_ItemId from T_Sys_DictionaryValue as t inner join cte as c on  c.F_ValueId = t.F_PrentId )select * from cte  ";
53 51
 
52
+            string sqltest = "     with cte(F_ValueId ,F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId) as(select F_ValueId ,F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId from T_Sys_DictionaryValue where F_PrentId = " + pid + " UNION all select t.F_ValueId, t.F_Value,t .F_PrentId,t.F_Layer,t.F_IsLeaf,t.F_State,t.F_ItemId from T_Sys_DictionaryValue as t inner join cte as c on  c.F_ValueId = t.F_PrentId )select * from cte  ";
54 53
 
55
-          var  tab2 = DbHelperSQL.Query(sqltest).Tables[0];
54
+
55
+            var tab2 = DbHelperSQL.Query(sqltest).Tables[0];
56 56
 
57 57
             List<Model.TreeModel> modelList = BindTree(dt, "0", tab2);
58 58
             if (pid == "0")
59 59
             {
60
-              //  RedisHelper1.StringSet("ZTreeList_0", modelList.ToJson());
60
+                RedisHelper1.StringSet("ZTreeList_0", modelList.ToJson());
61 61
             }
62 62
             if (modelList.Count > 0)
63 63
             {
@@ -81,15 +81,15 @@ namespace CallCenterApi.Interface.Controllers
81 81
                 pid = "0";
82 82
                 sql += " and F_PrentId=0   ";
83 83
             }
84
-            //if (pid=="38")
85
-            //{
86
-            //    string rjson = RedisHelper1.StringGet("ztree_38new")?.ToString() ?? "";
87
-            //    if (!string.IsNullOrEmpty(rjson))
88
-            //    {
89
-            //        return Success("加载成功", rjson);
90
-            //    }
91
-            //}
92
-           
84
+            if (pid == "38")
85
+            {
86
+                string rjson = RedisHelper.StringGet("ztree_38new")?.ToString() ?? "";
87
+                if (!string.IsNullOrEmpty(rjson))
88
+                {
89
+                    return Success("加载成功", rjson);
90
+                }
91
+            }
92
+
93 93
 
94 94
             dt = new BLL.T_Sys_DictionaryValue().GetList(" 1=1 " + sql).Tables[0];
95 95
             string sqltest = "     with cte(F_ValueId ,F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId) as(select F_ValueId ,F_Value,F_PrentId,F_Layer,F_IsLeaf,F_State,F_ItemId from T_Sys_DictionaryValue where F_PrentId = " + pid + " UNION all select t.F_ValueId, t.F_Value,t .F_PrentId,t.F_Layer,t.F_IsLeaf,t.F_State,t.F_ItemId from T_Sys_DictionaryValue as t inner join cte as c on  c.F_ValueId = t.F_PrentId )select * from cte  ";
@@ -100,7 +100,7 @@ namespace CallCenterApi.Interface.Controllers
100 100
             List<TreeModelNew> modelList = BindTreeNew(dt, "0", tab2);
101 101
             if (pid == "38")
102 102
             {
103
-              //  RedisHelper1.StringSet("ztree_38new", modelList.ToJson());
103
+                RedisHelper.StringSet("ztree_38new", modelList.ToJson());
104 104
             }
105 105
             if (modelList.Count > 0)
106 106
             {
@@ -122,7 +122,7 @@ namespace CallCenterApi.Interface.Controllers
122 122
                 get { return _id; }
123 123
             }
124 124
 
125
-          
125
+
126 126
             private string _title;
127 127
             /// <summary>
128 128
             /// 树节点显示文本
@@ -152,7 +152,7 @@ namespace CallCenterApi.Interface.Controllers
152 152
                     TreeModelNew model = new TreeModelNew();
153 153
                     string currentID = categorylist[i].F_ValueId.ToString();//当前功能ID
154 154
                     model.id = currentID;
155
-                    model.title  = categorylist[i].F_Value;
155
+                    model.title = categorylist[i].F_Value;
156 156
                     DataTable newdt = new DataTable();
157 157
                     newdt = tabtwo.Clone();
158 158
                     DataRow[] dr = tabtwo.Select(" F_PrentId=" + currentID + " and F_State=0 ");
@@ -162,7 +162,7 @@ namespace CallCenterApi.Interface.Controllers
162 162
                     }
163 163
                     if (newdt != null && newdt.Rows.Count > 0)
164 164
                     {
165
-                        model.child  = BindTreeNew(newdt, currentID, tabtwo);
165
+                        model.child = BindTreeNew(newdt, currentID, tabtwo);
166 166
                     }
167 167
                     modelList.Add(model);
168 168
                 }
@@ -179,7 +179,7 @@ namespace CallCenterApi.Interface.Controllers
179 179
         //tree  树形知识库分类
180 180
         private List<Model.TreeModel> BindTree(DataTable tab, string parentid, DataTable tabtwo)
181 181
         {
182
-           // DataTable tab2 = new DataTable();
182
+            // DataTable tab2 = new DataTable();
183 183
 
184 184
             if (tab != null && tab.Rows.Count > 0)
185 185
             {
@@ -228,15 +228,15 @@ namespace CallCenterApi.Interface.Controllers
228 228
         {
229 229
             DataTable dt = new DataTable();
230 230
             string pid = HttpUtility.UrlDecode(RequestString.GetQueryString("pid"));
231
-            //if (pid == "38")
232
-            //{
233
-            //    string rjson = RedisHelper1.StringGet("ztree_38")?.ToString()??"";
234
-            //    if (!string.IsNullOrEmpty(rjson))
235
-            //    {
236
-            //        return Success("加载成功", rjson.ToObject<DataTable>());
237
-            //    }
238
-
239
-            //}
231
+            if (pid == "38")
232
+            {
233
+                string rjson = RedisHelper1.StringGet("ztree_38")?.ToString() ?? "";
234
+                if (!string.IsNullOrEmpty(rjson))
235
+                {
236
+                    return Success("加载成功", rjson.ToObject<DataTable>());
237
+                }
238
+
239
+            }
240 240
             string sql = " and F_State=0 ";
241 241
             if (pid.Trim() != "")
242 242
             {
@@ -255,7 +255,7 @@ namespace CallCenterApi.Interface.Controllers
255 255
 
256 256
             if (pid == "38")
257 257
             {
258
-               // RedisHelper1.StringSet("ztree_38", tab2.ToJson());
258
+                RedisHelper1.StringSet("ztree_38", tab2.ToJson());
259 259
             }
260 260
 
261 261
             return Success("加载成功", tab2);
@@ -265,28 +265,28 @@ namespace CallCenterApi.Interface.Controllers
265 265
         {
266 266
             DataTable dt = new DataTable();
267 267
 
268
-            //string rjson = RedisHelper1.StringGet("key_38")?.ToString() ?? "";
269
-            //if (!string.IsNullOrEmpty(rjson))
270
-            //{
271
-            //    dt = rjson.ToObject<DataTable>();
272
-            //    var dtnew = new DataTable();
273
-            //    if (string.IsNullOrEmpty(key))
274
-            //    {
275
-            //        dtnew = dt;
276
-            //    }
277
-            //    else
278
-            //    {
279
-            //        var drs = dt.Select(" name like '%" + key + "%'","names");
280
-            //        if (drs.Length > 0)
281
-            //        {
282
-            //            dtnew = drs.CopyToDataTable();
283
-            //        }
284
-            //    }
285
-            //    return Success("加载成功", dtnew);
286
-            //}
268
+            string rjson = RedisHelper1.StringGet("key_38")?.ToString() ?? "";
269
+            if (!string.IsNullOrEmpty(rjson))
270
+            {
271
+                dt = rjson.ToObject<DataTable>();
272
+                var dtnew = new DataTable();
273
+                if (string.IsNullOrEmpty(key))
274
+                {
275
+                    dtnew = dt;
276
+                }
277
+                else
278
+                {
279
+                    var drs = dt.Select(" name like '%" + key + "%'", "names");
280
+                    if (drs.Length > 0)
281
+                    {
282
+                        dtnew = drs.CopyToDataTable();
283
+                    }
284
+                }
285
+                return Success("加载成功", dtnew);
286
+            }
287 287
 
288 288
             var tab2 = DbHelperSQL.Query("select * from View_Keys").Tables[0];
289
-           // RedisHelper1.StringSet("key_38", tab2.ToJson());
289
+            RedisHelper1.StringSet("key_38", tab2.ToJson());
290 290
 
291 291
             string sql = "";
292 292
             if (string.IsNullOrEmpty(key))
@@ -294,7 +294,7 @@ namespace CallCenterApi.Interface.Controllers
294 294
                 sql = " where name like '%" + key + "%'";
295 295
             }
296 296
 
297
-            return Success("加载成功", DbHelperSQL.Query("select * from View_Keys " + sql+ " order by names").Tables[0]);
297
+            return Success("加载成功", DbHelperSQL.Query("select * from View_Keys " + sql + " order by names").Tables[0]);
298 298
         }
299 299
 
300 300
         #region 字典值操作
@@ -363,9 +363,9 @@ namespace CallCenterApi.Interface.Controllers
363 363
         /// 获取字典值列表
364 364
         /// </summary>
365 365
         /// <returns></returns>
366
-        public ActionResult GetDicValueListById(int type=0)
366
+        public ActionResult GetDicValueListById(int type = 0)
367 367
         {
368
-            
368
+
369 369
             int id = RequestString.GetInt("id", 0);
370 370
             var sql = " F_State=0 ";
371 371
             if (id == 1)
@@ -409,16 +409,16 @@ namespace CallCenterApi.Interface.Controllers
409 409
             Model.T_Sys_DictionaryValue valueModel = dictionaryValueBLL.GetModel(id);
410 410
             if (valueModel != null)
411 411
             {
412
-                string deptname="";
413
-                 if (valueModel.F_Deptid!=null )
412
+                string deptname = "";
413
+                if (valueModel.F_Deptid != null)
414 414
                 {
415
-                    var dept = new BLL.T_Sys_Department().GetModel((int )valueModel.F_Deptid);
415
+                    var dept = new BLL.T_Sys_Department().GetModel((int)valueModel.F_Deptid);
416 416
                     if (dept != null)
417 417
                         deptname = dept.F_DeptName;
418 418
                 }
419 419
                 var obj = new
420 420
                 {
421
-                    F_CreateDate=  valueModel.F_CreateDate ,
421
+                    F_CreateDate = valueModel.F_CreateDate,
422 422
                     F_CreateUser = valueModel.F_CreateUser,
423 423
                     F_IsLeaf = valueModel.F_IsLeaf,
424 424
                     F_ItemId = valueModel.F_ItemId,
@@ -429,11 +429,11 @@ namespace CallCenterApi.Interface.Controllers
429 429
                     F_Value = valueModel.F_Value,
430 430
                     F_ValueId = valueModel.F_ValueId,
431 431
                     F_Deptid = valueModel.F_Deptid,
432
-                    F_DeptName= deptname
432
+                    F_DeptName = deptname
433 433
                 };
434 434
                 return Success("加载字典值成功", obj);
435 435
             }
436
-               
436
+
437 437
             else
438 438
                 return Error("加载字典值失败");
439 439
 
@@ -455,7 +455,7 @@ namespace CallCenterApi.Interface.Controllers
455 455
             string remark = RequestString.GetFormString("remark");
456 456
             Model.T_Sys_DictionaryValue orderModel = new Model.T_Sys_DictionaryValue();
457 457
             BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
458
-            
458
+
459 459
             if (id == 0)
460 460
             {
461 461
                 //var list = orderBll.GetModelList(" F_Value='" + name + "' and F_ItemId='"+pid+"' ");
@@ -470,22 +470,23 @@ namespace CallCenterApi.Interface.Controllers
470 470
                     orderModel.F_Value = name;
471 471
                     orderModel.F_PrentId = pid;
472 472
                     orderModel.F_State = 0;
473
-                    orderModel.F_Deptid  = deptid;
474
-                    orderModel.F_Remark  = remark;
473
+                    orderModel.F_Deptid = deptid;
474
+                    orderModel.F_Remark = remark;
475 475
                     int n = orderBll.Add(orderModel);
476 476
                     if (n > 0)
477 477
                     {
478 478
                         if (deptid > 0)
479 479
                         {
480 480
                             var dept = new BLL.T_Sys_Department().GetModel(deptid);
481
-                            if (dept != null )
481
+                            if (dept != null)
482 482
                             {
483
-                                dept.F_Valueid = n;                     }
484
-                            var b = new BLL.T_Sys_Department().Update(dept);
483
+                                dept.F_Valueid = n;
485 484
                             }
485
+                            var b = new BLL.T_Sys_Department().Update(dept);
486
+                        }
486 487
                         return Success("字典值添加成功", n);
487 488
                     }
488
-                       
489
+
489 490
                     else
490 491
                         return Error("字典值添加失败");
491 492
                 }
@@ -515,7 +516,7 @@ namespace CallCenterApi.Interface.Controllers
515 516
                                 var dept = new BLL.T_Sys_Department().GetModel(deptid);
516 517
                                 if (dept != null)
517 518
                                 {
518
-                                    dept.F_Valueid = orderModel.F_ValueId ;
519
+                                    dept.F_Valueid = orderModel.F_ValueId;
519 520
                                 }
520 521
                                 var b = new BLL.T_Sys_Department().Update(dept);
521 522
                             }

+ 3 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/packages.config

@@ -1,5 +1,6 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <packages>
3
+  <package id="CSRedisCore" version="3.6.9" targetFramework="net45" />
3 4
   <package id="Flurl" version="2.8.2" targetFramework="net45" />
4 5
   <package id="log4net" version="2.0.8" targetFramework="net45" />
5 6
   <package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net45" />
@@ -18,5 +19,6 @@
18 19
   <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" />
19 20
   <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
20 21
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
21
-  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
22
+  <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
23
+  <package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />
22 24
 </packages>

+ 1 - 0
CallCenterCommon/CallCenter.QuartzService/CallCenter.QuartzService.csproj

@@ -65,6 +65,7 @@
65 65
     <Compile Include="ZhengWuDuiJie.cs" />
66 66
   </ItemGroup>
67 67
   <ItemGroup>
68
+    <None Include="app.config" />
68 69
     <None Include="job_scheduling_data_2_0.xsd">
69 70
       <SubType>Designer</SubType>
70 71
     </None>

+ 11 - 0
CallCenterCommon/CallCenter.QuartzService/app.config

@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<configuration>
3
+  <runtime>
4
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5
+      <dependentAssembly>
6
+        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7
+        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
8
+      </dependentAssembly>
9
+    </assemblyBinding>
10
+  </runtime>
11
+</configuration>

+ 6 - 3
CallCenterCommon/CallCenter.Utility/CallCenter.Utility.csproj

@@ -42,9 +42,8 @@
42 42
       <HintPath>..\..\packages\Microsoft.Office.Interop.Word.15.0.4797.1003\lib\net20\Microsoft.Office.Interop.Word.dll</HintPath>
43 43
       <EmbedInteropTypes>True</EmbedInteropTypes>
44 44
     </Reference>
45
-    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
46
-      <HintPath>..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
47
-      <Private>True</Private>
45
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
46
+      <HintPath>..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
48 47
     </Reference>
49 48
     <Reference Include="NPOI, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
50 49
       <HintPath>..\..\packages\NPOI.2.3.0\lib\net40\NPOI.dll</HintPath>
@@ -71,6 +70,9 @@
71 70
     <Reference Include="System.Drawing" />
72 71
     <Reference Include="System.IO.Compression" />
73 72
     <Reference Include="System.Management" />
73
+    <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
74
+      <HintPath>..\..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
75
+    </Reference>
74 76
     <Reference Include="System.Web" />
75 77
     <Reference Include="System.Xml.Linq" />
76 78
     <Reference Include="System.Data.DataSetExtensions" />
@@ -94,6 +96,7 @@
94 96
     <Compile Include="NPOI\MergerHot.cs" />
95 97
     <Compile Include="RedisHelper1.cs" />
96 98
     <Compile Include="RedisHelper.cs" />
99
+    <Compile Include="RedisHelper2.cs" />
97 100
     <Compile Include="SaltAndHashHelper.cs" />
98 101
     <Compile Include="Sms\SmsNewHelper.cs" />
99 102
     <Compile Include="Sms\SmsHelper.cs" />

+ 3 - 3
CallCenterCommon/CallCenter.Utility/RedisHelper1.cs

@@ -31,7 +31,7 @@ namespace CallCenter.Utility
31 31
                 //redis = ConnectionMultiplexer.Connect(Configs.GetValue("Redis_Server1")+":"+Configs.GetValue("Redis_Port1"));
32 32
                 //redis = ConnectionMultiplexer.Connect("192.168.4.18, abortConnect=false");
33 33
 
34
-                database = redis.GetDatabase();
34
+                database = redis.GetDatabase(2);
35 35
             }
36 36
         }
37 37
 
@@ -64,8 +64,8 @@ namespace CallCenter.Utility
64 64
             }
65 65
             else
66 66
             {
67
-                var rt = database.StringGet(key);
68
-
67
+                // var rt = database.StringGet(key);
68
+                var rt = database.StringGetAsync(key).Result;
69 69
                 if (rt.IsNull)
70 70
                 {
71 71
                     return null ;

+ 815 - 0
CallCenterCommon/CallCenter.Utility/RedisHelper2.cs

@@ -0,0 +1,815 @@
1
+using System;
2
+using StackExchange.Redis;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using Newtonsoft.Json;
6
+using System.Collections;
7
+
8
+namespace CallCenter.Utility
9
+{
10
+    public class RedisHelper2
11
+    {
12
+        #region 
13
+        //执行顺序---静态字段---静态构造函数---构造函数
14
+        private static ConnectionMultiplexer redis;
15
+        private static IDatabase database;
16
+        static RedisHelper2()
17
+        {
18
+            if (redis == null || !redis.IsConnected)
19
+            {
20
+                var config = new ConfigurationOptions
21
+                {
22
+                    AbortOnConnectFail = false,
23
+                    AllowAdmin = true,
24
+                    ConnectTimeout = 15000,
25
+                    SyncTimeout = 5000,
26
+                    ResponseTimeout = 15000,
27
+                    Password = "",//Redis数据库密码
28
+                    EndPoints = { Configs.GetValue("Redis_Server1") + ":" + Configs.GetValue("Redis_Port1") }// connectionString 为IP:Port 如”192.168.2.110:6379”
29
+                };
30
+                redis = ConnectionMultiplexer.Connect(config);
31
+                //redis = ConnectionMultiplexer.Connect(Configs.GetValue("Redis_Server1")+":"+Configs.GetValue("Redis_Port1"));
32
+                //redis = ConnectionMultiplexer.Connect("192.168.4.18, abortConnect=false");
33
+
34
+                database = redis.GetDatabase(1);
35
+            }
36
+        }
37
+
38
+        #endregion
39
+
40
+        #region redis 字符串(string)操作
41
+
42
+        /// <summary>
43
+        /// 设置指定键的值
44
+        /// </summary>
45
+        /// <param name="key"></param>
46
+        /// <param name="value"></param>
47
+        /// <returns></returns>
48
+        public static bool StringSet(string key, string value)
49
+        {
50
+            return database.StringSet(key, value);
51
+        }
52
+
53
+        /// <summary>
54
+        /// 获取指定键的值
55
+        /// </summary>
56
+        /// <param name="key"></param>
57
+        /// <returns></returns>
58
+        public static object StringGet(string key)
59
+        {
60
+            if (string.IsNullOrEmpty(key))
61
+            {
62
+                return null;
63
+
64
+            }
65
+            else
66
+            {
67
+                // var rt = database.StringGet(key);
68
+                var rt = database.StringGetAsync(key).Result;
69
+                if (rt.IsNull)
70
+                {
71
+                    return null;
72
+                }
73
+                else
74
+                {
75
+                    return rt;
76
+                }
77
+            }
78
+
79
+        }
80
+
81
+        /// <summary>
82
+        /// 获取存储在键上的字符串的子字符串
83
+        /// </summary>
84
+        /// <param name="key"></param>
85
+        /// <param name="start"></param>
86
+        /// <param name="end"></param>
87
+        /// <returns></returns>
88
+        public static object StringGet(string key, int start, int end)
89
+        {
90
+            var rt = database.StringGetRange(key, start, end);
91
+            if (rt.IsNull)
92
+            {
93
+                return null;
94
+            }
95
+            else
96
+            {
97
+                return rt;
98
+            }
99
+        }
100
+
101
+        /// <summary>
102
+        /// 设置键的字符串值并返回其旧值
103
+        /// </summary>
104
+        /// <param name="key"></param>
105
+        /// <param name="value"></param>
106
+        /// <returns></returns>
107
+        public static object StringGetAndSet(string key, string value)
108
+        {
109
+            var rt = database.StringGetSet(key, value);
110
+            if (rt.IsNull)
111
+            {
112
+                return null;
113
+            }
114
+            else
115
+            {
116
+                return rt;
117
+            }
118
+        }
119
+
120
+        /// <summary>
121
+        /// 返回在键处存储的字符串值中偏移处的位值
122
+        /// </summary>
123
+        /// <param name="key"></param>
124
+        /// <param name="offset"></param>
125
+        /// <returns></returns>
126
+        public static bool StringGetBit(string key, long offset)
127
+        {
128
+            return database.StringGetBit(key, offset);
129
+        }
130
+
131
+        /// <summary>
132
+        /// 获取所有给定键的值
133
+        /// </summary>
134
+        /// <param name="keys"></param>
135
+        /// <returns></returns>
136
+        public static List<object> StringMultiGet(string[] keys)
137
+        {
138
+            List<object> list = new List<object>();
139
+            for (int i = 0; i < keys.Length; i++)
140
+            {
141
+                list.Add(database.StringGet(keys[i]));
142
+            }
143
+            return list;
144
+        }
145
+
146
+        /// <summary>
147
+        /// 存储在键上的字符串值中设置或清除偏移处的位
148
+        /// </summary>
149
+        /// <param name="key"></param>
150
+        /// <param name="offset"></param>
151
+        /// <param name="value"></param>
152
+        /// <returns></returns>
153
+        public static bool StringSetBit(string key, long offset)
154
+        {
155
+            return database.StringSetBit(key, offset, true);
156
+        }
157
+
158
+        /// <summary>
159
+        /// 使用键和到期时间来设置值
160
+        /// </summary>
161
+        /// <param name="key"></param>
162
+        /// <param name="value"></param>
163
+        /// <param name="expiry"></param>
164
+        /// <returns></returns>
165
+        public static bool StringSet(string key, string value, TimeSpan expiry)
166
+        {
167
+            return database.StringSet(key, value, expiry);
168
+        }
169
+
170
+        /// <summary>
171
+        /// 设置键的值,仅当键不存在时
172
+        /// </summary>
173
+        /// <param name="key"></param>
174
+        /// <param name="value"></param>
175
+        /// <returns></returns>
176
+        public static void StringSetIfAbsent(string key, string value)
177
+        {
178
+            if (database.StringGet(key) == RedisValue.Null)
179
+            {
180
+                database.StringSet(key, value);
181
+            }
182
+        }
183
+
184
+        /// <summary>
185
+        /// 在指定偏移处开始的键处覆盖字符串的一部分
186
+        /// </summary>
187
+        /// <param name="key">键值</param>
188
+        /// <param name="value">值</param>
189
+        /// <param name="offset">偏移量</param>
190
+        /// <returns></returns>
191
+        public static object StringSet(string key, long offset, string value)
192
+        {
193
+            return database.StringSetRange(key, offset, value);
194
+        }
195
+
196
+        /// <summary>
197
+        /// 获取存储在键中的值的长度
198
+        /// </summary>
199
+        /// <param name="key">键值</param>
200
+        /// <returns></returns>
201
+        public static long StringSize(string key)
202
+        {
203
+            return database.StringLength(key);
204
+        }
205
+
206
+        /// <summary>
207
+        /// 为多个键分别设置它们的值
208
+        /// </summary>
209
+        /// <param name="keys"></param>
210
+        /// <returns></returns>
211
+        public static void StringMultiSet(Dictionary<string, string> dic)
212
+        {
213
+            foreach (KeyValuePair<string, string> key in dic)
214
+            {
215
+                database.StringSet(key.Key, key.Value);
216
+            }
217
+        }
218
+
219
+        /// <summary>
220
+        /// 为多个键分别设置它们的值,仅当键不存在时
221
+        /// </summary>
222
+        /// <param name="keys">键值集合</param>
223
+        /// <returns></returns>
224
+        public static void StringMultiSetIfAbsent(Dictionary<string, string> dic)
225
+        {
226
+            foreach (KeyValuePair<string, string> key in dic)
227
+            {
228
+                //判断键值是否存在
229
+                if (database.StringGet(key.Key) == RedisValue.Null)
230
+                {
231
+                    database.StringSet(key.Key, key.Value);
232
+                }
233
+            }
234
+        }
235
+
236
+        /// <summary>
237
+        /// 将键的整数值按给定的数值增加
238
+        /// </summary>
239
+        /// <param name="key">键值</param>
240
+        /// <param name="value">给定的数值</param>
241
+        /// <returns></returns>
242
+        public static double StringIncrement(string key, double value)
243
+        {
244
+            return database.StringIncrement(key, value);
245
+        }
246
+
247
+        /// <summary>
248
+        /// 在key键对应值的右面追加值value
249
+        /// </summary>
250
+        /// <param name="key"></param>
251
+        /// <param name="value"></param>
252
+        /// <returns></returns>
253
+        public static long StringAppend(string key, string value)
254
+        {
255
+            return database.StringAppend(key, value);
256
+        }
257
+
258
+        /// <summary>
259
+        /// 删除某个键值
260
+        /// </summary>
261
+        /// <param name="key"></param>
262
+        /// <returns></returns>
263
+        public static bool StringDelete(string key)
264
+        {
265
+            return false;
266
+        }
267
+
268
+        #endregion
269
+
270
+        #region redis 哈希/散列/字典(Hash)操作
271
+
272
+        /// <summary>
273
+        /// 删除指定的哈希字段
274
+        /// </summary>
275
+        /// <param name="key"></param>
276
+        /// <param name="field"></param>
277
+        /// <returns></returns>
278
+        public static bool HashDelete(string key, string field)
279
+        {
280
+            return database.HashDelete(key, field);
281
+        }
282
+
283
+        /// <summary>
284
+        /// 判断是否存在散列字段
285
+        /// </summary>
286
+        /// <param name=""></param>
287
+        /// <param name=""></param>
288
+        /// <returns></returns>
289
+        public static bool HashHasKey(string key, string field)
290
+        {
291
+            return database.HashExists(key, field);
292
+        }
293
+
294
+        /// <summary>
295
+        /// 获取存储在指定键的哈希字段的值
296
+        /// </summary>
297
+        /// <param name="key"></param>
298
+        /// <param name="field"></param>
299
+        /// <returns></returns>
300
+        public static object HashGet(string key, string field)
301
+        {
302
+            return database.HashGet(key, field);
303
+        }
304
+
305
+        /// <summary>
306
+        /// 获取存储在指定键的哈希中的所有字段和值
307
+        /// </summary>
308
+        /// <param name="key"></param>
309
+        /// <returns></returns>
310
+        public static Dictionary<string, object> HashGetAll(string key)
311
+        {
312
+            Dictionary<string, object> dic = new Dictionary<string, object>();
313
+            var collection = database.HashGetAll(key);
314
+            foreach (var item in collection)
315
+            {
316
+                dic.Add(item.Name, item.Value);
317
+            }
318
+            return dic;
319
+        }
320
+
321
+        /// <summary>
322
+        /// 将哈希字段的浮点值按给定数值增加
323
+        /// </summary>
324
+        /// <param name="key"></param>
325
+        /// <param name="field"></param>
326
+        /// <param name="value">给定的数值</param>
327
+        /// <returns></returns>
328
+        public static double HashIncrement(string key, string field, double value)
329
+        {
330
+            return database.HashIncrement(key, field, value);
331
+        }
332
+
333
+        /// <summary>
334
+        /// 获取哈希中的所有字段
335
+        /// </summary>
336
+        /// <param name="key"></param>
337
+        /// <returns></returns>
338
+        public static string[] HashKeys(string key)
339
+        {
340
+            return database.HashKeys(key).ToStringArray();
341
+        }
342
+
343
+        /// <summary>
344
+        /// 获取散列中的字段数量
345
+        /// </summary>
346
+        /// <param name="key"></param>
347
+        /// <returns></returns>
348
+        public static long HashSize(string key)
349
+        {
350
+            return database.HashLength(key);
351
+        }
352
+
353
+        /// <summary>
354
+        /// 获取所有给定哈希字段的值
355
+        /// </summary>
356
+        /// <param name="key"></param>
357
+        /// <param name="hashKeys"></param>
358
+        /// <returns></returns>
359
+        public static List<object> HashMultiGet(string key, List<string> hashKeys)
360
+        {
361
+            List<object> result = new List<object>();
362
+            foreach (string field in hashKeys)
363
+            {
364
+                result.Add(database.HashGet(key, field));
365
+            }
366
+            return result;
367
+        }
368
+
369
+        /// <summary>
370
+        /// 为多个哈希字段分别设置它们的值
371
+        /// </summary>
372
+        /// <param name="key"></param>
373
+        /// <param name="dic"></param>
374
+        /// <returns></returns>
375
+        public static void HashPutAll(string key, Dictionary<string, string> dic)
376
+        {
377
+            List<HashEntry> list = new List<HashEntry>();
378
+            for (int i = 0; i < dic.Count; i++)
379
+            {
380
+                KeyValuePair<string, string> param = dic.ElementAt(i);
381
+                list.Add(new HashEntry(param.Key, param.Value));
382
+            }
383
+            database.HashSet(key, list.ToArray());
384
+        }
385
+
386
+        /// <summary>
387
+        /// 设置散列字段的字符串值
388
+        /// </summary>
389
+        /// <param name="key"></param>
390
+        /// <param name="field"></param>
391
+        /// <param name="value"></param>
392
+        /// <returns></returns>
393
+        public static void HashPut(string key, string field, string value)
394
+        {
395
+            database.HashSet(key, new HashEntry[] { new HashEntry(field, value) });
396
+        }
397
+
398
+        /// <summary>
399
+        /// 仅当字段不存在时,才设置散列字段的值
400
+        /// </summary>
401
+        /// <param name="key"></param>
402
+        /// <param name="fiels"></param>
403
+        /// <param name="value"></param>
404
+        /// <returns></returns>
405
+        public static void HashPutIfAbsent(string key, string field, string value)
406
+        {
407
+            if (!HashHasKey(key, field))
408
+            {
409
+                database.HashSet(key, new HashEntry[] { new HashEntry(field, value) });
410
+            }
411
+        }
412
+
413
+        /// <summary>
414
+        /// 获取哈希中的所有值
415
+        /// </summary>
416
+        /// <param name="key"></param>
417
+        /// <returns></returns>
418
+        public static string[] HashValues(string key)
419
+        {
420
+            return database.HashValues(key).ToStringArray();
421
+        }
422
+
423
+        /// <summary>
424
+        /// redis中获取指定键的值并返回对象
425
+        /// </summary>
426
+        /// <typeparam name="T"></typeparam>
427
+        /// <param name="key"></param>
428
+        /// <returns></returns>
429
+        public static T GetHashValue<T>(string key)
430
+        {
431
+            HashEntry[] array = database.HashGetAll(key);
432
+            Dictionary<string, object> dic = new Dictionary<string, object>();
433
+            for (int i = 0; i < array.Length; i++)
434
+            {
435
+                dic.Add(array[i].Name, array[i].Value);
436
+            }
437
+            if (dic.Count > 0)
438
+            {
439
+                string strJson = JsonConvert.SerializeObject(dic);
440
+                return JsonConvert.DeserializeObject<T>(strJson);
441
+            }
442
+            else
443
+            {
444
+                return default(T);
445
+            }
446
+        }
447
+
448
+        /// <summary>
449
+        /// 把指定对象存储在键值为key的redis中
450
+        /// </summary>
451
+        /// <typeparam name="T"></typeparam>
452
+        /// <param name="t"></param>
453
+        /// <param name="key"></param>
454
+        public static void SetHashValue<T>(T t, string key)
455
+        {
456
+            string strJson = JsonConvert.SerializeObject(t);
457
+            Dictionary<string, string> param = JsonConvert.DeserializeObject<Dictionary<string, string>>(strJson);
458
+            HashPutAll(key, param);
459
+        }
460
+
461
+        #endregion
462
+
463
+        #region redis 列表(List)操作
464
+
465
+        /// <summary>
466
+        /// 从左向右存压栈
467
+        /// </summary>
468
+        /// <param name="key"></param>
469
+        /// <param name="value"></param>
470
+        /// <returns></returns>
471
+        public static long ListLeftPush(string key, string value)
472
+        {
473
+            return database.ListLeftPush(key, value);
474
+        }
475
+
476
+        /// <summary>
477
+        /// 从左出栈
478
+        /// </summary>
479
+        /// <param name="key"></param>
480
+        /// <returns></returns>
481
+        public static object ListLeftPop(string key)
482
+        {
483
+            return database.ListLeftPop(key);
484
+        }
485
+
486
+        /// <summary>
487
+        /// 队/栈长
488
+        /// </summary>
489
+        /// <param name="key"></param>
490
+        /// <returns></returns>
491
+        public static long ListSize(string key)
492
+        {
493
+            return database.ListLength(key);
494
+        }
495
+
496
+        /// <summary>
497
+        /// 范围检索,返回List
498
+        /// </summary>
499
+        /// <param name="key"></param>
500
+        /// <param name="start"></param>
501
+        /// <param name="end"></param>
502
+        /// <returns></returns>
503
+        public static string[] ListRange(string key, int start, int end)
504
+        {
505
+            return database.ListRange(key, start, end).ToStringArray();
506
+        }
507
+
508
+        /// <summary>
509
+        /// 移除key中值为value的i个,返回删除的个数;如果没有这个元素则返回0 
510
+        /// </summary>
511
+        /// <param name="key"></param>
512
+        /// <param name="i"></param>
513
+        /// <param name="value"></param>
514
+        /// <returns></returns>
515
+        public static long ListRemove(string key, string value)
516
+        {
517
+            return database.ListRemove(key, value);
518
+        }
519
+
520
+        /// <summary>
521
+        /// 检索
522
+        /// </summary>
523
+        /// <param name="key"></param>
524
+        /// <param name="index"></param>
525
+        /// <returns></returns>
526
+        public static object ListIndex(string key, long index)
527
+        {
528
+            return database.ListGetByIndex(key, index);
529
+        }
530
+
531
+        /// <summary>
532
+        /// 赋值
533
+        /// </summary>
534
+        /// <param name="key"></param>
535
+        /// <param name="index"></param>
536
+        /// <param name="value"></param>
537
+        /// <returns></returns>
538
+        public static void ListSet(string key, int index, string value)
539
+        {
540
+            database.ListSetByIndex(key, index, value);
541
+        }
542
+
543
+        /// <summary>
544
+        /// 裁剪,删除除了[start,end]以外的所有元素 
545
+        /// </summary>
546
+        /// <param name="key"></param>
547
+        /// <param name="start"></param>
548
+        /// <param name="end"></param>
549
+        /// <returns></returns>
550
+        public static void ListTrim(string key, int start, int end)
551
+        {
552
+            database.ListTrim(key, start, end);
553
+        }
554
+
555
+        /// <summary>
556
+        /// 将源key的队列的右边的一个值删除,然后塞入目标key的队列的左边,返回这个值
557
+        /// </summary>
558
+        /// <param name="sourceKey"></param>
559
+        /// <param name="destinationKey"></param>
560
+        /// <returns></returns>
561
+        public static object ListRightPopAndLeftPush(string sourceKey, string destinationKey)
562
+        {
563
+            return database.ListRightPopLeftPush(sourceKey, destinationKey);
564
+        }
565
+
566
+        #endregion
567
+
568
+        #region redis 集合(Set)操作
569
+
570
+        /// <summary>
571
+        /// 集合添加元素
572
+        /// </summary>
573
+        /// <param name="key"></param>
574
+        /// <param name="value"></param>
575
+        public static void SetAdd(string key, string value)
576
+        {
577
+            database.SetAdd(key, value);
578
+        }
579
+
580
+        /// <summary>
581
+        /// 集合组合操作
582
+        /// </summary>
583
+        /// <param name="point">操作标示:0--并集;1--交集;2--差集</param>
584
+        /// <param name="firstKey">第一个集合的键值</param>
585
+        /// <param name="secondKey">第二个集合的键值</param>
586
+        public static string[] SetCombine(int point, string firstKey, string secondKey)
587
+        {
588
+            RedisValue[] array;
589
+            switch (point)
590
+            {
591
+                case 0:
592
+                    array = database.SetCombine(SetOperation.Union, firstKey, secondKey);
593
+                    break;
594
+                case 1:
595
+                    array = database.SetCombine(SetOperation.Intersect, firstKey, secondKey);
596
+                    break;
597
+                case 2:
598
+                    array = database.SetCombine(SetOperation.Difference, firstKey, secondKey);
599
+                    break;
600
+                default:
601
+                    array = new RedisValue[0];
602
+                    break;
603
+            }
604
+            return array.ToStringArray();
605
+        }
606
+
607
+        /// <summary>
608
+        /// 
609
+        /// </summary>
610
+        /// <param name="key"></param>
611
+        /// <param name="value"></param>
612
+        /// <returns></returns>
613
+        public static bool SetContains(string key, string value)
614
+        {
615
+            return database.SetContains(key, value);
616
+        }
617
+
618
+        /// <summary>
619
+        /// 返回对应键值集合的长度
620
+        /// </summary>
621
+        /// <param name="key"></param>
622
+        /// <returns></returns>
623
+        public static long SetLength(string key)
624
+        {
625
+            return database.SetLength(key);
626
+        }
627
+
628
+        /// <summary>
629
+        /// 根据键值返回集合中所有的value
630
+        /// </summary>
631
+        /// <param name="key"></param>
632
+        /// <returns></returns>
633
+        public static string[] SetMembers(string key)
634
+        {
635
+            return database.SetMembers(key).ToStringArray();
636
+        }
637
+
638
+        /// <summary>
639
+        /// 将成员从源集移动到目标集
640
+        /// </summary>
641
+        /// <param name="sourceKey">源集key</param>
642
+        /// <param name="destinationKey">目标集key</param>
643
+        /// <param name="value"></param>
644
+        public static bool SetMove(string sourceKey, string destinationKey, string value)
645
+        {
646
+            return database.SetMove(sourceKey, destinationKey, value);
647
+        }
648
+
649
+        /// <summary>
650
+        /// 移除集合中指定键值随机元素
651
+        /// </summary>
652
+        /// <param name="key"></param>
653
+        public static string SetPop(string key)
654
+        {
655
+            return database.SetPop(key);
656
+        }
657
+
658
+        /// <summary>
659
+        /// 返回集合中指定键值随机元素
660
+        /// </summary>
661
+        /// <param name="key"></param>
662
+        /// <returns></returns>
663
+        public static string SetRandomMember(string key)
664
+        {
665
+            return database.SetRandomMember(key);
666
+        }
667
+
668
+        /// <summary>
669
+        /// 
670
+        /// </summary>
671
+        /// <param name="key"></param>
672
+        /// <param name="count"></param>
673
+        public static string[] SetRandomMembers(string key, long count)
674
+        {
675
+            return database.SetRandomMembers(key, count).ToStringArray();
676
+        }
677
+
678
+        /// <summary>
679
+        /// 移除集合中指定key值和value
680
+        /// </summary>
681
+        /// <param name="key"></param>
682
+        /// <param name="value"></param>
683
+        public static void SetRemove(string key, string value)
684
+        {
685
+            database.SetRemove(key, value);
686
+        }
687
+
688
+        /// <summary>
689
+        /// 
690
+        /// </summary>
691
+        /// <param name="key"></param>
692
+        public static void SetScan(string key)
693
+        {
694
+            database.SetScan(key);
695
+        }
696
+
697
+        #endregion
698
+
699
+        #region redis 有序集合(sorted set)操作
700
+
701
+        public static void Method(string key, string value, double score)
702
+        {
703
+            database.SortedSetAdd(key, new SortedSetEntry[] { new SortedSetEntry(value, score) });
704
+        }
705
+
706
+        #endregion
707
+
708
+        #region redis 键(Key)操作
709
+
710
+        /// <summary>
711
+        /// 获取 Key
712
+        /// </summary>
713
+        /// <param name="redisKey"></param>
714
+        /// <returns></returns>
715
+        //public static IEnumerable<RedisKey> GetKeyList(string redisKey)
716
+        //{
717
+        //    var server = redis.GetServer(Configs.GetValue("Redis_Server"), Configs.GetValue("Redis_Port"));
718
+        //    return server.Keys(pattern: "*"+ redisKey + "*");
719
+        //}
720
+        public static List<string> GetKeyList(string redisKey)
721
+        {
722
+            var server = redis.GetServer(Configs.GetValue("Redis_Server"), Int32.Parse(Configs.GetValue("Redis_Port")));
723
+            List<string> keylist = new List<string>();
724
+            var redisenum = server.Keys(pattern: "*" + redisKey + "*");
725
+            foreach (var r in redisenum.ToList())
726
+            {
727
+                keylist.Add(r.ToString());
728
+            }
729
+            return keylist;
730
+        }
731
+
732
+        /// <summary>
733
+        /// 移除指定 Key
734
+        /// </summary>
735
+        /// <param name="redisKey"></param>
736
+        /// <returns></returns>
737
+        public static bool KeyDelete(string redisKey)
738
+        {
739
+            if (KeyExists(redisKey))
740
+                return database.KeyDelete(redisKey);
741
+            else
742
+                return true;
743
+        }
744
+
745
+        /// <summary>
746
+        /// 移除指定 Key
747
+        /// </summary>
748
+        /// <param name="redisKey"></param>
749
+        /// <returns></returns>
750
+        //public static long KeysDelete(IEnumerable<RedisKey> redisKeys)
751
+        //{
752
+        //    return database.KeyDelete(redisKeys.ToArray());
753
+        //}
754
+        public static long KeysDelete(List<string> redisKeys)
755
+        {
756
+            int n = 0;
757
+            foreach (var r in redisKeys)
758
+            {
759
+                if (database.KeyDelete(r))
760
+                {
761
+                    n++;
762
+                }
763
+            }
764
+            return n;
765
+        }
766
+
767
+        /// <summary>
768
+        /// 校验 Key 是否存在
769
+        /// </summary>
770
+        /// <param name="redisKey"></param>
771
+        /// <returns></returns>
772
+        public static bool KeyExists(string redisKey)
773
+        {
774
+            return database.KeyExists(redisKey);
775
+        }
776
+
777
+        /// <summary>
778
+        /// 重命名 Key
779
+        /// </summary>
780
+        /// <param name="redisKey"></param>
781
+        /// <param name="redisNewKey"></param>
782
+        /// <returns></returns>
783
+        public static bool KeyRename(string redisKey, string redisNewKey)
784
+        {
785
+            return database.KeyRename(redisKey, redisNewKey);
786
+        }
787
+
788
+        /// <summary>
789
+        /// 设置 Key 的时间
790
+        /// </summary>
791
+        /// <param name="redisKey"></param>
792
+        /// <param name="expiry"></param>
793
+        /// <returns></returns>
794
+        public static bool KeyExpire(string redisKey, TimeSpan? expiry)
795
+        {
796
+            return database.KeyExpire(redisKey, expiry);
797
+        }
798
+
799
+        #endregion
800
+
801
+        /// <summary>
802
+        /// 获取key过期时间
803
+        /// </summary>
804
+        /// <param name="redisKey"></param>
805
+        /// <returns></returns>
806
+        public static string GetKeyOutTime(string redisKey)
807
+        {
808
+            var server = redis.GetServer(Configs.GetValue("Redis_Server"), Int32.Parse(Configs.GetValue("Redis_Port")));
809
+            var timeNow = server.Time().ToUniversalTime();
810
+            var time = database.KeyTimeToLive(redisKey);
811
+            var expire = time == null ? (DateTime?)null : timeNow.Add(time.Value); //返回UTC时间。
812
+            return expire == null ? "" : expire.Value.AddHours(8).ToString("yyyy-MM-dd HH:mm:ss");
813
+        }
814
+    }
815
+}

+ 3 - 1
CallCenterCommon/CallCenter.Utility/packages.config

@@ -1,9 +1,11 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <packages>
3
+  <package id="CSRedisCore" version="3.6.9" targetFramework="net45" />
3 4
   <package id="log4net" version="2.0.7" targetFramework="net45" />
4 5
   <package id="Microsoft.Office.Interop.Word" version="15.0.4797.1003" targetFramework="net45" />
5
-  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
6
+  <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
6 7
   <package id="NPOI" version="2.3.0" targetFramework="net45" />
7 8
   <package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
8 9
   <package id="StackExchange.Redis" version="1.2.6" targetFramework="net45" />
10
+  <package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />
9 11
 </packages>

BIN
文档/材料/~$《关于部署大数据局12345市长热线系统的函》的答复-20220425.docx


BIN
文档/材料/~$心VPN&堡垒机登录说明 for windows.docx


BIN
文档/材料/云中心VPN&堡垒机登录说明 for windows.docx


BIN
文档/材料/关于《关于部署大数据局12345市长热线系统的函》的答复-20220425.docx