稽查文档
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
2bbc101f95
commit
a03d7f55c7
|
@ -1383,6 +1383,53 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.GetAuditDocumentList(IRaCIS.Core.Application.ViewModel.AuditDocumentQuery)">
|
||||
<summary>
|
||||
获取稽查文档
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.AddOrUpdateAuditDocument(IRaCIS.Core.Application.ViewModel.AuditDocumentAddOrEdit)">
|
||||
<summary>
|
||||
新增或者修改稽查文档
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.GetAuditDocumentData(IRaCIS.Core.Application.ViewModel.GetAuditDocumentDataInDto)">
|
||||
<summary>
|
||||
获取文件树形结构 (传Id 根节点就是自己)
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.DeleteAuditDocument(IRaCIS.Core.Application.ViewModel.DeleteAuditDocumentInDto)">
|
||||
<summary>
|
||||
删除稽查文档
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.MovieFileOrFolder(IRaCIS.Core.Application.ViewModel.MovieFileOrFolderInDto)">
|
||||
<summary>
|
||||
移动文件或者文件夹 到其他文件夹
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.GetHistoricalVersion(IRaCIS.Core.Application.ViewModel.GetHistoricalVersionInDto)">
|
||||
<summary>
|
||||
获取历史版本
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AuditDocumentService.SetCurrentVersion(IRaCIS.Core.Application.ViewModel.SetCurrentVersionInDto)">
|
||||
<summary>
|
||||
把历史版本设置为当前版本
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.SysFileTypeService">
|
||||
<summary>
|
||||
系统文件类型
|
||||
|
|
|
@ -0,0 +1,298 @@
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||
// 生成时间 2025-03-27 06:13:33Z
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
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;
|
||||
using AutoMapper.Execution;
|
||||
using System.Linq;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
|
||||
[ ApiExplorerSettings(GroupName = "Test")]
|
||||
public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepository,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取稽查文档
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<AuditDocumentView>> GetAuditDocumentList(AuditDocumentQuery inQuery)
|
||||
{
|
||||
var auditDocumentQueryable =_auditDocumentRepository
|
||||
.ProjectTo<AuditDocumentView>(_mapper.ConfigurationProvider);
|
||||
var pageList= await auditDocumentQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增或者修改稽查文档
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateAuditDocument(AuditDocumentAddOrEdit inDto)
|
||||
{
|
||||
if (inDto.ParentId != null)
|
||||
{
|
||||
var alikeData = await _auditDocumentRepository.Where(x => x.ParentId == inDto.ParentId&&x.Name==inDto.Name&&x.AuditDocumentTypeEnum==inDto.AuditDocumentTypeEnum).FirstOrDefaultAsync();
|
||||
if (alikeData != null)
|
||||
{
|
||||
if (inDto.AuditDocumentTypeEnum == AuditDocumentType.Folder)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotAddFolder"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entityData = await _auditDocumentRepository.InsertOrUpdateAsync(inDto, true);
|
||||
|
||||
var historicalVersionIds = await _auditDocumentRepository.Where(x => x.MainFileId == alikeData.Id).OrderBy(x => x.Version).Select(x => x.Id).ToListAsync();
|
||||
|
||||
historicalVersionIds.Add(alikeData.Id);
|
||||
|
||||
int num = 1;
|
||||
foreach (var item in historicalVersionIds)
|
||||
{
|
||||
await _auditDocumentRepository.UpdatePartialFromQueryAsync(item, x => new AuditDocument()
|
||||
{
|
||||
MainFileId = entityData.Id,
|
||||
ParentId = null,
|
||||
Version = num,
|
||||
AuditDocumentTypeEnum = AuditDocumentType.HistoricalVersion
|
||||
});
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(entityData.Id.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var entity = await _auditDocumentRepository.InsertOrUpdateAsync(inDto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// 删除稽查文档
|
||||
// /// </summary>
|
||||
// /// <param name="auditDocumentId"></param>
|
||||
// /// <returns></returns>
|
||||
// [HttpDelete("{auditDocumentId:guid}")]
|
||||
// public async Task<IResponseOutput> DeleteAuditDocument(Guid auditDocumentId)
|
||||
//{
|
||||
// var success = await _auditDocumentRepository.DeleteFromQueryAsync(t => t.Id == auditDocumentId,true);
|
||||
// return ResponseOutput.Ok();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件树形结构 (传Id 根节点就是自己)
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<GetAuditDocumentDataOutDto> GetAuditDocumentData(GetAuditDocumentDataInDto inDto)
|
||||
{
|
||||
var data= await _auditDocumentRepository
|
||||
.Where(x=>x.AuditDocumentTypeEnum!=AuditDocumentType.HistoricalVersion)
|
||||
.WhereIf(inDto.IsAuthorization!=null,x=>x.IsAuthorization==inDto.IsAuthorization).ProjectTo<AuditDocumentData>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var root= data
|
||||
.WhereIf(inDto.Id!= null, x => x.Id == inDto.Id)
|
||||
.WhereIf(inDto.Id==null,x=>x.ParentId==null).ToList();
|
||||
|
||||
foreach (var item in root)
|
||||
{
|
||||
GetChildren(item, data);
|
||||
|
||||
}
|
||||
|
||||
return new GetAuditDocumentDataOutDto()
|
||||
{
|
||||
Data = root
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private void GetChildren(AuditDocumentData item, List<AuditDocumentData> dataList)
|
||||
{
|
||||
item.Children = dataList.Where(x => x.ParentId == item.Id).ToList();
|
||||
foreach (var x in item.Children)
|
||||
{
|
||||
GetChildren(x, dataList);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除稽查文档
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> DeleteAuditDocument(DeleteAuditDocumentInDto inDto)
|
||||
{
|
||||
var data = await _auditDocumentRepository.Select(x => new DeleteAudit (){
|
||||
Id=x.Id,
|
||||
ParentId= x.ParentId,
|
||||
MainFileId= x.MainFileId
|
||||
}).ToListAsync();
|
||||
|
||||
List<Guid> DeleteId= inDto.Ids;
|
||||
|
||||
finId(inDto.Ids, data);
|
||||
|
||||
void finId(List<Guid> deletids, List<DeleteAudit> deletes)
|
||||
{
|
||||
DeleteId.AddRange(deletids);
|
||||
|
||||
var temp = deletes.Where(x => deletids.Contains(x.ParentId.Value)|| deletids.Contains(x.MainFileId.Value)).Select(x => x.Id).ToList();
|
||||
if (temp.Count() > 0)
|
||||
{
|
||||
finId(temp, deletes);
|
||||
}
|
||||
}
|
||||
|
||||
var success = await _auditDocumentRepository.DeleteFromQueryAsync(t => DeleteId.Contains(t.Id), true);
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移动文件或者文件夹 到其他文件夹
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> MovieFileOrFolder(MovieFileOrFolderInDto inDto)
|
||||
{
|
||||
var file = await _auditDocumentRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync();
|
||||
if (file.AuditDocumentTypeEnum == AuditDocumentType.Folder)
|
||||
{
|
||||
var data = await _auditDocumentRepository.Select(x => new DeleteAudit()
|
||||
{
|
||||
Id = x.Id,
|
||||
ParentId = x.ParentId,
|
||||
MainFileId = x.MainFileId
|
||||
}).ToListAsync();
|
||||
if (finChild(new List<Guid> { inDto.Id }, inDto.ParentId, data))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotMove"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool finChild(List<Guid> ids, Guid ChildId,List<DeleteAudit> data)
|
||||
{
|
||||
var child = data.Where(x =>x.ParentId!=null&& ids.Contains(x.ParentId.Value)).ToList();
|
||||
if (child.Count() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (child.Any(x => x.Id == ChildId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var newids = child.Select(x => x.Id).ToList();
|
||||
|
||||
return finChild(newids, ChildId, data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
await _auditDocumentRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new AuditDocument()
|
||||
{
|
||||
ParentId = inDto.ParentId
|
||||
});
|
||||
|
||||
await _auditDocumentRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取历史版本
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<GetHistoricalVersionOutDto> GetHistoricalVersion(GetHistoricalVersionInDto inDto)
|
||||
{
|
||||
return new GetHistoricalVersionOutDto()
|
||||
{
|
||||
|
||||
CurrentData = await _auditDocumentRepository.Where(x => x.Id == inDto.Id).ProjectTo<AuditDocumentData>(_mapper.ConfigurationProvider).FirstNotNullAsync(),
|
||||
HistoricalVersionList = await _auditDocumentRepository.Where(x => x.MainFileId == inDto.Id).ProjectTo<AuditDocumentData>(_mapper.ConfigurationProvider).OrderByDescending(x => x.Version).ToListAsync()
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把历史版本设置为当前版本
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetCurrentVersion(SetCurrentVersionInDto inDto)
|
||||
{
|
||||
var file = await _auditDocumentRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync();
|
||||
if (file.AuditDocumentTypeEnum != AuditDocumentType.HistoricalVersion)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotSetCurrentVersion"]);
|
||||
}
|
||||
|
||||
var mainFile = await _auditDocumentRepository.Where(x => x.Id == file.MainFileId).FirstNotNullAsync();
|
||||
|
||||
var historicalVersionIds= await _auditDocumentRepository.Where(x => x.MainFileId == mainFile.Id&&x.Id!=inDto.Id).OrderBy(x=>x.Version).Select(x=>x.Id).ToListAsync();
|
||||
|
||||
historicalVersionIds.Add(mainFile.Id);
|
||||
await _auditDocumentRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new AuditDocument() {
|
||||
MainFileId=null,
|
||||
ParentId= mainFile.ParentId,
|
||||
AuditDocumentTypeEnum=AuditDocumentType.File,
|
||||
});
|
||||
|
||||
int num = 1;
|
||||
foreach (var item in historicalVersionIds)
|
||||
{
|
||||
await _auditDocumentRepository.UpdatePartialFromQueryAsync(item, x => new AuditDocument()
|
||||
{
|
||||
MainFileId = inDto.Id,
|
||||
ParentId = null,
|
||||
Version=num,
|
||||
AuditDocumentTypeEnum= AuditDocumentType.HistoricalVersion
|
||||
});
|
||||
}
|
||||
|
||||
await _auditDocumentRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 设置是否授权
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//[ht]
|
||||
// public async Task<IResponseOutput> SetIsAuthorization(SetIsAuthorizationInDto inDto)
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||
// 生成时间 2025-03-27 06:13:37Z
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Application.ViewModel;
|
||||
|
||||
public class DeleteAudit
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
public Guid? MainFileId { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteAuditDocumentInDto
|
||||
{
|
||||
public List<Guid> Ids { get; set; }
|
||||
}
|
||||
|
||||
public class GetAuditDocumentDataInDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public bool? IsAuthorization { get; set; }
|
||||
}
|
||||
|
||||
public class GetAuditDocumentDataOutDto
|
||||
{
|
||||
public List<AuditDocumentData> Data { get; set; } = new List<AuditDocumentData> { };
|
||||
}
|
||||
|
||||
public class AuditDocumentData : AuditDocumentView
|
||||
{
|
||||
public int? Version { get; set; }
|
||||
public List<AuditDocumentData> Children { get; set; }=new List<AuditDocumentData> (){ };
|
||||
|
||||
}
|
||||
|
||||
public class AuditDocumentView : AuditDocumentAddOrEdit
|
||||
{
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SetIsAuthorizationInDto
|
||||
{
|
||||
public List<Guid> Ids { get; set; }
|
||||
|
||||
public bool IsAuthorization { get; set; }
|
||||
}
|
||||
|
||||
public class SetCurrentVersionInDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
|
||||
public class GetHistoricalVersionInDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
|
||||
public class GetHistoricalVersionOutDto
|
||||
{
|
||||
public AuditDocumentData CurrentData { get; set; }
|
||||
public List<AuditDocumentData> HistoricalVersionList { get; set; } = new List<AuditDocumentData> { };
|
||||
}
|
||||
|
||||
public class MovieFileOrFolderInDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid ParentId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class AuditDocumentAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public AuditDocumentType AuditDocumentTypeEnum { get; set; }
|
||||
|
||||
public string FileFormat { get; set; }
|
||||
|
||||
public string FilePath { get; set; }
|
||||
|
||||
public decimal? FileSize { get; set; }
|
||||
|
||||
public bool IsAuthorization { get; set; }
|
||||
|
||||
// public Guid? MainFileId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
//public int? Version { get; set; }
|
||||
}
|
||||
|
||||
public class AuditDocumentQuery:PageInput
|
||||
{
|
||||
public AuditDocumentType? AuditDocumentEnum { get; set; }
|
||||
|
||||
public string? FileFormat { get; set; }
|
||||
|
||||
public string? FilePath { get; set; }
|
||||
|
||||
public decimal? FileSize { get; set; }
|
||||
|
||||
public bool? IsAuthorization { get; set; }
|
||||
|
||||
public Guid? MainFileId { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -14,7 +14,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var userId = Guid.Empty;
|
||||
var isEn_Us = false;
|
||||
|
||||
CreateMap<AuditDocument, AuditDocumentView>();
|
||||
CreateMap<AuditDocument, AuditDocumentData>();
|
||||
CreateMap<AuditDocument, AuditDocumentAddOrEdit>().ReverseMap();
|
||||
CreateMap<SystemDocument, SystemDocumentView>()
|
||||
.ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
[Comment("稽查文档管理")]
|
||||
[Table("AuditDocument")]
|
||||
public class AuditDocument : BaseFullAuditEntity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 文件夹名或者文件名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文档类型
|
||||
/// </summary>
|
||||
public AuditDocumentType AuditDocumentTypeEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父文件夹Id
|
||||
/// </summary>
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件路径
|
||||
/// </summary>
|
||||
[StringLength(1000)]
|
||||
public string FilePath { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小
|
||||
/// </summary>
|
||||
public decimal? FileSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
/// </summary>
|
||||
public string FileFormat { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 版本
|
||||
/// </summary>
|
||||
public int? Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主文件Id
|
||||
/// </summary>
|
||||
public Guid? MainFileId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否授权
|
||||
/// </summary>
|
||||
public bool IsAuthorization { get; set; } = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 稽查文档类型
|
||||
/// </summary>
|
||||
public enum AuditDocumentType
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件夹
|
||||
/// </summary>
|
||||
Folder = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 文件
|
||||
/// </summary>
|
||||
File = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 历史版本
|
||||
/// </summary>
|
||||
HistoricalVersion = 2,
|
||||
|
||||
}
|
||||
}
|
|
@ -648,6 +648,8 @@ public class IRaCISDBContext : DbContext
|
|||
|
||||
#region 报告、 文档、记录
|
||||
|
||||
public virtual DbSet<AuditDocument> AuditDocument { get; set; }
|
||||
|
||||
public virtual DbSet<SysFileType> SysFileType { get; set; }
|
||||
public virtual DbSet<TrialFileType> TrialFileType { get; set; }
|
||||
public virtual DbSet<TrialFinalRecord> TrialFinalRecord { get; set; }
|
||||
|
|
19234
IRaCIS.Core.Infra.EFCore/Migrations/20250327060052_AuditDocument.Designer.cs
generated
Normal file
19234
IRaCIS.Core.Infra.EFCore/Migrations/20250327060052_AuditDocument.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AuditDocument : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuditDocument",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
AuditDocumentEnum = table.Column<int>(type: "int", nullable: false),
|
||||
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
FilePath = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
|
||||
FileSize = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
|
||||
FileFormat = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
Version = table.Column<int>(type: "int", nullable: true),
|
||||
MainFileId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsAuthorization = table.Column<bool>(type: "bit", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AuditDocument", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AuditDocument_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "稽查文档管理");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AuditDocument_CreateUserId",
|
||||
table: "AuditDocument",
|
||||
column: "CreateUserId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuditDocument");
|
||||
}
|
||||
}
|
||||
}
|
19234
IRaCIS.Core.Infra.EFCore/Migrations/20250327074301_AuditDocumenttype.Designer.cs
generated
Normal file
19234
IRaCIS.Core.Infra.EFCore/Migrations/20250327074301_AuditDocumenttype.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,28 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AuditDocumenttype : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AuditDocumentEnum",
|
||||
table: "AuditDocument",
|
||||
newName: "AuditDocumentTypeEnum");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AuditDocumentTypeEnum",
|
||||
table: "AuditDocument",
|
||||
newName: "AuditDocumentEnum");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -94,6 +94,67 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocument", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("AuditDocumentTypeEnum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("FileFormat")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<string>("FilePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("nvarchar(1000)");
|
||||
|
||||
b.Property<decimal?>("FileSize")
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<bool>("IsAuthorization")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("MainFileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int?>("Version")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.ToTable("AuditDocument", t =>
|
||||
{
|
||||
t.HasComment("稽查文档管理");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CRO", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
@ -14547,6 +14608,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("Doctor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocument", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CRO", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
|
|
Loading…
Reference in New Issue