瀏覽代碼

解决注入问题

Dun.Jason 7 月之前
父節點
當前提交
f3cfe4227a

+ 10 - 8
src/Hotline.Api/StartupHelper.cs

@@ -256,14 +256,7 @@ namespace Hotline.Api
                 d.MaxBatchSize = 3;
 
                 //load send order job
-                var autoSendOrderKey = new JobKey(nameof(SendOrderJob), "send order task");
-                d.AddJob<SendOrderJob>(autoSendOrderKey);
-                d.AddTrigger(t => t
-                    .WithIdentity("task-send-order-trigger")
-                    .ForJob(autoSendOrderKey)
-                    .StartNow()
-                    .WithCronSchedule("0 10 9 * * ?")
-                );
+                
 
                 //即将超期和超期短信
                 var autoSendOverTimeSmsKey = new JobKey(nameof(SendOverTimeSmsJob), "send overtime order task");
@@ -285,6 +278,15 @@ namespace Hotline.Api
                         .ForJob(aiVisitStatusKey)
                         .StartNow()
                         .WithCronSchedule("0 0/5 * * * ? *"));
+
+                        var autoSendOrderKey = new JobKey(nameof(SendOrderJob), "send order task");
+                        d.AddJob<SendOrderJob>(autoSendOrderKey);
+                        d.AddTrigger(t => t
+                            .WithIdentity("task-send-order-trigger")
+                            .ForJob(autoSendOrderKey)
+                            .StartNow()
+                            .WithCronSchedule("0 10 9 * * ?")
+                        );
                         break;
                     default:
                         break;

+ 1 - 1
src/Hotline.Api/config/appsettings.Development.json

@@ -1,7 +1,7 @@
 {
   "AllowedHosts": "*",
   "AppConfiguration": {
-    "AppScope": "YiBin",
+    "AppScope": "ZiGong",
     "YiBin": {
       "CallCenterType": "TianRun", //XunShi、WeiErXin、TianRun、XingTang
       //智能回访

+ 2 - 4
src/Hotline.Application/Tels/TelApplication.cs

@@ -17,7 +17,6 @@ namespace Hotline.Application.Tels;
 public class TelApplication : ITelApplication, IScopeDependency
 {
     private readonly IUserCacheManager _userCacheManager;
-    private readonly ITrClient _trClient;
     private readonly ITelRestRepository _telRestRepository;
     private readonly ITypedCache<Work> _cacheWork;
     private readonly IWorkRepository _workRepository;
@@ -28,15 +27,14 @@ public class TelApplication : ITelApplication, IScopeDependency
         ITelRestRepository telRestRepository,
         ITypedCache<Work> cacheWork,
         IWorkRepository workRepository,
-        IRepository<TelActionRecord> telActionRecordRepository,
-        ITrClient trClient)
+        IRepository<TelActionRecord> telActionRecordRepository
+        )
     {
         _userCacheManager = userCacheManager;
         _telRestRepository = telRestRepository;
         _cacheWork = cacheWork;
         _workRepository = workRepository;
         _telActionRecordRepository = telActionRecordRepository;
-        _trClient = trClient;
     }
 
     /// <summary>

+ 2 - 0
src/Hotline/Orders/AiVisitDomainService.cs

@@ -1,4 +1,5 @@
 using Hotline.Ai.Visit;
+using Hotline.DI;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,6 +10,7 @@ using XF.Domain.Repository;
 
 namespace Hotline.Orders
 {
+    [Injection(AppScopes = EAppScope.YiBin)]
     public class AiVisitDomainService : IAiVisitDomainService, IScopeDependency
     {
         private readonly IAiVisitService _aiVisitService;