瀏覽代碼

Merge branch 'release' of http://git.12345lm.cn/Fengwo/hotline into release

Dun.Jason 9 月之前
父節點
當前提交
a4b22451bd

+ 1 - 1
src/Hotline.Api/Controllers/Bi/BiOrderController.cs

@@ -737,7 +737,7 @@ namespace Hotline.Api.Controllers.Bi
                     AcceptType = x.AcceptType,
                     OneHotspot = SqlFunc.Substring(x.HotspotSpliceName, 0, SqlFunc.CharIndex("-", x.HotspotSpliceName + "-")),
                     Id = x.Id
-                }).MergeTable()
+                }).MergeTable().Where(x => x.OneHotspot != "非受理范围")
                 .GroupBy(x => new { x.OneHotspot })
                 .Select(x => new AcceptTypeTop10Vo
                 {

+ 16 - 6
src/Hotline.Api/Controllers/IPPbxController.cs

@@ -25,6 +25,7 @@ using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
 using Newtonsoft.Json;
+using System.Threading;
 using Tr.Sdk;
 using Tr.Sdk.Blacklist;
 using Tr.Sdk.Tels;
@@ -498,12 +499,21 @@ namespace Hotline.Api.Controllers
                         {
 							var setting = _systemSettingCacheManager.GetSetting(SettingConstants.ViteRecordPrefix);
 							//await _aiQualityService.CreateAiOrderQualityTask(quality, model, order, setting?.SettingValue[0], HttpContext.RequestAborted);
-                            await _aiQualityService.CreateAiOrderQualityTask(
-                                quality,
-                                model.RecordingAbsolutePath,
-                                model.CPN,
-                                model.CreatedTime,
-                                order, setting?.SettingValue[0], HttpContext.RequestAborted);
+
+							try
+							{
+								await _aiQualityService.CreateAiOrderQualityTask(
+									quality,
+									model.RecordingAbsolutePath,
+									model.CPN,
+									model.CreatedTime,
+									order, setting?.SettingValue[0], HttpContext.RequestAborted);
+							}
+							catch (Exception e)
+							{
+								_logger.LogError($"写入智能质检异常!, \r\n{e.Message}");
+							}
+						
                         }
                     }
                 }

+ 2 - 2
src/Hotline.Api/Controllers/PushMessageController.cs

@@ -127,8 +127,8 @@ namespace Hotline.Api.Controllers
                          d.CreatorOrgName.Contains(pagedDto.Keyword!))
                 .WhereIF(pagedDto.StartTime.HasValue, d => d.SendTime >= pagedDto.StartTime)
                 .WhereIF(pagedDto.EndTime.HasValue, d => d.SendTime <= pagedDto.EndTime)
-                .WhereIF(!string.IsNullOrEmpty(pagedDto.UserName), d => d.Name == pagedDto.UserName)
-                 .WhereIF(!string.IsNullOrEmpty(pagedDto.TelNumber), d => d.TelNumber == pagedDto.TelNumber)
+                .WhereIF(!string.IsNullOrEmpty(pagedDto.UserName), d => d.Name.Contains(pagedDto.UserName))
+                 .WhereIF(!string.IsNullOrEmpty(pagedDto.TelNumber), d => d.TelNumber.Contains(pagedDto.TelNumber))
                 .OrderByDescending(it => it.CreationTime)
                 .ToPagedListAsync(pagedDto.PageIndex, pagedDto.PageSize, HttpContext.RequestAborted);
 

+ 14 - 7
src/Hotline.Api/Controllers/QualityController.cs

@@ -755,13 +755,20 @@ namespace Hotline.Api.Controllers
                 }
 
                 var setting = _systemSettingCacheManager.GetSetting(SettingConstants.ViteRecordPrefix);
-                await _aiQualityService.CreateAiOrderQualityTask(
-                    quality,
-                    audioFile,
-                    fromNo,
-                    callStartTime,
-                    order, setting?.SettingValue[0], HttpContext.RequestAborted);
-                await _qualitey.UpdateAsync(quality, HttpContext.RequestAborted);
+                try
+                {
+					await _aiQualityService.CreateAiOrderQualityTask(
+						quality,
+						audioFile,
+						fromNo,
+						callStartTime,
+						order, setting?.SettingValue[0], HttpContext.RequestAborted);
+				}
+                catch (Exception e)
+                {
+	                _logger.LogError($"写入智能质检异常!, \r\n{e.Message}");
+                }
+				await _qualitey.UpdateAsync(quality, HttpContext.RequestAborted);
             }
         }
 

+ 11 - 3
src/Hotline.Application/Handlers/FlowEngine/WorkflowStartHandler.cs

@@ -196,12 +196,20 @@ namespace Hotline.Application.Handlers.FlowEngine
                             }
                         }
                     }
-                    catch
+                    catch(Exception e)
                     {
+                        _logger.LogError($"发送短信失败! orderId: {order.Id},\r\n{e.Message}");
                     }
 
