添加12
parent
35a9fe2878
commit
29fe343519
|
@ -44,6 +44,25 @@
|
|||
FrontAuditConfigService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetDatabaseTables">
|
||||
<summary>
|
||||
获取数据库所有表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetTableColumn(System.String)">
|
||||
<summary>
|
||||
获取表列名
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.BatchAddFrontAudit(IRaCIS.Core.Application.ViewModel.BatchAddFrontAudit)">
|
||||
<summary>
|
||||
批量添加字段
|
||||
</summary>
|
||||
<param name="data">数据集</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetInspectionEnumValue(IRaCIS.Core.Infra.EFCore.Dto.SetInspectionEnumValueDto)">
|
||||
<summary>
|
||||
翻译稽查数据
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
using IRaCIS.Core.Infra.EFCore.Dto;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
/// <summary> FrontAuditConfigView 列表视图模型 </summary>
|
||||
|
@ -30,6 +33,14 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
}
|
||||
|
||||
public class BatchAddFrontAudit
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid ParentId { get; set; }
|
||||
|
||||
public List<TableList> Columns { get; set; }
|
||||
}
|
||||
|
||||
public class GetChildrenItem
|
||||
{
|
||||
|
||||
|
|
|
@ -27,6 +27,54 @@ namespace IRaCIS.Core.Application.Service
|
|||
_frontAuditConfigRepository = frontAuditConfigRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据库所有表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<TableList>> GetDatabaseTables()
|
||||
{
|
||||
return await _frontAuditConfigRepository._dbContext.GetTableList().ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取表列名
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<TableList>> GetTableColumn(string tableName)
|
||||
{
|
||||
return await _frontAuditConfigRepository._dbContext.GetTableColumn(tableName).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加字段
|
||||
/// </summary>
|
||||
/// <param name="data">数据集</param>
|
||||
/// <returns></returns>
|
||||
public async Task BatchAddFrontAudit(BatchAddFrontAudit data)
|
||||
{
|
||||
var maxsort = await _frontAuditConfigRepository.Where(x => x.ParentId == data.ParentId).MaxAsync(x => x.Sort);
|
||||
|
||||
List<FrontAuditConfig> fronts=new List<FrontAuditConfig>();
|
||||
foreach (var item in data.Columns)
|
||||
{
|
||||
maxsort++;
|
||||
fronts.Add(new FrontAuditConfig()
|
||||
{
|
||||
|
||||
Sort = maxsort,
|
||||
Code = item.Name,
|
||||
ValueCN = item.Remake,
|
||||
IsEnable = true,
|
||||
ParentId = data.ParentId
|
||||
});
|
||||
}
|
||||
|
||||
await _frontAuditConfigRepository.AddRangeAsync(fronts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 翻译稽查数据
|
||||
/// </summary>
|
||||
|
|
|
@ -336,7 +336,7 @@ namespace IRaCIS.Application.Services
|
|||
x.Id,
|
||||
x.IsEnrollment,
|
||||
x.IsUrgent,
|
||||
|
||||
|
||||
});
|
||||
|
||||
List<SubjectVisit> subjectVisits = new List<SubjectVisit>();
|
||||
|
@ -367,7 +367,6 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
BlindName = x.BlindName,
|
||||
IsBaseLine = x.IsBaseLine,
|
||||
|
||||
IsUrgent = false,
|
||||
};
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.ValueGeneration;
|
||||
using UserTypeGroup = IRaCIS.Core.Domain.Models.UserTypeGroup;
|
||||
using IRaCIS.Core.Infra.EFCore.Dto;
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore
|
||||
{
|
||||
|
@ -71,6 +72,15 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<TableList>(builder =>
|
||||
{
|
||||
builder.HasBaseType((Type)null);
|
||||
builder.ToView(null);
|
||||
builder.HasNoKey();
|
||||
});
|
||||
|
||||
//modelBuilder.HasDbFunction(typeof(DbContext).GetMethod(nameof(GetTableList)));
|
||||
|
||||
|
||||
if (_userInfo.IsEn_Us)
|
||||
{
|
||||
|
@ -112,6 +122,18 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
}
|
||||
|
||||
#region
|
||||
public IQueryable<TableList> GetTableList()
|
||||
{
|
||||
return Set<TableList>().FromSqlRaw("EXEC dbo.procGetTableList");
|
||||
}
|
||||
|
||||
public IQueryable<TableList> GetTableColumn(string tableName)
|
||||
{
|
||||
return Set<TableList>().FromSqlRaw($"EXEC dbo.procGetTableColumn {tableName}");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Doctor
|
||||
public virtual DbSet<Dictionary> Dictionary { get; set; }
|
||||
public virtual DbSet<Doctor> Doctor { get; set; }
|
||||
|
@ -128,7 +150,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
public virtual DbSet<TrialExperienceCriteria> TrialExperienceCriteria { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -25,6 +25,13 @@ namespace IRaCIS.Core.Infra.EFCore.Dto
|
|||
}
|
||||
|
||||
|
||||
public class TableList
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Remake { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
{
|
||||
public interface IRepository<TEntity> : ICommandRepository<TEntity>, IQueryRepository<TEntity> where TEntity : Entity
|
||||
{
|
||||
IRaCISDBContext _dbContext { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取中心啥的名称
|
||||
/// </summary>
|
||||
|
|
|
@ -201,7 +201,6 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
@ -794,6 +793,9 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
Identification = "Init|Trial|Status|Trial Setting-Infomation", // 初始化项目
|
||||
JsonDetail = entity.ToJcJson()
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 受试者
|
||||
|
@ -811,6 +813,8 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
Identification = "Init|Subject|Status|Subject", // 初始化受试者信息
|
||||
JsonDetail = entity.ToJcJson()
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Dicom序列 // 移动不进来
|
||||
|
|
Loading…
Reference in New Issue