From 8490311e944c81d9031223564da19e4676452bee Mon Sep 17 00:00:00 2001 From: xiaju <1784803958@qq.com> Date: Thu, 19 Nov 2026 16:31:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=85=B3=E8=81=94=E5=9F=B9?= =?UTF-8?q?=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2026-11-19-xiaj.sql | 22 +++ .../SafetyProblemClassifyItemService.cs | 2 + SGGL/BLL/Common/Enums.cs | 1 + .../EduTrain/CompanyTrainingItemService.cs | 48 +++++- SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs | 10 +- SGGL/BLL/HSSE/SitePerson/PersonService.cs | 34 ++-- .../BaseInfo/SafetyProblemClassify.aspx | 5 +- .../BaseInfo/SafetyProblemClassify.aspx.cs | 20 ++- .../SafetyProblemClassifyItemSave.aspx | 9 +- .../SafetyProblemClassifyItemSave.aspx.cs | 31 +++- ...tyProblemClassifyItemSave.aspx.designer.cs | 9 + .../Check/HSE/CheckProblemEdit.aspx.cs | 66 ++++++-- .../Check/HSE/CheckProblemIn.aspx.cs | 50 +++++- .../Check/QMS/CheckProblemEdit.aspx.cs | 12 +- .../Check/QMS/CheckProblemIn.aspx.cs | 13 +- .../HSSE/EduTrain/PlanEdit.aspx.cs | 159 +++++++++--------- .../SafeEnvBudget/SafetyManagementData.aspx | 2 +- .../SafetyManagementDataEdit.aspx | 2 +- SGGL/FineUIPro.Web/Score/ScoreFlowLog.aspx | 2 +- SGGL/Model/JQueryFeature.cs | 52 ++++++ SGGL/Model/Model.cs | 24 +++ SGGL/Model/Model.csproj | 1 + 22 files changed, 442 insertions(+), 132 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2026-11-19-xiaj.sql create mode 100644 SGGL/Model/JQueryFeature.cs diff --git a/DataBase/版本日志/SGGLDB_V2026-11-19-xiaj.sql b/DataBase/版本日志/SGGLDB_V2026-11-19-xiaj.sql new file mode 100644 index 00000000..d870c6f7 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-11-19-xiaj.sql @@ -0,0 +1,22 @@ + +--ÅàѵÀàÐͣº¼ì²éÖØÐÞÅàѵ +IF NOT EXISTS (SELECT 1 FROM Base_TrainType WHERE TrainTypeId = '2F687916-5E31-4DF3-97A3-E33E108C8070') +BEGIN + --ÅàѵÀàÐͣº¼ì²éÖØÐÞÅàѵ + INSERT INTO Base_TrainType(TrainTypeId,TrainTypeCode,TrainTypeName,Remark,IsAboutSendCard,IsRepeat,TrainType) + VALUES('2F687916-5E31-4DF3-97A3-E33E108C8070','00','¼ì²éÖØÐÞÅàѵ','',0,1,0) +END + + +GO + +--²»·ûºÏÏîÀàÐͣºÅàѵ½̲ÄId +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Base_SafetyProblemClassifyItem' AND COLUMN_NAME = 'CompanyTrainingItemId') +BEGIN + --Åàѵ½̲ÄId + ALTER TABLE Base_SafetyProblemClassifyItem ADD CompanyTrainingItemId nvarchar(500); + EXEC sp_addextendedproperty 'MS_Description', N'Åàѵ½̲ÄId','SCHEMA', N'dbo','TABLE', N'Base_SafetyProblemClassifyItem','COLUMN', N'CompanyTrainingItemId'; +END + +GO + diff --git a/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs index 115e1887..3c3644aa 100644 --- a/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs +++ b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs @@ -32,6 +32,7 @@ namespace BLL newModel.ClassifyId = model.ClassifyId; newModel.ClassifyItemCode = model.ClassifyItemCode; newModel.ClassifyItemName = model.ClassifyItemName; + newModel.CompanyTrainingItemId = model.CompanyTrainingItemId; newModel.CompileMan = model.CompileMan; newModel.CompileManName = model.CompileManName; newModel.CompileDate = model.CompileDate; @@ -52,6 +53,7 @@ namespace BLL newModel.ClassifyId = model.ClassifyId; newModel.ClassifyItemCode = model.ClassifyItemCode; newModel.ClassifyItemName = model.ClassifyItemName; + newModel.CompanyTrainingItemId = model.CompanyTrainingItemId; newModel.CompileMan = model.CompileMan; newModel.CompileManName = model.CompileManName; newModel.CompileDate = model.CompileDate; diff --git a/SGGL/BLL/Common/Enums.cs b/SGGL/BLL/Common/Enums.cs index 09df78bd..24ad022e 100644 --- a/SGGL/BLL/Common/Enums.cs +++ b/SGGL/BLL/Common/Enums.cs @@ -56,6 +56,7 @@ namespace BLL 日常巡检 = 1, 专项检查 = 2, 领导带班检查 = 3, + HSE不符合项 = 4, } #endregion diff --git a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs index 8fbc0851..eedddaed 100644 --- a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using System; +using Model; +using System.Collections.Generic; using System.Linq; namespace BLL @@ -117,5 +119,49 @@ namespace BLL return lst; } + + #region BoundTree + + /// + /// 加载培训教材 + /// + /// + /// + /// + public static void BoundTree(List myList, string menuId, int depth) + { + var dt = GetNewTraining(menuId); + if (dt.Count() > 0) + { + foreach (var dr in dt) + { + myList.Add(new JQueryFeature(dr.CompanyTrainingId, dr.CompanyTrainingName, depth, false)); + BoundTree(myList, dr.CompanyTrainingId, depth + 1); + } + } + else + { + var item = Funs.DB.Training_CompanyTrainingItem.Where(x => x.CompanyTrainingId == menuId).OrderBy(x => x.CompanyTrainingItemCode); + if (item.Count() > 0) + { + foreach (var dr in item) + { + myList.Add(new JQueryFeature(dr.CompanyTrainingItemId, dr.CompanyTrainingItemName, depth, true)); + } + } + } + } + + /// + /// 得到菜单方法 + /// + /// + /// + public static List GetNewTraining(string parentId) + { + return (from x in Funs.DB.Training_CompanyTraining where x.SupCompanyTrainingId == parentId orderby x.CompanyTrainingCode select x).ToList(); ; + } + + #endregion } } \ No newline at end of file diff --git a/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs b/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs index 68a7f5db..555b1971 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs @@ -11,7 +11,7 @@ namespace BLL /// public static class TrainingPlanService { - + /// /// 根据主键获取培训计划 @@ -172,6 +172,7 @@ namespace BLL var plan = GetPlanByCheckId(info.CheckId); var person = PersonService.GetPersonById(info.PersonId); var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(info.CompanyTrainingItemId); + //var teachHour = companyTrainingItem.LearningTime != null ? companyTrainingItem.LearningTime / 3600 : 0; var teachHour = companyTrainingItem.LearningTime / 3600; string planId = string.Empty; @@ -189,7 +190,7 @@ namespace BLL TrainStartDate = plan.TrainStartDate, TrainEndDate = info.TrainEndDate, TeachMan = plan.TeachMan, - TeachAddress = plan.TeachAddress, + TeachAddress = !string.IsNullOrWhiteSpace(plan.TeachAddress) ? plan.TeachAddress : "小程序线上培训", TrainTypeId = Const.RetakeCourseTrainTypeId, TrainLevelId = Const.OtherTrainLevelId, States = "1", @@ -204,8 +205,8 @@ namespace BLL else {//生成培训计划 planId = SQLHelper.GetNewID(); - string code = ProjectService.GetProjectByProjectId(info.CurrProjectId).ProjectCode + "-"; - string planCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", info.CurrProjectId, code); + string code = $"{(!string.IsNullOrWhiteSpace(info.CurrProjectId) ? ProjectService.GetProjectByProjectId(info.CurrProjectId).ProjectCode : "HSE")}-"; + string planCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", (!string.IsNullOrWhiteSpace(info.CurrProjectId) ? info.CurrProjectId : "HSE"), code); Model.Training_Plan planModel = new Model.Training_Plan { @@ -221,6 +222,7 @@ namespace BLL TeachHour = teachHour, //TeachMan = model.TeachMan, //TeachAddress = model.TeachAddress, + TeachAddress = "小程序线上培训", TrainTypeId = Const.RetakeCourseTrainTypeId, TrainLevelId = Const.OtherTrainLevelId, UnitIds = person.UnitId, diff --git a/SGGL/BLL/HSSE/SitePerson/PersonService.cs b/SGGL/BLL/HSSE/SitePerson/PersonService.cs index e6ce67ca..396e6e99 100644 --- a/SGGL/BLL/HSSE/SitePerson/PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/PersonService.cs @@ -12,7 +12,7 @@ namespace BLL /// public static class PersonService { - + #region 劳务人员列表 /// @@ -186,25 +186,39 @@ namespace BLL /// /// 根据项目单位获取人员信息 /// - /// + /// + /// /// - public static List GetPersonLitsByprojectIdUnitId(string projectId, string unitId) + public static List GetPersonLitsByProjectIdUnitId(string projectId, string unitId) { - if (!string.IsNullOrEmpty(unitId)) + if (!string.IsNullOrEmpty(projectId) && !string.IsNullOrEmpty(unitId)) { return (from x in Funs.DB.SitePerson_Person - where x.ProjectId == projectId && x.UnitId == unitId + //where x.ProjectId == projectId && x.UnitId == unitId + where x.ProjectId == projectId orderby x.PersonName select x).ToList(); } - else + else if (!string.IsNullOrEmpty(projectId)) { return (from x in Funs.DB.SitePerson_Person where x.ProjectId == projectId orderby x.PersonName select x).ToList(); } - + else if (!string.IsNullOrEmpty(unitId)) + { + return (from x in Funs.DB.SitePerson_Person + where x.UnitId == unitId + orderby x.PersonName + select x).ToList(); + } + else + { + return (from x in Funs.DB.SitePerson_Person + orderby x.PersonName + select x).ToList(); + } } /// @@ -214,7 +228,7 @@ namespace BLL /// public static List GetPersonLitsByprojectIdUnitIdTeamGroupId(string projectId, string unitId, string teamGroupId) { - var getPersons = GetPersonLitsByprojectIdUnitId(projectId, unitId); + var getPersons = GetPersonLitsByProjectIdUnitId(projectId, unitId); if (!string.IsNullOrEmpty(teamGroupId)) { getPersons = getPersons.Where(x => x.TeamGroupId == teamGroupId).OrderBy(x => x.PersonName).ToList(); @@ -695,7 +709,7 @@ namespace BLL { dropName.DataValueField = "PersonId"; dropName.DataTextField = "PersonName"; - dropName.DataSource = GetPersonLitsByprojectIdUnitId(projectId, unitId); + dropName.DataSource = GetPersonLitsByProjectIdUnitId(projectId, unitId); dropName.DataBind(); if (isShowPlease) { @@ -720,7 +734,7 @@ namespace BLL { if (!string.IsNullOrWhiteSpace(item)) { - var lst = GetPersonLitsByprojectIdUnitId(projectId, item); + var lst = GetPersonLitsByProjectIdUnitId(projectId, item); list.AddRange(lst); } } diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx index 4672fc26..d306ffc8 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx @@ -70,9 +70,12 @@ - + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs index 00a51615..cd044279 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs @@ -196,7 +196,7 @@ namespace FineUIPro.Web.BaseInfo if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID)) { StringBuilder sb = new StringBuilder(); - sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompileMan, item.CompileDate "); + sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompanyTrainingItemId,item.CompileMan, item.CompileDate "); sb.Append("FROM dbo.Base_SafetyProblemClassifyItem AS item "); sb.Append("WHERE item.ClassifyId=@ClassifyId "); @@ -217,6 +217,24 @@ namespace FineUIPro.Web.BaseInfo SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter); + // 学习教材:把逗号分隔的教材Id转换成教材中文名称 + var trainingNames = new Dictionary(); + foreach (var trainingItem in BLL.CompanyTrainingItemService.GetCompanyTrainingItemList(null)) + { + trainingNames[trainingItem.CompanyTrainingItemId] = trainingItem.CompanyTrainingItemName; + } + tb.Columns.Add("CompanyTrainingItemNames", typeof(string)); + foreach (DataRow dr in tb.Rows) + { + var ids = Convert.ToString(dr["CompanyTrainingItemId"]).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + var names = new List(); + foreach (var id in ids) + { + names.Add(trainingNames.ContainsKey(id.Trim()) ? trainingNames[id.Trim()] : id.Trim()); + } + dr["CompanyTrainingItemNames"] = string.Join(",", names); + } + Grid1.RecordCount = tb.Rows.Count; var table = this.GetPagedDataTable(Grid1, tb); diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx index 25fb420e..407664e0 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx @@ -16,7 +16,7 @@ + ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px"> @@ -27,6 +27,13 @@ + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs index 33587a6c..1426fa56 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs @@ -1,9 +1,8 @@ -using System; -using System.Linq; +using BLL; using Model; -using BLL; +using System; using System.Collections.Generic; -using Microsoft.Office.Interop.Excel; +using System.Linq; namespace FineUIPro.Web.BaseInfo { @@ -46,6 +45,7 @@ namespace FineUIPro.Web.BaseInfo { if (!IsPostBack) { + InitDropDownList(); this.GetButtonPower(); btnClose.OnClientClick = ActiveWindow.GetHideReference(); @@ -64,6 +64,10 @@ namespace FineUIPro.Web.BaseInfo { txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate); } + if (!string.IsNullOrWhiteSpace(model.CompanyTrainingItemId)) + { + dpCompanyTraining.SelectedValueArray = model.CompanyTrainingItemId.Split(','); + } } } else @@ -76,6 +80,21 @@ namespace FineUIPro.Web.BaseInfo } } + /// + /// 初始化下拉框 + /// + private void InitDropDownList() + { + List myList = new List(); + CompanyTrainingItemService.BoundTree(myList, "0", 0); + dpCompanyTraining.DataTextField = "Name"; + dpCompanyTraining.DataValueField = "Id"; + dpCompanyTraining.DataSimulateTreeLevelField = "Level"; + dpCompanyTraining.DataEnableSelectField = "EnableSelect"; + dpCompanyTraining.DataSource = myList; + dpCompanyTraining.DataBind(); + } + #endregion @@ -94,6 +113,10 @@ namespace FineUIPro.Web.BaseInfo CompileManName = this.CurrUser.UserName, }; + if (dpCompanyTraining.SelectedValueArray != null && dpCompanyTraining.SelectedValueArray.Count() > 0) + { + newModel.CompanyTrainingItemId = string.Join(",", dpCompanyTraining.SelectedValueArray); + } if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim())) { newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim()); diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.designer.cs index e80dfac6..1f75a8d0 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.designer.cs @@ -59,6 +59,15 @@ namespace FineUIPro.Web.BaseInfo /// protected global::FineUIPro.TextBox txtClassifyItemName; + /// + /// dpCompanyTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList dpCompanyTraining; + /// /// txtCompileMan 控件。 /// diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.cs index bf4790f2..80bb6d82 100644 --- a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.cs @@ -58,7 +58,7 @@ namespace FineUIPro.Web.Check.HSE { this.drpUnit.SelectedValue = model.UnitId; this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, model.UnitId, true); + //BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, model.UnitId, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, model.UnitId, true); @@ -71,7 +71,7 @@ namespace FineUIPro.Web.Check.HSE var pro = BLL.ProjectService.GetProjectByProjectId(model.ProjectId); this.txtAddress.Text = pro.ProjectAddress; this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserDropDownList(this.drpRectificationUser, model.ProjectId, true); + //BLL.UserService.InitUserDropDownList(this.drpRectificationUser, model.ProjectId, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserDropDownList(this.drpPMUser, model.ProjectId, true); } @@ -79,6 +79,7 @@ namespace FineUIPro.Web.Check.HSE { this.drpProject.Text = model.ProjectName; } + PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, model.ProjectId, model.UnitId, true); //var pro = BLL.ProjectService.GetProjectByProjectId(model.ProjectId); //if (pro != null) //{ @@ -172,7 +173,8 @@ namespace FineUIPro.Web.Check.HSE BLL.ProjectService.InitProjectDropDownList(this.drpProject, this.drpUnit.SelectedValue, true); this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true); + //BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true); + PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, null, this.drpUnit.SelectedValue, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, this.drpUnit.SelectedValue, true); } @@ -192,7 +194,8 @@ namespace FineUIPro.Web.Check.HSE { this.txtAddress.Text = pro.ProjectAddress; this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserDropDownList(this.drpRectificationUser, proId, true); + //BLL.UserService.InitUserDropDownList(this.drpRectificationUser, proId, true); + PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, proId, this.drpUnit.SelectedValue, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserDropDownList(this.drpPMUser, proId, true); } @@ -407,7 +410,8 @@ namespace FineUIPro.Web.Check.HSE } #region 扣分记录 - var user = BLL.UserService.GetUserByUserId(model.RectificationUserId); + var user = BLL.PersonService.GetPersonById(model.RectificationUserId); + //var user = BLL.UserService.GetUserByUserId(model.RectificationUserId); if (user != null) { int oldS = 0; @@ -428,20 +432,17 @@ namespace FineUIPro.Web.Check.HSE //增加人员记分流水 ScoreFlowLog log = new ScoreFlowLog(); log.Id = SQLHelper.GetNewID(); - if (!string.IsNullOrEmpty(txtCheckDate.Text.Trim())) - { - log.Year = Convert.ToDateTime(txtCheckDate.Text.Trim()).Year; - } - log.UserId = this.drpRectificationUser.SelectedValue; - log.UserName = this.drpRectificationUser.SelectedText; + log.Year = model.CheckDate.Year; + log.UserId = model.RectificationUserId; + log.UserName = model.RectificationUserName; log.IdentityCard = user.IdentityCard; - log.UnitId = this.drpUnit.SelectedValue; - log.ProjectId = this.drpProject.SelectedValue; - log.UnitName = this.drpUnit.SelectedText; - log.ProjectName = this.drpProject.SelectedText; + log.UnitId = model.UnitId; + log.ProjectId = model.ProjectId; + log.UnitName = model.UnitName; + log.ProjectName = model.ProjectName; log.Item = "安全不符合项"; log.LogContent = "隐患问责扣分"; - log.CheckDate = Convert.ToDateTime(this.txtCheckDate.Text.Trim()); + log.CheckDate = model.CheckDate; if (saveType == "1") { log.CompileDate = DateTime.Now; @@ -452,7 +453,7 @@ namespace FineUIPro.Web.Check.HSE } log.CompileMan = this.CurrUser.UserName; log.CompileManId = this.CurrUser.UserId; - log.DataSourceId = this.CheckId; + log.DataSourceId = model.CheckId; log.Type = 0;//扣分 //特别严重(管控红线)扣成0分,严重(危险作业许可)扣除100分,较大扣除50分,一般扣除20分,轻微扣除2分 if (drpNature.SelectedValue == BLL.Const.SafetyNatureIdN1) @@ -499,7 +500,7 @@ namespace FineUIPro.Web.Check.HSE su.Score = log.CurrentScore; su.UserName = log.UserName; su.CompileDate = log.CompileDate; - su.DataSourceId = this.CheckId; + su.DataSourceId = model.CheckId; su.CheckDate = log.CheckDate; BLL.ScoreUserService.AddScoreUser(su); #endregion @@ -524,6 +525,35 @@ namespace FineUIPro.Web.Check.HSE } } #endregion + + var classModel = SafetyProblemClassifyItemService.GetClassifyItemById(model.ClassifyItemId); + + #region 责任人和问题类型关联重修教材非空,生成培训计划 + + if (!string.IsNullOrWhiteSpace(model.RectificationUserId) && !string.IsNullOrWhiteSpace(classModel.CompanyTrainingItemId)) + {//责任人和重修教材非空,生成培训计划 + var ItemIds = classModel.CompanyTrainingItemId.Split(','); + int index = 0; + foreach (var ItemId in ItemIds) + { + index++; + var CheckTypeName = Enums.RetakeCourseType.HSE不符合项.ToString(); + Model.ProducePlanInfo info = new Model.ProducePlanInfo + { + CurrProjectId = !string.IsNullOrWhiteSpace(model.ProjectId) ? model.ProjectId : this.CurrUser.LoginProjectId, + CurrUserId = this.CurrUser.UserId, + CheckId = $"{this.CheckId}_{index}", + CheckType = (int)Enums.RetakeCourseType.HSE不符合项, + CheckTypeName = "HSE不符合项", + PersonId = model.RectificationUserId, + CompanyTrainingItemId = ItemId, + //TrainEndDate = model.RectificationPeriod + }; + TrainingPlanService.RetakeCourseProducePlan(info); + } + } + + #endregion } diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.cs index c6f8b798..589e9d50 100644 --- a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.cs @@ -109,6 +109,10 @@ namespace FineUIPro.Web.Check.HSE /// public static List users = new List(); + /// + /// 项目人员 + /// + public static List persons = new List(); #endregion protected void Page_Load(object sender, EventArgs e) @@ -118,6 +122,8 @@ namespace FineUIPro.Web.Check.HSE //users = BLL.ProjectUserService.GetProjectUserByProjectId(this.ProjectId,null,null); //获取所有在岗用户 users = BLL.UserService.GetProjectUserListByProjectId(null); + //获取所有项目人员 + persons = BLL.PersonService.GetPersonLitsByProjectIdUnitId(null, null); classifys = SafetyProblemClassifyService.GetClassify(); classifyItems = SafetyProblemClassifyItemService.GetClassifyItemList(""); @@ -462,10 +468,12 @@ namespace FineUIPro.Web.Check.HSE } if (!string.IsNullOrEmpty(rData9)) { - var user = users.Where(x => x.UserName == rData9).FirstOrDefault(); + var user = persons.Where(x => (x.ProjectId == ProjectId || ProjectId == null) && x.PersonName == rData9).FirstOrDefault(); + //var user = users.Where(x => x.UserName == rData9).FirstOrDefault(); if (user != null) { - RectificationUserId = user.UserId; + RectificationUserId = user.PersonName; + //RectificationUserId = user.UserId; RectificationUserName = rData9; } else @@ -699,16 +707,19 @@ namespace FineUIPro.Web.Check.HSE Funs.DB.CheckProblem_Safety.InsertAllOnSubmit(toInsert); Funs.DB.SubmitChanges(); - #region 扣分记录 + #region 扣分记录&重修培训 toInsert = toInsert.OrderBy(x => x.CheckDate).ToList(); foreach (var item in toInsert) { + #region 扣分记录 + ScoreFlowLog log = new ScoreFlowLog(); log.Id = SQLHelper.GetNewID(); log.Year = item.CheckDate.Year; log.UserId = item.RectificationUserId; log.UserName = item.RectificationUserName; - var user = BLL.UserService.GetUserByUserId(item.RectificationUserId); + var user = BLL.PersonService.GetPersonById(item.RectificationUserId); + //var user = BLL.UserService.GetUserByUserId(item.RectificationUserId); if (user != null) { log.IdentityCard = user.IdentityCard; @@ -773,6 +784,37 @@ namespace FineUIPro.Web.Check.HSE su.DataSourceId = log.DataSourceId; su.CheckDate = log.CheckDate; BLL.ScoreUserService.AddScoreUser(su); + + #endregion + + #region 责任人和问题类型关联重修教材非空,生成培训计划 + + var classModel = SafetyProblemClassifyItemService.GetClassifyItemById(item.ClassifyItemId); + + if (!string.IsNullOrWhiteSpace(item.RectificationUserId) && !string.IsNullOrWhiteSpace(classModel.CompanyTrainingItemId)) + {//责任人和重修教材非空,生成培训计划 + var ItemIds = classModel.CompanyTrainingItemId.Split(','); + int index = 0; + foreach (var ItemId in ItemIds) + { + index++; + var CheckTypeName = Enums.RetakeCourseType.HSE不符合项.ToString(); + Model.ProducePlanInfo info = new Model.ProducePlanInfo + { + CurrProjectId = !string.IsNullOrWhiteSpace(item.ProjectId) ? item.ProjectId : this.CurrUser.LoginProjectId, + CurrUserId = this.CurrUser.UserId, + CheckId = $"{item.CheckId}_{index}", + CheckType = (int)Enums.RetakeCourseType.HSE不符合项, + CheckTypeName = "HSE不符合项", + PersonId = item.RectificationUserId, + CompanyTrainingItemId = ItemId, + //TrainEndDate = model.RectificationPeriod + }; + TrainingPlanService.RetakeCourseProducePlan(info); + } + } + + #endregion } #endregion } diff --git a/SGGL/FineUIPro.Web/Check/QMS/CheckProblemEdit.aspx.cs b/SGGL/FineUIPro.Web/Check/QMS/CheckProblemEdit.aspx.cs index e4ed0f67..f4d3926c 100644 --- a/SGGL/FineUIPro.Web/Check/QMS/CheckProblemEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Check/QMS/CheckProblemEdit.aspx.cs @@ -58,7 +58,7 @@ namespace FineUIPro.Web.Check.QMS { this.drpUnit.SelectedValue = model.UnitId; this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, model.UnitId, true); + //BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, model.UnitId, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, model.UnitId, true); this.drpQCUser.Items.Clear(); @@ -75,7 +75,7 @@ namespace FineUIPro.Web.Check.QMS var pro = BLL.ProjectService.GetProjectByProjectId(model.ProjectId); this.txtAddress.Text = pro.ProjectAddress; this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserDropDownList(this.drpRectificationUser, model.ProjectId, true); + //BLL.UserService.InitUserDropDownList(this.drpRectificationUser, model.ProjectId, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserDropDownList(this.drpPMUser, model.ProjectId, true); this.drpQCUser.Items.Clear(); @@ -85,6 +85,8 @@ namespace FineUIPro.Web.Check.QMS { this.drpProject.Text = model.ProjectName; } + PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, model.ProjectId, model.UnitId, true); + this.drpClassify.SelectedValue = model.ClassifyId; BLL.QualityProblemClassifyItemService.InitClassifyItemDownList(this.drpClassifyItem, model.ClassifyId, true); if (!string.IsNullOrWhiteSpace(model.ClassifyItemId)) @@ -174,7 +176,8 @@ namespace FineUIPro.Web.Check.QMS BLL.ProjectService.InitProjectDropDownList(this.drpProject, this.drpUnit.SelectedValue, true); this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true); + //BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true); + PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, null, this.drpUnit.SelectedValue, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, this.drpUnit.SelectedValue, true); this.drpQCUser.Items.Clear(); @@ -196,7 +199,8 @@ namespace FineUIPro.Web.Check.QMS { this.txtAddress.Text = pro.ProjectAddress; this.drpRectificationUser.Items.Clear(); - BLL.UserService.InitUserDropDownList(this.drpRectificationUser, proId, true); + //BLL.UserService.InitUserDropDownList(this.drpRectificationUser, proId, true); + PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, proId, this.drpUnit.SelectedValue, true); this.drpPMUser.Items.Clear(); BLL.UserService.InitUserDropDownList(this.drpPMUser, proId, true); this.drpQCUser.Items.Clear(); diff --git a/SGGL/FineUIPro.Web/Check/QMS/CheckProblemIn.aspx.cs b/SGGL/FineUIPro.Web/Check/QMS/CheckProblemIn.aspx.cs index 5c8f5a6d..b0184d92 100644 --- a/SGGL/FineUIPro.Web/Check/QMS/CheckProblemIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Check/QMS/CheckProblemIn.aspx.cs @@ -109,6 +109,11 @@ namespace FineUIPro.Web.Check.QMS /// public static List users = new List(); + /// + /// 项目人员 + /// + public static List persons = new List(); + #endregion protected void Page_Load(object sender, EventArgs e) @@ -118,6 +123,8 @@ namespace FineUIPro.Web.Check.QMS //users = BLL.ProjectUserService.GetProjectUserByProjectId(this.ProjectId,null,null); //获取所有在岗用户 users = BLL.UserService.GetProjectUserListByProjectId(null); + //获取所有项目人员 + persons = BLL.PersonService.GetPersonLitsByProjectIdUnitId(null, null); classifys = QualityProblemClassifyService.GetClassify(); classifyItems = QualityProblemClassifyItemService.GetClassifyItemList(""); @@ -465,10 +472,12 @@ namespace FineUIPro.Web.Check.QMS } if (!string.IsNullOrEmpty(rData9)) { - var user = users.Where(x => x.UserName == rData9).FirstOrDefault(); + var user = persons.Where(x => (x.ProjectId == ProjectId || ProjectId == null) && x.PersonName == rData9).FirstOrDefault(); + //var user = users.Where(x => x.UserName == rData9).FirstOrDefault(); if (user != null) { - RectificationUserId = user.UserId; + RectificationUserId = user.PersonName; + //RectificationUserId = user.UserId; RectificationUserName = rData9; } else diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs index f268d597..dc357ee2 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs @@ -137,9 +137,10 @@ namespace FineUIPro.Web.HSSE.EduTrain //dpWorkPost.DataTextField = "WorkPostName"; //dpWorkPost.DataSource = workPost; //dpWorkPost.DataBind(); + List myList = new List(); - BoundTree(myList, "0", 0); + CompanyTrainingItemService.BoundTree(myList, "0", 0); dpCompanyTraining.DataTextField = "Name"; dpCompanyTraining.DataValueField = "Id"; dpCompanyTraining.DataSimulateTreeLevelField = "Level"; @@ -150,96 +151,96 @@ namespace FineUIPro.Web.HSSE.EduTrain } - #region JQueryFeature + //#region JQueryFeature - public class JQueryFeature - { - private string _id; + //public class JQueryFeature + //{ + // private string _id; - public string Id - { - get { return _id; } - set { _id = value; } - } - private string _name; + // public string Id + // { + // get { return _id; } + // set { _id = value; } + // } + // private string _name; - public string Name - { - get { return _name; } - set { _name = value; } - } + // public string Name + // { + // get { return _name; } + // set { _name = value; } + // } - private int _level; + // private int _level; - public int Level - { - get { return _level; } - set { _level = value; } - } + // public int Level + // { + // get { return _level; } + // set { _level = value; } + // } - private bool _enableSelect; + // private bool _enableSelect; - public bool EnableSelect - { - get { return _enableSelect; } - set { _enableSelect = value; } - } + // public bool EnableSelect + // { + // get { return _enableSelect; } + // set { _enableSelect = value; } + // } - public JQueryFeature(string id, string name, int level, bool enableSelect) - { - _id = id; - _name = name; - _level = level; - _enableSelect = enableSelect; - } + // public JQueryFeature(string id, string name, int level, bool enableSelect) + // { + // _id = id; + // _name = name; + // _level = level; + // _enableSelect = enableSelect; + // } - public override string ToString() - { - return String.Format("Name:{0}+Id:{1}", Name, Id); - } - } + // public override string ToString() + // { + // return String.Format("Name:{0}+Id:{1}", Name, Id); + // } + //} - #endregion + //#endregion - /// - /// 加载培训教材 - /// - /// - /// - /// - private void BoundTree(List myList, string menuId, int depth) - { - var dt = GetNewTraining(menuId); - if (dt.Count() > 0) - { - foreach (var dr in dt) - { - myList.Add(new JQueryFeature(dr.CompanyTrainingId, dr.CompanyTrainingName, depth, false)); - BoundTree(myList, dr.CompanyTrainingId, depth + 1); - } - } - else - { - var item = Funs.DB.Training_CompanyTrainingItem.Where(x => x.CompanyTrainingId == menuId).OrderBy(x => x.CompanyTrainingItemCode); - if (item.Count() > 0) - { - foreach (var dr in item) - { - myList.Add(new JQueryFeature(dr.CompanyTrainingItemId, dr.CompanyTrainingItemName, depth, true)); - } - } - } - } + ///// + ///// 加载培训教材 + ///// + ///// + ///// + ///// + //private void BoundTree(List myList, string menuId, int depth) + //{ + // var dt = GetNewTraining(menuId); + // if (dt.Count() > 0) + // { + // foreach (var dr in dt) + // { + // myList.Add(new JQueryFeature(dr.CompanyTrainingId, dr.CompanyTrainingName, depth, false)); + // BoundTree(myList, dr.CompanyTrainingId, depth + 1); + // } + // } + // else + // { + // var item = Funs.DB.Training_CompanyTrainingItem.Where(x => x.CompanyTrainingId == menuId).OrderBy(x => x.CompanyTrainingItemCode); + // if (item.Count() > 0) + // { + // foreach (var dr in item) + // { + // myList.Add(new JQueryFeature(dr.CompanyTrainingItemId, dr.CompanyTrainingItemName, depth, true)); + // } + // } + // } + //} - /// - /// 得到菜单方法 - /// - /// - /// - private List GetNewTraining(string parentId) - { - return (from x in Funs.DB.Training_CompanyTraining where x.SupCompanyTrainingId == parentId orderby x.CompanyTrainingCode select x).ToList(); ; - } + ///// + ///// 得到菜单方法 + ///// + ///// + ///// + //private List GetNewTraining(string parentId) + //{ + // return (from x in Funs.DB.Training_CompanyTraining where x.SupCompanyTrainingId == parentId orderby x.CompanyTrainingCode select x).ToList(); ; + //} #endregion diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementData.aspx b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementData.aspx index e93f71ef..2576e731 100644 --- a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementData.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementData.aspx @@ -65,7 +65,7 @@ - + diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementDataEdit.aspx b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementDataEdit.aspx index d93a420e..6ece4d22 100644 --- a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementDataEdit.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/SafetyManagementDataEdit.aspx @@ -13,7 +13,7 @@ - + diff --git a/SGGL/FineUIPro.Web/Score/ScoreFlowLog.aspx b/SGGL/FineUIPro.Web/Score/ScoreFlowLog.aspx index 5599d639..8d09fe44 100644 --- a/SGGL/FineUIPro.Web/Score/ScoreFlowLog.aspx +++ b/SGGL/FineUIPro.Web/Score/ScoreFlowLog.aspx @@ -58,7 +58,7 @@ - _CompileDate; + private string _CompanyTrainingItemId; + private EntityRef _Base_SafetyProblemClassify; #region 可扩展性方法定义 @@ -41031,6 +41033,8 @@ namespace Model partial void OnCompileManNameChanged(); partial void OnCompileDateChanging(System.Nullable value); partial void OnCompileDateChanged(); + partial void OnCompanyTrainingItemIdChanging(string value); + partial void OnCompanyTrainingItemIdChanged(); #endregion public Base_SafetyProblemClassifyItem() @@ -41183,6 +41187,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompanyTrainingItemId", DbType="NVarChar(50)")] + public string CompanyTrainingItemId + { + get + { + return this._CompanyTrainingItemId; + } + set + { + if ((this._CompanyTrainingItemId != value)) + { + this.OnCompanyTrainingItemIdChanging(value); + this.SendPropertyChanging(); + this._CompanyTrainingItemId = value; + this.SendPropertyChanged("CompanyTrainingItemId"); + this.OnCompanyTrainingItemIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemClassifyItem_Classify", Storage="_Base_SafetyProblemClassify", ThisKey="ClassifyId", OtherKey="ClassifyId", IsForeignKey=true)] public Base_SafetyProblemClassify Base_SafetyProblemClassify { diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index 9e66d28c..844ce9ea 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -212,6 +212,7 @@ +