diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/FeedingRunApplication.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/FeedingRunApplication.aspx.cs index f346ae2e..5120677f 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/FeedingRunApplication.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/FeedingRunApplication.aspx.cs @@ -42,7 +42,7 @@ namespace FineUIPro.Web.TestRun.Feeding var inspectTerms = Funs.DB.FeedingRun_SubInspectTerm.Where(x => x.InspectIsClose == 1).ToList(); if (inspectTerms.Count == 0) return; var subInstallationIds = inspectTerms.ConvertAll(x => x.InstallationId); - var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)).OrderBy(a => a.Sort); if (list.Count() > 0) { foreach (var item in list) diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/InspectTailTermList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/InspectTailTermList.aspx.cs index 4e6bc5e0..92a8f4e3 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/InspectTailTermList.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/InspectTailTermList.aspx.cs @@ -38,7 +38,7 @@ namespace FineUIPro.Web.TestRun.Feeding var userSubInspects = Funs.DB.FeedingRun_SubInspectTermItem.Where(x => x.InspectedUser == this.CurrUser.UserId && x.InspectionResults == 0).ToList(); if (userSubInspects.Count == 0) return; var subInstallationIds = userSubInspects.ConvertAll(x => x.InstallationId); - var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)).OrderBy(a => a.Sort); if (list.Count() > 0) { foreach (var item in list) diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutAllPassList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutAllPassList.aspx.cs index 9827ed08..09007559 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutAllPassList.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutAllPassList.aspx.cs @@ -38,7 +38,7 @@ namespace FineUIPro.Web.TestRun.Feeding var inspectTerms = Funs.DB.FeedingRun_SubInspectTerm.Where(x => x.InspectionIsAllPass == 1).ToList(); if (inspectTerms.Count == 0) return; var subInstallationIds = inspectTerms.ConvertAll(x => x.InstallationId); - var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)).OrderBy(a => a.Sort); if (list.Count() > 0) { foreach (var item in list) diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutList.aspx.cs index 7ecbe513..15267545 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutList.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/InspectWanderAboutList.aspx.cs @@ -39,7 +39,7 @@ namespace FineUIPro.Web.TestRun.Feeding var inspectTerms = Funs.DB.FeedingRun_SubInspectTerm.Where(x => (x.DriverCharge == this.CurrUser.UserId && x.InspectionIsAllPass == 1) || (x.DrivingManager == this.CurrUser.UserId && x.InspectionIsAllPass == 1) || (x.ProjectManager == this.CurrUser.UserId && x.InspectionIsAllPass == 1)).ToList(); if (inspectTerms.Count == 0) return; var subInstallationIds = inspectTerms.ConvertAll(x => x.InstallationId); - var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)).OrderBy(a => a.Sort); if (list.Count() > 0) { var ids = list.Select(x => x.ProcessesId).ToList(); diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/SubInspectTerm.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/SubInspectTerm.aspx.cs index 0ea4804e..a215f8ea 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/SubInspectTerm.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/SubInspectTerm.aspx.cs @@ -37,7 +37,7 @@ namespace FineUIPro.Web.TestRun.Feeding rootNode.ToolTip = ""; rootNode.EnableClickEvent = true; this.tvControlItem.Nodes.Add(rootNode); - var list = Funs.DB.PreRun_SysDevice.Where(a => a.ProjectId == this.CurrUser.LoginProjectId && a.PreRunLevel == 1); + var list = Funs.DB.PreRun_SysDevice.Where(a => a.ProjectId == this.CurrUser.LoginProjectId && a.PreRunLevel == 1).OrderBy(a => a.Sort); if (list.Count() > 0) { foreach (var item in list) diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/SubWorkInspect.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/SubWorkInspect.aspx.cs index 84f4156b..c5074abe 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/SubWorkInspect.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/SubWorkInspect.aspx.cs @@ -34,10 +34,10 @@ namespace FineUIPro.Web.TestRun.Feeding rootNode.ToolTip = ""; rootNode.EnableClickEvent = true; this.tvControlItem.Nodes.Add(rootNode); - var userSubInspects = Funs.DB.FeedingRun_SubInspectTermItem.Where(x => x.InspectedUser == this.CurrUser.UserId).ToList(); + var userSubInspects = Funs.DB.FeedingRun_SubInspectTermItem.Where(x => x.InspectedUser == this.CurrUser.UserId).OrderBy(a => a.Sort).ToList(); if (userSubInspects.Count == 0) return; var subInstallationIds = userSubInspects.ConvertAll(x => x.InstallationId); - var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)).OrderBy(a => a.Sort); if (list.Count() > 0) { foreach (var item in list) diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermApproveList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermApproveList.aspx.cs index f6f6d357..b01bde74 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermApproveList.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermApproveList.aspx.cs @@ -46,7 +46,7 @@ namespace FineUIPro.Web.TestRun.Feeding var userSubInspects = Funs.DB.FeedingRun_SubInspectTermItem.Where(x => termIds.Contains(x.TermItemId) && x.ProjectId == this.CurrUser.LoginProjectId).ToList(); if (userSubInspects.Count() == 0) return; var subInstallationIds = userSubInspects.ConvertAll(x => x.InstallationId); - var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)).OrderBy(a => a.Sort); if (list.Count() > 0) { var ids = list.Select(x => x.ProcessesId).ToList(); diff --git a/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermHandleList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermHandleList.aspx.cs index e4f65791..5afc2ef3 100644 --- a/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermHandleList.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Feeding/TailTermHandleList.aspx.cs @@ -45,7 +45,7 @@ namespace FineUIPro.Web.TestRun.Feeding var userSubInspects = Funs.DB.FeedingRun_SubInspectTermItem.Where(x => termIds.Contains(x.TermItemId) && x.ProjectId == this.CurrUser.LoginProjectId).ToList(); if (userSubInspects.Count == 0) return; var subInstallationIds = userSubInspects.ConvertAll(x => x.InstallationId); - var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1 && subInstallationIds.Contains(x.PreRunId)).OrderBy(a => a.Sort); if (list.Count() > 0) { foreach (var item in list) diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx index b4b3642a..ff84b5d7 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx @@ -57,6 +57,16 @@ + + + + + + @@ -107,8 +117,8 @@ - - + + diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs index d56b9dfe..78739ad3 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs @@ -24,10 +24,54 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun if (!IsPostBack) { //绑定数据 + InitTreeMenu(); BindGrid(); } } + #region 树绑定 + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "装置"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + rootNode.ToolTip = ""; + rootNode.EnableClickEvent = true; + this.tvControlItem.Nodes.Add(rootNode); + var list = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 1).OrderBy(x => x.Sort).ToList(); + if (list.Count() > 0) + { + foreach (var itemOne in list) + { + TreeNode rootOneNode = new TreeNode(); + rootOneNode.NodeID = itemOne.PreRunId; + rootOneNode.Text = itemOne.PreRunName; + rootOneNode.ToolTip = itemOne.PreRunName; + rootOneNode.CommandName = ""; + rootOneNode.EnableClickEvent = true; + rootOneNode.EnableExpandEvent = false; + rootNode.Nodes.Add(rootOneNode); + rootOneNode.Expanded = true; + } + } + } + + /// + /// 点击TreeView + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.BindGrid(); + } + + #endregion + #region 绑定数据 /// @@ -39,6 +83,14 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun string strSql = @"select a.RunningId,a.ProjectId,project.ProjectName as ProjectName,a.InstallationId,a.ProcessesId,a.SystemId,inst.PreRunName as InstallationName,proce.PreRunName as ProcessesName,syst.PreRunName as SystemName,a.JobNo,a.ShiftType,(case a.ShiftType when 1 then '白班' else '夜班' end) as ShiftTypeName,a.ShiftUser,shiftuser.UserName as ShiftUserName,a.SuccessionUser,successuser.UserName as SuccessionUserName,a.StartData,a.EndData,a.AddUser,a.AddTime,a.Sort from Running_LogManagement as a inner join Sys_User as shiftuser on shiftuser.UserId=a.ShiftUser inner join Sys_User as successuser on successuser.UserId=a.SuccessionUser inner join Base_Project as project on project.ProjectId=a.ProjectId inner join PreRun_SysDevice as inst on inst.PreRunId=a.InstallationId inner join PreRun_SysDevice as proce on proce.PreRunId=a.ProcessesId inner join PreRun_SysDevice as syst on syst.PreRunId=a.SystemId where a.ProjectId=@ProjectId "; List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + if (!string.IsNullOrWhiteSpace(this.tvControlItem.SelectedNodeID)) + { + if (this.tvControlItem.SelectedNodeID != "0" && !string.IsNullOrWhiteSpace(this.tvControlItem.SelectedNodeID)) + { + strSql += " and a.InstallationId=@InstallationId"; + listStr.Add(new SqlParameter("@InstallationId", this.tvControlItem.SelectedNodeID)); + } + } if (!string.IsNullOrWhiteSpace(txtStartData.Text)) { strSql += " and a.StartData>=@StartData"; diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.designer.cs index 96b43d03..7db22016 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.designer.cs @@ -41,6 +41,24 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// protected global::FineUIPro.Panel Panel1; + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + /// /// Grid1 控件。 /// diff --git a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx index a09e302f..7f19d0cb 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx +++ b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx @@ -36,6 +36,7 @@ AutoPostBack="true" OnTabIndexChanged="TabStrip1_TabIndexChanged" ShowBorder="true" ActiveTabIndex="1" runat="server"> + @@ -128,7 +129,6 @@ - @@ -170,6 +170,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -217,6 +314,7 @@ }); return valid; } + //预试车合计 function onGridYscAfterEdit(event, value, params) { var me = F('<%= GridYsc.ClientID %>'); @@ -309,6 +407,7 @@ }); return valid; } + //三查四定合计 function onGridScsdAfterEdit(event, value, params) { var me = F('<%= GridScsd.ClientID %>'); @@ -327,6 +426,25 @@ me.updateSummaryCellValue('CompleteNum', completeNumTotal, true); } + //投料试车状态 + var ddlRunType = '<%= ddlRunType.ClientID %>'; + function renderRunType(value) { + if (value == -1) { + return ''; + } else { + return F(ddlRunType).getTextByValue(value); + } + } + + //生产试运行状态 + var ddlProducRunType = '<%= ddlProducRunType.ClientID %>'; + function renderProducRunType(value) { + if (value == -1) { + return ''; + } else { + return F(ddlProducRunType).getTextByValue(value); + } + } diff --git a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs index 0ddb1ea1..25b0786c 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs @@ -21,6 +21,8 @@ using NPOI.SS.Util; using NPOI.XSSF.UserModel; using System.IO; using NPOI.SS.Formula.Functions; +using FineUIPro.Web.ProjectData; +using System.Web.Services.Description; namespace FineUIPro.Web.TestRun.Report { @@ -856,6 +858,351 @@ namespace FineUIPro.Web.TestRun.Report #endregion + #region 投料试车 + + /// + /// 投料试车绑定 + /// + public void gvFeedingBrid() + { + var result = new List(); + if (Funs.DB.Run_ParameterSettings.Count(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 1) == 0) + { + var query = from runsys in Funs.DB.PreRun_SysDevice + join install in Funs.DB.PreRun_SysDevice on runsys.InstallationId equals install.PreRunId + join proce in Funs.DB.PreRun_SysDevice on runsys.ProcessesId equals proce.PreRunId + join project in Funs.DB.Base_Project on runsys.ProjectId equals project.ProjectId + where runsys.PreRunLevel == 3 && runsys.ProjectId == this.CurrUser.LoginProjectId + orderby runsys.Sort ascending + select new ParameterSettingsDto() + { + ProjectId = this.CurrUser.LoginProjectId, + ProjectName = project.ProjectName, + InstallationId = runsys.InstallationId, + InstallationName = install.PreRunName, + ProcessesId = runsys.ProcessesId, + ProcessesName = proce.PreRunName, + SystemId = runsys.PreRunId, + SystemName = runsys.PreRunName, + States = 1, + RunType = 1 + }; + if (query.Count() > 0) + { + result = query.ToList(); + result.ForEach(x => { x.SettingsId = Guid.NewGuid().ToString(); }); + } + } + else + { + var query = from setting in Funs.DB.Run_ParameterSettings + join install in Funs.DB.PreRun_SysDevice on setting.InstallationId equals install.PreRunId + join proce in Funs.DB.PreRun_SysDevice on setting.ProcessesId equals proce.PreRunId + join sys in Funs.DB.PreRun_SysDevice on setting.SystemId equals sys.PreRunId + join project in Funs.DB.Base_Project on setting.ProjectId equals project.ProjectId + where setting.ProjectId == this.CurrUser.LoginProjectId && setting.States == 1 + orderby setting.Sort ascending + select new ParameterSettingsDto() + { + SettingsId = setting.SettingsId, + ProjectId = setting.ProjectId, + ProjectName = project.ProjectName, + InstallationId = setting.InstallationId, + InstallationName = install.PreRunName, + ProcessesId = setting.ProcessesId, + ProcessesName = proce.PreRunName, + SystemId = setting.SystemId, + SystemName = sys.PreRunName, + States = setting.States, + RunType = setting.RunType, + AddUser = setting.AddUser, + AddTime = setting.AddTime, + Sort = setting.Sort, + }; + if (query.Count() > 0) + { + result = query.ToList(); + } + } + gvFeeding.DataSource = result; + TabStrip1.ActiveTabIndex = 3; + gvFeeding.DataBind(); + } + + /// + /// 投料试车保存 + /// + protected void btnFeedingSave_Click(object sender, EventArgs e) + { + try + { + var deletelist = Funs.DB.Run_ParameterSettings.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 1); + Funs.DB.Run_ParameterSettings.DeleteAllOnSubmit(deletelist); + Funs.DB.SubmitChanges(); + var addList = new List(); + JArray mergedData = gvFeeding.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + var model = new Run_ParameterSettings(); + model.SettingsId = this.gvFeeding.Rows[i].DataKeys[0].ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.InstallationId = this.gvFeeding.Rows[i].DataKeys[1].ToString(); + model.ProcessesId = this.gvFeeding.Rows[i].DataKeys[2].ToString(); + model.SystemId = this.gvFeeding.Rows[i].DataKeys[3].ToString(); + model.States = 1; + var runtype = !string.IsNullOrWhiteSpace(values.Value("RunType")) ? values.Value("RunType") : string.Empty; + if (!string.IsNullOrWhiteSpace(runtype)) + { + model.RunType = int.Parse(runtype); + } + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i; + addList.Add(model); + } + Funs.DB.Run_ParameterSettings.InsertAllOnSubmit(addList); + Funs.DB.SubmitChanges(); + gvFeedingBrid(); + ShowNotify("保存成功!"); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Error); + } + } + + #endregion + + #region 生产性能考核 + + /// + /// 生产性能考核绑定 + /// + public void PerformPageInit() + { + var model = Funs.DB.Run_ProductionSettings.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId); + if (model != null) + { + if (model.States == 1) + { + txtStartData.Hidden = true; + txtEndData.Hidden = true; + rbtNotStarted.Checked = true; + } + else if (model.States == 2) + { + txtStartData.Hidden = false; + txtEndData.Hidden = false; + rbtInProgress.Checked = true; + txtStartData.Text = model.StartTime.Value.ToString("yyyy-MM-dd"); + txtEndData.Text = model.EndTime.Value.ToString("yyyy-MM-dd"); + } + else if (model.States == 2) + { + txtStartData.Hidden = true; + txtEndData.Hidden = true; + rbtComplete.Checked = true; + } + } + } + + /// + /// 保存 + /// + protected void btnSubmit_Click(object sender, EventArgs e) + { + bool add = false; + if (rbtInProgress.Checked && string.IsNullOrWhiteSpace(txtStartData.Text)) + { + ShowNotify("开始时间不能为空!", MessageBoxIcon.Warning); + return; + } + if (rbtInProgress.Checked && string.IsNullOrWhiteSpace(txtEndData.Text)) + { + ShowNotify("结束时间不能为空!", MessageBoxIcon.Warning); + return; + } + var state = 0; + if (rbtNotStarted.Checked) + { + state = 1; + } + if (rbtInProgress.Checked) + { + state = 2; + } + if (rbtComplete.Checked) + { + state = 3; + } + var model = Funs.DB.Run_ProductionSettings.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId); + if (model == null) + { + add = true; + model = new Run_ProductionSettings(); + model.ProductionId = Guid.NewGuid().ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + } + model.States = state; + if (state == 2) + { + model.StartTime = DateTime.Parse(txtStartData.Text.ToString()); + model.EndTime = DateTime.Parse(txtEndData.Text.ToString()); + } + else + { + model.StartTime = null; + model.EndTime = null; + } + if (add) Funs.DB.Run_ProductionSettings.InsertOnSubmit(model); + Funs.DB.SubmitChanges(); + PerformPageInit(); + ShowNotify("保存成功!"); + } + + /// + /// 考核选择 + /// + protected void rbtCheck_CheckedChanged(object sender, CheckedEventArgs e) + { + if (rbtInProgress.Checked) + { + txtStartData.Hidden = false; + txtEndData.Hidden = false; + } + else + { + txtStartData.Hidden = true; + txtEndData.Hidden = true; + } + } + + #endregion + + #region 生产试运行 + + /// + ///生产试运行绑定 + /// + public void gvProducBrid() + { + var result = new List(); + if (Funs.DB.Run_ParameterSettings.Count(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 2) == 0) + { + var query = from runsys in Funs.DB.PreRun_SysDevice + join install in Funs.DB.PreRun_SysDevice on runsys.InstallationId equals install.PreRunId + join proce in Funs.DB.PreRun_SysDevice on runsys.ProcessesId equals proce.PreRunId + join project in Funs.DB.Base_Project on runsys.ProjectId equals project.ProjectId + where runsys.PreRunLevel == 3 && runsys.ProjectId == this.CurrUser.LoginProjectId + orderby runsys.Sort ascending + select new ParameterSettingsDto() + { + ProjectId = this.CurrUser.LoginProjectId, + ProjectName = project.ProjectName, + InstallationId = runsys.InstallationId, + InstallationName = install.PreRunName, + ProcessesId = runsys.ProcessesId, + ProcessesName = proce.PreRunName, + SystemId = runsys.PreRunId, + SystemName = runsys.PreRunName, + States = 2, + RunType = 1 + }; + if (query.Count() > 0) + { + result = query.ToList(); + result.ForEach(x => { x.SettingsId = Guid.NewGuid().ToString(); }); + } + } + else + { + var query = from setting in Funs.DB.Run_ParameterSettings + join install in Funs.DB.PreRun_SysDevice on setting.InstallationId equals install.PreRunId + join proce in Funs.DB.PreRun_SysDevice on setting.ProcessesId equals proce.PreRunId + join sys in Funs.DB.PreRun_SysDevice on setting.SystemId equals sys.PreRunId + join project in Funs.DB.Base_Project on setting.ProjectId equals project.ProjectId + where setting.ProjectId == this.CurrUser.LoginProjectId && setting.States == 2 + orderby setting.Sort ascending + select new ParameterSettingsDto() + { + SettingsId = setting.SettingsId, + ProjectId = setting.ProjectId, + ProjectName = project.ProjectName, + InstallationId = setting.InstallationId, + InstallationName = install.PreRunName, + ProcessesId = setting.ProcessesId, + ProcessesName = proce.PreRunName, + SystemId = setting.SystemId, + SystemName = sys.PreRunName, + States = setting.States, + RunType = setting.RunType, + AddUser = setting.AddUser, + AddTime = setting.AddTime, + Sort = setting.Sort, + }; + if (query.Count() > 0) + { + result = query.ToList(); + } + } + gvProduc.DataSource = result; + TabStrip1.ActiveTabIndex = 5; + gvProduc.DataBind(); + } + + /// + /// 生产试运行保存 + /// + protected void btnProducSave_Click(object sender, EventArgs e) + { + try + { + var deletelist = Funs.DB.Run_ParameterSettings.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 2); + Funs.DB.Run_ParameterSettings.DeleteAllOnSubmit(deletelist); + Funs.DB.SubmitChanges(); + var addList = new List(); + JArray mergedData = gvProduc.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + var model = new Run_ParameterSettings(); + model.SettingsId = this.gvProduc.Rows[i].DataKeys[0].ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.InstallationId = this.gvProduc.Rows[i].DataKeys[1].ToString(); + model.ProcessesId = this.gvProduc.Rows[i].DataKeys[2].ToString(); + model.SystemId = this.gvProduc.Rows[i].DataKeys[3].ToString(); + model.States = 2; + var runtype = !string.IsNullOrWhiteSpace(values.Value("RunType")) ? values.Value("RunType") : string.Empty; + if (!string.IsNullOrWhiteSpace(runtype)) + { + model.RunType = int.Parse(runtype); + } + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i; + addList.Add(model); + } + Funs.DB.Run_ParameterSettings.InsertAllOnSubmit(addList); + Funs.DB.SubmitChanges(); + gvProducBrid(); + ShowNotify("保存成功!"); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Error); + } + } + + #endregion + + #region 私有方法 /// @@ -919,6 +1266,21 @@ namespace FineUIPro.Web.TestRun.Report //三查四定 DataBridScsd(); } + else if (TabStrip1.ActiveTabIndex == 3) + { + //投料试车 + gvFeedingBrid(); + } + else if (TabStrip1.ActiveTabIndex == 4) + { + //生产性能考核 + PerformPageInit(); + } + else if (TabStrip1.ActiveTabIndex == 5) + { + //生产试运行 + gvProducBrid(); + } } public class Run_ScheduleSetUpDto : Run_ScheduleSetUp @@ -979,6 +1341,29 @@ namespace FineUIPro.Web.TestRun.Report public int CloseNum { get; set; } } + /// + /// 投料试车实体 + /// + public class ParameterSettingsDto : Run_ParameterSettings + { + /// + /// 项目名称 + /// + public string ProjectName { get; set; } + /// + /// 装置名称 + /// + public string InstallationName { get; set; } + /// + /// 工序名称 + /// + public string ProcessesName { get; set; } + /// + /// 系统名称 + /// + public string SystemName { get; set; } + } + #endregion diff --git a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs index a56ee2ad..c571ef20 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs @@ -346,5 +346,167 @@ namespace FineUIPro.Web.TestRun.Report /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.NumberBox NumberBox3; + + /// + /// gvFeeding 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvFeeding; + + /// + /// Toolbar5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar5; + + /// + /// btnFeedingSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnFeedingSave; + + /// + /// ToolbarFill3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill3; + + /// + /// ddlRunType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlRunType; + + /// + /// Toolbar6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar6; + + /// + /// ToolbarFill4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill4; + + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSubmit; + + /// + /// rbtNotStarted 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButton rbtNotStarted; + + /// + /// rbtInProgress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButton rbtInProgress; + + /// + /// rbtComplete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButton rbtComplete; + + /// + /// txtStartData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartData; + + /// + /// txtEndData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndData; + + /// + /// gvProduc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvProduc; + + /// + /// Toolbar7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar7; + + /// + /// btnProducSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnProducSave; + + /// + /// ToolbarFill5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill5; + + /// + /// ddlProducRunType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlProducRunType; } } diff --git a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx index fe66d4f7..2106e0fb 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx +++ b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx @@ -88,7 +88,7 @@
-
+
@@ -101,7 +101,65 @@
-
+
+
+
+
+ +
+
+
+
+
+
未投料
+
+
投料中
+
+
投料完成
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
未运行
+
+
运行中
+
+
停车检修
+
+
+
+
+
+
+
+
+
+
+
+
+
+
考核未开始
+
+
考核进行中
+
+
考核已完成
+
+
+
+
@@ -417,6 +475,124 @@ $("#three").append("
"); }); + //图4 + var fourStr = '<%=feedingRunStr%>'; + var fourData = JSON.parse(fourStr); + var fourwidth = Math.floor(100 / (fourData.length / 2)); + $.each(fourData, function (index, item) { + $("#four").append("
"); + }); + + //图5 + var fiveStr = '<%=productsStr%>'; + var fiveData = JSON.parse(fiveStr); + var fivewidth = Math.floor(100 / (fiveData.length / 2)); + $.each(fourData, function (index, item) { + $("#five").append("
"); + }); + + //图6 + var sixStr = '<%=runProductionStr%>'; + var sixData = JSON.parse(sixStr); + var colorData = ["#988989", "#6D5F5F", "#524747"]; + if (sixData.States == 2) { + colorData = ["#2B1485", "#3E1DC0", "#603FE2"]; + } + if (sixData.States == 3) { + colorData = ["#106722", "#20CE43", "#5DE679"]; + } + var chart = echarts.init(document.getElementById('six')); + var value = 100; + option = { + backgroundColor: '000', + title: { + text: `` + sixData.StatesName, + subtext: sixData.States == 2 ? (sixData.StartTime + "\n" + sixData.EndTime) : "", + left: 'center', + top: '45%', //top待调整 + textStyle: { + color: '#fff', + fontSize: 16, + fontFamily: 'DINAlternate-Bold', + }, + subtextStyle: { + color: '#ff', + fontSize: 16, + fontFamily: 'PingFangSC-Regular', + top: 'center' + }, + itemGap: 10 //主副标题间距 + }, + xAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + yAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + series: [ + // 内圆 + { + type: 'pie', + radius: ['0', '80%'], + center: ['50%', '50%'], + z: 0, + itemStyle: { + normal: { + color: new echarts.graphic.RadialGradient(0.5, 0.5, 0.5, [ + { + offset: 0, + color: colorData[0] + }, + { + offset: 0.44, + color: colorData[0] + }, + { + offset: 0.73, + color: colorData[1] + }, + { + offset: 1, + color: colorData[2] + } + ]), + label: { + show: false + }, + labelLine: { + show: false + } + }, + }, + label: { + normal: { + position: "center", + + } + }, + data: [100], + } + ] + }; + chart.setOption(option); + + $(function () { $.each(threeData, function (index, item) { var chart = echarts.init(document.getElementById('three' + index)); @@ -435,7 +611,7 @@ }, subtextStyle: { color: '#ff', - fontSize: 14, + fontSize: 12, fontFamily: 'PingFangSC-Regular', top: 'center' }, @@ -608,778 +784,213 @@ }; chart.setOption(option); }); + + $.each(fourData, function (index, item) { + + var colorData = ["#808080", "#A2945E", "#B3764D", "#482F1F"]; + if (item.RunType == 2) { + colorData = ["#A2945E", "#4444BB", "#D52B6F", "#DD226D"]; + } + if (item.RunType == 3) { + colorData = ["#CCCC33", "#8FCC33", "#57C43C", "#22DD48"]; + } + var chart = echarts.init(document.getElementById('four' + index)); + var value = 100; + option = { + backgroundColor: '000', + title: { + text: `` + item.SystemName, + subtext: item.RunType == 1 ? "未投料" : item.RunType == 2 ? "投料中" : "投料完成", + left: 'center', + top: '45%', //top待调整 + textStyle: { + color: '#fff', + fontSize: 9, + fontFamily: 'DINAlternate-Bold', + }, + subtextStyle: { + color: '#ff', + fontSize: 9, + fontFamily: 'PingFangSC-Regular', + top: 'center' + }, + itemGap: 10 //主副标题间距 + }, + xAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + yAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + series: [ + // 内圆 + { + type: 'pie', + radius: ['0', '80%'], + center: ['50%', '50%'], + z: 0, + itemStyle: { + normal: { + color: new echarts.graphic.RadialGradient(0.5, 0.5, 0.5, [ + { + offset: 0, + color: colorData[0] + }, + { + offset: 0.44, + color: colorData[1] + }, + { + offset: 0.73, + color: colorData[2] + }, + { + offset: 1, + color: colorData[3] + } + ]), + label: { + show: false + }, + labelLine: { + show: false + } + }, + }, + label: { + normal: { + position: "center", + + } + }, + data: [100], + } + ] + }; + chart.setOption(option); + }); + + $.each(fiveData, function (index, item) { + + var colorData = ["#7A7AA7", "#5656CC", "#3939E9", "#2222FF"]; + if (item.RunType == 2) { + colorData = ["#A5F82A", "#2AF853", "#31F0F0", "#3FC1E2"]; + } + if (item.RunType == 3) { + colorData = ["#F82AF8", "#F0A431", "#E95B39", "#F82A2A"]; + } + var chart = echarts.init(document.getElementById('five' + index)); + var value = 100; + option = { + backgroundColor: '000', + title: { + text: `` + item.SystemName, + subtext: item.RunType == 1 ? "未运行" : item.RunType == 2 ? "运行中" : "停车检修", + left: 'center', + top: '45%', //top待调整 + textStyle: { + color: '#fff', + fontSize: 9, + fontFamily: 'DINAlternate-Bold', + }, + subtextStyle: { + color: '#ff', + fontSize: 9, + fontFamily: 'PingFangSC-Regular', + top: 'center' + }, + itemGap: 10 //主副标题间距 + }, + xAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + yAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + series: [ + // 内圆 + { + type: 'pie', + radius: ['0', '80%'], + center: ['50%', '50%'], + z: 0, + itemStyle: { + normal: { + color: new echarts.graphic.RadialGradient(0.5, 0.5, 0.5, [ + { + offset: 0, + color: colorData[0] + }, + { + offset: 0.44, + color: colorData[1] + }, + { + offset: 0.73, + color: colorData[2] + }, + { + offset: 1, + color: colorData[3] + } + ]), + label: { + show: false + }, + labelLine: { + show: false + } + }, + }, + label: { + normal: { + position: "center", + + } + }, + data: [100], + } + ] + }; + chart.setOption(option); + }); + }); - //data = [ - // { - // name: 'A类', - // value: 20, - // }, - // { - // name: 'B类', - // value: 30, - // }, - // { - // name: 'C类', - // value: 50, - // }, - //]; - //arrName = getArrayValue(data, 'name'); - //arrValue = getArrayValue(data, 'value'); - //sumValue = eval(arrValue.join('+')); - //objData = array2obj(data, 'name'); - //optionData = getData(data); - - //function getArrayValue(array, key) { - // var key = key || 'value'; - // var res = []; - // if (array) { - // array.forEach(function (t) { - // res.push(t[key]); - // }); - // } - // return res; - //} - //function array2obj(array, key) { - // var resObj = {}; - // for (var i = 0; i < array.length; i++) { - // resObj[array[i][key]] = array[i]; - // } - // return resObj; - //} - //function getData(data) { - // var res = { - // series: [], - // yAxis: [], - // }; - // for (let i = 0; i < data.length; i++) { - // res.series.push({ - // name: '', - // type: 'pie', - // clockWise: false, //顺时加载 - // hoverAnimation: false, //鼠标移入变大 - // radius: [73 - i * 15 + '%', 68 - i * 15 + '%'], - // center: ['40%', '55%'], - // label: { - // show: false, - // }, - // itemStyle: { - // label: { - // show: false, - // }, - // labelLine: { - // show: false, - // }, - // borderWidth: 5, - // }, - // data: [ - // { - // value: data[i].value, - // name: data[i].name, - // }, - // { - // value: sumValue - data[i].value, - // name: '', - // itemStyle: { - // color: 'rgba(0,0,0,0)', - // borderWidth: 0, - // }, - // tooltip: { - // show: false, - // }, - // hoverAnimation: false, - // }, - // ], - // }); - // res.series.push({ - // name: '', - // type: 'pie', - // silent: true, - // z: 1, - // clockWise: false, //顺时加载 - // hoverAnimation: false, //鼠标移入变大 - // radius: [73 - i * 15 + '%', 68 - i * 15 + '%'], - // center: ['40%', '55%'], - // label: { - // show: false, - // }, - // itemStyle: { - // label: { - // show: false, - // }, - // labelLine: { - // show: false, - // }, - // borderWidth: 5, - // }, - // data: [ - // { - // value: 7.5, - // itemStyle: { - // color: '#add2d2', //圆环背景色-全 - // borderWidth: 0, - // }, - // tooltip: { - // show: false, - // }, - // hoverAnimation: false, - // }, - // { - // value: 2.5, - // name: '', - // itemStyle: { - // color: 'rgba(0,0,0,0)', - // borderWidth: 0, - // }, - // tooltip: { - // show: false, - // }, - // hoverAnimation: false, - // }, - // ], - // }); - // res.yAxis.push(((data[i].value / sumValue) * 100).toFixed(2) + '%'); - // } - // return res; - //} - //option = { - // //backgroundColor: '#ddd', - // legend: { - // show: true, - // icon: 'circle', - // top: 'center', - // top: '16%', - // bottom: '53%', - // left: '40%', - // data: arrName, - // width: 40, - // padding: [0, 16], - // itemGap: 25, - // //图例显示 - // formatter: function (name) { - // return '{title|' + name + '}{value|' + ((objData[name].value / sumValue) * 100).toFixed(2) + '} {title|%}'; - // }, - - // textStyle: { - // rich: { - // title: { - // fontSize: 20, - // lineHeight: 30, - // color: '#fff', - // }, - // value: { - // fontSize: 18, - // lineHeight: 20, - // color: '#fff', - // }, - // }, - // }, - // }, - // title: { - // text: '', //图形标题,配置在中间对应效果图的80% - // left: '20%', - // top: '50%', - // textStyle: { - // color: 'rgb(50,197,233)', - // fontSize: 16, - // align: 'left', - // }, - // }, - // tooltip: { - // show: true, - // trigger: 'item', - // formatter: '{a}
{b}:{c}({d}%)', - // }, - // color: ['yellow', 'blue', 'green'], - // xAxis: [ - // { - // show: false, - // }, - // ], - // series: optionData.series, - //}; - //chart2.setOption(option); - - -<%-- - - - - ---%> diff --git a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs index 1f29f58f..cf3c7de1 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs @@ -17,6 +17,7 @@ using static FineUIPro.Web.TestRun.Report.PreRunSchedule; using Aspose.Words; using static FineUIPro.Web.TestRun.Report.TestRunSchedule; using System.Web.UI.DataVisualization.Charting; +using NPOI.POIFS.Crypt.Dsig; namespace FineUIPro.Web { @@ -26,6 +27,9 @@ namespace FineUIPro.Web public string oneDataStr { get; set; } public string twoDataStr { get; set; } public string fourDecisionStr { get; set; } + public string feedingRunStr { get; set; } + public string productsStr { get; set; } + public string runProductionStr { get; set; } protected void Page_Load(object sender, EventArgs e) { @@ -40,6 +44,9 @@ namespace FineUIPro.Web OneYsc(); TwoSc(); FourDecision(); + FeedingRuns(); + Products(); + RunProduction(); } /// @@ -265,6 +272,149 @@ namespace FineUIPro.Web fourDecisionStr = JsonConvert.SerializeObject(result); } + /// + /// 投料试车 + /// + public void FeedingRuns() + { + List result = new List(); + var data = ParamentSettings(1); + if (data.Count > 0) + { + foreach (var item in data) + { + result.Add(new FourFiveDto() + { + RunType = item.RunType.Value, + SystemName = item.SystemName, + InstallationName = item.InstallationName + }); + } + feedingRunStr = JsonConvert.SerializeObject(result); + } + } + + /// + /// 生产试运行 + /// + public void Products() + { + List result = new List(); + var data = ParamentSettings(2); + if (data.Count > 0) + { + foreach (var item in data) + { + result.Add(new FourFiveDto() + { + RunType = item.RunType.Value, + SystemName = item.SystemName, + InstallationName = item.InstallationName + }); + } + productsStr = JsonConvert.SerializeObject(result); + } + } + + /// + /// 投料试车和生产试运行数据获取 + /// + /// + private List ParamentSettings(int state) + { + var result = new List(); + + try + { + if (Funs.DB.Run_ParameterSettings.Count(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == state) == 0) + { + var query = from runsys in Funs.DB.PreRun_SysDevice + join install in Funs.DB.PreRun_SysDevice on runsys.InstallationId equals install.PreRunId + join proce in Funs.DB.PreRun_SysDevice on runsys.ProcessesId equals proce.PreRunId + join project in Funs.DB.Base_Project on runsys.ProjectId equals project.ProjectId + where runsys.PreRunLevel == 3 && runsys.ProjectId == this.CurrUser.LoginProjectId + orderby runsys.Sort ascending + select new ParameterSettingsDto() + { + ProjectId = this.CurrUser.LoginProjectId, + ProjectName = project.ProjectName, + InstallationId = runsys.InstallationId, + InstallationName = install.PreRunName, + ProcessesId = runsys.ProcessesId, + ProcessesName = proce.PreRunName, + SystemId = runsys.PreRunId, + SystemName = runsys.PreRunName, + States = 1, + RunType = 1 + }; + if (query.Count() > 0) + { + result = query.ToList(); + result.ForEach(x => { x.SettingsId = Guid.NewGuid().ToString(); }); + } + } + else + { + var query = from setting in Funs.DB.Run_ParameterSettings + join install in Funs.DB.PreRun_SysDevice on setting.InstallationId equals install.PreRunId + join proce in Funs.DB.PreRun_SysDevice on setting.ProcessesId equals proce.PreRunId + join sys in Funs.DB.PreRun_SysDevice on setting.SystemId equals sys.PreRunId + join project in Funs.DB.Base_Project on setting.ProjectId equals project.ProjectId + where setting.ProjectId == this.CurrUser.LoginProjectId && setting.States == state + orderby setting.Sort ascending + select new ParameterSettingsDto() + { + SettingsId = setting.SettingsId, + ProjectId = setting.ProjectId, + ProjectName = project.ProjectName, + InstallationId = setting.InstallationId, + InstallationName = install.PreRunName, + ProcessesId = setting.ProcessesId, + ProcessesName = proce.PreRunName, + SystemId = setting.SystemId, + SystemName = sys.PreRunName, + States = setting.States, + RunType = setting.RunType, + AddUser = setting.AddUser, + AddTime = setting.AddTime, + Sort = setting.Sort, + }; + if (query.Count() > 0) + { + result = query.ToList(); + } + } + } + catch (Exception ex) + { + result = new List(); + } + + return result; + } + + /// + /// 生产性能考核 + /// + public void RunProduction() + { + var result = new SixDto(); + var data = Funs.DB.Run_ProductionSettings.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId); + if (data != null) + { + result.States = data.States.Value; + result.StatesName = data.States == 1 ? "考核未开始" : data.States == 2 ? "考核进行中" : data.States == 3 ? "考核已完成" : "考核未开始"; + result.StartTime = data.StartTime != null ? data.StartTime.Value.ToString("yyyy-MM-dd") : string.Empty; + result.EndTime = data.EndTime != null ? data.EndTime.Value.ToString("yyyy-MM-dd") : string.Empty; + } + else + { + result.States = 1; + result.StatesName = "考核未开始"; + } + runProductionStr = JsonConvert.SerializeObject(result); + } + #region 实体类 /// @@ -285,6 +435,27 @@ namespace FineUIPro.Web public float Rate { get; set; } } + /// + /// 图4,5 + /// + public class FourFiveDto + { + public int RunType { get; set; } + public string SystemName { get; set; } + public string InstallationName { get; set; } + } + + /// + /// 图6 + /// + public class SixDto + { + public int States { get; set; } + public string StatesName { get; set; } + public string StartTime { get; set; } + public string EndTime { get; set; } + } + public class WorkPackageInspectDto { ///