删除废弃字段
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
32931e155c
commit
115017197b
|
@ -99,9 +99,6 @@ public class Subject : BaseFullDeleteAuditEntity
|
|||
public DateTime? BirthDate { get; set; }
|
||||
public DateTime? SignDate { get; set; }
|
||||
|
||||
public int StudyCount { get; set; } = 0;
|
||||
public string Modalities { get; set; } = string.Empty;
|
||||
|
||||
public DateTime? FirstGiveMedicineTime { get; set; }
|
||||
|
||||
public bool IsUrgent { get; set; }
|
||||
|
|
|
@ -26,15 +26,10 @@
|
|||
|
||||
var usings = new List<string>
|
||||
{
|
||||
"System",
|
||||
"System.Collections.Generic"
|
||||
};
|
||||
|
||||
if (Options.UseDataAnnotations)
|
||||
{
|
||||
usings.Add("System.ComponentModel.DataAnnotations");
|
||||
usings.Add("System.ComponentModel.DataAnnotations.Schema");
|
||||
usings.Add("Microsoft.EntityFrameworkCore");
|
||||
usings.Add("IRaCIS.Core.Domain.Models");
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Core.Test.GenerateContextModelFolder;
|
||||
|
||||
[Comment("后台 - 字典表(需要同步)")]
|
||||
[Table("Dictionary")]
|
||||
public partial class Dictionary: BaseFullAuditEntity
|
||||
{
|
||||
[StringLength(400)]
|
||||
public string ChildGroup { get; set; } = null!;
|
||||
|
||||
public string Code { get; set; } = null!;
|
||||
|
||||
public Guid? ConfigTypeId { get; set; }
|
||||
|
||||
[Comment(" 字典类型- 枚举|bool|下拉框")]
|
||||
public int DataTypeEnum { get; set; }
|
||||
|
||||
[StringLength(512)]
|
||||
public string Description { get; set; } = null!;
|
||||
|
||||
[Comment(" 是否字典类型配置")]
|
||||
public bool IsConfig { get; set; }
|
||||
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
public int ShowOrder { get; set; }
|
||||
|
||||
[StringLength(400)]
|
||||
public string Value { get; set; } = null!;
|
||||
|
||||
[StringLength(400)]
|
||||
public string ValueCN { get; set; } = null!;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace IRaCIS.Core.Test.GenerateContextModelFolder;
|
||||
|
||||
public partial class TempContext : DbContext
|
||||
{
|
||||
public TempContext()
|
||||
{
|
||||
}
|
||||
|
||||
public TempContext(DbContextOptions<TempContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<Dictionary> Dictionaries { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
=> optionsBuilder.UseSqlServer("Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true");
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.UseCollation("Chinese_PRC_CI_AS");
|
||||
|
||||
modelBuilder.Entity<Dictionary>(entity =>
|
||||
{
|
||||
entity.ToTable("Dictionary", tb => tb.HasComment("后台 - 字典表(需要同步)"));
|
||||
|
||||
entity.Property(e => e.Id).ValueGeneratedNever();
|
||||
entity.Property(e => e.ChildGroup).HasDefaultValue("");
|
||||
entity.Property(e => e.Code).HasDefaultValue("");
|
||||
entity.Property(e => e.DataTypeEnum).HasComment("字典类型- 枚举|bool|下拉框");
|
||||
entity.Property(e => e.IsConfig).HasComment("是否字典类型配置");
|
||||
entity.Property(e => e.IsEnable).HasDefaultValue(true);
|
||||
entity.Property(e => e.Value).HasDefaultValue("");
|
||||
entity.Property(e => e.ValueCN).HasDefaultValue("");
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
global using Microsoft.EntityFrameworkCore;
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.ComponentModel.DataAnnotations;
|
||||
global using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||
// 生成时间 2024-09-20 01:22:34Z
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using System.Threading.Tasks;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
[ ApiExplorerSettings(GroupName = "Test")]
|
||||
public class DictionaryService(IRepository<Dictionary> _dictionaryRepository): BaseService, IDictionaryService
|
||||
{
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<DictionaryView>> GetDictionaryList(DictionaryQuery inQuery)
|
||||
{
|
||||
|
||||
var dictionaryQueryable =_dictionaryRepository
|
||||
.ProjectTo<DictionaryView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList= await dictionaryQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateDictionary(DictionaryAddOrEdit addOrEditDictionary)
|
||||
{
|
||||
// 在此处拷贝automapper 映射
|
||||
|
||||
CreateMap<Dictionary, DictionaryView>();
|
||||
CreateMap<Dictionary,DictionaryAddOrEdit>().ReverseMap();
|
||||
|
||||
|
||||
var entity = await _dictionaryRepository.InsertOrUpdateAsync(addOrEditDictionary, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
[HttpDelete("{dictionaryId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteDictionary(Guid dictionaryId)
|
||||
{
|
||||
var success = await _<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository.DeleteFromQueryAsync(t => t.Id == dictionaryId,true);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||
// 生成时间 2024-09-20 01:22:37Z
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Application.ViewModel;
|
||||
|
||||
public class DictionaryView : DictionaryAddOrEdit
|
||||
{
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class DictionaryAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public string ChildGroup { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public Guid? ConfigTypeId { get; set; }
|
||||
|
||||
public DicDataTypeEnum DataTypeEnum { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public bool IsConfig { get; set; }
|
||||
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
public int ShowOrder { get; set; }
|
||||
|
||||
public string Value { get; set; }
|
||||
|
||||
public string ValueCN { get; set; }
|
||||
}
|
||||
|
||||
public class DictionaryQuery
|
||||
{
|
||||
public string? ChildGroup { get; set; }
|
||||
|
||||
public string? Code { get; set; }
|
||||
|
||||
public Guid? ConfigTypeId { get; set; }
|
||||
|
||||
public DicDataTypeEnum? DataTypeEnum { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public bool? IsConfig { get; set; }
|
||||
|
||||
public bool? IsEnable { get; set; }
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
public int? ShowOrder { get; set; }
|
||||
|
||||
public string? Value { get; set; }
|
||||
|
||||
public string? ValueCN { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||
// 生成时间 2024-09-20 01:22:37Z
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using System;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using System.Threading.Tasks;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
namespace IRaCIS.Core.Application.Interfaces;
|
||||
|
||||
public interface IDictionaryService
|
||||
{
|
||||
|
||||
Task<PageOutput<<DictionaryView>> GetDictionaryList(DictionaryQuery inQuery);
|
||||
|
||||
Task<IResponseOutput> AddOrUpdateDictionary(DictionaryAddOrEdit addOrEditDictionary);
|
||||
|
||||
Task<IResponseOutput> DeleteDictionaryView(Guid dictionaryId);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue