diff --git a/src/Shentun.Peis.Application/AIMessages/AIMessageAppService.cs b/src/Shentun.Peis.Application/AIMessages/AIMessageAppService.cs
index a18312e..17b0d36 100644
--- a/src/Shentun.Peis.Application/AIMessages/AIMessageAppService.cs
+++ b/src/Shentun.Peis.Application/AIMessages/AIMessageAppService.cs
@@ -133,5 +133,109 @@ namespace Shentun.Peis.AIMessages
}
return messageDto;
}
+
+
+
+ /////
+ ///// 获取Ai回复内容 流式返回
+ /////
+ /////
+ /////
+ /////
+ //[HttpPost("api/app/AIMessage/GetAIMessageResultStream")]
+ //public async Task GetAIMessageResultStreamAsync(GetAIMessageResultInputDto input)
+ //{
+ // var messageDto = new GetAIMessageResultDto();
+
+ // if (string.IsNullOrWhiteSpace(input.Message))
+ // {
+ // throw new UserFriendlyException("请求内容不能为空");
+ // }
+
+ // var thirdInterface = await _thirdInterfaceRepository.FirstOrDefaultAsync(f => f.ThirdInterfaceType == ThirdInterfaceTypeFlag.WebAI);
+
+ // if (thirdInterface == null)
+ // {
+ // throw new UserFriendlyException("未配置第三方AI接口");
+ // }
+
+ // if (thirdInterface.IsActive != 'Y')
+ // {
+ // throw new UserFriendlyException("该接口已禁用");
+ // }
+
+ // var parmValue = thirdInterface.ParmValue;
+ // var configurationBuilder = new ConfigurationBuilder()
+ // .AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue)));
+ // var config = configurationBuilder.Build();
+ // var apiBaseAddress = config.GetSection("Interface").GetSection("BaseAddress").Value;
+ // var apiKey = config.GetSection("Interface").GetSection("ApiKey").Value;
+ // var aiType = config.GetSection("Interface").GetSection("AIType").Value;
+ // var modelValue = config.GetSection("Interface").GetSection("ModelValue").Value;
+
+ // if (aiType == AITypeFlag.DeepSeek)
+ // {
+ // using (HttpClient client = new HttpClient())
+ // {
+ // client.BaseAddress = new Uri(apiBaseAddress);
+ // // 设置API密钥或其他认证信息(如果有的话)
+ // client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
+ // //client.DefaultRequestHeaders.Add("Accept", "text/html");
+ // try
+ // {
+ // var requestBody = new
+ // {
+ // model = modelValue,
+ // messages = new[] { new { role = "user", content = input.Message } }
+ // //response_format = "html"
+ // };
+
+ // var response = await client.PostAsJsonAsync("chat/completions", requestBody);
+ // var result = await response.Content.ReadFromJsonAsync();
+ // string data = result.Choices.First().Message.Content;
+
+ // //string dataHtml = data.Replace("### ", "").Replace("---", "").Replace("-", "");
+ // //var dataHtmlList = dataHtml.Split("**", StringSplitOptions.RemoveEmptyEntries).ToList();
+ // //StringBuilder stringBuilder = new StringBuilder();
+ // //foreach (var item in dataHtmlList)
+ // //{
+ // // var sindex = dataHtmlList.IndexOf(item) + 1;
+ // // if (sindex > 1)
+ // // {
+ // // if (sindex % 2 == 0)
+ // // {
+
+ // // stringBuilder.Append("" + item);
+ // // }
+ // // else
+ // // {
+
+ // // stringBuilder.Append("" + item);
+ // // }
+ // // }
+ // // else
+ // // {
+ // // stringBuilder.Append(item);
+ // // }
+ // //}
+ // //messageDto.Result = stringBuilder.ToString();
+
+ // string dataHtml = data.Replace("### ", "").Replace("---", "").Replace("-", "").Replace("**", "");
+
+ // messageDto.Result = dataHtml;
+
+ // }
+ // catch (HttpRequestException e)
+ // {
+ // throw new UserFriendlyException($"获取异常:{e.Message}");
+ // }
+ // }
+ // }
+ // else
+ // {
+ // throw new UserFriendlyException("AI接口类型不正确");
+ // }
+ // return messageDto;
+ //}
}
}
diff --git a/src/Shentun.Peis.Application/BeiJingMZAKExportDatas/Class1.cs b/src/Shentun.Peis.Application/BeiJingMZAKExportDatas/Class1.cs
deleted file mode 100644
index 661fac5..0000000
--- a/src/Shentun.Peis.Application/BeiJingMZAKExportDatas/Class1.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Shentun.Peis.BeiJingMZAKExportDatas
-{
- internal class Class1
- {
- }
-}
diff --git a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
index 9bd26a9..d2736d2 100644
--- a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
+++ b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
@@ -100,8 +100,8 @@ namespace Shentun.Peis.InternalReports
from ad in dd.DefaultIfEmpty()
join b in await _userRepository.GetQueryableAsync() on ad.CheckDoctorId equals b.Id.ToString() into bb
from ab in bb.DefaultIfEmpty()
- where (a.CreationTime >= Convert.ToDateTime(input.StartDate) &&
- a.CreationTime < Convert.ToDateTime(input.EndDate).AddDays(1)
+ where (ad.CheckDate >= Convert.ToDateTime(input.StartDate) &&
+ ad.CheckDate < Convert.ToDateTime(input.EndDate).AddDays(1)
&& ad.CompleteFlag == RegisterCheckCompleteFlag.Checked
)
select new
@@ -117,10 +117,7 @@ namespace Shentun.Peis.InternalReports
query = query.Where(m => input.UserIds.Contains(m.CheckDoctorId));
}
-
- //var ssd = query.ToQueryString();
-
- var entlistdto = query.ToList().GroupBy(g => new { g.a.AsbitemId, g.a.CreatorId, })
+ var entlistdto = query.ToList().GroupBy(g => new { g.a.AsbitemId, g.CheckDoctorId, })
.Select(s => new GetDoctorPersonnelWorkLoadReportDto
{
AsbitemName = s.FirstOrDefault().AsbitemName,
diff --git a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
index bf43208..def6583 100644
--- a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
+++ b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
@@ -885,12 +885,6 @@ namespace Shentun.Peis.PeisReports
join aj in await _registerCheckAsbitemRepository.GetQueryableAsync() on a.Id equals aj.PatientRegisterId
join ak in await _registerCheckRepository.GetQueryableAsync() on aj.RegisterCheckId equals ak.Id
join al in await _asbitemRepository.GetQueryableAsync() on aj.AsbitemId equals al.Id
- //join j in await _registerAsbitemRepository.GetQueryableAsync() on a.Id equals j.PatientRegisterId into jj
- //from aj in jj.DefaultIfEmpty()
- //join k in await _registerCheckRepository.GetQueryableAsync() on aj.RegisterCheckId equals k.Id into kk
- //from ak in kk.DefaultIfEmpty()
- //join l in await _asbitemRepository.GetQueryableAsync() on aj.AsbitemId equals l.Id into ll
- //from al in ll.DefaultIfEmpty()
select new
{
a,
@@ -1006,31 +1000,25 @@ namespace Shentun.Peis.PeisReports
sumquery = sumquery.Where(m => m.a.CompleteFlag == input.CompleteFlag);
}
+ var sss = sumquery.ToList();
- var entlist = sumquery.GroupBy(g => g.a.Id).Select(s => new GetPatientRegisterUnCheckedReportDto
+
+ var entlist = sumquery.ToList().GroupBy(g => g.a.Id).Select(s => new GetPatientRegisterUnCheckedReportDto
{
Age = s.FirstOrDefault().a.Age,
CustomerOrgGroupName = s.FirstOrDefault().ac.DisplayName,
- CustomerOrgName = _cacheService.GetTopCustomerOrgAsync(s.FirstOrDefault().a.CustomerOrgId).Result.DisplayName,
- DepartmentName = _cacheService.GetCustomerOrgNameAsync(s.FirstOrDefault().a.CustomerOrgId).Result,
- //GiveUpAsbitems = s.Where(m => m.ak.CompleteFlag == '2').Select(gs => new GetPatientRegisterUnCheckedReport_GiveUpAsbitem
- //{
- // AsbitemName = gs.al.DisplayName
- //}).ToList(),
+ CustomerOrgName = _cacheService.GetTopCustomerOrgAsync(s.FirstOrDefault().a.CustomerOrgId).GetAwaiter().GetResult().DisplayName,
+ DepartmentName = _cacheService.GetCustomerOrgNameAsync(s.FirstOrDefault().a.CustomerOrgId).GetAwaiter().GetResult(),
GiveUpAsbitems = s.Where(m => m.ak.CompleteFlag == RegisterCheckCompleteFlag.GiveUpChecked).Select(gs => gs.al.DisplayName).ToList(),
- MedicalPackageName = s.FirstOrDefault().ad.DisplayName,
+ MedicalPackageName = s.FirstOrDefault().ad != null ? s.FirstOrDefault().ad.DisplayName : "",
MedicalTimes = s.FirstOrDefault().a.MedicalTimes,
MobileTelephone = s.FirstOrDefault().ab.MobileTelephone,
PatientName = s.FirstOrDefault().a.PatientName,
PatientNo = s.FirstOrDefault().ab.PatientNo,
PatientRegisterNo = s.FirstOrDefault().a.PatientRegisterNo,
- SexName = s.FirstOrDefault().ag.DisplayName,
+ SexName = s.FirstOrDefault().ag != null ? s.FirstOrDefault().ag.DisplayName : "",
Telephone = s.FirstOrDefault().ab.Telephone,
- UnCheckAsbitems = s.Where(m => m.ak.CompleteFlag == RegisterCheckCompleteFlag.UnChecked).Select(gs => gs.al.DisplayName).ToList(),
- //UnCheckAsbitems = s.Where(m => m.ak.CompleteFlag == '0').Select(gs => new GetPatientRegisterUnCheckedReport_UnCheckAsbitem
- //{
- // AsbitemName = gs.al.DisplayName
- //}).ToList()
+ UnCheckAsbitems = s.Where(m => m.ak.CompleteFlag == RegisterCheckCompleteFlag.UnChecked).Select(gs => gs.al.DisplayName).ToList()
}).ToList();
return entlist;
diff --git a/src/Shentun.Peis.HttpApi.Host/Controllers/AiMessageWsController.cs b/src/Shentun.Peis.HttpApi.Host/Controllers/AiMessageWsController.cs
new file mode 100644
index 0000000..ee258f9
--- /dev/null
+++ b/src/Shentun.Peis.HttpApi.Host/Controllers/AiMessageWsController.cs
@@ -0,0 +1,69 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System.Net.WebSockets;
+using System.Text;
+using System.Threading;
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+
+namespace Shentun.Peis.Controllers
+{
+ [Route("api/[controller]")]
+ [ApiController]
+ public class AiMessageWsController : ControllerBase
+ {
+
+ [HttpGet]
+ public IAsyncEnumerable GetData()
+ {
+ return GenerateDataAsync();
+ }
+
+ private async IAsyncEnumerable GenerateDataAsync()
+ {
+ for (int i = 0; i < 100; i++)
+ {
+ await Task.Delay(100); // 模拟延迟
+ yield return $"Data {i}";
+ }
+ }
+
+ //public async Task HandleWebSocket()
+ //{
+ // if (HttpContext.WebSockets.IsWebSocketRequest)
+ // {
+ // using var webSocket = await HttpContext.WebSockets.AcceptWebSocketAsync();
+ // await ProcessDeepSeekStream(webSocket);
+ // }
+ // else
+ // {
+ // HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
+ // }
+ //}
+
+
+
+ //private async Task ProcessDeepSeekStream(WebSocket webSocket)
+ //{
+ // // 调用deepseek API
+ // var stream = await GetDeepSeekStream();
+
+ // foreach (var chunk in stream)
+ // {
+ // var buffer = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(chunk));
+ // await webSocket.SendAsync(
+ // new ArraySegment(buffer),
+ // WebSocketMessageType.Text,
+ // true,
+ // CancellationToken.None);
+ // }
+
+ // await webSocket.CloseAsync(
+ // WebSocketCloseStatus.NormalClosure,
+ // "Stream completed",
+ // CancellationToken.None);
+ //}
+
+ }
+}
diff --git a/src/Shentun.Peis.HttpApi.Host/appsettings.json b/src/Shentun.Peis.HttpApi.Host/appsettings.json
index 7466fdb..8f4b920 100644
--- a/src/Shentun.Peis.HttpApi.Host/appsettings.json
+++ b/src/Shentun.Peis.HttpApi.Host/appsettings.json
@@ -12,9 +12,10 @@
"LisPassword": "666666"
},
"ConnectionStrings": {
- "Default": "Host=10.1.12.140;Port=5432;Database=ShentunPeis0508;User ID=postgres;Password=st123;"
+ //"Default": "Host=10.1.12.140;Port=5432;Database=ShentunPeis0508;User ID=postgres;Password=st123;"
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
- //"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
+ //"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;",
+ "Default": "Host=192.168.0.188;Port=5432;Database=ShentunPeis;User ID=postgres;Password=St123456;"
},
"AuthServer": {
"Authority": "http://localhost:9530",
@@ -30,7 +31,7 @@
"Abp.Identity.Password.RequireLowercase": false,
"Abp.Identity.Password.RequireUppercase": false,
"Abp.Identity.Password.RequireNonAlphanumeric": false,
- "Abp.Identity.Password.RequiredLength": 6,
+ "Abp.Identity.Password.RequiredLength": 1,
"Abp.Localization.DefaultLanguage": "zh-Hans"
},
"HostUrl": {
@@ -61,7 +62,7 @@
"Hangfire": {
"IsEnabled": true,
"IsEnabledDashboard": true,
- "ConnectionStrings": "10.1.12.140:6379,password=st123",
+ "ConnectionStrings": "192.168.0.188:6379,password=shentun123",
"Db": 3
},
"Pacs": {