From 062401534ecb67c488c524890963b467f0112ed6 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 27 Jun 2024 13:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E6=9C=BA=E6=9E=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghrs/Ghrs_AttachmentController.cs | 14 + Tiobon.Core.Api/Tiobon.Core.Model.xml | 316 +++++++++++++++++- Tiobon.Core.Api/Tiobon.Core.xml | 5 + .../Ghrs/IGhrs_AttachmentServices.cs | 12 + Tiobon.Core.Model/Base/BasePoco.cs | 10 +- .../Base/Ghrs/Ghrs_Attachment.Dto.Base.cs | 185 ++++++++++ .../Edit/Ghre/Ghre_School.Dto.EditInput.cs | 7 +- .../Ghre_SchoolAttachment.Dto.EditInput.cs | 7 +- .../Ghrs/Ghrs_Attachment.Dto.EditInput.cs | 27 ++ .../Ghre/Ghre_School.Dto.InsertInput.cs | 7 +- .../Ghre_SchoolAttachment.Dto.InsertInput.cs | 6 +- .../Ghrs/Ghrs_Attachment.Dto.InsertInput.cs | 27 ++ Tiobon.Core.Model/Models/Ghre/Ghre_School.cs | 4 +- .../Models/Ghrs/Ghrs_Attachment.cs | 187 +++++++++++ .../Models/Ghrs/Ghrs_ParaDetail.cs | 2 +- .../Ghre/Ghre_SchoolAttachment.Dto.View.cs | 2 +- .../View/Ghrs/Ghrs_Attachment.Dto.View.cs | 34 ++ .../Ghre/Ghre_SchoolServices.cs | 78 ++++- .../Ghrs/Ghrs_AttachmentServices.cs | 23 ++ .../RoleModulePermissionServices.cs | 1 + Tiobon.Core/Tiobon.Core.Model.xml | 316 +++++++++++++++++- Tiobon.Core/Tiobon.Core.xml | 5 + 22 files changed, 1251 insertions(+), 24 deletions(-) create mode 100644 Tiobon.Core.Api/Controllers/Ghrs/Ghrs_AttachmentController.cs create mode 100644 Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs create mode 100644 Tiobon.Core.Model/Base/Ghrs/Ghrs_Attachment.Dto.Base.cs create mode 100644 Tiobon.Core.Model/Edit/Ghrs/Ghrs_Attachment.Dto.EditInput.cs create mode 100644 Tiobon.Core.Model/Insert/Ghrs/Ghrs_Attachment.Dto.InsertInput.cs create mode 100644 Tiobon.Core.Model/Models/Ghrs/Ghrs_Attachment.cs create mode 100644 Tiobon.Core.Model/View/Ghrs/Ghrs_Attachment.Dto.View.cs create mode 100644 Tiobon.Core.Services/Ghrs/Ghrs_AttachmentServices.cs diff --git a/Tiobon.Core.Api/Controllers/Ghrs/Ghrs_AttachmentController.cs b/Tiobon.Core.Api/Controllers/Ghrs/Ghrs_AttachmentController.cs new file mode 100644 index 00000000..21d7e262 --- /dev/null +++ b/Tiobon.Core.Api/Controllers/Ghrs/Ghrs_AttachmentController.cs @@ -0,0 +1,14 @@ +namespace Tiobon.Core.Api.Controllers; + +/// +/// Ghrs_Attachment(Controller) +/// +[Route("api/[controller]")] +[ApiController, GlobalActionFilter] +[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghrs)] +public class Ghrs_AttachmentController : BaseController +{ + public Ghrs_AttachmentController(IGhrs_AttachmentServices service) : base(service) + { + } +} \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index e7d75c18..598f6314 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -14,11 +14,6 @@ 1:有效,0:未生效 - - - 操作日志ID - - 创建人 @@ -3060,6 +3055,149 @@ 预留字段12 + + + Ghrs_Attachment (Dto.Base) + + + + + Ghr附件记录ID + + + + + 文件编号 + + + + + 说明 + + + + + 英文说明 + + + + + TableName + + + + + TableKeyID + + + + + StaffID + + + + + 文件类别 (基本资料/证照/加班/请假....) + + + + + AttachmentGroupID + + + + + 文件名 + + + + + AttachBinary + + + 扩展名 + + + + + 大小 + + + + + 物理路径 + + + + + 相对路径 + + + + + ThumbnailPath + + + + + 附件网页链接地址 + + + + + 备注 + + + + + SortNo + + + + + IsDefault + + + + + CompanyID + + + + + ReverseN1 + + + + + ReverseD1 + + + + + Reverse1 + + + + + Reverse2 + + + + + Reverse3 + + + + + Reverse4 + + + + + Reverse5 + + Ghrs_ParaDetail (Dto.Base) @@ -3464,6 +3602,11 @@ 培训机构附件 (Dto.EditInput) + + + Ghrs_Attachment (Dto.EditInput) + + Ghrs_ParaDetail (Dto.EditInput) @@ -3584,6 +3727,11 @@ 培训机构附件 (Dto.InsertInput) + + + Ghrs_Attachment (Dto.InsertInput) + + Ghrs_ParaDetail (Dto.InsertInput) @@ -6958,6 +7106,149 @@ 任务内存中的状态 + + + Ghrs_Attachment (Model) + + + + + Ghr附件记录ID + + + + + 文件编号 + + + + + 说明 + + + + + 英文说明 + + + + + TableName + + + + + TableKeyID + + + + + StaffID + + + + + 文件类别 (基本资料/证照/加班/请假....) + + + + + AttachmentGroupID + + + + + 文件名 + + + + + AttachBinary + + + 扩展名 + + + + + 大小 + + + + + 物理路径 + + + + + 相对路径 + + + + + ThumbnailPath + + + + + 附件网页链接地址 + + + + + 备注 + + + + + SortNo + + + + + IsDefault + + + + + CompanyID + + + + + ReverseN1 + + + + + ReverseD1 + + + + + Reverse1 + + + + + Reverse2 + + + + + Reverse3 + + + + + Reverse4 + + + + + Reverse5 + + Ghrs_ParaDetail (Model) @@ -8276,6 +8567,21 @@ 修改信息 + + + Ghrs_Attachment(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + Ghrs_ParaDetail(Dto.View) diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 447daa32..93c1c191 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -821,6 +821,11 @@ 培训机构(Controller) + + + Ghrs_Attachment(Controller) + + Ghrs_ParaDetail(Controller) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs new file mode 100644 index 00000000..8fdc6540 --- /dev/null +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs @@ -0,0 +1,12 @@ +using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model.Models; + +namespace Tiobon.Core.IServices +{ + /// + /// Ghrs_Attachment(自定义服务接口) + /// + public interface IGhrs_AttachmentServices :IBaseServices + { + } +} \ No newline at end of file diff --git a/Tiobon.Core.Model/Base/BasePoco.cs b/Tiobon.Core.Model/Base/BasePoco.cs index e8a88fc7..ff2d1f95 100644 --- a/Tiobon.Core.Model/Base/BasePoco.cs +++ b/Tiobon.Core.Model/Base/BasePoco.cs @@ -23,11 +23,11 @@ public class BasePoco1 : IBaseDeleteFilter [Display(Name = "1:有效,0:未生效")] public int IsEnable { get; set; } = 1; - /// - /// 操作日志ID - /// - [Display(Name = "操作日志ID")] - public long? OperateLogID { get; set; } + ///// + ///// 操作日志ID + ///// + //[Display(Name = "操作日志ID")] + //public long? OperateLogID { get; set; } /// /// 创建人 diff --git a/Tiobon.Core.Model/Base/Ghrs/Ghrs_Attachment.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghrs/Ghrs_Attachment.Dto.Base.cs new file mode 100644 index 00000000..4146cb62 --- /dev/null +++ b/Tiobon.Core.Model/Base/Ghrs/Ghrs_Attachment.Dto.Base.cs @@ -0,0 +1,185 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghrs_Attachment.cs +* +*功 能: N / A +* 类 名: Ghrs_Attachment +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/6/27 11:34:43 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace Tiobon.Core.Model.Models +{ + + /// + /// Ghrs_Attachment (Dto.Base) + /// + public class Ghrs_AttachmentBase + { + + /// + /// Ghr附件记录ID + /// + public int? AttachmentID { get; set; } + + /// + /// 文件编号 + /// + [Display(Name = "AttachmentNo"), Description("文件编号"), MaxLength(100, ErrorMessage = "文件编号 不能超过 100 个字符")] + public string AttachmentNo { get; set; } + + /// + /// 说明 + /// + [Display(Name = "AttachmentName"), Description("说明"), MaxLength(200, ErrorMessage = "说明 不能超过 200 个字符")] + public string AttachmentName { get; set; } + + /// + /// 英文说明 + /// + [Display(Name = "AttachmentEname"), Description("英文说明"), MaxLength(500, ErrorMessage = "英文说明 不能超过 500 个字符")] + public string AttachmentEname { get; set; } + + /// + /// TableName + /// + [Display(Name = "TableName"), Description("TableName"), MaxLength(200, ErrorMessage = "TableName 不能超过 200 个字符")] + public string TableName { get; set; } + + /// + /// TableKeyID + /// + public int? TableKeyID { get; set; } + + /// + /// StaffID + /// + public int? StaffID { get; set; } + + /// + /// 文件类别 (基本资料/证照/加班/请假....) + /// + [Display(Name = "AttachmentType"), Description("文件类别 (基本资料/证照/加班/请假....)"), MaxLength(100, ErrorMessage = "文件类别 (基本资料/证照/加班/请假....) 不能超过 100 个字符")] + public string AttachmentType { get; set; } + + /// + /// AttachmentGroupID + /// + public int? AttachmentGroupID { get; set; } + + /// + /// 文件名 + /// + [Display(Name = "AttachFileName"), Description("文件名"), MaxLength(200, ErrorMessage = "文件名 不能超过 200 个字符")] + public string AttachFileName { get; set; } + + /// + /// AttachBinary + /// + + /// + /// 扩展名 + /// + [Display(Name = "AttachFileExtension"), Description("扩展名"), MaxLength(100, ErrorMessage = "扩展名 不能超过 100 个字符")] + public string AttachFileExtension { get; set; } + + /// + /// 大小 + /// + public int? AttachFileSize { get; set; } + + /// + /// 物理路径 + /// + [Display(Name = "PhysicsPath"), Description("物理路径"), MaxLength(500, ErrorMessage = "物理路径 不能超过 500 个字符")] + public string PhysicsPath { get; set; } + + /// + /// 相对路径 + /// + [Display(Name = "RelativePath"), Description("相对路径"), MaxLength(500, ErrorMessage = "相对路径 不能超过 500 个字符")] + public string RelativePath { get; set; } + + /// + /// ThumbnailPath + /// + [Display(Name = "ThumbnailPath"), Description("ThumbnailPath"), MaxLength(500, ErrorMessage = "ThumbnailPath 不能超过 500 个字符")] + public string ThumbnailPath { get; set; } + + /// + /// 附件网页链接地址 + /// + [Display(Name = "FileURL"), Description("附件网页链接地址"), MaxLength(500, ErrorMessage = "附件网页链接地址 不能超过 500 个字符")] + public string FileURL { get; set; } + + /// + /// 备注 + /// + [Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")] + public string RemarkSz { get; set; } + + /// + /// SortNo + /// + public int? SortNo { get; set; } + + /// + /// IsDefault + /// + public int? IsDefault { get; set; } + + /// + /// CompanyID + /// + public int? CompanyID { get; set; } + + /// + /// ReverseN1 + /// + public int? ReverseN1 { get; set; } + + /// + /// ReverseD1 + /// + public DateTime? ReverseD1 { get; set; } + + /// + /// Reverse1 + /// + [Display(Name = "Reverse1"), Description("Reverse1"), MaxLength(1000, ErrorMessage = "Reverse1 不能超过 1000 个字符")] + public string Reverse1 { get; set; } + + /// + /// Reverse2 + /// + [Display(Name = "Reverse2"), Description("Reverse2"), MaxLength(1000, ErrorMessage = "Reverse2 不能超过 1000 个字符")] + public string Reverse2 { get; set; } + + /// + /// Reverse3 + /// + [Display(Name = "Reverse3"), Description("Reverse3"), MaxLength(1000, ErrorMessage = "Reverse3 不能超过 1000 个字符")] + public string Reverse3 { get; set; } + + /// + /// Reverse4 + /// + [Display(Name = "Reverse4"), Description("Reverse4"), MaxLength(1000, ErrorMessage = "Reverse4 不能超过 1000 个字符")] + public string Reverse4 { get; set; } + + /// + /// Reverse5 + /// + [Display(Name = "Reverse5"), Description("Reverse5"), MaxLength(1000, ErrorMessage = "Reverse5 不能超过 1000 个字符")] + public string Reverse5 { get; set; } + } +} diff --git a/Tiobon.Core.Model/Edit/Ghre/Ghre_School.Dto.EditInput.cs b/Tiobon.Core.Model/Edit/Ghre/Ghre_School.Dto.EditInput.cs index 38a8dfa8..c0402e86 100644 --- a/Tiobon.Core.Model/Edit/Ghre/Ghre_School.Dto.EditInput.cs +++ b/Tiobon.Core.Model/Edit/Ghre/Ghre_School.Dto.EditInput.cs @@ -13,7 +13,9 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ + +using System.ComponentModel.DataAnnotations.Schema; namespace Tiobon.Core.Model.Models { @@ -23,5 +25,8 @@ namespace Tiobon.Core.Model.Models /// public class EditGhre_SchoolInput : Ghre_SchoolBase { + + [NotMapped] + public List SchoolAttachments { get; set; } } } diff --git a/Tiobon.Core.Model/Edit/Ghre/Ghre_SchoolAttachment.Dto.EditInput.cs b/Tiobon.Core.Model/Edit/Ghre/Ghre_SchoolAttachment.Dto.EditInput.cs index 645dba44..8a81bc9e 100644 --- a/Tiobon.Core.Model/Edit/Ghre/Ghre_SchoolAttachment.Dto.EditInput.cs +++ b/Tiobon.Core.Model/Edit/Ghre/Ghre_SchoolAttachment.Dto.EditInput.cs @@ -13,7 +13,9 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ + +using System.ComponentModel.DataAnnotations.Schema; namespace Tiobon.Core.Model.Models { @@ -23,5 +25,8 @@ namespace Tiobon.Core.Model.Models /// public class EditGhre_SchoolAttachmentInput : Ghre_SchoolAttachmentBase { + + [NotMapped] + public List Attachments { get; set; } } } diff --git a/Tiobon.Core.Model/Edit/Ghrs/Ghrs_Attachment.Dto.EditInput.cs b/Tiobon.Core.Model/Edit/Ghrs/Ghrs_Attachment.Dto.EditInput.cs new file mode 100644 index 00000000..dee4e5e5 --- /dev/null +++ b/Tiobon.Core.Model/Edit/Ghrs/Ghrs_Attachment.Dto.EditInput.cs @@ -0,0 +1,27 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghrs_Attachment.cs +* +*功 能: N / A +* 类 名: Ghrs_Attachment +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/6/27 11:34:43 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ + +namespace Tiobon.Core.Model.Models +{ + + /// + /// Ghrs_Attachment (Dto.EditInput) + /// + public class EditGhrs_AttachmentInput : Ghrs_AttachmentBase + { + } +} diff --git a/Tiobon.Core.Model/Insert/Ghre/Ghre_School.Dto.InsertInput.cs b/Tiobon.Core.Model/Insert/Ghre/Ghre_School.Dto.InsertInput.cs index dc258599..2acb40ab 100644 --- a/Tiobon.Core.Model/Insert/Ghre/Ghre_School.Dto.InsertInput.cs +++ b/Tiobon.Core.Model/Insert/Ghre/Ghre_School.Dto.InsertInput.cs @@ -13,7 +13,9 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ + +using System.ComponentModel.DataAnnotations.Schema; namespace Tiobon.Core.Model.Models { @@ -23,5 +25,8 @@ namespace Tiobon.Core.Model.Models /// public class InsertGhre_SchoolInput : Ghre_SchoolBase { + [NotMapped] + public List SchoolAttachments { get; set; } + } } diff --git a/Tiobon.Core.Model/Insert/Ghre/Ghre_SchoolAttachment.Dto.InsertInput.cs b/Tiobon.Core.Model/Insert/Ghre/Ghre_SchoolAttachment.Dto.InsertInput.cs index 0693bab1..967ba00a 100644 --- a/Tiobon.Core.Model/Insert/Ghre/Ghre_SchoolAttachment.Dto.InsertInput.cs +++ b/Tiobon.Core.Model/Insert/Ghre/Ghre_SchoolAttachment.Dto.InsertInput.cs @@ -13,7 +13,9 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ + +using System.ComponentModel.DataAnnotations.Schema; namespace Tiobon.Core.Model.Models { @@ -23,5 +25,7 @@ namespace Tiobon.Core.Model.Models /// public class InsertGhre_SchoolAttachmentInput : Ghre_SchoolAttachmentBase { + [NotMapped] + public List Attachments { get; set; } } } diff --git a/Tiobon.Core.Model/Insert/Ghrs/Ghrs_Attachment.Dto.InsertInput.cs b/Tiobon.Core.Model/Insert/Ghrs/Ghrs_Attachment.Dto.InsertInput.cs new file mode 100644 index 00000000..4143f4c9 --- /dev/null +++ b/Tiobon.Core.Model/Insert/Ghrs/Ghrs_Attachment.Dto.InsertInput.cs @@ -0,0 +1,27 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghrs_Attachment.cs +* +*功 能: N / A +* 类 名: Ghrs_Attachment +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/6/27 11:34:43 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ + +namespace Tiobon.Core.Model.Models +{ + + /// + /// Ghrs_Attachment (Dto.InsertInput) + /// + public class InsertGhrs_AttachmentInput : Ghrs_AttachmentBase + { + } +} diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_School.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_School.cs index 4dec4fd6..314babcc 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_School.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_School.cs @@ -13,7 +13,7 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using SqlSugar; @@ -31,7 +31,7 @@ namespace Tiobon.Core.Model.Models /// /// 机构编号 /// - [Display(Name = "SchoolNo"), Description("机构编号"), MaxLength(32, ErrorMessage = "机构编号 不能超过 32 个字符")] + [Display(Name = "SchoolNo"), Description("机构编号"), MaxLength(32, ErrorMessage = "机构编号 不能超过 32 个字符"), EntityColumn(Unique = true)] public string SchoolNo { get; set; } /// diff --git a/Tiobon.Core.Model/Models/Ghrs/Ghrs_Attachment.cs b/Tiobon.Core.Model/Models/Ghrs/Ghrs_Attachment.cs new file mode 100644 index 00000000..34b29e4a --- /dev/null +++ b/Tiobon.Core.Model/Models/Ghrs/Ghrs_Attachment.cs @@ -0,0 +1,187 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghrs_Attachment.cs +* +*功 能: N / A +* 类 名: Ghrs_Attachment +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/6/27 11:34:43 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using SqlSugar; + +namespace Tiobon.Core.Model.Models +{ + + /// + /// Ghrs_Attachment (Model) + /// + [SugarTable("Ghrs_Attachment", "Ghrs_Attachment"), Entity(TableCnName = "Ghrs_Attachment", TableName = "Ghrs_Attachment")] + public class Ghrs_Attachment : BasePoco1 + { + + /// + /// Ghr附件记录ID + /// + public int? AttachmentID { get; set; } + + /// + /// 文件编号 + /// + [Display(Name = "AttachmentNo"), Description("文件编号"), MaxLength(100, ErrorMessage = "文件编号 不能超过 100 个字符")] + public string AttachmentNo { get; set; } + + /// + /// 说明 + /// + [Display(Name = "AttachmentName"), Description("说明"), MaxLength(200, ErrorMessage = "说明 不能超过 200 个字符")] + public string AttachmentName { get; set; } + + /// + /// 英文说明 + /// + [Display(Name = "AttachmentEname"), Description("英文说明"), MaxLength(500, ErrorMessage = "英文说明 不能超过 500 个字符")] + public string AttachmentEname { get; set; } + + /// + /// TableName + /// + [Display(Name = "TableName"), Description("TableName"), MaxLength(200, ErrorMessage = "TableName 不能超过 200 个字符")] + public string TableName { get; set; } + + /// + /// TableKeyID + /// + public int? TableKeyID { get; set; } + + /// + /// StaffID + /// + public int? StaffID { get; set; } + + /// + /// 文件类别 (基本资料/证照/加班/请假....) + /// + [Display(Name = "AttachmentType"), Description("文件类别 (基本资料/证照/加班/请假....)"), MaxLength(100, ErrorMessage = "文件类别 (基本资料/证照/加班/请假....) 不能超过 100 个字符")] + public string AttachmentType { get; set; } + + /// + /// AttachmentGroupID + /// + public int? AttachmentGroupID { get; set; } + + /// + /// 文件名 + /// + [Display(Name = "AttachFileName"), Description("文件名"), MaxLength(200, ErrorMessage = "文件名 不能超过 200 个字符")] + public string AttachFileName { get; set; } + + /// + /// AttachBinary + /// + + /// + /// 扩展名 + /// + [Display(Name = "AttachFileExtension"), Description("扩展名"), MaxLength(100, ErrorMessage = "扩展名 不能超过 100 个字符")] + public string AttachFileExtension { get; set; } + + /// + /// 大小 + /// + public int? AttachFileSize { get; set; } + + /// + /// 物理路径 + /// + [Display(Name = "PhysicsPath"), Description("物理路径"), MaxLength(500, ErrorMessage = "物理路径 不能超过 500 个字符")] + public string PhysicsPath { get; set; } + + /// + /// 相对路径 + /// + [Display(Name = "RelativePath"), Description("相对路径"), MaxLength(500, ErrorMessage = "相对路径 不能超过 500 个字符")] + public string RelativePath { get; set; } + + /// + /// ThumbnailPath + /// + [Display(Name = "ThumbnailPath"), Description("ThumbnailPath"), MaxLength(500, ErrorMessage = "ThumbnailPath 不能超过 500 个字符")] + public string ThumbnailPath { get; set; } + + /// + /// 附件网页链接地址 + /// + [Display(Name = "FileURL"), Description("附件网页链接地址"), MaxLength(500, ErrorMessage = "附件网页链接地址 不能超过 500 个字符")] + public string FileURL { get; set; } + + /// + /// 备注 + /// + [Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")] + public string RemarkSz { get; set; } + + /// + /// SortNo + /// + public int? SortNo { get; set; } + + /// + /// IsDefault + /// + public int? IsDefault { get; set; } + + /// + /// CompanyID + /// + public int? CompanyID { get; set; } + + /// + /// ReverseN1 + /// + public int? ReverseN1 { get; set; } + + /// + /// ReverseD1 + /// + public DateTime? ReverseD1 { get; set; } + + /// + /// Reverse1 + /// + [Display(Name = "Reverse1"), Description("Reverse1"), MaxLength(1000, ErrorMessage = "Reverse1 不能超过 1000 个字符")] + public string Reverse1 { get; set; } + + /// + /// Reverse2 + /// + [Display(Name = "Reverse2"), Description("Reverse2"), MaxLength(1000, ErrorMessage = "Reverse2 不能超过 1000 个字符")] + public string Reverse2 { get; set; } + + /// + /// Reverse3 + /// + [Display(Name = "Reverse3"), Description("Reverse3"), MaxLength(1000, ErrorMessage = "Reverse3 不能超过 1000 个字符")] + public string Reverse3 { get; set; } + + /// + /// Reverse4 + /// + [Display(Name = "Reverse4"), Description("Reverse4"), MaxLength(1000, ErrorMessage = "Reverse4 不能超过 1000 个字符")] + public string Reverse4 { get; set; } + + /// + /// Reverse5 + /// + [Display(Name = "Reverse5"), Description("Reverse5"), MaxLength(1000, ErrorMessage = "Reverse5 不能超过 1000 个字符")] + public string Reverse5 { get; set; } + } +} diff --git a/Tiobon.Core.Model/Models/Ghrs/Ghrs_ParaDetail.cs b/Tiobon.Core.Model/Models/Ghrs/Ghrs_ParaDetail.cs index 2b2287eb..fcd2d00d 100644 --- a/Tiobon.Core.Model/Models/Ghrs/Ghrs_ParaDetail.cs +++ b/Tiobon.Core.Model/Models/Ghrs/Ghrs_ParaDetail.cs @@ -25,7 +25,7 @@ namespace Tiobon.Core.Model.Models /// Ghrs_ParaDetail (Model) /// [SugarTable("Ghrs_ParaDetail", "Ghrs_ParaDetail"), Entity(TableCnName = "Ghrs_ParaDetail", TableName = "Ghrs_ParaDetail")] - public class Ghrs_ParaDetail : BasePoco + public class Ghrs_ParaDetail : BasePoco1 { /// diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_SchoolAttachment.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_SchoolAttachment.Dto.View.cs index 2ac2824f..2d2fd17a 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_SchoolAttachment.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_SchoolAttachment.Dto.View.cs @@ -32,6 +32,6 @@ public class Ghre_SchoolAttachmentDto : Ghre_SchoolAttachment /// public string UpdateDataInfo { get; set; } - public List SchoolAttachments { get; set; } = new List(); + public List Attachments { get; set; } = new List(); } diff --git a/Tiobon.Core.Model/View/Ghrs/Ghrs_Attachment.Dto.View.cs b/Tiobon.Core.Model/View/Ghrs/Ghrs_Attachment.Dto.View.cs new file mode 100644 index 00000000..252513b8 --- /dev/null +++ b/Tiobon.Core.Model/View/Ghrs/Ghrs_Attachment.Dto.View.cs @@ -0,0 +1,34 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghrs_Attachment.cs +* +*功 能: N / A +* 类 名: Ghrs_Attachment +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/6/27 11:34:43 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ + +namespace Tiobon.Core.Model.Models; + +/// +/// Ghrs_Attachment(Dto.View) +/// +public class Ghrs_AttachmentDto : Ghrs_Attachment +{ +/// +/// 创建信息 +/// +public string CreateDataInfo { get; set; } + +/// +/// 修改信息 +/// +public string UpdateDataInfo { get; set; } +} diff --git a/Tiobon.Core.Services/Ghre/Ghre_SchoolServices.cs b/Tiobon.Core.Services/Ghre/Ghre_SchoolServices.cs index f21ed37e..7892cdd0 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_SchoolServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_SchoolServices.cs @@ -8,6 +8,9 @@ using Tiobon.Core.Common; using Tiobon.Core.Model; using Newtonsoft.Json.Linq; using Newtonsoft.Json; +using MathNet.Numerics.Distributions; +using K4os.Hash.xxHash; +using AgileObjects.AgileMapper; namespace Tiobon.Core.Services; @@ -17,11 +20,18 @@ namespace Tiobon.Core.Services; public class Ghre_SchoolServices : BaseServices, IGhre_SchoolServices { private readonly IBaseRepository _dal; - public Ghre_SchoolServices(ICaching caching, IBaseRepository dal) + private IGhrs_AttachmentServices _ghrs_AttachmentServices; + private IGhre_SchoolAttachmentServices _ghre_SchoolAttachmentServices; + public Ghre_SchoolServices(ICaching caching, + IGhrs_AttachmentServices ghrs_AttachmentServices, + IGhre_SchoolAttachmentServices ghre_SchoolAttachmentServices, + IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; base._caching = caching; + _ghrs_AttachmentServices = ghrs_AttachmentServices; + _ghre_SchoolAttachmentServices = ghre_SchoolAttachmentServices; } public override async Task> QueryFilterPage(QueryBody filter) @@ -56,6 +66,72 @@ public class Ghre_SchoolServices : BaseServices> QueryForm(QueryForm body) { var data = await base.QueryForm(body); + var entitys = data.result.DT_TableDataT1; + var ids = entitys.Select(x => x.Id).ToList(); + var schoolAttachments = await _ghre_SchoolAttachmentServices.QueryDto(x => ids.Contains(x.SchoolId.Value)); + var ids1 = schoolAttachments.Select(x => x.Id.ToString()).ToList(); + var attachments = await _ghrs_AttachmentServices.QueryDto(x => ids1.Contains(x.TableName)); + + schoolAttachments.ForEach(x => + { + x.Attachments = attachments.Where(o => o.TableName == x.Id.ToString()).ToList(); + }); + entitys.ForEach(x => + { + x.SchoolAttachments = schoolAttachments.Where(o => o.SchoolId == x.Id).ToList(); + }); + + data.result.DT_TableDataT1 = entitys; return data; } + + public override async Task Add(InsertGhre_SchoolInput entity) + { + var id = await base.Add(entity); + + if (entity.SchoolAttachments != null && entity.SchoolAttachments.Any()) + { + for (int i = 0; i < entity.SchoolAttachments.Count; i++) + { + var insert = entity.SchoolAttachments[i]; + insert.SchoolId = id; + var schoolAttachmentId = await _ghre_SchoolAttachmentServices.Add(insert); + if (insert.Attachments != null && insert.Attachments.Any()) + for (int j = 0; j < insert.Attachments.Count; j++) + { + await Db.Updateable() + .SetColumns(it => new Ghrs_Attachment() { TableName = schoolAttachmentId.ToString(), UpdateTime = DateTime.Now }) + .Where(it => it.RelativePath == insert.Attachments[j].RelativePath) + .ExecuteCommandAsync(); + } + } + } + + return id; + } + + public override async Task Update(long Id, EditGhre_SchoolInput editModel) + { + var result = await base.Update(Id, editModel); + await _ghre_SchoolAttachmentServices.Delete(x => x.SchoolId == Id); + if (editModel.SchoolAttachments != null && editModel.SchoolAttachments.Any()) + { + for (int i = 0; i < editModel.SchoolAttachments.Count; i++) + { + var insert = editModel.SchoolAttachments[i]; + insert.SchoolId = Id; + var schoolAttachmentId = await _ghre_SchoolAttachmentServices.Add(Mapper.Map(insert).ToANew()); + if (insert.Attachments != null && insert.Attachments.Any()) + for (int j = 0; j < insert.Attachments.Count; j++) + { + await Db.Updateable() + .SetColumns(it => new Ghrs_Attachment() { TableName = schoolAttachmentId.ToString(), UpdateTime = DateTime.Now }) + .Where(it => it.RelativePath == insert.Attachments[j].RelativePath) + .ExecuteCommandAsync(); + } + } + } + + return result; + } } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghrs/Ghrs_AttachmentServices.cs b/Tiobon.Core.Services/Ghrs/Ghrs_AttachmentServices.cs new file mode 100644 index 00000000..077123ff --- /dev/null +++ b/Tiobon.Core.Services/Ghrs/Ghrs_AttachmentServices.cs @@ -0,0 +1,23 @@ + +using Tiobon.Core.IServices; +using Tiobon.Core.Model.Models; +using Tiobon.Core.Services.BASE; +using Tiobon.Core.IRepository.Base; +using Tiobon.Core.Common.Caches; + +namespace Tiobon.Core.Services +{ + /// + /// Ghrs_Attachment (服务) + /// + public class Ghrs_AttachmentServices : BaseServices, IGhrs_AttachmentServices + { + private readonly IBaseRepository _dal; + public Ghrs_AttachmentServices(ICaching caching, IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + base._caching = caching; + } + } +} \ No newline at end of file diff --git a/Tiobon.Core.Services/RoleModulePermissionServices.cs b/Tiobon.Core.Services/RoleModulePermissionServices.cs index 56b71426..2b01c4de 100644 --- a/Tiobon.Core.Services/RoleModulePermissionServices.cs +++ b/Tiobon.Core.Services/RoleModulePermissionServices.cs @@ -25,6 +25,7 @@ namespace Tiobon.Core.Services IBaseRepository moduleRepository, IBaseRepository roleRepository) { + this._dal = dal; this._moduleRepository = moduleRepository; this._roleRepository = roleRepository; diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index e7d75c18..598f6314 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -14,11 +14,6 @@ 1:有效,0:未生效 - - - 操作日志ID - - 创建人 @@ -3060,6 +3055,149 @@ 预留字段12 + + + Ghrs_Attachment (Dto.Base) + + + + + Ghr附件记录ID + + + + + 文件编号 + + + + + 说明 + + + + + 英文说明 + + + + + TableName + + + + + TableKeyID + + + + + StaffID + + + + + 文件类别 (基本资料/证照/加班/请假....) + + + + + AttachmentGroupID + + + + + 文件名 + + + + + AttachBinary + + + 扩展名 + + + + + 大小 + + + + + 物理路径 + + + + + 相对路径 + + + + + ThumbnailPath + + + + + 附件网页链接地址 + + + + + 备注 + + + + + SortNo + + + + + IsDefault + + + + + CompanyID + + + + + ReverseN1 + + + + + ReverseD1 + + + + + Reverse1 + + + + + Reverse2 + + + + + Reverse3 + + + + + Reverse4 + + + + + Reverse5 + + Ghrs_ParaDetail (Dto.Base) @@ -3464,6 +3602,11 @@ 培训机构附件 (Dto.EditInput) + + + Ghrs_Attachment (Dto.EditInput) + + Ghrs_ParaDetail (Dto.EditInput) @@ -3584,6 +3727,11 @@ 培训机构附件 (Dto.InsertInput) + + + Ghrs_Attachment (Dto.InsertInput) + + Ghrs_ParaDetail (Dto.InsertInput) @@ -6958,6 +7106,149 @@ 任务内存中的状态 + + + Ghrs_Attachment (Model) + + + + + Ghr附件记录ID + + + + + 文件编号 + + + + + 说明 + + + + + 英文说明 + + + + + TableName + + + + + TableKeyID + + + + + StaffID + + + + + 文件类别 (基本资料/证照/加班/请假....) + + + + + AttachmentGroupID + + + + + 文件名 + + + + + AttachBinary + + + 扩展名 + + + + + 大小 + + + + + 物理路径 + + + + + 相对路径 + + + + + ThumbnailPath + + + + + 附件网页链接地址 + + + + + 备注 + + + + + SortNo + + + + + IsDefault + + + + + CompanyID + + + + + ReverseN1 + + + + + ReverseD1 + + + + + Reverse1 + + + + + Reverse2 + + + + + Reverse3 + + + + + Reverse4 + + + + + Reverse5 + + Ghrs_ParaDetail (Model) @@ -8276,6 +8567,21 @@ 修改信息 + + + Ghrs_Attachment(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + Ghrs_ParaDetail(Dto.View) diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 447daa32..93c1c191 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -821,6 +821,11 @@ 培训机构(Controller) + + + Ghrs_Attachment(Controller) + + Ghrs_ParaDetail(Controller)