-                    //写入质检
-                    await _qualityApplication.AddQualityAsync(EQualitySource.Accepted, order.Id, cancellationToken);
+                    try
+                    {
+                        //写入质检
+                        await _qualityApplication.AddQualityAsync(EQualitySource.Accepted, order.Id, cancellationToken);
+                    }
+                    catch (Exception e)
+                    {
+                        _logger.LogError($"写入质检异常!orderId: {order.Id}, \r\n{e.Message}");
+                    }
                     break;
                 case WorkflowModuleConsts.KnowledgeAdd:
                 case WorkflowModuleConsts.KnowledgeUpdate:

+ 21 - 9
src/Hotline.Application/Quality/QualityApplication.cs

@@ -10,6 +10,7 @@ using Hotline.Share.Dtos.Quality;
 using Hotline.Share.Enums.Quality;
 using MapsterMapper;
 using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using XF.Domain.Authentications;
 using XF.Domain.Constants;
@@ -30,7 +31,8 @@ namespace Hotline.Application.Quality
         //private readonly IRepository<TrCallRecord> _trCallRecordRepository;
         private readonly IRepository<QualityTemplate> _qualityTemplate;
         private readonly ISystemSettingCacheManager _systemSettingCacheManager;
-        private readonly ICallApplication _callApplication;
+        private readonly ILogger<Hotline.Quality.Quality> _logger;
+		private readonly ICallApplication _callApplication;
         private readonly IOptionsSnapshot<CallCenterConfiguration> _callcenterOptions;
 
         public QualityApplication(
@@ -44,7 +46,8 @@ namespace Hotline.Application.Quality
 			IOrderRepository orderRepository,
             ISystemSettingCacheManager systemSettingCacheManager,
             ICallApplication callApplication,
-            IOptionsSnapshot<CallCenterConfiguration> callcenterOptions)
+            IOptionsSnapshot<CallCenterConfiguration> callcenterOptions,
+            ILogger<Hotline.Quality.Quality> logger)
         {
             _sessionContext = sessionContext;
             _mapper = mapper;
@@ -57,7 +60,9 @@ namespace Hotline.Application.Quality
             _systemSettingCacheManager = systemSettingCacheManager;
             _callApplication = callApplication;
             _callcenterOptions = callcenterOptions;
-        }
+            _logger = logger;
+
+		}
 
         public async Task AddQualityAsync(EQualitySource Source, string OrderId, string VisitId, CancellationToken cancellationToken)
         {
@@ -139,12 +144,19 @@ namespace Hotline.Application.Quality
 
                         var setting = _systemSettingCacheManager.GetSetting(SettingConstants.ViteRecordPrefix);
 						//await _aiQualityService.CreateAiOrderQualityTask(quality, call, order, setting?.SettingValue[0], cancellationToken);
-                        await _aiQualityService.CreateAiOrderQualityTask(
-                            quality,
-                            audioFile,
-                            fromNo,
-                            callStartTime,
-                            order, setting?.SettingValue[0], cancellationToken);
+						try
+						{
+							await _aiQualityService.CreateAiOrderQualityTask(
+								quality,
+								audioFile,
+								fromNo,
+								callStartTime,
+								order, setting?.SettingValue[0], cancellationToken);
+						}
+						catch (Exception e)
+						{
+							_logger.LogError($"写入智能质检异常!, \r\n{e.Message}");
+						}
                     }
 	            }
             }

+ 1 - 1
src/Hotline/Caching/Services/SysDicDataCacheManager.cs

@@ -21,7 +21,7 @@ namespace Hotline.Caching.Services
         {
             var sysDicDataList = _cacheSysDicData.GetOrSet(code, k =>
             {
-                return _sysDicDataRepository.Queryable().Where(x => x.DicTypeCode == code).OrderBy(x=>x.Sort).ToTreeAsync(x => x.Children, it => it.ParentId, "").GetAwaiter().GetResult();
+                return _sysDicDataRepository.Queryable().Where(x => x.DicTypeCode == code && x.IsShow == true).OrderBy(x=>x.Sort).ToTreeAsync(x => x.Children, it => it.ParentId, "").GetAwaiter().GetResult();
             });
             return sysDicDataList;
         }

+ 11 - 4
src/Hotline/Settings/SystemDicData.cs

@@ -5,8 +5,8 @@ using XF.Domain.Repository;
 namespace Hotline.Settings
 {
     [Description("字典表")]
-    public class SystemDicData: CreationEntity
-    {
+    public class SystemDicData : FullStateEntity
+	{
         /// <summary>
         /// 字典类型Id
         /// </summary>
@@ -32,10 +32,17 @@ namespace Hotline.Settings
         /// </summary>
         [SugarColumn(DefaultValue = "0")]
         public int Sort { get; set; }
+
         /// <summary>
-        /// 上级ID
+        /// 是否显示
         /// </summary>
-        [SugarColumn(IsNullable = true)]
+        [SugarColumn(DefaultValue = "t")]
+		public bool IsShow { get; set; }
+
+		/// <summary>
+		/// 上级ID
+		/// </summary>
+		[SugarColumn(IsNullable = true)]
         public string? ParentId { get; set; }
 
         [SugarColumn(IsIgnore = true)]