From c731c542d156ae66efdfef3e897b3043af0bf1e2 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 30 May 2025 17:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_PlanServices.cs | 35 ++++++++++--------- .../Ghre/Ghre_StudyRecordServices.cs | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs index be6f67af..fcc440b8 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs @@ -289,22 +289,25 @@ public class Ghre_PlanServices : BaseServices(sql); - - d.M1_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 1).Sum(x => x.TrainDays); - d.M2_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 2).Sum(x => x.TrainDays); - d.M3_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 3).Sum(x => x.TrainDays); - d.M4_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 4).Sum(x => x.TrainDays); - d.M5_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 5).Sum(x => x.TrainDays); - d.M6_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 6).Sum(x => x.TrainDays); - d.M7_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 7).Sum(x => x.TrainDays); - d.M8_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 8).Sum(x => x.TrainDays); - d.M9_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 9).Sum(x => x.TrainDays); - d.M10_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 10).Sum(x => x.TrainDays); - d.M11_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 11).Sum(x => x.TrainDays); - d.M12_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 12).Sum(x => x.TrainDays); + if (await QueryCompanyCode() == "Ushio") + { + var sql = $"select TrainDays,BeginDate,EndDate from [120.26.205.42].[GhrUshio].[dbo].Ushio_ExternalTrainApply where TrainNeeds like '%{d.Id}%'"; + + var applys = await DbAccess.QueryListAsync(sql); + + d.M1_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 1).Sum(x => x.TrainDays); + d.M2_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 2).Sum(x => x.TrainDays); + d.M3_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 3).Sum(x => x.TrainDays); + d.M4_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 4).Sum(x => x.TrainDays); + d.M5_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 5).Sum(x => x.TrainDays); + d.M6_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 6).Sum(x => x.TrainDays); + d.M7_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 7).Sum(x => x.TrainDays); + d.M8_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 8).Sum(x => x.TrainDays); + d.M9_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 9).Sum(x => x.TrainDays); + d.M10_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 10).Sum(x => x.TrainDays); + d.M11_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 11).Sum(x => x.TrainDays); + d.M12_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 12).Sum(x => x.TrainDays); + } } diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs index fd49e431..d4741ef2 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs @@ -1981,7 +1981,7 @@ WHERE A.Id = '{id}'"; StudyProgress = studyProgress1, StudyStatus = studyStatus, StandardDuration = mins, - ReverseI1 = 1 + //ReverseI1 = 1 }) .Where(it => it.Id == studyRecordId) .ExecuteCommandAsync();