master
xiaochanghai 3 weeks ago
parent 02e5af37c7
commit c731c542d1
  1. 35
      Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs
  2. 2
      Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs

@ -289,22 +289,25 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr
else else
{ {
var sql = $"select TrainDays,BeginDate,EndDate from [120.26.205.42].[GhrUshio].[dbo].Ushio_ExternalTrainApply where TrainNeeds like '%{d.Id}%'"; if (await QueryCompanyCode() == "Ushio")
{
var applys = await DbAccess.QueryListAsync<Ushio_ExternalTrainApply>(sql); var sql = $"select TrainDays,BeginDate,EndDate from [120.26.205.42].[GhrUshio].[dbo].Ushio_ExternalTrainApply where TrainNeeds like '%{d.Id}%'";
d.M1_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 1).Sum(x => x.TrainDays); var applys = await DbAccess.QueryListAsync<Ushio_ExternalTrainApply>(sql);
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.M1_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 1).Sum(x => x.TrainDays);
d.M4_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 4).Sum(x => x.TrainDays); d.M2_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 2).Sum(x => x.TrainDays);
d.M5_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 5).Sum(x => x.TrainDays); d.M3_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 3).Sum(x => x.TrainDays);
d.M6_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 6).Sum(x => x.TrainDays); d.M4_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 4).Sum(x => x.TrainDays);
d.M7_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 7).Sum(x => x.TrainDays); d.M5_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 5).Sum(x => x.TrainDays);
d.M8_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 8).Sum(x => x.TrainDays); d.M6_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 6).Sum(x => x.TrainDays);
d.M9_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 9).Sum(x => x.TrainDays); d.M7_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 7).Sum(x => x.TrainDays);
d.M10_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 10).Sum(x => x.TrainDays); d.M8_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 8).Sum(x => x.TrainDays);
d.M11_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 11).Sum(x => x.TrainDays); d.M9_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 9).Sum(x => x.TrainDays);
d.M12_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 12).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);
}
} }

@ -1981,7 +1981,7 @@ WHERE A.Id = '{id}'";
StudyProgress = studyProgress1, StudyProgress = studyProgress1,
StudyStatus = studyStatus, StudyStatus = studyStatus,
StandardDuration = mins, StandardDuration = mins,
ReverseI1 = 1 //ReverseI1 = 1
}) })
.Where(it => it.Id == studyRecordId) .Where(it => it.Id == studyRecordId)
.ExecuteCommandAsync(); .ExecuteCommandAsync();

Loading…
Cancel
Save