Procházet zdrojové kódy

添加修改删除客户信息时重新将来电单位放入缓存 在点选时模糊匹配

machenyang %!s(int64=8) %!d(string=před) roky
rodič
revize
e961c1e6db

+ 37 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

@@ -170,7 +170,7 @@ namespace CallCenterApi.Interface.Controllers.customer
170 170
             }
171 171
             return res;
172 172
         }
173
-        
173
+
174 174
         /// <summary>
175 175
         /// 添加/修改客户信息
176 176
         /// </summary>
@@ -237,6 +237,9 @@ namespace CallCenterApi.Interface.Controllers.customer
237 237
                             }
238 238
                         }
239 239
                     }
240
+
241
+                    List<string> lddep = new BLL.T_Cus_CustomerBase().GetLDdep();
242
+                    CacheHelper.Insert("LDDep", lddep);
240 243
                 }
241 244
 
242 245
             }
@@ -269,6 +272,8 @@ namespace CallCenterApi.Interface.Controllers.customer
269 272
                         if (DbHelperSQL.ExecuteSql(sql) > 0)
270 273
                         {
271 274
                             res = Success("设置成功");
275
+                            List<string> lddep = new BLL.T_Cus_CustomerBase().GetLDdep();
276
+                            CacheHelper.Insert("LDDep", lddep);
272 277
                         }
273 278
                         else
274 279
                         {
@@ -295,20 +300,48 @@ namespace CallCenterApi.Interface.Controllers.customer
295 300
         public ActionResult BindLDdep()
296 301
         {
297 302
             ActionResult res = NoToken("未知错误,请重新登录");
303
+            string keypara = RequestString.GetQueryString("keypara");
298 304
             if (Request.IsAuthenticated)
299 305
             {
300
-                List<string> lddep = new BLL.T_Cus_CustomerBase().GetLDdep();
306
+                //List<string> lddep = new BLL.T_Cus_CustomerBase().GetLDdep();
307
+                List<string> lddep = null;
308
+                lddep = CacheHelper.Get("LDDep") as List<string>;
309
+                List<string> resdep = new List<string>();
301 310
                 if (lddep != null && lddep.Count > 0)
302 311
                 {
312
+                    foreach (string dep in lddep)
313
+                    {
314
+                        if (dep.Contains(keypara))
315
+                        {
316
+                            resdep.Add(dep);
317
+                        }
318
+                    }
303 319
                     var obj = new
304 320
                     {
305
-                        dep = lddep
321
+                        dep = resdep
306 322
                     };
307 323
                     res = Success("获取成功", obj);
308 324
                 }
309 325
                 else
310 326
                 {
311
-                    res = Error("获取失败,没有对应数据");
327
+                    lddep = new BLL.T_Cus_CustomerBase().GetLDdep();
328
+                    if (lddep != null && lddep.Count > 0)
329
+                    {
330
+                        foreach (string dep in lddep)
331
+                        {
332
+                            if (dep.Contains(keypara))
333
+                            {
334
+                                resdep.Add(dep);
335
+                            }
336
+                        }
337
+                        var obj = new
338
+                        {
339
+                            dep = resdep
340
+                        };
341
+                        res = Success("获取成功", obj);
342
+                    }
343
+                    else
344
+                        res = Error("获取失败,没有对应数据");
312 345
                 }
313 346
             }
314 347
             return res;