增加考核指标

master
孤兰 2 months ago
parent d217887018
commit 498db4bbdf
  1. 14
      Tiobon.Core.Api/Controllers/Ghrp/Ghrp_PerformanceItemController.cs
  2. 12
      Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceItemServices.cs
  3. 208
      Tiobon.Core.Model/Base/Ghrp/Ghrp_PerformanceItem.Dto.Base.cs
  4. 27
      Tiobon.Core.Model/Edit/Ghrp/Ghrp_PerformanceItem.Dto.EditInput.cs
  5. 27
      Tiobon.Core.Model/Insert/Ghrp/Ghrp_PerformanceItem.Dto.InsertInput.cs
  6. 210
      Tiobon.Core.Model/Models/Ghrp/Ghrp_PerformanceItem.cs
  7. 56
      Tiobon.Core.Model/View/Ghrp/Ghrp_PerformanceItem.Dto.View.cs
  8. 42
      Tiobon.Core.Services/Ghrp/Ghrp_PerformanceItemServices.cs

@ -0,0 +1,14 @@
namespace Tiobon.Core.Api.Controllers;
/// <summary>
/// 考核指标(Controller)
/// </summary>
[Route("api/[controller]")]
[ApiController, GlobalActionFilter]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghrp)]
public class Ghrp_PerformanceItemController : BaseController<IGhrp_PerformanceItemServices, Ghrp_PerformanceItem, Ghrp_PerformanceItemDto, InsertGhrp_PerformanceItemInput, EditGhrp_PerformanceItemInput>
{
public Ghrp_PerformanceItemController(IGhrp_PerformanceItemServices service) : base(service)
{
}
}

@ -0,0 +1,12 @@
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model.Models;
namespace Tiobon.Core.IServices
{
/// <summary>
/// 考核指标(自定义服务接口)
/// </summary>
public interface IGhrp_PerformanceItemServices :IBaseServices<Ghrp_PerformanceItem, Ghrp_PerformanceItemDto, InsertGhrp_PerformanceItemInput, EditGhrp_PerformanceItemInput>
{
}
}

