From 6233ceb686cd5c940fa9cd1d0911402bedd4437d Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 2 Jan 2025 13:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=9B=E8=81=98=E6=A8=A1=E5=9D=97=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghrs/Ghrs_LangKeyController.cs | 10 + Tiobon.Core.Api/Tiobon.Core.xml | 6 + .../Ghrs/IGhrs_LangKeyServices.cs | 19 +- .../Base/Ghrs/Ghrs_LangKey.Dto.Base.cs | 310 +++++++++--------- .../Edit/Ghrs/Ghrs_LangKey.Dto.EditInput.cs | 15 +- .../Ghrs/Ghrs_LangKey.Dto.InsertInput.cs | 15 +- .../View/Ghrs/Ghrs_LangKey.Dto.View.cs | 18 +- Tiobon.Core.Services/CommonServices.cs | 42 ++- .../Ghre/Ghre_CourseServices.cs | 5 +- .../Ghrh/Ghrh_ResumeServices.cs | 2 +- .../Ghrs/Ghrs_LangKeyServices.cs | 43 ++- Tiobon.Core/Tiobon.Core.xml | 6 + 12 files changed, 276 insertions(+), 215 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghrs/Ghrs_LangKeyController.cs b/Tiobon.Core.Api/Controllers/Ghrs/Ghrs_LangKeyController.cs index 9e192194..e0cc70f7 100644 --- a/Tiobon.Core.Api/Controllers/Ghrs/Ghrs_LangKeyController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrs/Ghrs_LangKeyController.cs @@ -11,4 +11,14 @@ public class Ghrs_LangKeyController : BaseController + /// 获取模块信息接口 + /// + /// + [HttpPost, Route("Generate")] + public async Task GetESSModuleInfoAsync() + { + return await _service.Generate(); + } } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index f555169a..e4bc20c5 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1850,6 +1850,12 @@ Ghrs_LangKey(Controller) + + + 获取模块信息接口 + + + Ghrs_ListCommonSql(Controller) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs index 7e41b861..03e7347e 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs @@ -1,12 +1,15 @@ using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model; using Tiobon.Core.Model.Models; -namespace Tiobon.Core.IServices -{ - /// - /// Ghrs_LangKey(自定义服务接口) - /// - public interface IGhrs_LangKeyServices :IBaseServices - { - } +namespace Tiobon.Core.IServices; + +/// +/// Ghrs_LangKey(自定义服务接口) +/// +public interface IGhrs_LangKeyServices : IBaseServices +{ + + Task Generate(); + } \ No newline at end of file diff --git a/Tiobon.Core.Model/Base/Ghrs/Ghrs_LangKey.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghrs/Ghrs_LangKey.Dto.Base.cs index abb852b3..a43315b7 100644 --- a/Tiobon.Core.Model/Base/Ghrs/Ghrs_LangKey.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghrs/Ghrs_LangKey.Dto.Base.cs @@ -13,165 +13,161 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; +*/ +namespace Tiobon.Core.Model.Models; -namespace Tiobon.Core.Model.Models + +/// +/// Ghrs_LangKey (Dto.Base) +/// +public class Ghrs_LangKeyBase { /// - /// Ghrs_LangKey (Dto.Base) - /// - public class Ghrs_LangKeyBase - { - - /// - /// 多语设定(语言别,Key Value对应表) - /// - public int? LangKeyID { get; set; } - - /// - /// 语言别 ID - /// - public int? LangID { get; set; } - - /// - /// 语言Key - /// - [Display(Name = "LangKey"), Description("语言Key"), MaxLength(100, ErrorMessage = "语言Key 不能超过 100 个字符")] - public string LangKey { get; set; } - - /// - /// LangKeyType - /// - [Display(Name = "LangKeyType"), Description("LangKeyType"), MaxLength(100, ErrorMessage = "LangKeyType 不能超过 100 个字符")] - public string LangKeyType { get; set; } - - /// - /// 语言值 - /// - [Display(Name = "LangValue"), Description("语言值"), MaxLength(-1, ErrorMessage = "语言值 不能超过 -1 个字符")] - public string LangValue { get; set; } - - /// - /// Value01 - /// - [Display(Name = "Value01"), Description("Value01"), MaxLength(-1, ErrorMessage = "Value01 不能超过 -1 个字符")] - public string Value01 { get; set; } - - /// - /// Value02 - /// - [Display(Name = "Value02"), Description("Value02"), MaxLength(-1, ErrorMessage = "Value02 不能超过 -1 个字符")] - public string Value02 { get; set; } - - /// - /// Value03 - /// - [Display(Name = "Value03"), Description("Value03"), MaxLength(-1, ErrorMessage = "Value03 不能超过 -1 个字符")] - public string Value03 { get; set; } - - /// - /// Value04 - /// - [Display(Name = "Value04"), Description("Value04"), MaxLength(-1, ErrorMessage = "Value04 不能超过 -1 个字符")] - public string Value04 { get; set; } - - /// - /// Value05 - /// - [Display(Name = "Value05"), Description("Value05"), MaxLength(-1, ErrorMessage = "Value05 不能超过 -1 个字符")] - public string Value05 { get; set; } - - /// - /// Value06 - /// - [Display(Name = "Value06"), Description("Value06"), MaxLength(-1, ErrorMessage = "Value06 不能超过 -1 个字符")] - public string Value06 { get; set; } - - /// - /// Value07 - /// - [Display(Name = "Value07"), Description("Value07"), MaxLength(-1, ErrorMessage = "Value07 不能超过 -1 个字符")] - public string Value07 { get; set; } - - /// - /// Value08 - /// - [Display(Name = "Value08"), Description("Value08"), MaxLength(-1, ErrorMessage = "Value08 不能超过 -1 个字符")] - public string Value08 { get; set; } - - /// - /// Value09 - /// - [Display(Name = "Value09"), Description("Value09"), MaxLength(-1, ErrorMessage = "Value09 不能超过 -1 个字符")] - public string Value09 { get; set; } - - /// - /// Value10 - /// - [Display(Name = "Value10"), Description("Value10"), MaxLength(-1, ErrorMessage = "Value10 不能超过 -1 个字符")] - public string Value10 { get; set; } - - /// - /// RemarkSz - /// - [Display(Name = "RemarkSz"), Description("RemarkSz"), MaxLength(2000, ErrorMessage = "RemarkSz 不能超过 2000 个字符")] - public string RemarkSz { get; set; } - - /// - /// SortNo - /// - public int? SortNo { get; set; } - - /// - /// IsDefault - /// - public int? IsDefault { get; set; } - - /// - /// CompanyID - /// - public int? CompanyID { get; set; } - - /// - /// Reverse1 - /// - [Display(Name = "Reverse1"), Description("Reverse1"), MaxLength(-1, ErrorMessage = "Reverse1 不能超过 -1 个字符")] - public string Reverse1 { get; set; } - - /// - /// Reverse2 - /// - [Display(Name = "Reverse2"), Description("Reverse2"), MaxLength(-1, ErrorMessage = "Reverse2 不能超过 -1 个字符")] - public string Reverse2 { get; set; } - - /// - /// Reverse3 - /// - [Display(Name = "Reverse3"), Description("Reverse3"), MaxLength(-1, ErrorMessage = "Reverse3 不能超过 -1 个字符")] - public string Reverse3 { get; set; } - - /// - /// Reverse4 - /// - public int? Reverse4 { get; set; } - - /// - /// Reverse5 - /// - public int? Reverse5 { get; set; } - - /// - /// TableName - /// - [Display(Name = "TableName"), Description("TableName"), MaxLength(100, ErrorMessage = "TableName 不能超过 100 个字符")] - public string TableName { get; set; } - - /// - /// TableID - /// - public int? TableID { get; set; } - } + /// 多语设定(语言别,Key Value对应表) + /// + public int? LangKeyID { get; set; } + + /// + /// 语言别 ID + /// + public int? LangID { get; set; } + + /// + /// 语言Key + /// + [Display(Name = "LangKey"), Description("语言Key"), MaxLength(100, ErrorMessage = "语言Key 不能超过 100 个字符")] + public string LangKey { get; set; } + + /// + /// LangKeyType + /// + [Display(Name = "LangKeyType"), Description("LangKeyType"), MaxLength(100, ErrorMessage = "LangKeyType 不能超过 100 个字符")] + public string LangKeyType { get; set; } + + /// + /// 语言值 + /// + [Display(Name = "LangValue"), Description("语言值"), MaxLength(-1, ErrorMessage = "语言值 不能超过 -1 个字符")] + public string LangValue { get; set; } + + /// + /// Value01 + /// + [Display(Name = "Value01"), Description("Value01"), MaxLength(-1, ErrorMessage = "Value01 不能超过 -1 个字符")] + public string Value01 { get; set; } + + /// + /// Value02 + /// + [Display(Name = "Value02"), Description("Value02"), MaxLength(-1, ErrorMessage = "Value02 不能超过 -1 个字符")] + public string Value02 { get; set; } + + /// + /// Value03 + /// + [Display(Name = "Value03"), Description("Value03"), MaxLength(-1, ErrorMessage = "Value03 不能超过 -1 个字符")] + public string Value03 { get; set; } + + /// + /// Value04 + /// + [Display(Name = "Value04"), Description("Value04"), MaxLength(-1, ErrorMessage = "Value04 不能超过 -1 个字符")] + public string Value04 { get; set; } + + /// + /// Value05 + /// + [Display(Name = "Value05"), Description("Value05"), MaxLength(-1, ErrorMessage = "Value05 不能超过 -1 个字符")] + public string Value05 { get; set; } + + /// + /// Value06 + /// + [Display(Name = "Value06"), Description("Value06"), MaxLength(-1, ErrorMessage = "Value06 不能超过 -1 个字符")] + public string Value06 { get; set; } + + /// + /// Value07 + /// + [Display(Name = "Value07"), Description("Value07"), MaxLength(-1, ErrorMessage = "Value07 不能超过 -1 个字符")] + public string Value07 { get; set; } + + /// + /// Value08 + /// + [Display(Name = "Value08"), Description("Value08"), MaxLength(-1, ErrorMessage = "Value08 不能超过 -1 个字符")] + public string Value08 { get; set; } + + /// + /// Value09 + /// + [Display(Name = "Value09"), Description("Value09"), MaxLength(-1, ErrorMessage = "Value09 不能超过 -1 个字符")] + public string Value09 { get; set; } + + /// + /// Value10 + /// + [Display(Name = "Value10"), Description("Value10"), MaxLength(-1, ErrorMessage = "Value10 不能超过 -1 个字符")] + public string Value10 { get; set; } + + /// + /// RemarkSz + /// + [Display(Name = "RemarkSz"), Description("RemarkSz"), MaxLength(2000, ErrorMessage = "RemarkSz 不能超过 2000 个字符")] + public string RemarkSz { get; set; } + + /// + /// SortNo + /// + public int? SortNo { get; set; } + + /// + /// IsDefault + /// + public int? IsDefault { get; set; } + + /// + /// CompanyID + /// + public int? CompanyID { get; set; } + + /// + /// Reverse1 + /// + [Display(Name = "Reverse1"), Description("Reverse1"), MaxLength(-1, ErrorMessage = "Reverse1 不能超过 -1 个字符")] + public string Reverse1 { get; set; } + + /// + /// Reverse2 + /// + [Display(Name = "Reverse2"), Description("Reverse2"), MaxLength(-1, ErrorMessage = "Reverse2 不能超过 -1 个字符")] + public string Reverse2 { get; set; } + + /// + /// Reverse3 + /// + [Display(Name = "Reverse3"), Description("Reverse3"), MaxLength(-1, ErrorMessage = "Reverse3 不能超过 -1 个字符")] + public string Reverse3 { get; set; } + + /// + /// Reverse4 + /// + public int? Reverse4 { get; set; } + + /// + /// Reverse5 + /// + public int? Reverse5 { get; set; } + + /// + /// TableName + /// + [Display(Name = "TableName"), Description("TableName"), MaxLength(100, ErrorMessage = "TableName 不能超过 100 个字符")] + public string TableName { get; set; } + + /// + /// TableID + /// + public int? TableID { get; set; } } diff --git a/Tiobon.Core.Model/Edit/Ghrs/Ghrs_LangKey.Dto.EditInput.cs b/Tiobon.Core.Model/Edit/Ghrs/Ghrs_LangKey.Dto.EditInput.cs index fb28373b..ece8a480 100644 --- a/Tiobon.Core.Model/Edit/Ghrs/Ghrs_LangKey.Dto.EditInput.cs +++ b/Tiobon.Core.Model/Edit/Ghrs/Ghrs_LangKey.Dto.EditInput.cs @@ -15,13 +15,12 @@ *└──────────────────────────────────┘ */ -namespace Tiobon.Core.Model.Models -{ +namespace Tiobon.Core.Model.Models; + - /// - /// Ghrs_LangKey (Dto.EditInput) - /// - public class EditGhrs_LangKeyInput : Ghrs_LangKeyBase - { - } +/// +/// Ghrs_LangKey (Dto.EditInput) +/// +public class EditGhrs_LangKeyInput : Ghrs_LangKeyBase +{ } diff --git a/Tiobon.Core.Model/Insert/Ghrs/Ghrs_LangKey.Dto.InsertInput.cs b/Tiobon.Core.Model/Insert/Ghrs/Ghrs_LangKey.Dto.InsertInput.cs index e02a4c09..98330e26 100644 --- a/Tiobon.Core.Model/Insert/Ghrs/Ghrs_LangKey.Dto.InsertInput.cs +++ b/Tiobon.Core.Model/Insert/Ghrs/Ghrs_LangKey.Dto.InsertInput.cs @@ -15,13 +15,12 @@ *└──────────────────────────────────┘ */ -namespace Tiobon.Core.Model.Models -{ +namespace Tiobon.Core.Model.Models; + - /// - /// Ghrs_LangKey (Dto.InsertInput) - /// - public class InsertGhrs_LangKeyInput : Ghrs_LangKeyBase - { - } +/// +/// Ghrs_LangKey (Dto.InsertInput) +/// +public class InsertGhrs_LangKeyInput : Ghrs_LangKeyBase +{ } diff --git a/Tiobon.Core.Model/View/Ghrs/Ghrs_LangKey.Dto.View.cs b/Tiobon.Core.Model/View/Ghrs/Ghrs_LangKey.Dto.View.cs index f77c1a7a..087dbafb 100644 --- a/Tiobon.Core.Model/View/Ghrs/Ghrs_LangKey.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrs/Ghrs_LangKey.Dto.View.cs @@ -13,7 +13,7 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ namespace Tiobon.Core.Model.Models; @@ -22,13 +22,13 @@ namespace Tiobon.Core.Model.Models; /// public class Ghrs_LangKeyDto : Ghrs_LangKey { -/// -/// 创建信息 -/// -public string CreateDataInfo { get; set; } + /// + /// 创建信息 + /// + public string CreateDataInfo { get; set; } -/// -/// 修改信息 -/// -public string UpdateDataInfo { get; set; } + /// + /// 修改信息 + /// + public string UpdateDataInfo { get; set; } } diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 17611ae5..cafd2020 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -817,7 +817,7 @@ public partial class CommonServices : BaseServices>, ICommon }); Db.Ado.CommitTran(); - sql = @"SELECT Langkey field, + string sqlLang = @"SELECT Langkey field, CASE {2} WHEN 1 THEN isnull (Value01, LangValue) WHEN 2 THEN isnull (Value02, LangValue) @@ -833,8 +833,7 @@ public partial class CommonServices : BaseServices>, ICommon FROM Ghrs_LangKey WHERE IsEnable = 1 AND (LangKey LIKE 'GHR_Page%' OR LangKey LIKE 'GHR_Common%')"; - sql = string.Format(sql, param.menuName, App.User.ID, param.langId); - result.DT_PageMutiMsg = Db.Ado.SqlQuery(sql); + sqlLang = string.Format(sqlLang, param.menuName, App.User.ID, param.langId); sql = "select QueryProcedure, EditProcedure, IUDProcedure from Ghrs_Menu where MenuNo='{0}'"; sql = string.Format(sql, param.menuName, App.User.ID, param.langId); @@ -851,7 +850,6 @@ public partial class CommonServices : BaseServices>, ICommon result.DT_Procedure.ExportExcel = result.DT_Procedure.EditProcedure.Replace("QueryForm", "ExportExcel"); } } - #endregion #region 特殊处理 @@ -1897,6 +1895,42 @@ public partial class CommonServices : BaseServices>, ICommon } #endregion + + #region 多语返回处理 + if (param.menuName == "F_ResumeMaintenance_All" || + param.menuName == "F_ResumeMaintenance_Process" || + param.menuName == "F_ResumeMaintenance_Hire" || + param.menuName == "F_ResumeMaintenance_Talent_Pool" || + param.menuName == "F_ResumeMaintenance_Recycled" || + param.menuName == "F_ResumeMaintenance_Blacklist" || + param.menuName == "F_ESS_Candidate" || + param.menuName == "F_ESS_Interview" || + param.menuName == "F_ESS_Hire" || + param.menuName == "F_ResumeMaintenance_Talent_Pool") + { + + sqlLang = @"SELECT Langkey field, + CASE {2} + WHEN 1 THEN isnull (Value01, LangValue) + WHEN 2 THEN isnull (Value02, LangValue) + WHEN 3 THEN isnull (Value03, LangValue) + WHEN 4 THEN isnull (Value04, LangValue) + WHEN 5 THEN isnull (Value05, LangValue) + WHEN 6 THEN isnull (Value06, LangValue) + WHEN 7 THEN isnull (Value07, LangValue) + WHEN 8 THEN isnull (Value08, LangValue) + WHEN 9 THEN isnull (Value09, LangValue) + WHEN 10 THEN isnull (Value10, LangValue) + END label + FROM Ghrs_LangKey + WHERE IsEnable = 1 + AND (LangKey LIKE 'F_ResumeMaintenance_%')"; + sqlLang = string.Format(sqlLang, param.menuName, App.User.ID, param.langId); + } + #endregion + + result.DT_PageMutiMsg = Db.Ado.SqlQuery(sqlLang); + return new ServiceResult() { Success = true, Message = "查询成功", Data = result, }; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs index 8b13da6b..0b88d758 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs @@ -1,6 +1,4 @@ -using NPOI.SS.Formula.Functions; -using NPOI.SS.UserModel; -using NPOI.Util; +using NPOI.SS.UserModel; using static Tiobon.Core.Model.Consts; namespace Tiobon.Core.Services; @@ -572,7 +570,6 @@ public class Ghre_CourseServices : BaseServices> ExportExcel(QueryExport body, string status) { QueryBody filter = new QueryBody(); diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index e933d7e6..a372109f 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -581,7 +581,7 @@ WHERE ParentMenuId = (SELECT MenuId for (int j = 0; j < tabs[i].Items.Count; j++) { var key = "Recruit_" + tabs[i].MenuName + "_" + tabs[i].Items[j].Key; - tabs[i].Items[j].ItemName = await QueryLangValue(key, langId, key); + tabs[i].Items[j].ItemName = await QueryLangValue(key, langId, tabs[i].Items[j].ItemName); } } diff --git a/Tiobon.Core.Services/Ghrs/Ghrs_LangKeyServices.cs b/Tiobon.Core.Services/Ghrs/Ghrs_LangKeyServices.cs index 1d8c685c..102dfc45 100644 --- a/Tiobon.Core.Services/Ghrs/Ghrs_LangKeyServices.cs +++ b/Tiobon.Core.Services/Ghrs/Ghrs_LangKeyServices.cs @@ -1,23 +1,34 @@ - -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 Microsoft.Extensions.Logging.Abstractions; -namespace Tiobon.Core.Services +namespace Tiobon.Core.Services; + +/// +/// Ghrs_LangKey (服务) +/// +public class Ghrs_LangKeyServices : BaseServices, IGhrs_LangKeyServices { - /// - /// Ghrs_LangKey (服务) - /// - public class Ghrs_LangKeyServices : BaseServices, IGhrs_LangKeyServices + private readonly IBaseRepository _dal; + public Ghrs_LangKeyServices(ICaching caching, IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + base._caching = caching; + } + + public async Task Generate() { - private readonly IBaseRepository _dal; - public Ghrs_LangKeyServices(ICaching caching, IBaseRepository dal) + + var entity =await base.QuerySingle(9801); + for (int i = 100; i < 146; i++) { - this._dal = dal; - base.BaseDal = dal; - base._caching = caching; + entity.CreateTime = DateTime.Now; + entity.UpdateTime = null; + entity.LangKey = "F_ResumeMaintenance_" + i.ToString().PadLeft(4, '0'); ; + await Db.Insertable(entity).ExecuteReturnIdentityAsync(); + } + + return ServiceResult.OprateSuccess(); + } } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index f555169a..e4bc20c5 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1850,6 +1850,12 @@ Ghrs_LangKey(Controller) + + + 获取模块信息接口 + + + Ghrs_ListCommonSql(Controller)