From d09dae83784e5c5259b2e0439d7640f98f77cdf0 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 8 May 2023 15:33:45 +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 --- .../IRaCIS.Core.Application.xml | 38 ++++++++++ .../Reading/Dto/UserWLTemplateViewModel.cs | 50 +++++++++++++ .../ShortcutKey/UserWLTemplateService.cs | 66 +++++++++++++++++ .../Service/Reading/_MapConfig.cs | 6 +- .../Reading/ShortcutKey/UserWLTemplate.cs | 73 +++++++++++++++++++ .../Context/IRaCISDBContext.cs | 4 +- IRaCIS.Core.Test/DbHelper.ttinclude | 2 +- 7 files changed, 236 insertions(+), 3 deletions(-) create mode 100644 IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs create mode 100644 IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs create mode 100644 IRaCIS.Core.Domain/Reading/ShortcutKey/UserWLTemplate.cs diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index bc9329515..cead395d6 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -6921,6 +6921,32 @@ + + + 用户WL模板 + + + + + 获取模板 + + + + + + + 新增修改模板 + + + + + + + 删除模板 + + + + 项目外部人员 录入流程相关 @@ -8019,6 +8045,18 @@ 任务类型 + + UserWLTemplateView 列表视图模型 + + + UserWLTemplateQuery 列表查询参数模型 + + + TemplateName + + + UserWLTemplateAddOrEdit 列表查询参数模型 + TrialExternalUserView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs new file mode 100644 index 000000000..d90957e6d --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs @@ -0,0 +1,50 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-05-08 15:20:44 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- +using System; +using IRaCIS.Core.Domain.Share; +using System.Collections.Generic; +namespace IRaCIS.Core.Application.ViewModel +{ + /// UserWLTemplateView 列表视图模型 + public class UserWLTemplateView + { + public Guid Id { get; set; } + public string TemplateName { get; set; } + public Guid UserId { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public int WW { get; set; } + public int WL { get; set; } + public int ShowOrder { get; set; } = 0; + public bool IsPitchOn { get; set; } + } + + ///UserWLTemplateQuery 列表查询参数模型 + public class UserWLTemplateQuery + { + /// TemplateName + public string TemplateName { get; set; } + + } + + /// UserWLTemplateAddOrEdit 列表查询参数模型 + public class UserWLTemplateAddOrEdit + { + public Guid? Id { get; set; } + public string TemplateName { get; set; } + public Guid UserId { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public int WW { get; set; } + public int WL { get; set; } + //public int ShowOrder { get; set; } + //public bool IsPitchOn { get; set; } + } + + +} + + diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs new file mode 100644 index 000000000..bec717886 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs @@ -0,0 +1,66 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-05-08 15:26:52 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Domain.Models; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.ViewModel; +namespace IRaCIS.Core.Application.Service +{ + /// + /// 用户WL模板 + /// + [ApiExplorerSettings(GroupName = "Reading")] + public class UserWLTemplateService : BaseService + { + + private readonly IRepository _userWLTemplateRepository; + + public UserWLTemplateService(IRepository userWLTemplateRepository) + { + _userWLTemplateRepository = userWLTemplateRepository; + } + + /// + /// 获取模板 + /// + /// + /// + public async Task> GetUserWLTemplateList(UserWLTemplateQuery inQuery) + { + var userWLTemplateQueryable = _userWLTemplateRepository + .Where(x=>x.UserId==_userInfo.Id) + .ProjectTo(_mapper.ConfigurationProvider); + return await userWLTemplateQueryable.ToListAsync(); + } + + /// + /// 新增修改模板 + /// + /// + /// + public async Task AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate) + { + addOrEditUserWLTemplate.UserId = _userInfo.Id; + var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); + return ResponseOutput.Ok(entity.Id.ToString()); + } + + /// + /// 删除模板 + /// + /// + /// + [HttpDelete("{userWLTemplateId:guid}")] + public async Task DeleteUserWLTemplate(Guid userWLTemplateId) + { + var success = await _userWLTemplateRepository.DeleteFromQueryAsync(t => t.Id == userWLTemplateId, true); + return ResponseOutput.Ok(); + } + + + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 9d481d5a7..6596968c2 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -20,7 +20,11 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap(); - CreateMap(); + + CreateMap(); + CreateMap().ReverseMap(); + + CreateMap(); CreateMap(); diff --git a/IRaCIS.Core.Domain/Reading/ShortcutKey/UserWLTemplate.cs b/IRaCIS.Core.Domain/Reading/ShortcutKey/UserWLTemplate.cs new file mode 100644 index 000000000..d867b4524 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ShortcutKey/UserWLTemplate.cs @@ -0,0 +1,73 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-05-08 15:14:38 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///UserWLTemplate + /// + [Table("UserWLTemplate")] + public class UserWLTemplate : Entity, IAuditAdd + { + + /// + /// Id + /// + [Key] + [Required] + public Guid Id { get; set; } + + /// + /// TemplateName + /// + [Required] + public string TemplateName { get; set; } + + /// + /// UserId + /// + [Required] + public Guid UserId { get; set; } + + /// + /// CreateTime + /// + [Required] + public DateTime CreateTime { get; set; } + + /// + /// CreateUserId + /// + [Required] + public Guid CreateUserId { get; set; } + + /// + /// WW + /// + public int WW { get; set; } + + /// + /// WL + /// + public int WL { get; set; } + + /// + /// ShowOrder + /// + public int ShowOrder { get; set; } = 0; + + /// + /// 是否为默认 + /// + public bool IsPitchOn { get; set; } = true; + + } + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index e9e34e6af..089e70cbb 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -451,7 +451,9 @@ namespace IRaCIS.Core.Infra.EFCore #endregion public virtual DbSet ShortcutKey { get; set; } - public virtual DbSet EmailNoticeConfig { get; set; } + + public virtual DbSet UserWLTemplate { get; set; } + public virtual DbSet EmailNoticeConfig { get; set; } public virtual DbSet SystemBasicData { get; set; } public virtual DbSet TrialSign { get; set; } diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 793d43cb7..798e5963d 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 = "ReadingTrialCriterionDictionary"; + public static readonly string TableName = "UserWLTemplate"; //ļ service Ƿҳ } #>