增加指标状态查询

master
孤兰 2 months ago
parent 498db4bbdf
commit 2985c5a070
  1. 19
      Tiobon.Core.Model/Models/Ghrp/Ghrp_PerformanceItem.cs
  2. 21
      Tiobon.Core.Model/View/Ghrp/Ghrp_PerformanceItem.Dto.View.cs
  3. 1
      Tiobon.Core.Services/Ghrp/Ghrp_PerformanceItemServices.cs

@ -206,5 +206,24 @@ namespace Tiobon.Core.Model.Models
/// 内置
/// </summary>
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"; //生效中
}
}
}
}

@ -33,24 +33,5 @@ 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 "2"; // 未生效
}
if (EndDate.HasValue)
{
return now > EndDate.Value ? "0" : "1"; // 0已失效 1生效中
}
return "1"; //生效中
}
}
}

@ -22,6 +22,7 @@ namespace Tiobon.Core.Services
public override async Task<ServicePageResult<Ghrp_PerformanceItemDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true)
{
var result = await base.QueryFilterPage(filter, condition, IsEnable);
result.result.DT_TableDataT1.ForEach(async x =>

Loading…
Cancel
Save