Procházet zdrojové kódy

获取知识库关键词列表(汉字拼音检索)

lihai %!s(int64=7) %!d(string=před) roky
rodič
revize
061cea72b0

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

248
     <Compile Include="Models\Dto\AddressBookDto.cs" />
248
     <Compile Include="Models\Dto\AddressBookDto.cs" />
249
     <Compile Include="Models\Dto\CallPlan.cs" />
249
     <Compile Include="Models\Dto\CallPlan.cs" />
250
     <Compile Include="Models\Dto\DeptAssessment.cs" />
250
     <Compile Include="Models\Dto\DeptAssessment.cs" />
251
+    <Compile Include="Models\Dto\KnowledgeKeyDto.cs" />
251
     <Compile Include="Models\Dto\WorkOrderReportDto.cs" />
252
     <Compile Include="Models\Dto\WorkOrderReportDto.cs" />
252
     <Compile Include="Models\Filter\FilterCallPhone.cs" />
253
     <Compile Include="Models\Filter\FilterCallPhone.cs" />
253
     <Compile Include="Models\Filter\FilterCallPlan.cs" />
254
     <Compile Include="Models\Filter\FilterCallPlan.cs" />

+ 3 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs

1
 using CallCenter.Utility;
1
 using CallCenter.Utility;
2
+using CallCenterApi.Common;
2
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
3
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
4
 using System;
5
 using System;
193
 
194
 
194
             Model.T_Sys_DictionaryValue orderModel = new Model.T_Sys_DictionaryValue();
195
             Model.T_Sys_DictionaryValue orderModel = new Model.T_Sys_DictionaryValue();
195
             BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
196
             BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
196
-
197
+            //清除知识库关键词缓存
198
+            CacheHelper.Remove("KnowledgeKeyWordList");
197
             if (id == 0)
199
             if (id == 0)
198
             {
200
             {
199
                 var list = orderBll.GetModelList(" F_Value='" + name + "' and F_ItemId='" + pid + "' ");
201
                 var list = orderBll.GetModelList(" F_Value='" + name + "' and F_ItemId='" + pid + "' ");

+ 46 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/knowledge/KnowledgeController.cs

1
 using CallCenter.Utility;
1
 using CallCenter.Utility;
2
+using CallCenterApi.Common;
2
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
3
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Interface.Models.Dto;
4
 using System;
6
 using System;
5
 using System.Collections.Generic;
7
 using System.Collections.Generic;
6
 using System.Data;
8
 using System.Data;
16
         BLL.T_RepositoryInformation infoBLL = new BLL.T_RepositoryInformation();
18
         BLL.T_RepositoryInformation infoBLL = new BLL.T_RepositoryInformation();
17
         BLL.T_RepositoryCategory bllcategory = new BLL.T_RepositoryCategory();
19
         BLL.T_RepositoryCategory bllcategory = new BLL.T_RepositoryCategory();
18
         BLL.T_RepositoryFavorites bllfavorites = new BLL.T_RepositoryFavorites();
20
         BLL.T_RepositoryFavorites bllfavorites = new BLL.T_RepositoryFavorites();
21
+        BLL.T_Sys_DictionaryValue blldic = new BLL.T_Sys_DictionaryValue();
19
         // 获取知识库列表
22
         // 获取知识库列表
20
         public ActionResult GetList(string keywords, string pid, int? issub, int? ispass)
23
         public ActionResult GetList(string keywords, string pid, int? issub, int? ispass)
21
         {
24
         {
272
         }
275
         }
273
 
276
 
274
         /// <summary>
277
         /// <summary>
275
-        /// 获取审核列表 修改前修改后对比
278
+        /// 获取修改前修改后对比详情
276
         /// </summary>
279
         /// </summary>
277
         /// <param name="auditid">id</param>
280
         /// <param name="auditid">id</param>
278
         /// <returns></returns>
281
         /// <returns></returns>
593
             return logid;
596
             return logid;
594
         }
597
         }
595
 
598
 
599
+        #region 知识库关键词
600
+
601
+        /// <summary>
602
+        /// 获取知识库关键词列表
603
+        /// </summary>
604
+        /// <param name="keywords"></param>
605
+        /// <returns></returns>
606
+        public ActionResult GetKnowledgeKeyWordList(string keywords)
607
+        {
608
+            //获取数组
609
+            var lists = new List<KnowledgeKeyDto>();
610
+
611
+            var dtCache = CacheHelper.Get<List<KnowledgeKeyDto>>($"KnowledgeKeyWordList");
612
+            if (dtCache != null)
613
+            {
614
+                lists = dtCache;
615
+            }
616
+            else {
617
+                //知识库关键词(字典)
618
+                string sql = "  F_PrentId = 59 AND F_PrentId != 0 ";
619
+                var list = blldic.DataTableToList(blldic.GetList($" {sql} ").Tables[0]);
620
+                foreach (var item in list)
621
+                {
622
+                    lists.Add(new KnowledgeKeyDto
623
+                    {
624
+                        titleEN = ChineseToPinYin.Convert(item.F_Value).ToLower(),
625
+                        titleCH = item.F_Value
626
+                    });
627
+                }
628
+                //排序
629
+                lists = lists.OrderBy(x => x.titleEN).ToList();
630
+                CacheHelper.Insert($"KnowledgeKeyWordList", lists, 10);
631
+            }
632
+            
633
+            if (!string.IsNullOrEmpty(keywords))
634
+            {
635
+                lists = lists.Where(x => x.titleCH.Contains(keywords) || x.titleEN.Contains(keywords)).ToList();
636
+            }
637
+            return Success("获取知识库关键词成功", lists);
638
+        }
639
+        #endregion
640
+
596
     }
641
     }
597
 }
642
 }

+ 19 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Dto/KnowledgeKeyDto.cs

1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+
6
+namespace CallCenterApi.Interface.Models.Dto
7
+{
8
+    public class KnowledgeKeyDto
9
+    {
10
+        /// <summary>
11
+        /// 关键词中文对应的英文
12
+        /// </summary>
13
+        public string titleEN { get; set; }
14
+        /// <summary>
15
+        /// 关键词中文
16
+        /// </summary>
17
+        public string titleCH { get; set; }
18
+    }
19
+}