Browse Source

refactor: 重点关注事件改为字典配置

xf 9 months ago
parent
commit
6404142658

+ 19 - 11
src/Hotline.Api/Controllers/OrderController.cs

@@ -3407,18 +3407,26 @@ public class OrderController : BaseController
         //是否行政执法类工单
         //是否行政执法类工单
         var IsOpenJudicialManagement = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsOpenJudicialManagement).SettingValue[0]);
         var IsOpenJudicialManagement = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsOpenJudicialManagement).SettingValue[0]);
         //重点关注事件
         //重点关注事件
-        List<Kv> FocusOnEvents = new()
+        var FocusOnEvents = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.FocusOnEvent).ToList();
+        if (!IsOpenJudicialManagement)
         {
         {
-            new Kv { Key = "0", Value = "紧急工单" },
-            new Kv { Key = "1", Value = "形式主义工单" },
-            new Kv { Key = "3", Value = "敏感类工单" }
-        };
-        if (IsOpenJudicialManagement)
-            FocusOnEvents.Add(new Kv { Key = "2", Value = "行政执法类工单" });
+            var xingzhenglei = FocusOnEvents.FirstOrDefault(d => d.DicDataValue == "2");
+            if (xingzhenglei is not null)
+                FocusOnEvents.Remove(xingzhenglei);
+        }
+
+        //List<Kv> FocusOnEvents = new()
+        //{
+        //    new Kv { Key = "0", Value = "紧急工单" },
+        //    new Kv { Key = "1", Value = "形式主义工单" },
+        //    new Kv { Key = "3", Value = "敏感类工单" }
+        //};
+        //if (IsOpenJudicialManagement)
+        //    FocusOnEvents.Add(new Kv { Key = "2", Value = "行政执法类工单" });
 
 
-        //todo 宜宾add 1,3
-        //todo 自贡add 4
-        FocusOnEvents.Add(new Kv { Key = "4", Value = "24小时" });
+        ////todo 宜宾add 1,3
+        ////todo 自贡add 4
+        //FocusOnEvents.Add(new Kv { Key = "4", Value = "24小时办结" });
 
 
         var rsp = new
         var rsp = new
         {
         {
@@ -4813,7 +4821,7 @@ public class OrderController : BaseController
                 d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
                 d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
             //.WhereIF(!string.IsNullOrEmpty(dto.Content), d => d.Content.Contains(dto.Content!))
             //.WhereIF(!string.IsNullOrEmpty(dto.Content), d => d.Content.Contains(dto.Content!))
             .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType)//受理类型
             .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType)//受理类型
-                                                                                                //.WhereIF(dto.AcceptTypes.Any(), d => dto.AcceptTypes.Contains(d.AcceptTypeCode)) //受理类型
+                                                                                                    //.WhereIF(dto.AcceptTypes.Any(), d => dto.AcceptTypes.Contains(d.AcceptTypeCode)) //受理类型
             .WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.SourceChannelCode == dto.Channel)//来源渠道
             .WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.SourceChannelCode == dto.Channel)//来源渠道
             .WhereIF(!string.IsNullOrEmpty(dto.Hotspot), d => d.HotspotSpliceName != null && d.HotspotSpliceName.Contains(dto.Hotspot))
             .WhereIF(!string.IsNullOrEmpty(dto.Hotspot), d => d.HotspotSpliceName != null && d.HotspotSpliceName.Contains(dto.Hotspot))
             .WhereIF(!string.IsNullOrEmpty(dto.TransferPhone), d => d.TransferPhone.Contains(dto.TransferPhone!))
             .WhereIF(!string.IsNullOrEmpty(dto.TransferPhone), d => d.TransferPhone.Contains(dto.TransferPhone!))

+ 5 - 0
src/Hotline/Settings/SysDicTypeConsts.cs

@@ -234,4 +234,9 @@ public class SysDicTypeConsts
     /// 工单标签
     /// 工单标签
     /// </summary>
     /// </summary>
 	public const string OrderTag = "OrderTag";
 	public const string OrderTag = "OrderTag";
+
+    /// <summary>
+    /// 重点关注事件
+    /// </summary>
+	public const string FocusOnEvent = "FocusOnEvent";
 }
 }