From 136414848aeba8f7f75c8b6003be7faf937cbc7f Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 12 Aug 2022 14:11:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/QC/QCQuestionService.cs | 2 +- .../Service/Reading/Dto/OrganInfoViewModel.cs | 55 ++++++++++++++++++ .../Reading/Interface/IOrganInfoService.cs | 25 ++++++++ .../Service/Reading/OrganInfoService.cs | 58 +++++++++++++++++++ .../Service/Reading/_MapConfig.cs | 6 +- IRaCIS.Core.Domain/Reading/OrganInfo.cs | 53 +++++++++++++++++ .../Context/IRaCISDBContext.cs | 2 +- IRaCIS.Core.Test/DbHelper.ttinclude | 2 +- 8 files changed, 199 insertions(+), 4 deletions(-) create mode 100644 IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs create mode 100644 IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs create mode 100644 IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs create mode 100644 IRaCIS.Core.Domain/Reading/OrganInfo.cs diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index c6c7aa57..0bf4945b 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -92,9 +92,9 @@ namespace IRaCIS.Core.Application.Contracts { var QCQuestionQueryable = _qcQuestionRepository + .Where(x=>x.IsEnable) .WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.QuestionName), t => t.QuestionName.Contains(queryQCQuestionConfigure.QuestionName)) .WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.Type), t => t.Type.Contains(queryQCQuestionConfigure.Type)) - .WhereIf(queryQCQuestionConfigure.IsEnable != null, t => t.IsEnable == queryQCQuestionConfigure.IsEnable) .ProjectTo(_mapper.ConfigurationProvider); return await QCQuestionQueryable.ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs new file mode 100644 index 00000000..b27ba76e --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs @@ -0,0 +1,55 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-08-12 14:07:12 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- +using System; +using IRaCIS.Core.Domain.Share; +using System.Collections.Generic; +namespace IRaCIS.Core.Application.ViewModel +{ + /// OrganInfoView 列表视图模型 + public class OrganInfoView + { + public Guid Id { get; set; } + public string Part { get; set; } + public string TULOC { get; set; } + public string TULAT { get; set; } + public string TypeName { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + } + + ///OrganInfoQuery 列表查询参数模型 + public class OrganInfoQuery + { + /// 部位 + public string Part { get; set; } + + /// TULOC + public string TULOC { get; set; } + + /// 位置 + public string TULAT { get; set; } + + /// 类型名称 + public string TypeName { get; set; } + + } + + /// OrganInfoAddOrEdit 列表查询参数模型 + public class OrganInfoAddOrEdit + { + public Guid? Id { get; set; } + public string Part { get; set; } + public string TULOC { get; set; } + public string TULAT { get; set; } + public string TypeName { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + } + + +} + + diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs new file mode 100644 index 00000000..25eadf67 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs @@ -0,0 +1,25 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-08-12 14:07:43 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Application.ViewModel; +namespace IRaCIS.Core.Application.Interfaces +{ + /// + /// IOrganInfoService + /// + public interface IOrganInfoService + { + + + Task> GetOrganInfoList(OrganInfoQuery inQuery); + + Task AddOrUpdateOrganInfo(OrganInfoAddOrEdit addOrEditOrganInfo); + + Task DeleteOrganInfo(Guid organInfoId); + + + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs new file mode 100644 index 00000000..54efab0d --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs @@ -0,0 +1,58 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-08-12 14:07:20 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Domain.Models; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.ViewModel; +namespace IRaCIS.Core.Application.Service +{ + /// + /// OrganInfoService + /// + [ ApiExplorerSettings(GroupName = "Test")] + public class OrganInfoService: BaseService, IOrganInfoService + { + + private readonly IRepository _organInfoRepository; + + public OrganInfoService(IRepository organInfoRepository) + { + _organInfoRepository = organInfoRepository; + } + + + public async Task> GetOrganInfoList(OrganInfoQuery inQuery) + { + + + var organInfoQueryable = _organInfoRepository + .ProjectTo(_mapper.ConfigurationProvider); + + return await organInfoQueryable.ToListAsync(); + } + + + public async Task AddOrUpdateOrganInfo(OrganInfoAddOrEdit addOrEditOrganInfo) + { + + var entity = await _organInfoRepository.InsertOrUpdateAsync(addOrEditOrganInfo, true); + + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + + [HttpDelete("{organInfoId:guid}")] + public async Task DeleteOrganInfo(Guid organInfoId) + { + var success = await _organInfoRepository.DeleteFromQueryAsync(t => t.Id == organInfoId,true); + return ResponseOutput.Ok(); + } + + + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 71d8c9ec..b12d3c17 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -119,10 +119,14 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(x => x.CreateUserName, y => y.MapFrom(n => n.CreateUser.UserName)); - + #endregion + #region 阅片部位 + CreateMap(); + CreateMap(); + #endregion } } diff --git a/IRaCIS.Core.Domain/Reading/OrganInfo.cs b/IRaCIS.Core.Domain/Reading/OrganInfo.cs new file mode 100644 index 00000000..a57f5eb6 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/OrganInfo.cs @@ -0,0 +1,53 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-08-12 13:58:25 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///OrganInfo + /// + [Table("OrganInfo")] + public class OrganInfo : Entity, IAuditAdd + { + + + /// + /// 部位 + /// + public string Part { get; set; } + + /// + /// TULOC + /// + public string TULOC { get; set; } + + /// + /// 位置 + /// + public string TULAT { get; set; } + + /// + /// 类型名称 + /// + public string TypeName { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + } + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 3eb7f2c5..1253f955 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -202,7 +202,7 @@ namespace IRaCIS.Core.Infra.EFCore #region Reading - + public virtual DbSet OrganInfo { get; set; } public virtual DbSet ReadingTableQuestionSystem { get; set; } public virtual DbSet ReadingPeriodSet { get; set; } diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 0196c847..e3236736 100644 --- a/IRaCIS.Core.Test/DbHelper.ttinclude +++ b/IRaCIS.Core.Test/DbHelper.ttinclude @@ -4,7 +4,7 @@ public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"; public static readonly string DbDatabase = "IRaCIS_New_Tet"; //ַ,ƴ - public static readonly string TableName = "ReadingTableQuestionSystem"; + public static readonly string TableName = "OrganInfo"; //ļ service Ƿҳ } #>