@ -0,0 +1,208 @@
/* ,
* Ghrp_PerformanceItem.cs
*
* N / A
* Ghrp_PerformanceItem
*
* Ver
*
*V0.01 2025/4/23 14:05:59 SimonHsiao
*
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
*  
* SimonHsiao
*
*/
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Tiobon.Core.Model.Models
{
/// <summary>
/// 考核指标 (Dto.Base)
/// </summary>
public class Ghrp_PerformanceItemBase
{
/// <summary>
/// 指标编号
/// </summary>
[Display(Name = "ItemNo"), Description("指标编号"), MaxLength(500, ErrorMessage = "指标编号 不能超过 500 个字符")]
public string ItemNo { get; set; }
/// <summary>
/// 指标内容
/// </summary>
[Display(Name = "ItemName"), Description("指标内容"), MaxLength(-1, ErrorMessage = "指标内容 不能超过 -1 个字符")]
public string ItemName { get; set; }
/// <summary>
/// 指标说明
/// </summary>
[Display(Name = "ItemCaption"), Description("指标说明"), MaxLength(-1, ErrorMessage = "指标说明 不能超过 -1 个字符")]
public string ItemCaption { get; set; }
/// <summary>
/// 目标达成说明
/// </summary>
[Display(Name = "TargetCaption"), Description("目标达成说明"), MaxLength(-1, ErrorMessage = "目标达成说明 不能超过 -1 个字符")]
public string TargetCaption { get; set; }
/// <summary>
/// 一级指标分类
/// </summary>
[Display(Name = "ItemType1"), Description("一级指标分类"), MaxLength(255, ErrorMessage = "一级指标分类 不能超过 255 个字符")]
public string ItemType1 { get; set; }
/// <summary>
/// 二级指标分类
/// </summary>
[Display(Name = "ItemType2"), Description("二级指标分类"), MaxLength(255, ErrorMessage = "二级指标分类 不能超过 255 个字符")]
public string ItemType2 { get; set; }
/// <summary>
/// 三级指标分类
/// </summary>
[Display(Name = "ItemType3"), Description("三级指标分类"), MaxLength(255, ErrorMessage = "三级指标分类 不能超过 255 个字符")]
public string ItemType3 { get; set; }
/// <summary>
/// 默认权重(%)
/// </summary>
[Display(Name = "ItemWeight"), Description("默认权重(%)"), Column(TypeName = "decimal(18,2)")]
public decimal? ItemWeight { get; set; }
/// <summary>
/// 指标性质
/// </summary>
[Display(Name = "ItemKind"), Description("指标性质"), MaxLength(255, ErrorMessage = "指标性质 不能超过 255 个字符")]
public string ItemKind { get; set; }
/// <summary>
/// 评估部门分类
/// </summary>
[Display(Name = "DeptType"), Description("评估部门分类"), MaxLength(255, ErrorMessage = "评估部门分类 不能超过 255 个字符")]
public string DeptType { get; set; }
/// <summary>
/// 标签1
/// </summary>
[Display(Name = "Tag1"), Description("标签1"), MaxLength(255, ErrorMessage = "标签1 不能超过 255 个字符")]
public string Tag1 { get; set; }
/// <summary>
/// 标签2
/// </summary>
[Display(Name = "Tag2"), Description("标签2"), MaxLength(255, ErrorMessage = "标签2 不能超过 255 个字符")]
public string Tag2 { get; set; }
/// <summary>
/// 标签3
/// </summary>
[Display(Name = "Tag3"), Description("标签3"), MaxLength(255, ErrorMessage = "标签3 不能超过 255 个字符")]
public string Tag3 { get; set; }
/// <summary>
/// 有效开始日
/// </summary>
public DateTime? BeginDate { get; set; }
/// <summary>
/// 有效结束日
/// </summary>
public DateTime? EndDate { get; set; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")]
public string RemarkSz { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? SortNo { get; set; }
/// <summary>
/// 默认标志
/// </summary>
public int? IsDefault { get; set; }
/// <summary>
/// 预留字段1
/// </summary>
[Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")]
public string Reverse1 { get; set; }
/// <summary>
/// 预留字段2
/// </summary>
[Display(Name = "Reverse2"), Description("预留字段2"), MaxLength(1000, ErrorMessage = "预留字段2 不能超过 1000 个字符")]
public string Reverse2 { get; set; }
/// <summary>
/// 预留字段3
/// </summary>
[Display(Name = "Reverse3"), Description("预留字段3"), MaxLength(1000, ErrorMessage = "预留字段3 不能超过 1000 个字符")]
public string Reverse3 { get; set; }
/// <summary>
/// 预留字段4
/// </summary>
[Display(Name = "Reverse4"), Description("预留字段4"), MaxLength(1000, ErrorMessage = "预留字段4 不能超过 1000 个字符")]
public string Reverse4 { get; set; }
/// <summary>
/// 预留字段5
/// </summary>
[Display(Name = "Reverse5"), Description("预留字段5"), MaxLength(1000, ErrorMessage = "预留字段5 不能超过 1000 个字符")]
public string Reverse5 { get; set; }
/// <summary>
/// 预留字段6
/// </summary>
[Display(Name = "Reverse6"), Description("预留字段6"), MaxLength(1000, ErrorMessage = "预留字段6 不能超过 1000 个字符")]
public string Reverse6 { get; set; }
/// <summary>
/// 预留字段7
/// </summary>
[Display(Name = "Reverse7"), Description("预留字段7"), MaxLength(1000, ErrorMessage = "预留字段7 不能超过 1000 个字符")]
public string Reverse7 { get; set; }
/// <summary>
/// 预留字段8
/// </summary>
[Display(Name = "Reverse8"), Description("预留字段8"), MaxLength(1000, ErrorMessage = "预留字段8 不能超过 1000 个字符")]
public string Reverse8 { get; set; }
/// <summary>
/// 预留字段9
/// </summary>
[Display(Name = "Reverse9"), Description("预留字段9"), MaxLength(1000, ErrorMessage = "预留字段9 不能超过 1000 个字符")]
public string Reverse9 { get; set; }
/// <summary>
/// 预留字段10
/// </summary>
[Display(Name = "Reverse10"), Description("预留字段10"), MaxLength(1000, ErrorMessage = "预留字段10 不能超过 1000 个字符")]
public string Reverse10 { get; set; }
/// <summary>
/// 预留字段11
/// </summary>
public int? ReverseI1 { get; set; }
/// <summary>
/// 预留字段12
/// </summary>
public int? ReverseI2 { get; set; }
/// <summary>
/// 内置
/// </summary>
public int? BuiltIn { get; set; }
}
}

@ -0,0 +1,27 @@
/* ,
* Ghrp_PerformanceItem.cs
*
* N / A
* Ghrp_PerformanceItem
*
* Ver
*
*V0.01 2025/4/23 14:05:59 SimonHsiao
*
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
*  
* SimonHsiao
*
*/
namespace Tiobon.Core.Model.Models
{
/// <summary>
/// 考核指标 (Dto.EditInput)
/// </summary>
public class EditGhrp_PerformanceItemInput : Ghrp_PerformanceItemBase
{
}
}

@ -0,0 +1,27 @@
/* ,
* Ghrp_PerformanceItem.cs
*
* N / A
* Ghrp_PerformanceItem
*
* Ver
*
*V0.01 2025/4/23 14:05:59 SimonHsiao
*
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
*  
* SimonHsiao
*
*/
namespace Tiobon.Core.Model.Models
{
/// <summary>
/// 考核指标 (Dto.InsertInput)
/// </summary>
public class InsertGhrp_PerformanceItemInput : Ghrp_PerformanceItemBase
{
}
}

@ -0,0 +1,210 @@
/* ,
* Ghrp_PerformanceItem.cs
*
* N / A
* Ghrp_PerformanceItem
*
* Ver
*
*V0.01 2025/4/23 14:05:59 SimonHsiao
*
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
*  
* SimonHsiao
*
*/
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using SqlSugar;
namespace Tiobon.Core.Model.Models
{
/// <summary>
/// 考核指标 (Model)
/// </summary>
[SugarTable("Ghrp_PerformanceItem", "Ghrp_PerformanceItem"), Entity(TableCnName = "考核指标", TableName = "Ghrp_PerformanceItem")]
public class Ghrp_PerformanceItem : BasePoco
{
/// <summary>
/// 指标编号
/// </summary>
[Display(Name = "ItemNo"), Description("指标编号"), MaxLength(500, ErrorMessage = "指标编号 不能超过 500 个字符")]
public string ItemNo { get; set; }
/// <summary>
/// 指标内容
/// </summary>
[Display(Name = "ItemName"), Description("指标内容"), MaxLength(-1, ErrorMessage = "指标内容 不能超过 -1 个字符")]
public string ItemName { get; set; }
/// <summary>
/// 指标说明
/// </summary>
[Display(Name = "ItemCaption"), Description("指标说明"), MaxLength(-1, ErrorMessage = "指标说明 不能超过 -1 个字符")]
public string ItemCaption { get; set; }
/// <summary>
/// 目标达成说明
/// </summary>
[Display(Name = "TargetCaption"), Description("目标达成说明"), MaxLength(-1, ErrorMessage = "目标达成说明 不能超过 -1 个字符")]
public string TargetCaption { get; set; }
/// <summary>
/// 一级指标分类
/// </summary>
[Display(Name = "ItemType1"), Description("一级指标分类"), MaxLength(255, ErrorMessage = "一级指标分类 不能超过 255 个字符")]
public string ItemType1 { get; set; }
/// <summary>
/// 二级指标分类
/// </summary>
[Display(Name = "ItemType2"), Description("二级指标分类"), MaxLength(255, ErrorMessage = "二级指标分类 不能超过 255 个字符")]
public string ItemType2 { get; set; }
/// <summary>
/// 三级指标分类
/// </summary>
[Display(Name = "ItemType3"), Description("三级指标分类"), MaxLength(255, ErrorMessage = "三级指标分类 不能超过 255 个字符")]
public string ItemType3 { get; set; }
/// <summary>
/// 默认权重(%)
/// </summary>
[Display(Name = "ItemWeight"), Description("默认权重(%)"), Column(TypeName = "decimal(18,2)")]
public decimal? ItemWeight { get; set; }
/// <summary>
/// 指标性质
/// </summary>
[Display(Name = "ItemKind"), Description("指标性质"), MaxLength(255, ErrorMessage = "指标性质 不能超过 255 个字符")]
public string ItemKind { get; set; }
/// <summary>
/// 评估部门分类
/// </summary>
[Display(Name = "DeptType"), Description("评估部门分类"), MaxLength(255, ErrorMessage = "评估部门分类 不能超过 255 个字符")]
public string DeptType { get; set; }
/// <summary>
/// 标签1
/// </summary>
[Display(Name = "Tag1"), Description("标签1"), MaxLength(255, ErrorMessage = "标签1 不能超过 255 个字符")]
public string Tag1 { get; set; }
/// <summary>
/// 标签2
/// </summary>
[Display(Name = "Tag2"), Description("标签2"), MaxLength(255, ErrorMessage = "标签2 不能超过 255 个字符")]
public string Tag2 { get; set; }
/// <summary>
/// 标签3
/// </summary>
[Display(Name = "Tag3"), Description("标签3"), MaxLength(255, ErrorMessage = "标签3 不能超过 255 个字符")]
public string Tag3 { get; set; }
/// <summary>
/// 有效开始日
/// </summary>
public DateTime? BeginDate { get; set; }
/// <summary>
/// 有效结束日
/// </summary>
public DateTime? EndDate { get; set; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")]
public string RemarkSz { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? SortNo { get; set; }
/// <summary>
/// 默认标志
/// </summary>
public int? IsDefault { get; set; }
/// <summary>
/// 预留字段1
/// </summary>
[Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")]
public string Reverse1 { get; set; }
/// <summary>
/// 预留字段2
/// </summary>
[Display(Name = "Reverse2"), Description("预留字段2"), MaxLength(1000, ErrorMessage = "预留字段2 不能超过 1000 个字符")]
public string Reverse2 { get; set; }
/// <summary>
/// 预留字段3
/// </summary>
[Display(Name = "Reverse3"), Description("预留字段3"), MaxLength(1000, ErrorMessage = "预留字段3 不能超过 1000 个字符")]
public string Reverse3 { get; set; }
/// <summary>
/// 预留字段4
/// </summary>
[Display(Name = "Reverse4"), Description("预留字段4"), MaxLength(1000, ErrorMessage = "预留字段4 不能超过 1000 个字符")]
public string Reverse4 { get; set; }
/// <summary>
/// 预留字段5
/// </summary>
[Display(Name = "Reverse5"), Description("预留字段5"), MaxLength(1000, ErrorMessage = "预留字段5 不能超过 1000 个字符")]
public string Reverse5 { get; set; }
/// <summary>
/// 预留字段6
/// </summary>
[Display(Name = "Reverse6"), Description("预留字段6"), MaxLength(1000, ErrorMessage = "预留字段6 不能超过 1000 个字符")]
public string Reverse6 { get; set; }
/// <summary>
/// 预留字段7
/// </summary>
[Display(Name = "Reverse7"), Description("预留字段7"), MaxLength(1000, ErrorMessage = "预留字段7 不能超过 1000 个字符")]
public string Reverse7 { get; set; }
/// <summary>
/// 预留字段8
/// </summary>
[Display(Name = "Reverse8"), Description("预留字段8"), MaxLength(1000, ErrorMessage = "预留字段8 不能超过 1000 个字符")]
public string Reverse8 { get; set; }
/// <summary>
/// 预留字段9
/// </summary>
[Display(Name = "Reverse9"), Description("预留字段9"), MaxLength(1000, ErrorMessage = "预留字段9 不能超过 1000 个字符")]
public string Reverse9 { get; set; }
/// <summary>
/// 预留字段10
/// </summary>
[Display(Name = "Reverse10"), Description("预留字段10"), MaxLength(1000, ErrorMessage = "预留字段10 不能超过 1000 个字符")]
public string Reverse10 { get; set; }
/// <summary>
/// 预留字段11
/// </summary>
public int? ReverseI1 { get; set; }
/// <summary>
/// 预留字段12
/// </summary>
public int? ReverseI2 { get; set; }
/// <summary>
/// 内置
/// </summary>
public int? BuiltIn { get; set; }
}
}

@ -0,0 +1,56 @@
/* ,
* Ghrp_PerformanceItem.cs
*
* N / A
* Ghrp_PerformanceItem
*
* Ver
*
*V0.01 2025/4/23 14:05:59 SimonHsiao
*
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
*  
* SimonHsiao
*
*/
namespace Tiobon.Core.Model.Models;
/// <summary>
/// 考核指标(Dto.View1)
/// </summary>
public class Ghrp_PerformanceItemDto : Ghrp_PerformanceItem
{
/// <summary>
/// 创建信息
/// </summary>
public string CreateDataInfo { get; set; }
/// <summary>
/// 修改信息
/// </summary>
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"; //生效中
}
}
}

@ -0,0 +1,42 @@

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
{
/// <summary>
/// 考核指标 (服务)
/// </summary>
public class Ghrp_PerformanceItemServices : BaseServices<Ghrp_PerformanceItem, Ghrp_PerformanceItemDto, InsertGhrp_PerformanceItemInput, EditGhrp_PerformanceItemInput>, IGhrp_PerformanceItemServices
{
private readonly IBaseRepository<Ghrp_PerformanceItem> _dal;
public Ghrp_PerformanceItemServices(ICaching caching, IBaseRepository<Ghrp_PerformanceItem> dal)
{
this._dal = dal;
base.BaseDal = dal;
base._caching = caching;
}
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 =>
{
x.ItemType1 = await GetParaLabel("PerformanceItemType1", x.ItemType1);
x.ItemType2 = await GetParaLabel("PerformanceItemType2", x.ItemType2);
x.ItemType3 = await GetParaLabel("PerformanceItemType3", x.ItemType3);
x.ItemKind = await GetParaLabel("PerformanceItemKind", x.ItemKind);
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);
});
return result;
}
}
}
Loading…
Cancel
Save