优化绩效期间查询

master
孤兰 2 months ago
parent 7bd6d6c92f
commit e04650af90
  1. 12
      Tiobon.Core.Api/Controllers/Base/BaseController.cs
  2. 2
      Tiobon.Core.Model/View/Ghrp/Ghrp_PerformancePeriodType.Dto.View.cs
  3. 8
      Tiobon.Core.Services/CommonServices.cs
  4. 24
      Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodServices.cs
  5. 11
      Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodTypeServices.cs
  6. 7
      Tiobon.Core/Tiobon.Core.xml

@ -42,6 +42,18 @@ public class BaseController<IServiceBase, TEntity, TEntityDto, TInsertDto, TEdit
return data;
}
/// <summary>
/// 查询作废
/// </summary>
/// <param name="body"></param>
/// <returns></returns>
[HttpPost, Route("QueryDel")]
public virtual async Task<ServicePageResult<TEntityDto>> QueryDel([FromBody] QueryBody body)
{
var data = (await InvokeServiceAsync("QueryFilterPage", [body, null, false])) as ServicePageResult<TEntityDto>;
return data;
}
public static T ConvertTo<T>(object input)
{
if (input == null)

@ -33,6 +33,8 @@ public class Ghrp_PerformancePeriodTypeDto : Ghrp_PerformancePeriodType
/// </summary>
public string UpdateDataInfo { get; set; }
public string DataBelongName { get; set; }
/// <summary>
/// 考核阶段名称
/// </summary>

@ -2437,20 +2437,22 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
result.DT_Procedure.ExportExcel = result.DT_Procedure.EditProcedure.Replace("QueryGroupForm", "ExportGroupExcel");
break;
case "F_PerformancePeriod":
case "F_PerformancePeriodType":
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault();
if (toolbar != null) toolbar.fnKey = "TBD1YN";
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault();
if (toolbar != null) toolbar.fnKey = "TBD2YN";
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault();
if (toolbar != null) toolbar.fnKey = "TBD3YN";
break;
case "F_PerformancePeriod":
result.JM_PageControlT1.Toolbar.Insert(0, new Toolbar()
{
display = true,
fnKey = "TBD4YN",
fnKey = "TBD1YN",
fnTitle = "考核期间展开",
fnType = "table",
icon = "ghr-publish",
icon = "ghr-batch-update",
position = "left"
});
break;

@ -35,6 +35,14 @@ namespace Tiobon.Core.Services
result.result.DT_TableDataT1.ForEach(async x =>
{
x.BeginDate = string.IsNullOrEmpty(x.BeginDate)?"":Convert.ToDateTime(x.BeginDate).ToString("yyyy-MM-dd");
x.EndDate = string.IsNullOrEmpty(x.EndDate) ? "" : Convert.ToDateTime(x.EndDate).ToString("yyyy-MM-dd");
x.StaffBeginDate = string.IsNullOrEmpty(x.StaffBeginDate) ? "" : Convert.ToDateTime(x.StaffBeginDate).ToString("yyyy-MM-dd");
x.StaffEndDate = string.IsNullOrEmpty(x.StaffEndDate) ? "" : Convert.ToDateTime(x.StaffEndDate).ToString("yyyy-MM-dd");
x.MGBeginDate = string.IsNullOrEmpty(x.MGBeginDate) ? "" : Convert.ToDateTime(x.MGBeginDate).ToString("yyyy-MM-dd");
x.MGEndDate = string.IsNullOrEmpty(x.MGEndDate) ? "" : Convert.ToDateTime(x.MGEndDate).ToString("yyyy-MM-dd");
x.OnJobBaseDate = string.IsNullOrEmpty(x.OnJobBaseDate) ? "" : Convert.ToDateTime(x.OnJobBaseDate).ToString("yyyy-MM-dd");
x.Stage = await GetParaLabel("PerformanceStage", x.Stage);
x.StageItem = await GetParaLabel("PerformanceStageItem", x.StageItem);
x.PerformancePeriodTypeName = await Db.Queryable<Ghrp_PerformancePeriodType>().Where(a => a.Id==x.PerformancePeriodTypeID).Select(x=> x.PeriodTypeName).FirstAsync();
@ -94,6 +102,8 @@ namespace Tiobon.Core.Services
Declare @MGDays int = '{MGDays}'
if @MGDays = 0 set @MGDays = null
Declare @OnJobBaseType nvarchar(100) ='{OnJobBaseType}'
Declare @GUID nvarchar(100) = NEWID();
;with PerformancePeriod as(
select top 999 ROW_NUMBER() over(order by PeriodTypeNo,b.Nums,c.SortNo) SortNo,
@YYYY YYYY,
@ -157,7 +167,7 @@ namespace Tiobon.Core.Services
insert into Ghrp_PerformancePeriod
(SortNo,ID,YYYY,PeriodNo,PeriodName,PerformancePeriodTypeID,PeriodType,Stage,StageItem,PeriodNum,IsUsing,
BeginDate,EndDate,StaffBeginDate,StaffEndDate,MGBeginDate,MGEndDate,OnJobBaseDate,PrePerformancePeriodID,RemarkSz,
IsEnable,CreateBy,CreateTime,CreateProg)
IsEnable,CreateBy,CreateTime,CreateProg,Reverse1)
select SortNo,
ISNULL((select MAX(Id) from Ghrp_PerformancePeriod), 1000000000000000000 )
+SortNo,
@ -169,10 +179,20 @@ namespace Tiobon.Core.Services
dbo.FS_MinDate(ISNULL(MGEndDate,EndDate),EndDate) MGEndDate,
case when ISNULL(@OnJobBaseType,'') = 'Begin' then BeginDate else EndDate end OnJobBaseDate,
NULL PrePerformancePeriodID,'' RemarkSz,
1 IsEnable,1 CreateBy,GETDATE() CreateTime,'/api/Ghrp_PerformancePeriod/BatchCreatePeriod' CreateProg
1 IsEnable,1 CreateBy,GETDATE() CreateTime,'/api/Ghrp_PerformancePeriod/BatchCreatePeriod' CreateProg,@GUID
from PerformancePeriod a
where Not Exists(select 1 from Ghrp_PerformancePeriod where IsEnable=1 and YYYY= a.YYYY and PerformancePeriodTypeID=a.PerformancePeriodTypeID and PeriodNo=a.PeriodNo)
order by SortNo
update a
set PrePerformancePeriodID = (select Id from Ghrp_PerformancePeriod
where IsEnable=1 and YYYY=a.YYYY
and PerformancePeriodTypeID=a.PerformancePeriodTypeID
and SortNo = a.SortNo-1
and Reverse1=@GUID
)
from Ghrp_PerformancePeriod a
where Reverse1=@GUID
";
await Db.Ado.ExecuteCommandAsync(sql);
return ServiceResult.OprateSuccess("批量展开成功!");

@ -29,8 +29,9 @@ namespace Tiobon.Core.Services
{
x.Stage = await GetParaLabel("PerformanceStage", x.Stage);
x.StageItems = await GetParaLabelListString("Performance", "PerformanceStageItem", x.StageItems);
});
x.DataBelongName = Db.Ado.GetString("select DataBelongName from Ghrs_DataBelong where DataBelongID=@DataBelongID"
, new { DataBelongID=x.DataBelongID });
});
return result;
}
@ -62,12 +63,12 @@ namespace Tiobon.Core.Services
return result;
}
public async Task<ServiceResult<List<string>>> GetStageItems(string Stage)
public async Task<ServiceResult<List<string>>> GetStageItems(string Stage)
{
List<string> StageItmes = [];
if (Stage == "1Q1C") StageItmes = new List<string> { "C" };
if (Stage == "1Q2C") StageItmes = new List<string> { "A","C" };
if (Stage == "1Q3C") StageItmes = new List<string> { "A", "B","C" };
if (Stage == "1Q2C") StageItmes = new List<string> { "A", "C" };
if (Stage == "1Q3C") StageItmes = new List<string> { "A", "B", "C" };
return ServiceResult<List<string>>.OprateSuccess("查询成功!", StageItmes);
}

@ -86,6 +86,13 @@
<param name="body">条件</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Controllers.BaseController`5.QueryDel(Tiobon.Core.Common.QueryBody)">
<summary>
查询作废
</summary>
<param name="body"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Controllers.BaseController`5.QueryById(System.Int64)">
<summary>
根据Id查询数据

Loading…
Cancel
Save