Sfoglia il codice sorgente

Merge branch 'release' of http://110.188.24.182:10023/Fengwo/hotline into release

tangjiang 6 mesi fa
parent
commit
617de4930e

+ 41 - 0
src/Hotline.Application.Tests/Controller/OrderControllerTest.cs

@@ -0,0 +1,41 @@
+using AutoFixture;
+using Hotline.Api.Controllers;
+using Hotline.Share.Dtos.Order;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Testing;
+using Moq;
+using Shouldly;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hotline.Application.Tests.Controller;
+public class OrderControllerTest : IClassFixture<WebApplicationFactory<Startup>>
+{
+    private readonly OrderController _orderController;
+    private readonly IFixture _fixture;
+    private readonly WebApplicationFactory<Startup> _factory;
+
+    public OrderControllerTest(OrderController orderController, WebApplicationFactory<Startup> factory)
+    //public OrderControllerTest(HttpClient testClient)
+    {
+        _fixture = new Fixture();
+        _orderController = orderController;
+        //_testClient = testClient;
+        _factory = factory;
+        _orderController.ControllerContext = new ControllerContext
+        {
+            HttpContext = new DefaultHttpContext()
+        };
+    }
+
+    [Fact]
+    public async Task SendSMS_Test()
+    {
+        var inDto = _fixture.Create<VisitSmsInDto>();
+        await _orderController.VisitPushSMSAsync(inDto);
+    }
+}

+ 2 - 0
src/Hotline.Application.Tests/Hotline.Application.Tests.csproj

@@ -22,9 +22,11 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="AutoFixture" Version="4.18.1" />
     <PackageReference Include="coverlet.collector" Version="3.2.0" />
     <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.20" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
+    <PackageReference Include="Moq" Version="4.20.72" />
     <PackageReference Include="Shouldly" Version="4.2.1" />
     <PackageReference Include="xunit" Version="2.4.2" />
     <PackageReference Include="Xunit.DependencyInjection" Version="9.3.0" />

+ 6 - 1
src/Hotline.Application.Tests/Startup.cs

@@ -47,6 +47,8 @@ using Hotline.CallCenter.Configs;
 using Tr.Sdk;
 using Hotline.Application.StatisticalReport.CallReport;
 using XF.Domain.Authentications;
+using Hotline.Api.Controllers;
+using Hotline.Application.ExportExcel;
 
 namespace Hotline.Application.Tests;
 public class Startup
@@ -95,6 +97,8 @@ public class Startup
             services.Configure<CityBaseConfiguration>(d => configuration.GetSection(nameof(CityBaseConfiguration)).Bind(d));
 
 			services.RegisterMapper();
+            //services.AddControllers()
+            //    .AddControllersAsServices();
 
             //sqlsugar
             services.AddSqlSugar(configuration);
@@ -150,8 +154,9 @@ public class Startup
             services.AddScoped<ZiGongCallReportApplication>();
             services.AddScoped<YiBinCallReportApplication>();
             services.AddScoped<IMediator, MediatorMock>();
-
             services.AddScoped<ISessionContext, DefaultHttpContextAccessor>();
+            services.AddScoped<IExportApplication, ExportApplication>();
+            services.AddScoped<OrderController>();
 
             //ServiceLocator.Instance = services.BuildServiceProvider();
         }

+ 1 - 3
src/Hotline.Application/ExportExcel/ExportApplication.cs

@@ -20,12 +20,10 @@ namespace Hotline.Application.ExportExcel
     public class ExportApplication : IExportApplication, IScopeDependency
     {
         private readonly IMapper _mapper;
-        private readonly IHttpContextAccessor _httpContextAccessor;
 
-        public ExportApplication(IMapper mapper, IHttpContextAccessor httpContextAccessor)
+        public ExportApplication(IMapper mapper)
         {
             _mapper = mapper;
-            _httpContextAccessor = httpContextAccessor;
         }
 
         /// <summary>

+ 5 - 0
src/Hotline.Application/Subscribers/DatasharingSubscriber.cs

@@ -573,6 +573,11 @@ namespace Hotline.Application.Subscribers
                         orderVisit.IsCanHandle = orgProcessingResults.Key == "2";
                         orderVisit.IsCanAiVisit = false;
                         orderVisit.NowEvaluate = orgProcessingResults;
+                        if (_appOptions.Value.IsZiGong)
+                        {
+                            orderVisit.EmployeeId = _systemSettingCacheManager.DefaultVisitEmployeeId;
+                        }
+
                         await _orderVisitRepository.UpdateAsync(orderVisit, cancellationToken);
                         //子表
                         for (int i = 0; i < orderVisit.OrderVisitDetails.Count; i++)

+ 5 - 0
src/Hotline/Caching/Interfaces/ISystemSettingCacheManager.cs

@@ -13,6 +13,11 @@ namespace Hotline.Caching.Interfaces
         int SeatChaoTime { get; }
         int RingTimes { get; }
         string RecordPrefix { get; }
+
+        /// <summary>
+        /// 中心直办件默认回访人Id
+        /// 根据禅道 自贡需求 Id_361, 第一条, 3小条需求;
+        /// </summary>
         string DefaultVisitEmployeeId { get; }
     }
 }