From f6fab4e4488cf6ab79030749fa7a6a983409bf72 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Fri, 24 May 2024 09:36:11 +0800 Subject: [PATCH] 11 --- SGGL/BLL/API/HSSE/APITrainingTaskService.cs | 33 +++++++++++++++---- .../ProjectData/ProjectSetSave.aspx.cs | 14 ++++++++ SGGL/Model/APIItem/HSSE/TrainingTaskItem.cs | 7 ++++ 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/SGGL/BLL/API/HSSE/APITrainingTaskService.cs b/SGGL/BLL/API/HSSE/APITrainingTaskService.cs index c313c0d4..096baf8c 100644 --- a/SGGL/BLL/API/HSSE/APITrainingTaskService.cs +++ b/SGGL/BLL/API/HSSE/APITrainingTaskService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Numerics; namespace BLL { @@ -36,6 +37,7 @@ namespace BLL TrainTypeName = db.Base_TrainType.FirstOrDefault(b => b.TrainTypeId == y.TrainTypeId).TrainTypeName, TrainLevelName = db.Base_TrainLevel.FirstOrDefault(b => b.TrainLevelId == y.TrainLevelId).TrainLevelName, PlanStatesName = y.States == "3" ? "已完成" : "培训中", + TrainingItemCode = getTrainingItemCode(y.PlanId) }).ToList(); foreach(var item in getDataLists) @@ -55,6 +57,18 @@ namespace BLL return getDataLists; } } + + public static string getTrainingItemCode(string PlanId) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var ids = db.Training_PlanItem.Where(xx => xx.PlanId == PlanId).Select(x => x.CompanyTrainingItemId).ToList(); + var codes= db.Training_CompanyTrainingItem.Where(x => ids.Contains(x.CompanyTrainingItemId)).Select(x => x.CompanyTrainingItemCode); + string res = string.Join(",", codes); + return res; + } + return ""; + } #endregion #region 根据TaskId获取培训任务教材明细列表 @@ -280,15 +294,20 @@ namespace BLL //} if (!string.IsNullOrEmpty(VideoProgress)) { - if (!item.VideoProgress.HasValue) - { - item.VideoProgress = 0; - } - item.VideoProgress = item.VideoProgress.Value + int.Parse(VideoProgress); + //if (!item.VideoProgress.HasValue) + //{ + // item.VideoProgress = 0; + //} + item.VideoProgress = int.Parse(VideoProgress); } var span = endTime.Subtract(startTime); - //item.LearnTime = item.LearnTime.Value + (int)span.TotalMinutes; - item.EndTime = endTime; + if (!item.LearnTime.HasValue) + { + item.LearnTime = 0; + } + item.LearnTime = item.LearnTime.Value + (int)span.TotalMinutes; + + item.EndTime = endTime; db.SubmitChanges(); diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs index 57675ac0..1ae3a713 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs @@ -264,6 +264,20 @@ namespace FineUIPro.Web.ProjectData this.InsertConstructionStandardListToProject(project.ProjectId); ////初始化项目标准规范清单 this.InsertITPListProject(project.ProjectId); // 初始化ITP列表 this.InsertZT(project); //初始化总图 + if (project.ProjectState == "3") + { + var persons = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == project.ProjectId); + foreach(var item in persons) + {if (!item.OutTime.HasValue) + { + item.OutTime = project.EndDate; + } + item.IsUsed = 0; + + } + Funs.DB.SubmitChanges(); + } + ShowNotify("保存数据成功!", MessageBoxIcon.Success); // 2. 关闭本窗体,然后刷新父窗体 // PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); diff --git a/SGGL/Model/APIItem/HSSE/TrainingTaskItem.cs b/SGGL/Model/APIItem/HSSE/TrainingTaskItem.cs index 1a8b852a..92a77ae9 100644 --- a/SGGL/Model/APIItem/HSSE/TrainingTaskItem.cs +++ b/SGGL/Model/APIItem/HSSE/TrainingTaskItem.cs @@ -111,5 +111,12 @@ namespace Model get; set; } + public string TrainingItemCode + { + get; + set; + } + + } }