Parcourir la Source

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

machenyang il y a 8 ans
Parent
commit
e961c1e6db

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

170
             }
170
             }
171
             return res;
171
             return res;
172
         }
172
         }
173
-        
173
+
174
         /// <summary>
174
         /// <summary>
175
         /// 添加/修改客户信息
175
         /// 添加/修改客户信息
176
         /// </summary>
176
         /// </summary>
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
                         if (DbHelperSQL.ExecuteSql(sql) > 0)
272
                         if (DbHelperSQL.ExecuteSql(sql) > 0)
270
                         {
273
                         {
271
                             res = Success("设置成功");
274
                             res = Success("设置成功");
275
+                            List<string> lddep = new BLL.T_Cus_CustomerBase().GetLDdep();
276
+                            CacheHelper.Insert("LDDep", lddep);
272
                         }
277
                         }
273
                         else
278
                         else
274
                         {
279
                         {
295
         public ActionResult BindLDdep()
300
         public ActionResult BindLDdep()
296
         {
301
         {
297
             ActionResult res = NoToken("未知错误,请重新登录");
302
             ActionResult res = NoToken("未知错误,请重新登录");
303
+            string keypara = RequestString.GetQueryString("keypara");
298
             if (Request.IsAuthenticated)
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
                 if (lddep != null && lddep.Count > 0)
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
                     var obj = new
319
                     var obj = new
304
                     {
320
                     {
305
-                        dep = lddep
321
+                        dep = resdep
306
                     };
322
                     };
307
                     res = Success("获取成功", obj);
323
                     res = Success("获取成功", obj);
308
                 }
324
                 }
309
                 else
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
             return res;
347
             return res;