From f6842d13a8d54555f2a49566f60a640cc2268b02 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Wed, 17 Apr 2024 18:19:07 +0800
Subject: [PATCH 1/2] 22
---
.../BaseDataHandleAppService.cs | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
diff --git a/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
new file mode 100644
index 00000000..e40b368b
--- /dev/null
+++ b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
@@ -0,0 +1,24 @@
+using Microsoft.AspNetCore.Authorization;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TencentCloud.Dlc.V20210125.Models;
+using Volo.Abp.Application.Services;
+
+namespace Shentun.Peis.DataMigrations
+{
+ ///
+ /// 基础数据处理
+ ///
+ [Authorize]
+ public class BaseDataHandleAppService : ApplicationService
+ {
+ public BaseDataHandleAppService()
+ {
+ }
+
+
+ }
+}
From a8898284459ba25aa19615c45f376041aaca9e19 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Wed, 17 Apr 2024 20:20:20 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=AF=8A=E6=96=AD=E5=BB=BA=E8=AE=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Diagnosises/DiagnosisInSuggestionDto.cs | 10 +++++++-
.../Suggestions/CreateSuggestionManyDto.cs | 10 ++++----
.../Diagnosises/DiagnosisAppService.cs | 23 +++++++++++++++----
.../Suggestions/SuggestionAppService.cs | 5 ++--
.../Enums/SuggestionTypeFlag.cs | 23 +++++++++++++++++++
.../Suggestions/SuggestionManager.cs | 9 ++++----
6 files changed, 63 insertions(+), 17 deletions(-)
create mode 100644 src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs
diff --git a/src/Shentun.Peis.Application.Contracts/Diagnosises/DiagnosisInSuggestionDto.cs b/src/Shentun.Peis.Application.Contracts/Diagnosises/DiagnosisInSuggestionDto.cs
index e444e3d4..aaa9627a 100644
--- a/src/Shentun.Peis.Application.Contracts/Diagnosises/DiagnosisInSuggestionDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/Diagnosises/DiagnosisInSuggestionDto.cs
@@ -7,7 +7,15 @@ namespace Shentun.Peis.Diagnosises
{
public class DiagnosisInSuggestionDto:DiagnosisDto
{
- public List Suggestions { get; set; }
+ ///
+ /// 医学解释
+ ///
+ public List MedicalInterpretations { get; set; }
+
+ ///
+ /// 健康指导
+ ///
+ public List HealthGuidances { get; set; }
}
diff --git a/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs b/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs
index 0bc17d2a..19db928d 100644
--- a/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs
@@ -14,16 +14,16 @@ namespace Shentun.Peis.Suggestions
[Required(ErrorMessage = "诊断ID不能为空")]
public Guid DiagnosisId { get; set; }
+ ///
+ /// 建议类型(0-代表医学解释,1-代表健康指导)
+ ///
+ public char SuggestionType { get; set; }
+
public List Details { get; set; } = new List();
}
public class CreateSuggestionMany_Detail
{
- ///
- /// 诊断ID
- ///
- public Guid DiagnosisId { get; set; }
-
///
/// 建议内容
///
diff --git a/src/Shentun.Peis.Application/Diagnosises/DiagnosisAppService.cs b/src/Shentun.Peis.Application/Diagnosises/DiagnosisAppService.cs
index bb5326b2..ed10c395 100644
--- a/src/Shentun.Peis.Application/Diagnosises/DiagnosisAppService.cs
+++ b/src/Shentun.Peis.Application/Diagnosises/DiagnosisAppService.cs
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.Diagnosises;
+using Shentun.Peis.Enums;
using Shentun.Peis.GuidTypes;
using Shentun.Peis.HelperDto;
using Shentun.Peis.Items;
@@ -139,7 +140,7 @@ namespace Shentun.Peis.Diagnosises
IsSummaryTemplate = s.FirstOrDefault().a.IsSummaryTemplate,
ItemTypeId = s.FirstOrDefault().a.ItemTypeId,
SuggestionName = s.FirstOrDefault().a.SuggestionName,
- Suggestions = s.Where(m => m.ab != null).Select(ss => new SuggestionDto
+ HealthGuidances = s.Where(m => m.ab != null && m.ab.SuggestionType == SuggestionTypeFlag.HealthGuidance).Select(ss => new SuggestionDto
{
CreationTime = ss.ab.CreationTime,
CreatorId = ss.ab.CreatorId,
@@ -153,8 +154,22 @@ namespace Shentun.Peis.Diagnosises
SuggestionContent = ss.ab.SuggestionContent
}).OrderBy(o => o.DisplayOrder).ToList(),
+ MedicalInterpretations = s.Where(m => m.ab != null && m.ab.SuggestionType == SuggestionTypeFlag.MedicalInterpretation).Select(ss => new SuggestionDto
+ {
+ CreationTime = ss.ab.CreationTime,
+ CreatorId = ss.ab.CreatorId,
+ CreatorName = s.FirstOrDefault().ae != null ? s.FirstOrDefault().ae.UserName : "",
+ LastModifierName = s.FirstOrDefault().af != null ? s.FirstOrDefault().af.UserName : "",
+ DiagnosisId = ss.ab.DiagnosisId,
+ DisplayOrder = ss.ab.DisplayOrder,
+ Id = ss.ab.Id,
+ LastModificationTime = ss.ab.LastModificationTime,
+ LastModifierId = ss.ab.LastModifierId,
+ SuggestionContent = ss.ab.SuggestionContent
- }).OrderBy(o=>o.ItemTypeId).ThenBy(o => o.DisplayOrder).ToList();
+ }).OrderBy(o => o.DisplayOrder).ToList(),
+
+ }).OrderBy(o => o.ItemTypeId).ThenBy(o => o.DisplayOrder).ToList();
return entlist;
@@ -239,7 +254,7 @@ namespace Shentun.Peis.Diagnosises
var createEntity = ObjectMapper.Map(input);
var entity = await _manager.CreateAsync(createEntity);
entity = await Repository.InsertAsync(entity, true);
- var entdto =await GetAsync(entity.Id);
+ var entdto = await GetAsync(entity.Id);
return entdto;
}
///
@@ -268,7 +283,7 @@ namespace Shentun.Peis.Diagnosises
{
return base.DeleteAsync(id);
}
-
+
///
/// 修改排序 置顶,置底
diff --git a/src/Shentun.Peis.Application/Suggestions/SuggestionAppService.cs b/src/Shentun.Peis.Application/Suggestions/SuggestionAppService.cs
index ed814fbb..2e1ec7dc 100644
--- a/src/Shentun.Peis.Application/Suggestions/SuggestionAppService.cs
+++ b/src/Shentun.Peis.Application/Suggestions/SuggestionAppService.cs
@@ -41,7 +41,7 @@ namespace Shentun.Peis.Suggestions
public async Task CreateSuggestionManyAsync(CreateSuggestionManyDto input)
{
//先按诊断ID删除所有建议
- await _manager.CheckAndDeleteInDiagnosisIdAsync(input.DiagnosisId);
+ await _manager.CheckAndDeleteInDiagnosisIdAsync(input.DiagnosisId, input.SuggestionType);
if (input.Details.Any())
{
@@ -52,7 +52,8 @@ namespace Shentun.Peis.Suggestions
{
DiagnosisId = input.DiagnosisId,
DisplayOrder = input.Details.IndexOf(item) + 1,
- SuggestionContent = item.SuggestionContent
+ SuggestionContent = item.SuggestionContent,
+ SuggestionType = input.SuggestionType
};
suggestions.Add(_manager.CreateAsync(entity));
diff --git a/src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs b/src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs
new file mode 100644
index 00000000..d4c1d03b
--- /dev/null
+++ b/src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+
+namespace Shentun.Peis.Enums
+{
+ public static class SuggestionTypeFlag
+ {
+ ///
+ /// 医学解释
+ ///
+ [Description("医学解释")]
+ public const char MedicalInterpretation = '0';
+
+
+ ///
+ /// 健康指导
+ ///
+ [Description("健康指导")]
+ public const char HealthGuidance = '1';
+ }
+}
diff --git a/src/Shentun.Peis.Domain/Suggestions/SuggestionManager.cs b/src/Shentun.Peis.Domain/Suggestions/SuggestionManager.cs
index 072d512e..1e6f2a22 100644
--- a/src/Shentun.Peis.Domain/Suggestions/SuggestionManager.cs
+++ b/src/Shentun.Peis.Domain/Suggestions/SuggestionManager.cs
@@ -36,16 +36,15 @@ namespace Shentun.Peis.Suggestions
return entity;
}
-
///
/// 按诊断删除建议
///
- /// 诊断ID
+ /// 诊断ID
+ ///
///
- ///
- public async Task CheckAndDeleteInDiagnosisIdAsync(Guid DiagnosisId)
+ public async Task CheckAndDeleteInDiagnosisIdAsync(Guid diagnosisId, char suggestionType = '0')
{
- var suggestionList = await _repository.GetListAsync(m => m.DiagnosisId == DiagnosisId);
+ var suggestionList = await _repository.GetListAsync(m => m.DiagnosisId == diagnosisId && m.SuggestionType == suggestionType);
if (suggestionList.Any())
{