From 3ccfa6203f6a1066d0eef46da29783990d020aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A4=E5=85=B0?= Date: Wed, 23 Apr 2025 16:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Ghrp/Ghrp_PerformanceItem.cs | 20 +- .../Ghrp/Ghrp_PerformanceItem.Dto.View.cs | 21 +- .../Ghrp/Ghrp_PerformanceItemServices.cs | 30 +- Tiobon.Core/Tiobon.Core.Model.xml | 345 ++++++++++++++++++ Tiobon.Core/Tiobon.Core.xml | 5 + 5 files changed, 396 insertions(+), 25 deletions(-) diff --git a/Tiobon.Core.Model/Models/Ghrp/Ghrp_PerformanceItem.cs b/Tiobon.Core.Model/Models/Ghrp/Ghrp_PerformanceItem.cs index a4dfb31f..ea2a150d 100644 --- a/Tiobon.Core.Model/Models/Ghrp/Ghrp_PerformanceItem.cs +++ b/Tiobon.Core.Model/Models/Ghrp/Ghrp_PerformanceItem.cs @@ -206,24 +206,6 @@ namespace Tiobon.Core.Model.Models /// 内置 /// public int? BuiltIn { get; set; } - public string ItemStatus - { - get - { - DateTime now = DateTime.Now; - - if (now < BeginDate) - { - return "2"; // 未生效 - } - - if (EndDate.HasValue) - { - return now > EndDate.Value ? "0" : "1"; // 0已失效 1生效中 - } - - return "1"; //生效中 - } - } + } } diff --git a/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformanceItem.Dto.View.cs b/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformanceItem.Dto.View.cs index 01ca679d..2a063489 100644 --- a/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformanceItem.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformanceItem.Dto.View.cs @@ -33,5 +33,24 @@ public class Ghrp_PerformanceItemDto : Ghrp_PerformanceItem public string UpdateDataInfo { get; set; } public string BeginDateStr => BeginDate?.ToString("yyyy-MM-dd") ?? string.Empty; public string EndDateStr => EndDate?.ToString("yyyy-MM-dd") ?? string.Empty; - + + public string ItemStatus + { + get + { + DateTime now = DateTime.Now; + + if (now < BeginDate) + { + return "未生效"; + } + + if (EndDate.HasValue) + { + return now > EndDate.Value ? "已失效" : "生效中"; + } + + return "生效中"; + } + } } diff --git a/Tiobon.Core.Services/Ghrp/Ghrp_PerformanceItemServices.cs b/Tiobon.Core.Services/Ghrp/Ghrp_PerformanceItemServices.cs index ef5e3b33..c666b01b 100644 --- a/Tiobon.Core.Services/Ghrp/Ghrp_PerformanceItemServices.cs +++ b/Tiobon.Core.Services/Ghrp/Ghrp_PerformanceItemServices.cs @@ -4,12 +4,14 @@ using Tiobon.Core.Model.Models; using Tiobon.Core.Services.BASE; using Tiobon.Core.IRepository.Base; using Tiobon.Core.Common.Caches; +using NPOI.SS.Formula.Functions; +using NPOI.Util.Collections; namespace Tiobon.Core.Services { - /// - /// 考核指标 (服务) - /// + /// + /// 考核指标 (服务) + /// public class Ghrp_PerformanceItemServices : BaseServices, IGhrp_PerformanceItemServices { private readonly IBaseRepository _dal; @@ -21,8 +23,26 @@ namespace Tiobon.Core.Services } public override async Task> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) - { + { + string? ItemStatus = null; + if (filter.jsonParam != null) + foreach (JProperty jProperty in filter.jsonParam.Properties()) + { + var name = jProperty.Name; + var value = jProperty.Value.ToString(); + if (name == "ItemStatus") + { + var jsonParam = JsonHelper.JsonToObj(value); + ItemStatus = jsonParam.columnValue.ToString(); + } + } + if (!string.IsNullOrEmpty(ItemStatus)) + { + condition = $@" (case when BeginDate > convert(date,getdate()) then '2' + when convert(date,getdate()) between ISNULL(BeginDate,'1900-01-01') and ISNULL(EndDate,'2099-01-01') then '1' + else '0' end ) = '{ItemStatus}' "; + } var result = await base.QueryFilterPage(filter, condition, IsEnable); result.result.DT_TableDataT1.ForEach(async x => @@ -34,7 +54,7 @@ namespace Tiobon.Core.Services x.DeptType = await GetParaLabel("PerformanceDeptType", x.DeptType); x.Tag1 = await GetParaLabel("PerformanceTag1", x.Tag1); x.Tag2 = await GetParaLabel("PerformanceTag2", x.Tag2); - x.Tag3 = await GetParaLabel("PerformanceTag3", x.Tag3); + x.Tag3 = await GetParaLabel("PerformanceTag3", x.Tag3); }); return result; diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index c537d061..ac92ccc8 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -15000,6 +15000,166 @@ DeptDataType + + + 考核指标 (Dto.Base) + + + + + 指标编号 + + + + + 指标内容 + + + + + 指标说明 + + + + + 目标达成说明 + + + + + 一级指标分类 + + + + + 二级指标分类 + + + + + 三级指标分类 + + + + + 默认权重(%) + + + + + 指标性质 + + + + + 评估部门分类 + + + + + 标签1 + + + + + 标签2 + + + + + 标签3 + + + + + 有效开始日 + + + + + 有效结束日 + + + + + 备注 + + + + + 排序 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + + + + 内置 + + 考核期间 (Dto.Base) @@ -17397,6 +17557,11 @@ Ghro_Dept (Dto.EditInput) + + + 考核指标 (Dto.EditInput) + + 考核期间 (Dto.EditInput) @@ -18023,6 +18188,11 @@ Ghro_Dept (Dto.InsertInput) + + + 考核指标 (Dto.InsertInput) + + 考核期间 (Dto.InsertInput) @@ -33267,6 +33437,166 @@ DeptDataType + + + 考核指标 (Model) + + + + + 指标编号 + + + + + 指标内容 + + + + + 指标说明 + + + + + 目标达成说明 + + + + + 一级指标分类 + + + + + 二级指标分类 + + + + + 三级指标分类 + + + + + 默认权重(%) + + + + + 指标性质 + + + + + 评估部门分类 + + + + + 标签1 + + + + + 标签2 + + + + + 标签3 + + + + + 有效开始日 + + + + + 有效结束日 + + + + + 备注 + + + + + 排序 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + + + + 内置 + + 考核期间 (Model) @@ -38413,6 +38743,21 @@ 修改信息 + + + 考核指标(Dto.View1) + + + + + 创建信息 + + + + + 修改信息 + + 考核期间(Dto.View1) diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 3fd58c19..6bbae7a7 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -2209,6 +2209,11 @@ Ghro_Dept(Controller) + + + 考核指标(Controller) + + 考核期间(Controller)