Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
a3c575857a
|
@ -16992,11 +16992,32 @@
|
|||
SystemDocumentService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocumentAttachment},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
SystemDocumentService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.GetSystemDocumentAttachmentList(IRaCIS.Core.Application.Contracts.SystemDocumentAttachmentQuery)">
|
||||
<summary>
|
||||
获取系统文档附件
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.AddOrUpdateSystemDocumentAttachment(IRaCIS.Core.Application.Contracts.SystemDocumentAttachmentAddOrEdit)">
|
||||
<summary>
|
||||
新增或编辑系统文档附件
|
||||
</summary>
|
||||
<param name="addOrEditSystemDocumentAttachment"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.DeleteSystemDocumentAttachment(System.Guid)">
|
||||
<summary>
|
||||
删除系统文档附件
|
||||
</summary>
|
||||
<param name="systemDocumentAttachmentId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.GetSystemDocumentListAsync(IRaCIS.Core.Application.Contracts.SystemDocumentQuery)">
|
||||
<summary>
|
||||
管理端列表
|
||||
|
|
|
@ -50,6 +50,8 @@ public class SysFileTypeQuery : PageInput
|
|||
{
|
||||
public ArchiveType? ArchiveTypeEnum { get; set; }
|
||||
|
||||
public SysTemplateType? SysTemplateTypeEnum { get; set; }
|
||||
|
||||
public bool? IsConfirmRecord { get; set; }
|
||||
|
||||
public bool? IsEnable { get; set; }
|
||||
|
|
|
@ -8,6 +8,49 @@ using System.ComponentModel.DataAnnotations;
|
|||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public class SystemDocumentAttachmentView : SystemDocumentAttachmentAddOrEdit
|
||||
{
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class SystemDocumentAttachmentAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public string FileFormat { get; set; }
|
||||
|
||||
public string FileName { get; set; }
|
||||
|
||||
public string FilePath { get; set; }
|
||||
|
||||
public decimal? FileSize { get; set; }
|
||||
|
||||
public bool OffLine { get; set; }
|
||||
|
||||
public Guid SystemDocumentId { get; set; }
|
||||
}
|
||||
|
||||
public class SystemDocumentAttachmentQuery : PageInput
|
||||
{
|
||||
public string? FileFormat { get; set; }
|
||||
|
||||
public string? FileName { get; set; }
|
||||
|
||||
public string? FilePath { get; set; }
|
||||
|
||||
public decimal? FileSize { get; set; }
|
||||
|
||||
public bool? OffLine { get; set; }
|
||||
|
||||
public Guid? SystemDocumentId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary> SystemDocumentView 列表视图模型 </summary>
|
||||
public class SystemDocumentView : SystemDocumentAddOrEdit
|
||||
{
|
||||
|
@ -17,6 +60,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public string FileType { get; set; } = string.Empty;
|
||||
|
||||
public int AttachmentCount { get; set; }
|
||||
|
||||
public List<NeedConfirmedUserTypeView> NeedConfirmedUserTypeList { get; set; } = new List<NeedConfirmedUserTypeView>();
|
||||
}
|
||||
|
||||
|
@ -46,6 +91,9 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public class UnionDocumentWithConfirmInfoView : UnionDocumentView
|
||||
{
|
||||
|
||||
public DateTime UserCreateTime { get; set; }
|
||||
|
||||
|
||||
|
||||
public DateTime? ConfirmTime { get; set; }
|
||||
|
||||
|
@ -58,6 +106,24 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string RealName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public int AttachmentCount { get; set; }
|
||||
|
||||
public DateTime? SuggestFinishTime { get {
|
||||
|
||||
if (this.CreateTime > this.UserCreateTime && this.CurrentStaffTrainDays != null)
|
||||
{
|
||||
return this.CreateTime.AddDays(this.CurrentStaffTrainDays.Value);
|
||||
}
|
||||
|
||||
if (this.CreateTime < this.UserCreateTime && this.NewStaffTrainDays != null)
|
||||
{
|
||||
return this.UserCreateTime.AddDays(this.NewStaffTrainDays.Value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
} }
|
||||
|
||||
public string DocTypeCode { get; set; }
|
||||
|
||||
public List<string> UserConfirmedUserTypeList => (DocNeedSignUserTypeList != null && IdentityUserTypeList != null) ? IdentityUserTypeList.Intersect(DocNeedSignUserTypeList).ToList() : new List<string>();
|
||||
|
|
|
@ -27,6 +27,13 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery querySystemDocument);
|
||||
|
||||
|
||||
Task<PageOutput<SystemDocumentAttachmentView>> GetSystemDocumentAttachmentList(SystemDocumentAttachmentQuery inQuery);
|
||||
|
||||
Task<IResponseOutput> AddOrUpdateSystemDocumentAttachment(SystemDocumentAttachmentAddOrEdit addOrEditSystemDocumentAttachment);
|
||||
|
||||
Task<IResponseOutput> DeleteSystemDocumentAttachment(Guid systemDocumentAttachmentId);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ public class SysFileTypeService(IRepository<SysFileType> _sysFileTypeRepository,
|
|||
|
||||
var sysFileTypeQueryable = _sysFileTypeRepository
|
||||
.WhereIf(inQuery.ArchiveTypeEnum != null, t => t.ArchiveTypeEnum == inQuery.ArchiveTypeEnum)
|
||||
.WhereIf(inQuery.SysTemplateTypeEnum != null, t => t.SysTemplateTypeEnum == inQuery.SysTemplateTypeEnum)
|
||||
.WhereIf(inQuery.IsConfirmRecord != null, t => t.IsConfirmRecord == inQuery.IsConfirmRecord)
|
||||
.WhereIf(inQuery.SubIdentificationEnum != null, t => t.SubIdentificationEnum == inQuery.SubIdentificationEnum)
|
||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||
|
|
|
@ -16,12 +16,59 @@ namespace IRaCIS.Core.Application.Services
|
|||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class SystemDocumentService(IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<UserRole> _userRoleRepository,
|
||||
IRepository<SystemDocumentAttachment> _systemDocumentAttachmentRepository,
|
||||
IRepository<IdentityUser> _identityUserRepository,
|
||||
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统文档附件
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SystemDocumentAttachmentView>> GetSystemDocumentAttachmentList(SystemDocumentAttachmentQuery inQuery)
|
||||
{
|
||||
|
||||
var systemDocumentAttachmentQueryable = _systemDocumentAttachmentRepository
|
||||
.WhereIf(inQuery.SystemDocumentId != null, t => t.SystemDocumentId == inQuery.SystemDocumentId)
|
||||
.WhereIf(inQuery.FileName != null, t => t.FileName == inQuery.FileName)
|
||||
.WhereIf(inQuery.FileFormat != null, t => t.FileFormat == inQuery.FileFormat)
|
||||
.ProjectTo<SystemDocumentAttachmentView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await systemDocumentAttachmentQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增或编辑系统文档附件
|
||||
/// </summary>
|
||||
/// <param name="addOrEditSystemDocumentAttachment"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> AddOrUpdateSystemDocumentAttachment(SystemDocumentAttachmentAddOrEdit addOrEditSystemDocumentAttachment)
|
||||
{
|
||||
|
||||
|
||||
|
||||
var entity = await _systemDocumentAttachmentRepository.InsertOrUpdateAsync(addOrEditSystemDocumentAttachment, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除系统文档附件
|
||||
/// </summary>
|
||||
/// <param name="systemDocumentAttachmentId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{systemDocumentAttachmentId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteSystemDocumentAttachment(Guid systemDocumentAttachmentId)
|
||||
{
|
||||
var success = await _systemDocumentAttachmentRepository.DeleteFromQueryAsync(t => t.Id == systemDocumentAttachmentId, true);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -164,9 +211,12 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
AttachmentCount=sysDoc.SystemDocumentAttachmentList.Count(),
|
||||
IsSystemDoc = true,
|
||||
|
||||
CurrentStaffTrainDays=sysDoc.CurrentStaffTrainDays,
|
||||
NewStaffTrainDays = sysDoc.NewStaffTrainDays,
|
||||
Id = sysDoc.Id,
|
||||
UserCreateTime= user.CreateTime,
|
||||
CreateTime = sysDoc.CreateTime,
|
||||
IsDeleted = sysDoc.IsDeleted,
|
||||
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
|
||||
|
|
|
@ -14,6 +14,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var userId = Guid.Empty;
|
||||
var isEn_Us = false;
|
||||
|
||||
// 在此处拷贝automapper 映射
|
||||
|
||||
CreateMap<SystemDocumentAttachment, SystemDocumentAttachmentView>();
|
||||
CreateMap<SystemDocumentAttachment, SystemDocumentAttachmentAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<AuditDocumentData, AuditDocumentAddOrEdit>();
|
||||
//CreateMap<List<AuditDocumentData>, List<AuditDocumentAddOrEdit>>();
|
||||
CreateMap<AuditDocument, AuditDocumentView>();
|
||||
|
@ -23,6 +29,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<AuditDocument, AuditDocumentData>();
|
||||
CreateMap<AuditDocument, AuditDocumentAddOrEdit>().ReverseMap();
|
||||
CreateMap<SystemDocument, SystemDocumentView>()
|
||||
.ForMember(d => d.AttachmentCount, u => u.MapFrom(s => s.SystemDocumentAttachmentList.Count()))
|
||||
.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));
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ public class SystemDocument : BaseFullDeleteAuditEntity
|
|||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public List<SystemDocConfirmedIdentityUser> SystemDocConfirmedUserList { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public List<SystemDocumentAttachment> SystemDocumentAttachmentList { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<SystemDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
|
||||
[JsonIgnore]
|
||||
|
@ -35,12 +39,18 @@ public class SystemDocument : BaseFullDeleteAuditEntity
|
|||
/// 新员工培训天数
|
||||
/// </summary>
|
||||
public int? NewStaffTrainDays { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Comment("后台 - 系统签署文档附件")]
|
||||
[Table("SystemDocumentAttachment")]
|
||||
public class SystemDocumentAttachment : BaseFullAuditEntity
|
||||
{
|
||||
[JsonIgnore]
|
||||
[ForeignKey("SystemDocumentId")]
|
||||
public SystemDocument SystemDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统文档Id
|
||||
/// </summary>
|
||||
|
|
|
@ -530,6 +530,7 @@ public class IRaCISDBContext : DbContext
|
|||
|
||||
#region Document
|
||||
public virtual DbSet<SystemDocument> SystemDocument { get; set; }
|
||||
public virtual DbSet<SystemDocumentAttachment> SystemDocumentAttachment { get; set; }
|
||||
public virtual DbSet<TrialDocument> TrialDocument { get; set; }
|
||||
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocUserTypeConfirm { get; set; }
|
||||
public virtual DbSet<SystemDocNeedConfirmedUserType> SystemDocNeedConfirmedUserType { get; set; }
|
||||
|
|
19412
IRaCIS.Core.Infra.EFCore/Migrations/20250414032353_SystemDocumentAttachment1.Designer.cs
generated
Normal file
19412
IRaCIS.Core.Infra.EFCore/Migrations/20250414032353_SystemDocumentAttachment1.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SystemDocumentAttachment1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SystemDocumentAttachment",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SystemDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FileName = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
OffLine = table.Column<bool>(type: "bit", nullable: false),
|
||||
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),
|
||||
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_SystemDocumentAttachment", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocumentAttachment_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "后台 - 系统签署文档附件");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocumentAttachment_CreateUserId",
|
||||
table: "SystemDocumentAttachment",
|
||||
column: "CreateUserId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "SystemDocumentAttachment");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9700,6 +9700,58 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocumentAttachment", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
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>("FileName")
|
||||
.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>("OffLine")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SystemDocumentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.ToTable("SystemDocumentAttachment", t =>
|
||||
{
|
||||
t.HasComment("后台 - 系统签署文档附件");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemNotice", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
@ -17279,6 +17331,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("FileType");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocumentAttachment", 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.SystemNotice", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
|
|
Loading…
Reference in New Issue