xf 1 жил өмнө
parent
commit
b400407812

+ 13 - 0
src/Hotline.Ai.Jths/AiQualityService.cs

@@ -0,0 +1,13 @@
+using Hotline.Ai.Quality;
+using XF.Domain.Dependency;
+
+namespace Hotline.Ai.Jths
+{
+    public class AiQualityService : IAiQualityService, IScopeDependency
+    {
+        public async Task CreateAiOrderQualityTask(object obj)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 17 - 0
src/Hotline.Ai.Jths/Hotline.Ai.Jths.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net7.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="RestSharp" Version="110.2.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Hotline\Hotline.csproj" />
+  </ItemGroup>
+
+</Project>

+ 38 - 0
src/Hotline.Api/Controllers/BsController.cs

@@ -0,0 +1,38 @@
+using Hotline.Orders;
+using Hotline.Repository.SqlSugar.Orders;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+
+namespace Hotline.Api.Controllers
+{
+    public class BsController : BaseController
+    {
+        private readonly IOrderRepository _orderRepository;
+
+        public BsController(IOrderRepository orderRepository)
+        {
+            _orderRepository = orderRepository;
+        }
+
+        [AllowAnonymous]
+        [HttpGet("datashow")]
+        public async Task<dynamic> InitDataShowAync()
+        {
+            var now = DateTime.Now;
+            //area2
+            var area2 = await _orderRepository.Queryable(workflowFilter: false)
+                .Where(d => d.CreationTime.Month == now.Month)
+                .GroupBy(d => d.SourceChannel)
+                .Select(d => new
+                {
+                    source = d.SourceChannel,
+                    count = SqlFunc.AggregateCount(d.SourceChannel)
+                })
+                .ToListAsync();
+
+
+            return new { area2 };
+        }
+    }
+}