From 0e40334981da5317685149fee2401cf8e643e45a Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 18 Jul 2024 16:17:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E5=B2=97=E8=AF=81=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Tiobon.Web.pdm | 261 +++++++++------ .../Ghre/Ghre_CertificateRuleController.cs | 14 + Tiobon.Core.Api/Tiobon.Core.Model.xml | 310 ++++++++++++++++++ Tiobon.Core.Api/Tiobon.Core.xml | 5 + .../Ghre/IGhre_CertificateRuleServices.cs | 12 + .../Ghre/Ghre_CertificateRule.Dto.Base.cs | 176 ++++++++++ .../Ghre_CertificateRule.Dto.EditInput.cs | 27 ++ .../AttributeManager/EntityAttribute.cs | 2 +- .../Ghre_CertificateRule.Dto.InsertInput.cs | 27 ++ .../Models/Ghre/Ghre_CertificateRule.cs | 178 ++++++++++ .../Ghre/Ghre_CertificateRule.Dto.View.cs | 51 +++ .../Ghre/Ghre_CertificateRuleServices.cs | 87 +++++ Tiobon.Core/Tiobon.Core.Model.xml | 310 ++++++++++++++++++ Tiobon.Core/Tiobon.Core.xml | 5 + 14 files changed, 1357 insertions(+), 108 deletions(-) create mode 100644 Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateRuleController.cs create mode 100644 Tiobon.Core.IServices/Ghre/IGhre_CertificateRuleServices.cs create mode 100644 Tiobon.Core.Model/Base/Ghre/Ghre_CertificateRule.Dto.Base.cs create mode 100644 Tiobon.Core.Model/Edit/Ghre/Ghre_CertificateRule.Dto.EditInput.cs create mode 100644 Tiobon.Core.Model/Insert/Ghre/Ghre_CertificateRule.Dto.InsertInput.cs create mode 100644 Tiobon.Core.Model/Models/Ghre/Ghre_CertificateRule.cs create mode 100644 Tiobon.Core.Model/View/Ghre/Ghre_CertificateRule.Dto.View.cs create mode 100644 Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index cd21af2e..0a17a9a6 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -1,5 +1,5 @@ - + @@ -120887,9 +120887,9 @@ LABL 0 Arial Unicode MS,8,N Ghre_CertificateRule 1721280148 Administrator -1721280295 +1721283287 Administrator -培训记录 +培训证书规则 74B0AAD1-B9E2-4EDC-8F94-267A7290CFD7 @@ -121026,97 +121026,144 @@ LABL 0 Arial Unicode MS,8,N -2BE830BF-46B1-4B26-AA04-346E3902B3BF -员工ID -StaffId -1721280148 +5FF54614-5C5C-4F71-8467-0372DD3761F0 +规则类型 +RuleType +1721280484 Administrator -1721280148 +1721283065 Administrator -员工ID -int +规则类型 +nvarchar(32) +32 -D4EE8730-22F2-4720-AC97-89F3A2062346 -课程快照ID -CourseSnapId -1721280148 +B0C05A48-302C-4CE6-8BA1-A0C44BD0303E +规则编号 +RuleNo +1721280484 Administrator -1721280148 +1721283065 Administrator -课程快照ID -bigint +规则编号 +nvarchar(32) +32 -CEA3929B-FCC6-411A-A4E9-0D0347CFC8C0 +150DA0CC-7A81-4020-8C50-6C77A1CBB47C +证书名称 +CertificateName +1721280484 +Administrator +1721283657 +Administrator +证书名称 +nvarchar(32) +32 + + +CB9DAAC2-2757-4594-B1CD-0443C4CA61AE +课程场景ID +CourseSceneId +1721283001 +Administrator +1721283065 +Administrator +课程场景ID +bigint + + +D5BFD533-C0CB-40EF-B419-C76CFA5B2472 课程ID CourseId -1721280148 +1721283001 Administrator -1721280148 +1721283065 Administrator 课程ID bigint - -0782D3E7-E576-4D49-8D09-BA5B5D746D2C -证书类型 -CertificateType -1721280148 + +63D22867-D35B-48C8-8315-96999A56F14F +有效期类型 +ValidityType +1721280484 Administrator -1721280148 +1721283065 Administrator -证书类型 +有效期类型 nvarchar(32) 32 - -18219302-B747-4A3E-A689-87C805B9A2A3 -证书Url -CertificateUrl -1721280148 + +AA8964B1-9490-4BA5-8BA4-4C1E4260BAEC +固定数 +StaticNum +1721280484 Administrator -1721280148 +1721283065 Administrator -证书Url -nvarchar(128) -128 +固定数 +int - -A9EBC6EF-8621-48FC-AFD8-6B4A2D5E2777 -颁发日期 -AwardDate -1721280148 + +70867D03-D648-4D1C-9617-7F20505B1FF0 +固定类型 +StaticType +1721280484 Administrator -1721280148 +1721283065 Administrator -颁发日期 -datetime +固定类型 +nvarchar(32) +32 - -766541BD-16E2-452B-8234-7A4B1B071F60 + +419FB467-143A-4B5A-9DEA-1C321943D83F 有效期 -ValidityPeriod -1721280148 +ValidityTime +1721280484 Administrator -1721280148 +1721283065 Administrator 有效期 +datetime + + +408CA59F-CABC-49BA-B094-D1DDB66652AE +发放规则 +SendRule +1721283065 +Administrator +1721283155 +Administrator +发放规则 nvarchar(32) 32 - -208B9CD3-1A95-439B-ABE8-446568D1B378 -有效期1 -ValidityPeriodTime -1721280148 + +0DCFC327-8D5A-40B3-813D-42A7753DBC3D +分数 +ScoreMin +1721283065 Administrator -1721280148 +1721283155 Administrator -结束时间 -datetime +分数 +int - + +343AC157-AD4F-4382-BC76-BC9EA0317D8D +分数1 +ScoreMax +1721283065 +Administrator +1721283155 +Administrator +分数1 +int + + 8C3CC76E-55C9-4B86-9744-22EAA8105E9B 备注 RemarkSz @@ -121131,7 +121178,7 @@ LABL 0 Arial Unicode MS,8,N - + 5748058F-BCCD-49C0-9012-3D7E96B6D69A 默认标志 IsDefault @@ -121146,7 +121193,7 @@ LABL 0 Arial Unicode MS,8,N - + 2589055F-505E-441A-9696-9964A7A4A008 删除标志 IsEnable @@ -121161,7 +121208,7 @@ LABL 0 Arial Unicode MS,8,N - + D20B915C-FCA1-494B-A8A2-B2FF85468C64 预留字段1 Reverse1 @@ -121173,7 +121220,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 1B4FABC6-E541-4068-ACFB-BC9078682988 预留字段2 Reverse2 @@ -121185,7 +121232,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + B6310193-4CEE-4148-BE8B-3C11D8F4322D 预留字段3 Reverse3 @@ -121197,7 +121244,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 9FE04BB6-928C-4531-9DDD-0FDBC30BB174 预留字段4 Reverse4 @@ -121209,7 +121256,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + D97789F8-ED46-447A-AD69-0776DE2FABCD 预留字段5 Reverse5 @@ -121221,7 +121268,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + AEDD3137-4121-440A-9A7E-B6F299000B70 预留字段6 Reverse6 @@ -121233,7 +121280,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 4FCFEEF7-1047-46A9-916C-FA8C1AA3F795 预留字段7 Reverse7 @@ -121245,7 +121292,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 323C988B-20C0-43EC-ADAE-0FF35D6DFA4A 预留字段8 Reverse8 @@ -121257,7 +121304,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 69763777-A397-4C79-B48F-02E75CD145FF 预留字段9 Reverse9 @@ -121269,7 +121316,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + B6FBA743-4C50-4218-8E94-29BFBEEB0F26 预留字段10 Reverse10 @@ -121281,7 +121328,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + FCCD8A45-2561-4DD5-A9E9-348C2FD700BC 预留字段I1 ReverseI1 @@ -121293,7 +121340,7 @@ LABL 0 Arial Unicode MS,8,N 0 int - + 4EF2055B-A955-44E6-A36E-C6441D831DD6 预留字段I2 ReverseI2 @@ -121307,7 +121354,7 @@ LABL 0 Arial Unicode MS,8,N - + 9A140C59-A38D-4A71-9AAB-F1F0C0F7E66B Key_1 Key_1 @@ -121321,10 +121368,10 @@ LABL 0 Arial Unicode MS,8,N - + - + @@ -121348,7 +121395,7 @@ LABL 0 Arial Unicode MS,8,N - + 7F0DCA7C-274D-48A8-B3D8-0FD7B707AFC2 1714101292 Administrator @@ -121382,7 +121429,7 @@ LABL 0 Arial Unicode MS,8,N - + D23C452C-4BB6-4C2A-AB2E-E8434D958A77 1714101335 Administrator @@ -121416,7 +121463,7 @@ LABL 0 Arial Unicode MS,8,N - + D4016F9D-5631-4F9E-A70D-D42133A4EBB7 1714107872 Administrator @@ -121450,7 +121497,7 @@ LABL 0 Arial Unicode MS,8,N - + BEBA3346-CCC6-41D9-B95B-12B8F81188BF 1714108449 Administrator @@ -121484,7 +121531,7 @@ LABL 0 Arial Unicode MS,8,N - + FC69BEF9-F863-4A65-903E-CB2850197526 1714109221 Administrator @@ -121518,7 +121565,7 @@ LABL 0 Arial Unicode MS,8,N - + ACE0AB02-0D27-4F1C-BF71-738C20DF96C2 1714120556 Administrator @@ -121552,7 +121599,7 @@ LABL 0 Arial Unicode MS,8,N - + B95672ED-9976-4742-9FFC-52B326620682 1715565535 Administrator @@ -121586,7 +121633,7 @@ LABL 0 Arial Unicode MS,8,N - + B6E89235-A6E0-460D-9228-DCA8C58EE2AD 1715570661 Administrator @@ -121620,7 +121667,7 @@ LABL 0 Arial Unicode MS,8,N - + 5D4938F3-7934-4F74-891C-97DC9DC47B1B 1716798640 Administrator @@ -121654,7 +121701,7 @@ LABL 0 Arial Unicode MS,8,N - + 179079CB-7169-4B19-A07A-A61C331F59CD 1716876897 Administrator @@ -121688,7 +121735,7 @@ LABL 0 Arial Unicode MS,8,N - + DD965546-2361-4301-82D7-446B823BDCFD 1717481682 Administrator @@ -121722,7 +121769,7 @@ LABL 0 Arial Unicode MS,8,N - + E78B14FB-C2C3-4DCA-A3B4-CA471817B9FC 1717726229 Administrator @@ -121756,7 +121803,7 @@ LABL 0 Arial Unicode MS,8,N - + 8C71D6B9-780B-4547-ADFD-986E619F4DCD 1719381914 Administrator @@ -121790,7 +121837,7 @@ LABL 0 Arial Unicode MS,8,N - + EB9D1A5A-99AB-44AD-9B1A-D45E66C0CFDE 1719468257 Administrator @@ -121824,7 +121871,7 @@ LABL 0 Arial Unicode MS,8,N - + ACF1454B-2C3F-40E5-ADC5-4A48787EB937 1720488320 Administrator @@ -121858,7 +121905,7 @@ LABL 0 Arial Unicode MS,8,N - + 4E2F7E88-B341-46EF-9615-25AF4AAC9802 1721280189 Administrator @@ -121892,7 +121939,7 @@ LABL 0 Arial Unicode MS,8,N - + CE1833FA-A783-4FAC-87BF-AA0FF8008532 1721280283 Administrator @@ -121914,7 +121961,7 @@ LABL 0 Arial Unicode MS,8,N - + A1DD77B6-E48E-4C9D-947D-D42E3C5240C2 dbo dbo @@ -121927,7 +121974,7 @@ LABL 0 Arial Unicode MS,8,N - + C012A467-0031-4F3C-9D9D-13408491E147 DefaultSchema 1597196432 @@ -121935,12 +121982,12 @@ LABL 0 Arial Unicode MS,8,N 1597196433 ttsoftxch - + - + 41D2B655-5319-49C5-9BA6-133BB8B097CA dbo dbo @@ -121952,7 +121999,7 @@ LABL 0 Arial Unicode MS,8,N - + 2153E033-C4DC-4F90-B2F4-3B0F44BD33D5 文本 TEXT @@ -121962,7 +122009,7 @@ LABL 0 Arial Unicode MS,8,N ttsoftxch text - + AC8799D0-82CA-4B70-ADAC-18D8797720A9 图片 IMAGE @@ -121972,7 +122019,7 @@ LABL 0 Arial Unicode MS,8,N Administrator image - + DEC04470-B84A-413E-9B2A-C265C5506182 加密 ENCRYPT_STRING @@ -122040,7 +122087,7 @@ LABL 0 Arial Unicode MS,8,N varchar(4000) 4000 - + 703A2917-B6C4-4BC6-B2CB-6AB8E2B49D30 短字符串 SHORT_STRING @@ -122051,7 +122098,7 @@ LABL 0 Arial Unicode MS,8,N varchar(64) 64 - + 89A476D2-A1C0-428C-9875-26A50B7AFE1A 长字符串 LONG_STRING @@ -122073,7 +122120,7 @@ LABL 0 Arial Unicode MS,8,N varchar(2000) 2000 - + @@ -122151,7 +122198,7 @@ LABL 0 Arial Unicode MS,8,N varchar(32) 32 - + CB2F08D6-BE17-4046-B94A-4FD00EDA9015 文件 FILE @@ -122174,7 +122221,7 @@ LABL 0 Arial Unicode MS,8,N - + B41C21E8-76E9-4031-8EF0-34743E5525C5 PUBLIC PUBLIC @@ -122183,13 +122230,13 @@ LABL 0 Arial Unicode MS,8,N 1597196433 ttsoftxch - - + + - + 02EF92C9-49BF-45C7-934A-23BA290D5595 Microsoft SQL Server 2008 MSSQLSRV2008 diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateRuleController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateRuleController.cs new file mode 100644 index 00000000..f135f276 --- /dev/null +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateRuleController.cs @@ -0,0 +1,14 @@ +namespace Tiobon.Core.Api.Controllers; + +/// +/// 培训证书规则(Controller) +/// +[Route("api/[controller]")] +[ApiController, GlobalActionFilter] +[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)] +public class Ghre_CertificateRuleController : BaseController +{ + public Ghre_CertificateRuleController(IGhre_CertificateRuleServices 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 4ca656d5..9c322181 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -1145,6 +1145,141 @@ 预留字段12 + + + 培训证书规则 (Dto.Base) + + + + + 规则类型 + + + + + 规则编号 + + + + + 证书名称 + + + + + 课程场景ID + + + + + 课程ID + + + + + 有效期类型 + + + + + 固定数 + + + + + 固定类型 + + + + + 有效期 + + + + + 发放规则 + + + + + 分数 + + + + + 分数1 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 课程 (Dto.Base) @@ -4502,6 +4637,11 @@ 培训记录 (Dto.EditInput) + + + 培训证书规则 (Dto.EditInput) + + 课程 (Dto.EditInput) @@ -4667,6 +4807,11 @@ 培训记录 (Dto.InsertInput) + + + 培训证书规则 (Dto.InsertInput) + + 课程 (Dto.InsertInput) @@ -6121,6 +6266,141 @@ 预留字段12 + + + 培训证书规则 (Model) + + + + + 规则类型 + + + + + 规则编号 + + + + + 证书名称 + + + + + 课程场景ID + + + + + 课程ID + + + + + 有效期类型 + + + + + 固定数 + + + + + 固定类型 + + + + + 有效期 + + + + + 发放规则 + + + + + 分数 + + + + + 分数1 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 课程 (Model) @@ -10427,6 +10707,36 @@ 来源 + + + 培训证书规则(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + + + + 证书分类 + + + + + 有效期 + + + + + 发放规则 + + 课程(Dto.View) diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index ad88f81a..e29fb0b3 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -587,6 +587,11 @@ 培训记录(Controller) + + + 培训证书规则(Controller) + + Ghre_CourseClass(Controller) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CertificateRuleServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CertificateRuleServices.cs new file mode 100644 index 00000000..2900719a --- /dev/null +++ b/Tiobon.Core.IServices/Ghre/IGhre_CertificateRuleServices.cs @@ -0,0 +1,12 @@ +using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model.Models; + +namespace Tiobon.Core.IServices +{ + /// + /// 培训证书规则(自定义服务接口) + /// + public interface IGhre_CertificateRuleServices :IBaseServices + { + } +} \ No newline at end of file diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_CertificateRule.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_CertificateRule.Dto.Base.cs new file mode 100644 index 00000000..f987e596 --- /dev/null +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_CertificateRule.Dto.Base.cs @@ -0,0 +1,176 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghre_CertificateRule.cs +* +*功 能: N / A +* 类 名: Ghre_CertificateRule +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/7/18 14:15:12 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace Tiobon.Core.Model.Models +{ + + /// + /// 培训证书规则 (Dto.Base) + /// + public class Ghre_CertificateRuleBase + { + + /// + /// 规则类型 + /// + [Display(Name = "RuleType"), Description("规则类型"), MaxLength(32, ErrorMessage = "规则类型 不能超过 32 个字符")] + public string RuleType { get; set; } + + /// + /// 规则编号 + /// + [Display(Name = "RuleNo"), Description("规则编号"), MaxLength(32, ErrorMessage = "规则编号 不能超过 32 个字符")] + public string RuleNo { get; set; } + + /// + /// 证书名称 + /// + [Display(Name = "CertificateName"), Description("证书名称"), MaxLength(32, ErrorMessage = "证书名称 不能超过 32 个字符")] + public string CertificateName { get; set; } + + /// + /// 课程场景ID + /// + public long? CourseSceneId { get; set; } + + /// + /// 课程ID + /// + public long? CourseId { get; set; } + + /// + /// 有效期类型 + /// + [Display(Name = "ValidityType"), Description("有效期类型"), MaxLength(32, ErrorMessage = "有效期类型 不能超过 32 个字符")] + public string ValidityType { get; set; } + + /// + /// 固定数 + /// + public int? StaticNum { get; set; } + + /// + /// 固定类型 + /// + [Display(Name = "StaticType"), Description("固定类型"), MaxLength(32, ErrorMessage = "固定类型 不能超过 32 个字符")] + public string StaticType { get; set; } + + /// + /// 有效期 + /// + public DateTime? ValidityTime { get; set; } + + /// + /// 发放规则 + /// + [Display(Name = "SendRule"), Description("发放规则"), MaxLength(32, ErrorMessage = "发放规则 不能超过 32 个字符")] + public string SendRule { get; set; } + + /// + /// 分数 + /// + public int? ScoreMin { get; set; } + + /// + /// 分数1 + /// + public int? ScoreMax { get; set; } + + /// + /// 备注 + /// + [Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")] + public string RemarkSz { get; set; } + + /// + /// 默认标志 + /// + public int? IsDefault { get; set; } + + /// + /// 预留字段1 + /// + [Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")] + public string Reverse1 { get; set; } + + /// + /// 预留字段2 + /// + [Display(Name = "Reverse2"), Description("预留字段2"), MaxLength(1000, ErrorMessage = "预留字段2 不能超过 1000 个字符")] + public string Reverse2 { get; set; } + + /// + /// 预留字段3 + /// + [Display(Name = "Reverse3"), Description("预留字段3"), MaxLength(1000, ErrorMessage = "预留字段3 不能超过 1000 个字符")] + public string Reverse3 { get; set; } + + /// + /// 预留字段4 + /// + [Display(Name = "Reverse4"), Description("预留字段4"), MaxLength(1000, ErrorMessage = "预留字段4 不能超过 1000 个字符")] + public string Reverse4 { get; set; } + + /// + /// 预留字段5 + /// + [Display(Name = "Reverse5"), Description("预留字段5"), MaxLength(1000, ErrorMessage = "预留字段5 不能超过 1000 个字符")] + public string Reverse5 { get; set; } + + /// + /// 预留字段6 + /// + [Display(Name = "Reverse6"), Description("预留字段6"), MaxLength(1000, ErrorMessage = "预留字段6 不能超过 1000 个字符")] + public string Reverse6 { get; set; } + + /// + /// 预留字段7 + /// + [Display(Name = "Reverse7"), Description("预留字段7"), MaxLength(1000, ErrorMessage = "预留字段7 不能超过 1000 个字符")] + public string Reverse7 { get; set; } + + /// + /// 预留字段8 + /// + [Display(Name = "Reverse8"), Description("预留字段8"), MaxLength(1000, ErrorMessage = "预留字段8 不能超过 1000 个字符")] + public string Reverse8 { get; set; } + + /// + /// 预留字段9 + /// + [Display(Name = "Reverse9"), Description("预留字段9"), MaxLength(1000, ErrorMessage = "预留字段9 不能超过 1000 个字符")] + public string Reverse9 { get; set; } + + /// + /// 预留字段10 + /// + [Display(Name = "Reverse10"), Description("预留字段10"), MaxLength(1000, ErrorMessage = "预留字段10 不能超过 1000 个字符")] + public string Reverse10 { get; set; } + + /// + /// 预留字段11 + /// + public int? ReverseI1 { get; set; } + + /// + /// 预留字段12 + /// + public int? ReverseI2 { get; set; } + } +} diff --git a/Tiobon.Core.Model/Edit/Ghre/Ghre_CertificateRule.Dto.EditInput.cs b/Tiobon.Core.Model/Edit/Ghre/Ghre_CertificateRule.Dto.EditInput.cs new file mode 100644 index 00000000..eb72732d --- /dev/null +++ b/Tiobon.Core.Model/Edit/Ghre/Ghre_CertificateRule.Dto.EditInput.cs @@ -0,0 +1,27 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghre_CertificateRule.cs +* +*功 能: N / A +* 类 名: Ghre_CertificateRule +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/7/18 14:15:12 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ + +namespace Tiobon.Core.Model.Models +{ + + /// + /// 培训证书规则 (Dto.EditInput) + /// + public class EditGhre_CertificateRuleInput : Ghre_CertificateRuleBase + { + } +} diff --git a/Tiobon.Core.Model/Entity/AttributeManager/EntityAttribute.cs b/Tiobon.Core.Model/Entity/AttributeManager/EntityAttribute.cs index 8251cf59..c31604a3 100644 --- a/Tiobon.Core.Model/Entity/AttributeManager/EntityAttribute.cs +++ b/Tiobon.Core.Model/Entity/AttributeManager/EntityAttribute.cs @@ -35,6 +35,6 @@ /// /// 是否校验唯一性 /// - public bool Unique { get; set; } + public bool Unique { get; set; } = true; } } diff --git a/Tiobon.Core.Model/Insert/Ghre/Ghre_CertificateRule.Dto.InsertInput.cs b/Tiobon.Core.Model/Insert/Ghre/Ghre_CertificateRule.Dto.InsertInput.cs new file mode 100644 index 00000000..1ea68496 --- /dev/null +++ b/Tiobon.Core.Model/Insert/Ghre/Ghre_CertificateRule.Dto.InsertInput.cs @@ -0,0 +1,27 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghre_CertificateRule.cs +* +*功 能: N / A +* 类 名: Ghre_CertificateRule +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/7/18 14:15:12 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ + +namespace Tiobon.Core.Model.Models +{ + + /// + /// 培训证书规则 (Dto.InsertInput) + /// + public class InsertGhre_CertificateRuleInput : Ghre_CertificateRuleBase + { + } +} diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_CertificateRule.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_CertificateRule.cs new file mode 100644 index 00000000..40b9c4c6 --- /dev/null +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_CertificateRule.cs @@ -0,0 +1,178 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghre_CertificateRule.cs +* +*功 能: N / A +* 类 名: Ghre_CertificateRule +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/7/18 14:15:12 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using SqlSugar; + +namespace Tiobon.Core.Model.Models +{ + + /// + /// 培训证书规则 (Model) + /// + [SugarTable("Ghre_CertificateRule", "Ghre_CertificateRule"), Entity(TableCnName = "培训证书规则", TableName = "Ghre_CertificateRule")] + public class Ghre_CertificateRule : BasePoco + { + + /// + /// 规则类型 + /// + [Display(Name = "RuleType"), Description("规则类型"), MaxLength(32, ErrorMessage = "规则类型 不能超过 32 个字符")] + public string RuleType { get; set; } + + /// + /// 规则编号 + /// + [Display(Name = "RuleNo"), Description("规则编号"), MaxLength(32, ErrorMessage = "规则编号 不能超过 32 个字符"), EntityColumn] + public string RuleNo { get; set; } + + /// + /// 证书名称 + /// + [Display(Name = "CertificateName"), Description("证书名称"), MaxLength(32, ErrorMessage = "证书名称 不能超过 32 个字符")] + public string CertificateName { get; set; } + + /// + /// 课程场景ID + /// + public long? CourseSceneId { get; set; } + + /// + /// 课程ID + /// + public long? CourseId { get; set; } + + /// + /// 有效期类型 + /// + [Display(Name = "ValidityType"), Description("有效期类型"), MaxLength(32, ErrorMessage = "有效期类型 不能超过 32 个字符")] + public string ValidityType { get; set; } + + /// + /// 固定数 + /// + public int? StaticNum { get; set; } + + /// + /// 固定类型 + /// + [Display(Name = "StaticType"), Description("固定类型"), MaxLength(32, ErrorMessage = "固定类型 不能超过 32 个字符")] + public string StaticType { get; set; } + + /// + /// 有效期 + /// + public DateTime? ValidityTime { get; set; } + + /// + /// 发放规则 + /// + [Display(Name = "SendRule"), Description("发放规则"), MaxLength(32, ErrorMessage = "发放规则 不能超过 32 个字符")] + public string SendRule { get; set; } + + /// + /// 分数 + /// + public int? ScoreMin { get; set; } + + /// + /// 分数1 + /// + public int? ScoreMax { get; set; } + + /// + /// 备注 + /// + [Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")] + public string RemarkSz { get; set; } + + /// + /// 默认标志 + /// + public int? IsDefault { get; set; } + + /// + /// 预留字段1 + /// + [Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")] + public string Reverse1 { get; set; } + + /// + /// 预留字段2 + /// + [Display(Name = "Reverse2"), Description("预留字段2"), MaxLength(1000, ErrorMessage = "预留字段2 不能超过 1000 个字符")] + public string Reverse2 { get; set; } + + /// + /// 预留字段3 + /// + [Display(Name = "Reverse3"), Description("预留字段3"), MaxLength(1000, ErrorMessage = "预留字段3 不能超过 1000 个字符")] + public string Reverse3 { get; set; } + + /// + /// 预留字段4 + /// + [Display(Name = "Reverse4"), Description("预留字段4"), MaxLength(1000, ErrorMessage = "预留字段4 不能超过 1000 个字符")] + public string Reverse4 { get; set; } + + /// + /// 预留字段5 + /// + [Display(Name = "Reverse5"), Description("预留字段5"), MaxLength(1000, ErrorMessage = "预留字段5 不能超过 1000 个字符")] + public string Reverse5 { get; set; } + + /// + /// 预留字段6 + /// + [Display(Name = "Reverse6"), Description("预留字段6"), MaxLength(1000, ErrorMessage = "预留字段6 不能超过 1000 个字符")] + public string Reverse6 { get; set; } + + /// + /// 预留字段7 + /// + [Display(Name = "Reverse7"), Description("预留字段7"), MaxLength(1000, ErrorMessage = "预留字段7 不能超过 1000 个字符")] + public string Reverse7 { get; set; } + + /// + /// 预留字段8 + /// + [Display(Name = "Reverse8"), Description("预留字段8"), MaxLength(1000, ErrorMessage = "预留字段8 不能超过 1000 个字符")] + public string Reverse8 { get; set; } + + /// + /// 预留字段9 + /// + [Display(Name = "Reverse9"), Description("预留字段9"), MaxLength(1000, ErrorMessage = "预留字段9 不能超过 1000 个字符")] + public string Reverse9 { get; set; } + + /// + /// 预留字段10 + /// + [Display(Name = "Reverse10"), Description("预留字段10"), MaxLength(1000, ErrorMessage = "预留字段10 不能超过 1000 个字符")] + public string Reverse10 { get; set; } + + /// + /// 预留字段11 + /// + public int? ReverseI1 { get; set; } + + /// + /// 预留字段12 + /// + public int? ReverseI2 { get; set; } + } +} diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_CertificateRule.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_CertificateRule.Dto.View.cs new file mode 100644 index 00000000..1fe3a5d2 --- /dev/null +++ b/Tiobon.Core.Model/View/Ghre/Ghre_CertificateRule.Dto.View.cs @@ -0,0 +1,51 @@ +/* 代码由框架生成,任何更改都可能导致被代码生成器覆盖,可自行修改。 +* Ghre_CertificateRule.cs +* +*功 能: N / A +* 类 名: Ghre_CertificateRule +* +* Ver 变更日期 负责人 变更内容 +* ─────────────────────────────────── +*V0.01 2024/7/18 14:15:12 SimonHsiao 初版 +* +* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. +*┌──────────────────────────────────┐ +*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ +*│ 作者:SimonHsiao │ +*└──────────────────────────────────┘ +*/ + +namespace Tiobon.Core.Model.Models; + +/// +/// 培训证书规则(Dto.View) +/// +public class Ghre_CertificateRuleDto : Ghre_CertificateRule +{ + /// + /// 创建信息 + /// + public string CreateDataInfo { get; set; } + + /// + /// 修改信息 + /// + public string UpdateDataInfo { get; set; } + + /// + /// 证书分类 + /// + public string RuleTypeLabel { get; set; } + + /// + /// 有效期 + /// + public string ValidityLabel { get; set; } + + + /// + /// 发放规则 + /// + public string SendRuleLabel { get; set; } + public string SceneOrCourseName { get; set; } +} diff --git a/Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs new file mode 100644 index 00000000..448622aa --- /dev/null +++ b/Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs @@ -0,0 +1,87 @@ + +using Tiobon.Core.IServices; +using Tiobon.Core.Model.Models; +using Tiobon.Core.Services.BASE; +using Tiobon.Core.IRepository.Base; +using Tiobon.Core.Common.Caches; +using Tiobon.Core.Common; +using Tiobon.Core.Model; +using Google.Protobuf.WellKnownTypes; +using Newtonsoft.Json.Linq; +using NPOI.Util.Collections; +using Newtonsoft.Json; + +namespace Tiobon.Core.Services; + +/// +/// 培训证书规则 (服务) +/// +public class Ghre_CertificateRuleServices : BaseServices, IGhre_CertificateRuleServices +{ + private readonly IBaseRepository _dal; + private readonly IGhre_CourseServices _ghre_CourseServices; + private readonly IGhre_CourseSceneServices _ghre_CourseSceneServices; + public Ghre_CertificateRuleServices(ICaching caching, + IGhre_CourseServices ghre_CourseServices, + IGhre_CourseSceneServices ghre_CourseSceneServices, + IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + base._caching = caching; + _ghre_CourseServices = ghre_CourseServices; + _ghre_CourseSceneServices = ghre_CourseSceneServices; + } + + public override async Task> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) + { + if (filter.jsonParam != null) + foreach (JProperty jProperty in filter.jsonParam.Properties()) + { + var name = jProperty.Name; + var value = jProperty.Value.ToString(); + if (!string.IsNullOrWhiteSpace(value) && name == "CourseName") + { + var jsonParam = JsonConvert.DeserializeObject(value); + + switch (jsonParam.operationKey) + { + case "Equal": + condition = $" ( CourseSceneId='{jsonParam.columnValue}' or CourseId='{jsonParam.columnValue}' )"; + break; + case "NotEqual": + condition = $"( CourseSceneId!='{{jsonParam.columnValue}}' AND CourseId!='{{jsonParam.columnValue}}' )\";"; + break; + default: + break; + } + } + } + var data = await base.QueryFilterPage(filter, condition, IsEnable); + var courseIds = data.result.DT_TableDataT1.Where(x => x.CourseSceneId != null || x.CourseId != null).Select(x => x.CourseId ?? x.CourseSceneId).Distinct().ToList(); + + var courses = await _ghre_CourseServices.Query(x => courseIds.Contains(x.Id)); + var courseScenes = await _ghre_CourseSceneServices.Query(x => courseIds.Contains(x.Id)); + + data.result.DT_TableDataT1.ForEach(async x => + { + x.RuleTypeLabel = await GetParaLabel("TrainingCertificateRuleType", x.RuleType); + x.SendRuleLabel = await GetParaLabel("TrainingCertificateSendRule", x.SendRule); + if (x.ValidityType == "StaticDuration") + x.ValidityLabel = $"自颁发日起 【{x.StaticNum}】{x.StaticType}内有效"; + else + if (x.ValidityType == "Unlimited") + x.ValidityLabel = $"自颁发日起终生有效"; + else + if (x.ValidityType == "Option") + x.ValidityLabel = $"有效期至【{x.ValidityTime.Value.ToString("yyyy-MM-dd")}】"; + if (x.CourseSceneId != null) + x.SceneOrCourseName = courseScenes.FirstOrDefault(o => o.Id == x.CourseSceneId)?.SceneName; + + if (x.CourseId != null) + x.SceneOrCourseName = courses.FirstOrDefault(o => o.Id == x.CourseId)?.CourseName; + }); + return data; + + } +} \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 4ca656d5..9c322181 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -1145,6 +1145,141 @@ 预留字段12 + + + 培训证书规则 (Dto.Base) + + + + + 规则类型 + + + + + 规则编号 + + + + + 证书名称 + + + + + 课程场景ID + + + + + 课程ID + + + + + 有效期类型 + + + + + 固定数 + + + + + 固定类型 + + + + + 有效期 + + + + + 发放规则 + + + + + 分数 + + + + + 分数1 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 课程 (Dto.Base) @@ -4502,6 +4637,11 @@ 培训记录 (Dto.EditInput) + + + 培训证书规则 (Dto.EditInput) + + 课程 (Dto.EditInput) @@ -4667,6 +4807,11 @@ 培训记录 (Dto.InsertInput) + + + 培训证书规则 (Dto.InsertInput) + + 课程 (Dto.InsertInput) @@ -6121,6 +6266,141 @@ 预留字段12 + + + 培训证书规则 (Model) + + + + + 规则类型 + + + + + 规则编号 + + + + + 证书名称 + + + + + 课程场景ID + + + + + 课程ID + + + + + 有效期类型 + + + + + 固定数 + + + + + 固定类型 + + + + + 有效期 + + + + + 发放规则 + + + + + 分数 + + + + + 分数1 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 课程 (Model) @@ -10427,6 +10707,36 @@ 来源 + + + 培训证书规则(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + + + + 证书分类 + + + + + 有效期 + + + + + 发放规则 + + 课程(Dto.View) diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index ad88f81a..e29fb0b3 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -587,6 +587,11 @@ 培训记录(Controller) + + + 培训证书规则(Controller) + + Ghre_CourseClass(Controller)