diff --git a/Tiobon.Core.Api/Controllers/Base/BaseController.cs b/Tiobon.Core.Api/Controllers/Base/BaseController.cs index ca34753b..09d481e3 100644 --- a/Tiobon.Core.Api/Controllers/Base/BaseController.cs +++ b/Tiobon.Core.Api/Controllers/Base/BaseController.cs @@ -42,6 +42,18 @@ public class BaseController + /// 查询作废 + /// + /// + /// + [HttpPost, Route("QueryDel")] + public virtual async Task> QueryDel([FromBody] QueryBody body) + { + var data = (await InvokeServiceAsync("QueryFilterPage", [body, null, false])) as ServicePageResult; + return data; + } + public static T ConvertTo(object input) { if (input == null) diff --git a/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformancePeriodType.Dto.View.cs b/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformancePeriodType.Dto.View.cs index f90a6a4f..57a446bb 100644 --- a/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformancePeriodType.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrp/Ghrp_PerformancePeriodType.Dto.View.cs @@ -33,6 +33,8 @@ public class Ghrp_PerformancePeriodTypeDto : Ghrp_PerformancePeriodType /// public string UpdateDataInfo { get; set; } + public string DataBelongName { get; set; } + /// /// 考核阶段名称 /// diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index eaf7ac1a..4fe80766 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -2437,20 +2437,22 @@ public partial class CommonServices : BaseServices>, 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; diff --git a/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodServices.cs b/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodServices.cs index 292bc279..8f20c80b 100644 --- a/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodServices.cs +++ b/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodServices.cs @@ -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().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("批量展开成功!"); diff --git a/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodTypeServices.cs b/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodTypeServices.cs index 0dbae416..56d568c3 100644 --- a/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodTypeServices.cs +++ b/Tiobon.Core.Services/Ghrp/Ghrp_PerformancePeriodTypeServices.cs @@ -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>> GetStageItems(string Stage) + public async Task>> GetStageItems(string Stage) { List StageItmes = []; if (Stage == "1Q1C") StageItmes = new List { "C" }; - if (Stage == "1Q2C") StageItmes = new List { "A","C" }; - if (Stage == "1Q3C") StageItmes = new List { "A", "B","C" }; + if (Stage == "1Q2C") StageItmes = new List { "A", "C" }; + if (Stage == "1Q3C") StageItmes = new List { "A", "B", "C" }; return ServiceResult>.OprateSuccess("查询成功!", StageItmes); } diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index dcf7e246..3b86b6a1 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -86,6 +86,13 @@ 条件 + + + 查询作废 + + + + 根据Id查询数据